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

Generated by: LCOV version 1.14