12 #include "MooseMesh.h"
14 #include "libmesh/quadrature.h"
25 params.addCoupledVar(
"temp",
"Coupled Temperature");
27 params.addParam<Real>(
"thermal_conductivity_x",
"The thermal conductivity in the x direction");
28 params.addParam<Real>(
"thermal_conductivity_y",
"The thermal conductivity in the y direction");
29 params.addParam<Real>(
"thermal_conductivity_z",
"The thermal conductivity in the z direction");
30 params.addParam<PostprocessorName>(
"thermal_conductivity_x_pp",
31 "The thermal conductivity PP name in the x direction");
32 params.addParam<PostprocessorName>(
"thermal_conductivity_y_pp",
33 "The thermal conductivity PP name in the y direction");
34 params.addParam<PostprocessorName>(
"thermal_conductivity_z_pp",
35 "The thermal conductivity PP name in the z direction");
37 params.addParam<Real>(
"specific_heat",
"The specific heat value");
38 params.addParam<FunctionName>(
39 "specific_heat_temperature_function",
"",
"Specific heat as a function of temperature.");
45 : Material(parameters),
47 _has_temp(isCoupled(
"temp")),
48 _temperature(_has_temp ? coupledValue(
"temp") : _zero),
50 _my_thermal_conductivity_x(
51 isParamValid(
"thermal_conductivity_x") ? getParam<Real>(
"thermal_conductivity_x") : -1),
52 _my_thermal_conductivity_y(
53 isParamValid(
"thermal_conductivity_y") ? getParam<Real>(
"thermal_conductivity_y") : -1),
54 _my_thermal_conductivity_z(
55 isParamValid(
"thermal_conductivity_z") ? getParam<Real>(
"thermal_conductivity_z") : -1),
57 _thermal_conductivity_x_pp(isParamValid(
"thermal_conductivity_x_pp")
58 ? &getPostprocessorValue(
"thermal_conductivity_x_pp")
60 _thermal_conductivity_y_pp(isParamValid(
"thermal_conductivity_y_pp")
61 ? &getPostprocessorValue(
"thermal_conductivity_y_pp")
63 _thermal_conductivity_z_pp(isParamValid(
"thermal_conductivity_z_pp")
64 ? &getPostprocessorValue(
"thermal_conductivity_z_pp")
67 _my_specific_heat(isParamValid(
"specific_heat") ? getParam<Real>(
"specific_heat") : 0),
69 _thermal_conductivity_x(&declareProperty<Real>(
"thermal_conductivity_x")),
70 _thermal_conductivity_x_dT(&declareProperty<Real>(
"thermal_conductivity_x_dT")),
71 _thermal_conductivity_y(isParamValid(
"thermal_conductivity_y") ||
72 isParamValid(
"thermal_conductivity_y_pp")
73 ? &declareProperty<Real>(
"thermal_conductivity_y")
75 _thermal_conductivity_y_dT(
76 _thermal_conductivity_y ? &declareProperty<Real>(
"thermal_conductivity_y_dT") : NULL),
77 _thermal_conductivity_z(isParamValid(
"thermal_conductivity_z") ||
78 isParamValid(
"thermal_conductivity_z_pp")
79 ? &declareProperty<Real>(
"thermal_conductivity_z")
81 _thermal_conductivity_z_dT(
82 _thermal_conductivity_z ? &declareProperty<Real>(
"thermal_conductivity_z_dT") : NULL),
84 _specific_heat(declareProperty<Real>(
"specific_heat")),
85 _specific_heat_temperature_function(
86 getParam<FunctionName>(
"specific_heat_temperature_function") !=
""
87 ? &getFunction(
"specific_heat_temperature_function")
94 if (!k_x || (_subproblem.mesh().dimension() > 1 && !k_y) ||
95 (_subproblem.mesh().dimension() > 2 && !k_z))
97 mooseError(
"Incomplete set of orthotropic thermal conductivity parameters");
101 mooseError(
"Must couple with temperature if using specific heat function");
105 mooseError(
"Cannot define both specific heat and specific heat temperature function");
111 if (k_x || k_y || k_z)
113 mooseError(
"Cannot define thermal conductivity value and Postprocessor");
120 for (
unsigned int qp(0); qp < _qrule->n_points(); ++qp)
122 (*_thermal_conductivity_x)[qp] =
124 (*_thermal_conductivity_x_dT)[qp] = 0;
127 (*_thermal_conductivity_y)[qp] =
129 (*_thermal_conductivity_y_dT)[qp] = 0;
133 (*_thermal_conductivity_z)[qp] =
135 (*_thermal_conductivity_z_dT)[qp] = 0;