LCOV - code coverage report
Current view: top level - src/userobjects - SolidMaterialProperties.C (source / functions) Hit Total Coverage
Test: idaholab/moose thermal_hydraulics: #30301 (3b550b) with base 2ad78d Lines: 30 31 96.8 %
Date: 2025-07-30 13:02:48 Functions: 8 8 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 "SolidMaterialProperties.h"
      11             : 
      12             : registerMooseObjectDeprecated("ThermalHydraulicsApp", SolidMaterialProperties, "04/31/2024 24:00");
      13             : 
      14             : InputParameters
      15         154 : SolidMaterialProperties::validParams()
      16             : {
      17         154 :   InputParameters params = GeneralUserObject::validParams();
      18         154 :   params.addClassDescription(
      19             :       "User object to compute solid material properties using functions of temperature");
      20         308 :   params.addRequiredParam<FunctionName>("k", "Thermal conductivity [W/(m-K)]");
      21         308 :   params.addDeprecatedParam<FunctionName>(
      22             :       "Cp",
      23             :       "Specific heat [J/(kg-K)]",
      24             :       "The parameter 'Cp' has been deprecated. Use 'cp' instead.");
      25         308 :   params.addParam<FunctionName>("cp", "Specific heat [J/(kg-K)]");
      26         308 :   params.addRequiredParam<FunctionName>("rho", "Density [kg/m^3]");
      27             : 
      28         154 :   params.addPrivateParam<ExecFlagEnum>("execute_on");
      29         308 :   params.addPrivateParam<bool>("use_displaced_mesh");
      30             : 
      31         308 :   params.declareControllable("rho cp k");
      32             : 
      33         154 :   params.registerBase("SolidMaterialProperties");
      34             : 
      35         154 :   return params;
      36           0 : }
      37             : 
      38          77 : SolidMaterialProperties::SolidMaterialProperties(const InputParameters & parameters)
      39             :   : GeneralUserObject(parameters),
      40          77 :     _k(getFunction("k")),
      41         231 :     _cp(isParamValid("Cp") ? getFunction("Cp") : getFunction("cp")),
      42         154 :     _rho(getFunction("rho"))
      43             : {
      44          77 :   mooseDeprecated("Heat structure materials are deprecated in favor of SolidProperties objects. "
      45             :                   "See heat structure documentation for more information.");
      46          77 : }
      47             : 
      48             : void
      49         525 : SolidMaterialProperties::initialize()
      50             : {
      51         525 : }
      52             : 
      53             : void
      54         525 : SolidMaterialProperties::execute()
      55             : {
      56         525 : }
      57             : 
      58             : void
      59         525 : SolidMaterialProperties::finalize()
      60             : {
      61         525 : }
      62             : 
      63             : ADReal
      64      158700 : SolidMaterialProperties::k(const ADReal & temp) const
      65             : {
      66      158700 :   return _k.value(temp, ADPoint());
      67             : }
      68             : 
      69             : ADReal
      70      158700 : SolidMaterialProperties::cp(const ADReal & temp) const
      71             : {
      72      158700 :   return _cp.value(temp, ADPoint());
      73             : }
      74             : 
      75             : ADReal
      76      158700 : SolidMaterialProperties::rho(const ADReal & temp) const
      77             : {
      78      158700 :   return _rho.value(temp, ADPoint());
      79             : }

Generated by: LCOV version 1.14