LCOV - code coverage report
Current view: top level - src/materials - WallFrictionChurchillMaterial.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 "WallFrictionChurchillMaterial.h"
      11             : #include "WallFrictionModels.h"
      12             : #include "Numerics.h"
      13             : 
      14             : registerMooseObject("ThermalHydraulicsApp", WallFrictionChurchillMaterial);
      15             : 
      16             : InputParameters
      17          65 : WallFrictionChurchillMaterial::validParams()
      18             : {
      19          65 :   InputParameters params = Material::validParams();
      20          65 :   params.addClassDescription("Computes the Darcy friction factor using the Churchill correlation.");
      21         130 :   params.addRequiredCoupledVar("rhoA", "Mass equation variable: rho*A");
      22         130 :   params.addRequiredCoupledVar("rhouA", "Momentum equation variable: rho*u*A");
      23         130 :   params.addRequiredCoupledVar("rhoEA", "Total energy equation variable: rho*E*A");
      24         130 :   params.addRequiredParam<MaterialPropertyName>("rho", "Density");
      25         130 :   params.addRequiredParam<MaterialPropertyName>("vel", "x-component of the velocity");
      26         130 :   params.addRequiredParam<MaterialPropertyName>("D_h", "hydraulic diameter");
      27             : 
      28         130 :   params.addRequiredParam<MaterialPropertyName>("f_D", "Darcy friction factor material property");
      29         130 :   params.addRequiredParam<MaterialPropertyName>("mu", "Dynamic viscosity material property");
      30             : 
      31         130 :   params.addRequiredParam<Real>("roughness", "Surface roughness");
      32         130 :   params.declareControllable("roughness");
      33          65 :   return params;
      34           0 : }
      35             : 
      36          51 : WallFrictionChurchillMaterial::WallFrictionChurchillMaterial(const InputParameters & parameters)
      37             :   : DerivativeMaterialInterfaceTHM<Material>(parameters),
      38         102 :     _f_D_name(getParam<MaterialPropertyName>("f_D")),
      39          51 :     _f_D(declareProperty<Real>(_f_D_name)),
      40          51 :     _df_D_drhoA(declarePropertyDerivativeTHM<Real>(_f_D_name, "rhoA")),
      41          51 :     _df_D_drhouA(declarePropertyDerivativeTHM<Real>(_f_D_name, "rhouA")),
      42          51 :     _df_D_drhoEA(declarePropertyDerivativeTHM<Real>(_f_D_name, "rhoEA")),
      43             : 
      44         102 :     _mu(getMaterialProperty<Real>("mu")),
      45         102 :     _rho(getMaterialProperty<Real>("rho")),
      46         102 :     _vel(getMaterialProperty<Real>("vel")),
      47         102 :     _D_h(getMaterialProperty<Real>("D_h")),
      48         153 :     _roughness(getParam<Real>("roughness"))
      49             : {
      50          51 : }
      51             : 
      52             : void
      53         122 : WallFrictionChurchillMaterial::computeQpProperties()
      54             : {
      55         122 :   Real Re = THM::Reynolds(1., _rho[_qp], _vel[_qp], _D_h[_qp], _mu[_qp]);
      56             : 
      57         122 :   const Real f_F = WallFriction::FanningFrictionFactorChurchill(Re, _roughness, _D_h[_qp]);
      58             : 
      59         122 :   _f_D[_qp] = WallFriction::DarcyFrictionFactor(f_F);
      60         122 :   _df_D_drhoA[_qp] = 0;
      61         122 :   _df_D_drhouA[_qp] = 0;
      62         122 :   _df_D_drhoEA[_qp] = 0;
      63         122 : }

Generated by: LCOV version 1.14