LCOV - code coverage report
Current view: top level - src/solidproperties - ThermalGraphiteProperties.C (source / functions) Hit Total Coverage
Test: idaholab/moose solid_properties: #31405 (292dce) with base fef103 Lines: 51 61 83.6 %
Date: 2025-09-04 07:57:33 Functions: 9 9 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 "ThermalGraphiteProperties.h"
      11             : #include "libmesh/utility.h"
      12             : 
      13             : registerMooseObject("SolidPropertiesApp", ThermalGraphiteProperties);
      14             : 
      15             : InputParameters
      16          39 : ThermalGraphiteProperties::validParams()
      17             : {
      18          39 :   InputParameters params = ThermalSolidProperties::validParams();
      19             : 
      20          78 :   MooseEnum graphite_grade("H_451");
      21          78 :   params.addRequiredParam<MooseEnum>("grade", graphite_grade, "Graphite grade");
      22          78 :   params.addRangeCheckedParam<Real>("density", 1850.0, "density > 0.0", "(Constant) density");
      23          39 :   params.addClassDescription("Graphite thermal properties.");
      24          39 :   return params;
      25          39 : }
      26             : 
      27          20 : ThermalGraphiteProperties::ThermalGraphiteProperties(const InputParameters & parameters)
      28             :   : ThermalSolidProperties(parameters),
      29          20 :     _grade(getParam<MooseEnum>("grade").getEnum<GraphiteGrade>()),
      30          40 :     _rho_const(getParam<Real>("density")),
      31          20 :     _c1(4184.0),
      32          20 :     _c2(0.54212),
      33          20 :     _c3(2.42667e-6),
      34          20 :     _c4(90.2725),
      35          20 :     _c5(43449.3),
      36          20 :     _c6(1.59309e7),
      37          20 :     _c7(1.43688e9)
      38             : {
      39          20 : }
      40             : 
      41             : Real
      42         612 : ThermalGraphiteProperties::cp_from_T(const Real & T) const
      43             : {
      44         612 :   switch (_grade)
      45             :   {
      46         612 :     case GraphiteGrade::H_451:
      47         612 :       return _c1 * (_c2 - _c3 * T - _c4 / T - _c5 / Utility::pow<2>(T) + _c6 / Utility::pow<3>(T) -
      48         612 :                     _c7 / Utility::pow<4>(T));
      49           0 :     default:
      50           0 :       mooseError("Unhandled GraphiteGrade enum!");
      51             :   }
      52             : }
      53             : 
      54             : void
      55           2 : ThermalGraphiteProperties::cp_from_T(const Real & T, Real & cp, Real & dcp_dT) const
      56             : {
      57           2 :   cp = cp_from_T(T);
      58             : 
      59           2 :   switch (_grade)
      60             :   {
      61           2 :     case GraphiteGrade::H_451:
      62             :     {
      63           2 :       dcp_dT = _c1 * (-_c3 + _c4 / Utility::pow<2>(T) + 2.0 * _c5 / Utility::pow<3>(T) -
      64           2 :                       3.0 * _c6 / Utility::pow<4>(T) + 4.0 * _c7 / Utility::pow<5>(T));
      65             :       break;
      66             :     }
      67           0 :     default:
      68           0 :       mooseError("Unhandled GraphiteGrade enum!");
      69             :   }
      70           2 : }
      71             : 
      72             : Real
      73          14 : ThermalGraphiteProperties::cp_integral(const Real & T) const
      74             : {
      75          14 :   switch (_grade)
      76             :   {
      77          14 :     case GraphiteGrade::H_451:
      78             :     {
      79          14 :       return _c1 * (_c2 * T - 0.5 * _c3 * Utility::pow<2>(T) - _c4 * std::log(T) + _c5 / T -
      80          14 :                     0.5 * _c6 / Utility::pow<2>(T) + _c7 / (3.0 * Utility::pow<3>(T)));
      81             :     }
      82           0 :     default:
      83           0 :       mooseError("Unhandled GraphiteGrade enum!");
      84             :   }
      85             : }
      86             : 
      87             : Real
      88         610 : ThermalGraphiteProperties::k_from_T(const Real & T) const
      89             : {
      90         610 :   switch (_grade)
      91             :   {
      92             :     case GraphiteGrade::H_451:
      93         610 :       return 3.28248e-5 * Utility::pow<2>(T) - 1.24890e-1 * T + 1.692145e2;
      94           0 :     default:
      95           0 :       mooseError("Unhandled GraphiteGrade enum!");
      96             :   }
      97             : }
      98             : 
      99             : void
     100           2 : ThermalGraphiteProperties::k_from_T(const Real & T, Real & k, Real & dk_dT) const
     101             : {
     102           2 :   k = k_from_T(T);
     103             : 
     104           2 :   switch (_grade)
     105             :   {
     106           2 :     case GraphiteGrade::H_451:
     107             :     {
     108           2 :       dk_dT = 6.56496e-5 * T - 1.24890e-1;
     109             :       break;
     110             :     }
     111           0 :     default:
     112           0 :       mooseError("Unhandled GraphiteGrade enum!");
     113             :   }
     114           2 : }
     115             : 
     116             : Real
     117         610 : ThermalGraphiteProperties::rho_from_T(const Real & /* T */) const
     118             : {
     119         610 :   return _rho_const;
     120             : }
     121             : 
     122             : void
     123           2 : ThermalGraphiteProperties::rho_from_T(const Real & T, Real & rho, Real & drho_dT) const
     124             : {
     125           2 :   rho = rho_from_T(T);
     126           2 :   drho_dT = 0.0;
     127           2 : }

Generated by: LCOV version 1.14