LCOV - code coverage report
Current view: top level - src/materials - WallFrictionFunctionMaterial.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 27 28 96.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 "WallFrictionFunctionMaterial.h"
      11             : #include "Function.h"
      12             : 
      13             : registerMooseObject("ThermalHydraulicsApp", WallFrictionFunctionMaterial);
      14             : 
      15             : InputParameters
      16          20 : WallFrictionFunctionMaterial::validParams()
      17             : {
      18          20 :   InputParameters params = Material::validParams();
      19          20 :   params.addClassDescription("Defines a Darcy friction factor equal to the value of the function "
      20             :                              "at the local coordinates and time");
      21          40 :   params.addRequiredParam<MaterialPropertyName>("f_D", "Darcy friction factor material property");
      22             : 
      23          40 :   params.addRequiredParam<FunctionName>("function", "Darcy friction factor function");
      24             : 
      25          40 :   params.addCoupledVar("beta", "Volume fraction equation variable: beta");
      26          40 :   params.addRequiredCoupledVar("arhoA", "Mass equation variable: alpha*rho*A");
      27          40 :   params.addRequiredCoupledVar("arhouA", "Momentum equation variable: alpha*rho*u*A");
      28          40 :   params.addRequiredCoupledVar("arhoEA", "Energy equation variable: alpha*rho*E*A");
      29             : 
      30          20 :   return params;
      31           0 : }
      32             : 
      33          15 : WallFrictionFunctionMaterial::WallFrictionFunctionMaterial(const InputParameters & parameters)
      34             :   : DerivativeMaterialInterfaceTHM<Material>(parameters),
      35             : 
      36          15 :     _function(getFunction("function")),
      37             : 
      38          15 :     _f_D_name(getParam<MaterialPropertyName>("f_D")),
      39          15 :     _f_D(declareProperty<Real>(_f_D_name)),
      40          30 :     _df_D_dbeta(isCoupled("beta") ? &declarePropertyDerivativeTHM<Real>(_f_D_name, "beta")
      41             :                                   : nullptr),
      42          15 :     _df_D_darhoA(declarePropertyDerivativeTHM<Real>(_f_D_name, "arhoA")),
      43          15 :     _df_D_darhouA(declarePropertyDerivativeTHM<Real>(_f_D_name, "arhouA")),
      44          30 :     _df_D_darhoEA(declarePropertyDerivativeTHM<Real>(_f_D_name, "arhoEA"))
      45             : {
      46          15 : }
      47             : 
      48             : void
      49         130 : WallFrictionFunctionMaterial::computeQpProperties()
      50             : {
      51         130 :   _f_D[_qp] = _function.value(_t, _q_point[_qp]);
      52             : 
      53         130 :   _df_D_darhoA[_qp] = 0;
      54         130 :   _df_D_darhouA[_qp] = 0;
      55         130 :   _df_D_darhoEA[_qp] = 0;
      56         260 :   if (isCoupled("beta"))
      57         130 :     (*_df_D_dbeta)[_qp] = 0;
      58         130 : }

Generated by: LCOV version 1.14