LCOV - code coverage report
Current view: top level - src/kernels - INSADEnergyAmbientConvection.C (source / functions) Hit Total Coverage
Test: idaholab/moose navier_stokes: #32971 (54bef8) with base c6cf66 Lines: 17 18 94.4 %
Date: 2026-05-29 20:37:52 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : //* This file is part of the MOOSE framework
       2             : //* https://mooseframework.inl.gov
       3             : //*
       4             : //* All rights reserved, see COPYRIGHT for full restrictions
       5             : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
       6             : //*
       7             : //* Licensed under LGPL 2.1, please see LICENSE for details
       8             : //* https://www.gnu.org/licenses/lgpl-2.1.html
       9             : 
      10             : #include "INSADEnergyAmbientConvection.h"
      11             : #include "INSADObjectTracker.h"
      12             : #include "FEProblemBase.h"
      13             : 
      14             : registerMooseObject("NavierStokesApp", INSADEnergyAmbientConvection);
      15             : 
      16             : InputParameters
      17          57 : INSADEnergyAmbientConvection::validParams()
      18             : {
      19          57 :   InputParameters params = ADKernelValue::validParams();
      20          57 :   params.addClassDescription(
      21             :       "Computes a heat source/sink due to convection from ambient surroundings.");
      22         114 :   params.addRequiredParam<Real>("alpha",
      23             :                                 "The heat transfer coefficient from the ambient surroundings");
      24         114 :   params.addRequiredParam<Real>("T_ambient", "The ambient temperature");
      25          57 :   return params;
      26           0 : }
      27             : 
      28          30 : INSADEnergyAmbientConvection::INSADEnergyAmbientConvection(const InputParameters & parameters)
      29             :   : ADKernelValue(parameters),
      30          30 :     _temperature_ambient_convection_strong_residual(
      31          30 :         getADMaterialProperty<Real>("temperature_ambient_convection_strong_residual"))
      32             : {
      33             :   // Bypass the UserObjectInterface method because it requires a UserObjectName param which we
      34             :   // don't need
      35             :   auto & obj_tracker = const_cast<INSADObjectTracker &>(
      36          30 :       _fe_problem.getUserObject<INSADObjectTracker>("ins_ad_object_tracker"));
      37          60 :   for (const auto block_id : blockIDs())
      38             :   {
      39          30 :     obj_tracker.set("has_ambient_convection", true, block_id);
      40          90 :     obj_tracker.set("ambient_convection_alpha", getParam<Real>("alpha"), block_id);
      41          90 :     obj_tracker.set("ambient_temperature", getParam<Real>("T_ambient"), block_id);
      42             :   }
      43          30 : }
      44             : 
      45             : ADReal
      46      165888 : INSADEnergyAmbientConvection::precomputeQpResidual()
      47             : {
      48      165888 :   return _temperature_ambient_convection_strong_residual[_qp];
      49             : }

Generated by: LCOV version 1.14