https://mooseframework.inl.gov
ThermalFunctionSolidProperties.C
Go to the documentation of this file.
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 
11 #include "Function.h"
12 
14 
17 {
19  params.addRequiredParam<FunctionName>("k", "Thermal conductivity");
20  params.addRequiredParam<FunctionName>("cp", "Isobaric specific heat");
21  params.addRequiredParam<FunctionName>("rho", "Density");
22  params.addClassDescription("Function-based thermal properties.");
23  return params;
24 }
25 
27  : ThermalSolidProperties(parameters),
28  _k_function(getFunction("k")),
29  _cp_function(getFunction("cp")),
30  _rho_function(getFunction("rho"))
31 {
32 }
33 
34 Real
36 {
37  return _cp_function.value(T);
38 }
39 
40 void
41 ThermalFunctionSolidProperties::cp_from_T(const Real & T, Real & cp, Real & dcp_dT) const
42 {
43  cp = cp_from_T(T);
44  dcp_dT = _cp_function.timeDerivative(T);
45 }
46 
47 Real
49 {
50  return _cp_function.timeIntegral(_T_zero_e, T, Point(0, 0, 0));
51 }
52 
53 Real
55 {
56  return _k_function.value(T);
57 }
58 
59 void
60 ThermalFunctionSolidProperties::k_from_T(const Real & T, Real & k, Real & dk_dT) const
61 {
62  k = k_from_T(T);
63  dk_dT = _k_function.timeDerivative(T);
64 }
65 
66 Real
68 {
69  return _rho_function.value(T);
70 }
71 
72 void
73 ThermalFunctionSolidProperties::rho_from_T(const Real & T, Real & rho, Real & drho_dT) const
74 {
75  rho = rho_from_T(T);
76  drho_dT = _rho_function.timeDerivative(T);
77 }
registerMooseObject("SolidPropertiesApp", ThermalFunctionSolidProperties)
ThermalFunctionSolidProperties(const InputParameters &parameters)
virtual Real cp_integral(const Real &T) const override
Thermal material properties as a function of temperature from function inputs.
virtual Real cp_from_T(const Real &T) const override
virtual Real timeIntegral(Real t1, Real t2, const Point &p) const
virtual Real timeDerivative(Real t, const Point &p) const
Common class for solid properties that are a function of temperature.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
static const std::string cp
Definition: NS.h:121
const Function & _cp_function
Function providing the isobaric specific heat as a function of temperature.
virtual Real rho_from_T(const Real &T) const override
virtual Real k_from_T(const Real &T) const override
const Function & _k_function
Function providing the thermal conductivity as a function of temperature.
const Function & _rho_function
Function providing the density as a function of temperature.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
virtual Real value(Real t, const Point &p) const
static const std::string k
Definition: NS.h:130