https://mooseframework.inl.gov
ThermalSolidPropertiesMaterial.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 "ThermalSolidProperties.h"
12 #include "SolidPropertiesNames.h"
13 
16 
17 template <bool is_ad>
20 {
22  params.addRequiredCoupledVar("temperature", "Temperature");
23  params.addRequiredParam<UserObjectName>("sp", "The name of the user object for solid properties");
26  "Name to be used for the isobaric specific heat");
29  "Name to be used for the thermal conductivity");
30  params.addParam<std::string>(SolidPropertiesNames::density,
32  "Name to be used for the density");
33  params.addClassDescription("Computes solid thermal properties as a function of temperature");
34  return params;
35 }
36 
37 template <bool is_ad>
39  const InputParameters & parameters)
40  : Material(parameters),
41  _temperature(coupledGenericValue<is_ad>("temperature")),
42 
43  _cp(declareGenericProperty<Real, is_ad>(
44  getParam<std::string>(SolidPropertiesNames::specific_heat))),
45  _k(declareGenericProperty<Real, is_ad>(
46  getParam<std::string>(SolidPropertiesNames::thermal_conductivity))),
47  _rho(declareGenericProperty<Real, is_ad>(getParam<std::string>(SolidPropertiesNames::density))),
48 
49  _sp(getUserObject<ThermalSolidProperties>("sp"))
50 {
51 }
52 
53 template <bool is_ad>
54 void
56 {
57  _cp[_qp] = _sp.cp_from_T(_temperature[_qp]);
58  _k[_qp] = _sp.k_from_T(_temperature[_qp]);
59  _rho[_qp] = _sp.rho_from_T(_temperature[_qp]);
60 }
61 
registerMooseObject("SolidPropertiesApp", ThermalSolidPropertiesMaterial)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
Computes solid thermal properties as a function of temperature.
static const std::string thermal_conductivity
static const std::string density
Definition: NS.h:33
Common class for solid properties that are a function of temperature.
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
static const std::string specific_heat
ThermalSolidPropertiesMaterialTempl(const InputParameters &parameters)
static const std::string density