LCOV - code coverage report
Current view: top level - src/materials - ADWallHeatTransferCoefficientSchadMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 37 38 97.4 %
Date: 2025-07-30 13:02:48 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 "ADWallHeatTransferCoefficientSchadMaterial.h"
      11             : #include "SinglePhaseFluidProperties.h"
      12             : #include "FlowModelSinglePhase.h"
      13             : #include "Numerics.h"
      14             : 
      15             : registerMooseObject("ThermalHydraulicsApp", ADWallHeatTransferCoefficientSchadMaterial);
      16             : 
      17             : InputParameters
      18         277 : ADWallHeatTransferCoefficientSchadMaterial::validParams()
      19             : {
      20         277 :   InputParameters params = Material::validParams();
      21         554 :   params.addParam<MaterialPropertyName>("Hw",
      22             :                                         FlowModelSinglePhase::HEAT_TRANSFER_COEFFICIENT_WALL,
      23             :                                         "Heat transfer coefficient material property");
      24         554 :   params.addParam<MaterialPropertyName>(
      25             :       "rho", FlowModelSinglePhase::DENSITY, "Density of the fluid");
      26         554 :   params.addParam<MaterialPropertyName>("vel", FlowModelSinglePhase::VELOCITY, "Fluid velocity");
      27         554 :   params.addParam<MaterialPropertyName>(
      28             :       "D_h", FlowModelSinglePhase::HYDRAULIC_DIAMETER, "Hydraulic diameter");
      29         554 :   params.addParam<MaterialPropertyName>(
      30             :       "cp", FlowModelSinglePhase::SPECIFIC_HEAT_CONSTANT_PRESSURE, "Specific heat of the fluid");
      31         554 :   params.addParam<MaterialPropertyName>(
      32             :       "mu", FlowModelSinglePhase::DYNAMIC_VISCOSITY, "Dynamic viscosity of the fluid");
      33         554 :   params.addParam<MaterialPropertyName>(
      34             :       "k", FlowModelSinglePhase::THERMAL_CONDUCTIVITY, "Heat conductivity of the fluid");
      35         554 :   params.addParam<MaterialPropertyName>(
      36             :       "T", FlowModelSinglePhase::TEMPERATURE, "Fluid temperature");
      37         554 :   params.addParam<MaterialPropertyName>("T_wall", FlowModel::TEMPERATURE_WALL, "Wall temperature");
      38         554 :   params.addRequiredParam<Real>(
      39             :       "PoD", "The Pitch-to-diameter ratio value being assigned into the property");
      40         277 :   params.addClassDescription(
      41             :       "Computes wall heat transfer coefficient for liquid sodium using Schad-modified correlation");
      42         277 :   return params;
      43           0 : }
      44             : 
      45         216 : ADWallHeatTransferCoefficientSchadMaterial::ADWallHeatTransferCoefficientSchadMaterial(
      46         216 :     const InputParameters & parameters)
      47             :   : Material(parameters),
      48         216 :     _Hw(declareADProperty<Real>("Hw")),
      49         432 :     _rho(getADMaterialProperty<Real>("rho")),
      50         432 :     _vel(getADMaterialProperty<Real>("vel")),
      51         432 :     _D_h(getADMaterialProperty<Real>("D_h")),
      52         432 :     _k(getADMaterialProperty<Real>("k")),
      53         432 :     _mu(getADMaterialProperty<Real>("mu")),
      54         432 :     _cp(getADMaterialProperty<Real>("cp")),
      55         432 :     _T(getADMaterialProperty<Real>("T")),
      56         432 :     _T_wall(getADMaterialProperty<Real>("T_wall")),
      57         648 :     _PoD(getParam<Real>("PoD"))
      58             : {
      59         216 : }
      60             : 
      61             : void
      62        4302 : ADWallHeatTransferCoefficientSchadMaterial::computeQpProperties()
      63             : {
      64        4302 :   ADReal Pe = std::max(1.0, THM::Peclet(1., _cp[_qp], _rho[_qp], _vel[_qp], _D_h[_qp], _k[_qp]));
      65             : 
      66        4302 :   if (_PoD > 1.5 || _PoD < 1.1 || Pe > 1000)
      67             :   {
      68           4 :     mooseDoOnce(mooseWarning("Schad's correlation is valid when Pe<1000, and P/D is between 1.1 "
      69             :                              "and 1.5. Be aware that using values out of this range may lead to "
      70             :                              "significant errors in your results!"));
      71             :   }
      72             : 
      73        4298 :   if (Pe < 150)
      74             :   {
      75           9 :     ADReal Nu = 4.496 * (-16.15 + 24.96 * _PoD - 8.55 * std::pow(_PoD, 2));
      76           9 :     _Hw[_qp] = THM::wallHeatTransferCoefficient(Nu, _k[_qp], _D_h[_qp]);
      77             :   }
      78             :   else
      79             :   {
      80        8578 :     ADReal Nu = (-16.15 + 24.96 * _PoD - 8.55 * std::pow(_PoD, 2)) * std::pow(Pe, 0.3);
      81        4289 :     _Hw[_qp] = THM::wallHeatTransferCoefficient(Nu, _k[_qp], _D_h[_qp]);
      82             :   }
      83        4298 : }

Generated by: LCOV version 1.14