www.mooseframework.org
PorousFlowThermalConductivityFromPorosity.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowMaterialVectorBase>();
15  params.addRequiredParam<RealTensorValue>("lambda_s",
16  "The thermal conductivity of the solid matrix material");
17  params.addRequiredParam<RealTensorValue>("lambda_f",
18  "The thermal conductivity of the single fluid phase");
19  params.set<bool>("at_nodes") = false;
20  params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity "
21  "for the single phase, fully saturated case by using a linear "
22  "weighted average. "
23  "Thermal conductivity = phi * lambda_f + (1 - phi) * lambda_s, "
24  "where phi is porosity, and lambda_f, lambda_s are "
25  "thermal conductivities of the fluid and solid (assumed constant)");
26  return params;
27 }
28 
30  const InputParameters & parameters)
31  : PorousFlowMaterialVectorBase(parameters),
32  _la_s(getParam<RealTensorValue>("lambda_s")),
33  _la_f(getParam<RealTensorValue>("lambda_f")),
34  _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
35  _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
36  _la_qp(declareProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
37  _dla_qp_dvar(
38  declareProperty<std::vector<RealTensorValue>>("dPorousFlow_thermal_conductivity_qp_dvar"))
39 {
40  if (_num_phases != 1)
41  mooseError("The Dictator proclaims that the number of phases is ",
42  _dictator.numPhases(),
43  " whereas PorousFlowThermalConductivityFromPorosity can only be used for 1-phase "
44  "simulations. Be aware "
45  "that the Dictator has noted your mistake.");
46  if (_nodal_material == true)
47  mooseError("PorousFlowThermalConductivity classes are only defined for at_nodes = false");
48 }
49 
50 void
52 {
53  _la_qp[_qp] = _la_s * (1.0 - _porosity_qp[_qp]) + _la_f * _porosity_qp[_qp];
54 
55  _dla_qp_dvar[_qp].assign(_num_var, RealTensorValue());
56  for (unsigned v = 0; v < _num_var; ++v)
57  _dla_qp_dvar[_qp][v] = (_la_f - _la_s) * _dporosity_qp_dvar[_qp][v];
58 }
const unsigned int _num_phases
Number of phases.
const RealTensorValue _la_f
Thermal conductivity of the single fluid phase.
const MaterialProperty< Real > & _porosity_qp
quadpoint porosity
InputParameters validParams< PorousFlowThermalConductivityFromPorosity >()
InputParameters validParams< PorousFlowMaterialVectorBase >()
MaterialProperty< std::vector< RealTensorValue > > & _dla_qp_dvar
d(thermal conductivity at the qps)/d(PorousFlow variable)
Base class for all PorousFlow vector materials.
const MaterialProperty< std::vector< Real > > & _dporosity_qp_dvar
d(quadpoint porosity)/d(PorousFlow variable)
const unsigned int _num_var
Number of PorousFlow variables.
MaterialProperty< RealTensorValue > & _la_qp
Thermal conducitivity at the qps.
PorousFlowThermalConductivityFromPorosity(const InputParameters &parameters)
const RealTensorValue _la_s
Thermal conductivity of the solid phase.