www.mooseframework.org
PorousFlowThermalConductivityIdeal.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>(
16  "dry_thermal_conductivity",
17  "The thermal conductivity of the rock matrix when the aqueous saturation is zero");
18  params.addParam<RealTensorValue>("wet_thermal_conductivity",
19  "The thermal conductivity of the rock matrix when the aqueous "
20  "saturation is unity. This defaults to "
21  "dry_thermal_conductivity.");
22  params.addParam<Real>("exponent",
23  1.0,
24  "Exponent on saturation. Thermal conductivity = "
25  "dry_thermal_conductivity + S^exponent * "
26  "(wet_thermal_conductivity - dry_thermal_conductivity), "
27  "where S is the aqueous saturation");
28  params.addParam<unsigned>("aqueous_phase_number",
29  0,
30  "The phase number of the aqueous phase. In simulations without "
31  "fluids, this parameter and the exponent parameter will not be "
32  "used: only the dry_thermal_conductivity will be used.");
33  params.set<bool>("at_nodes") = false;
34  params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity by "
35  "using a weighted sum. Thermal conductivity = "
36  "dry_thermal_conductivity + S^exponent * (wet_thermal_conductivity - "
37  "dry_thermal_conductivity), where S is the aqueous saturation");
38  return params;
39 }
40 
42  const InputParameters & parameters)
43  : PorousFlowMaterialVectorBase(parameters),
44  _la_dry(getParam<RealTensorValue>("dry_thermal_conductivity")),
45  _wet_and_dry_differ(parameters.isParamValid("wet_thermal_conductivity")),
46  _la_wet(_wet_and_dry_differ ? getParam<RealTensorValue>("wet_thermal_conductivity")
47  : getParam<RealTensorValue>("dry_thermal_conductivity")),
48  _exponent(getParam<Real>("exponent")),
49  _aqueous_phase(_num_phases > 0),
50  _aqueous_phase_number(getParam<unsigned>("aqueous_phase_number")),
51  _saturation_qp(_aqueous_phase
52  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")
53  : nullptr),
54  _dsaturation_qp_dvar(
55  _aqueous_phase
56  ? &getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_saturation_qp_dvar")
57  : nullptr),
58  _la_qp(declareProperty<RealTensorValue>("PorousFlow_thermal_conductivity_qp")),
59  _dla_qp_dvar(
60  declareProperty<std::vector<RealTensorValue>>("dPorousFlow_thermal_conductivity_qp_dvar"))
61 {
63  mooseError("PorousFlowThermalConductivityIdeal: Your aqueous phase number, ",
65  " must not exceed the number of fluid phases in the system, which is ",
67  "\n");
68  if (_nodal_material == true)
69  mooseError("PorousFlowThermalConductivity classes are only defined for at_nodes = false");
70 }
71 
72 void
74 {
75  _la_qp[_qp] = _la_dry;
77  _la_qp[_qp] +=
79 
80  _dla_qp_dvar[_qp].assign(_num_var, RealTensorValue());
82  for (unsigned v = 0; v < _num_var; ++v)
83  _dla_qp_dvar[_qp][v] =
84  _exponent * std::pow((*_saturation_qp)[_qp][_aqueous_phase_number], _exponent - 1.0) *
85  (*_dsaturation_qp_dvar)[_qp][_aqueous_phase_number][v] * (_la_wet - _la_dry);
86 }
const Real _exponent
exponent for saturation
const unsigned int _num_phases
Number of phases.
const RealTensorValue _la_wet
Wet thermal conductivity of rock.
PorousFlowThermalConductivityIdeal(const InputParameters &parameters)
MaterialProperty< RealTensorValue > & _la_qp
Thermal conducitivity at the qps.
MaterialProperty< std::vector< RealTensorValue > > & _dla_qp_dvar
d(thermal conductivity at the qps)/d(PorousFlow variable)
const bool _wet_and_dry_differ
Whether _la_wet has been supplied.
InputParameters validParams< PorousFlowThermalConductivityIdeal >()
InputParameters validParams< PorousFlowMaterialVectorBase >()
Base class for all PorousFlow vector materials.
const bool _aqueous_phase
whether this is a fluid simulation
const RealTensorValue _la_dry
Dry thermal conductivity of rock.
const unsigned int _num_var
Number of PorousFlow variables.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const MaterialProperty< std::vector< Real > > *const _saturation_qp
Saturation of the fluid phases at the quadpoints.
const unsigned _aqueous_phase_number
Phase number of the aqueous phase.