13 #include "libmesh/quadrature.h"
24 params.addCoupledVar(
"temp",
"Coupled Temperature");
26 params.addParam<Real>(
"thermal_conductivity",
"The thermal conductivity value");
27 params.addParam<FunctionName>(
"thermal_conductivity_temperature_function",
29 "Thermal conductivity as a function of temperature.");
31 params.addParam<Real>(
"specific_heat",
"The specific heat value");
32 params.addParam<FunctionName>(
33 "specific_heat_temperature_function",
"",
"Specific heat as a function of temperature.");
34 params.addClassDescription(
"General-purpose material model for heat conduction");
40 : Material(parameters),
42 _has_temp(isCoupled(
"temp")),
43 _temperature(_has_temp ? coupledValue(
"temp") : _zero),
44 _my_thermal_conductivity(
45 isParamValid(
"thermal_conductivity") ? getParam<Real>(
"thermal_conductivity") : 0),
46 _my_specific_heat(isParamValid(
"specific_heat") ? getParam<Real>(
"specific_heat") : 0),
48 _thermal_conductivity(declareProperty<Real>(
"thermal_conductivity")),
49 _thermal_conductivity_dT(declareProperty<Real>(
"thermal_conductivity_dT")),
50 _thermal_conductivity_temperature_function(
51 getParam<FunctionName>(
"thermal_conductivity_temperature_function") !=
""
52 ? &getFunction(
"thermal_conductivity_temperature_function")
55 _specific_heat(declareProperty<Real>(
"specific_heat")),
56 _specific_heat_temperature_function(
57 getParam<FunctionName>(
"specific_heat_temperature_function") !=
""
58 ? &getFunction(
"specific_heat_temperature_function")
63 mooseError(
"Must couple with temperature if using thermal conductivity function");
68 "Cannot define both thermal conductivity and thermal conductivity temperature function");
72 mooseError(
"Must couple with temperature if using specific heat function");
76 mooseError(
"Cannot define both specific heat and specific heat temperature function");
83 for (
unsigned int qp(0); qp < _qrule->n_points(); ++qp)
85 Real qp_temperature = 0;
91 std::stringstream msg;
92 msg <<
"WARNING: In HeatConductionMaterial: negative temperature!\n"
93 <<
"\tResetting to zero.\n"
94 <<
"\t_qp: " << qp <<
"\n"
96 <<
"\telem: " << _current_elem->id() <<
"\n"
97 <<
"\tproc: " << processor_id() <<
"\n";
98 mooseWarning(msg.str());