www.mooseframework.org
PorousFlowThermalConductivityIdeal.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<PorousFlowThermalConductivityBase>();
19  params.addRequiredParam<RealTensorValue>(
20  "dry_thermal_conductivity",
21  "The thermal conductivity of the rock matrix when the aqueous saturation is zero");
22  params.addParam<RealTensorValue>("wet_thermal_conductivity",
23  "The thermal conductivity of the rock matrix when the aqueous "
24  "saturation is unity. This defaults to "
25  "dry_thermal_conductivity.");
26  params.addParam<Real>("exponent",
27  1.0,
28  "Exponent on saturation. Thermal conductivity = "
29  "dry_thermal_conductivity + S^exponent * "
30  "(wet_thermal_conductivity - dry_thermal_conductivity), "
31  "where S is the aqueous saturation");
32  params.addParam<unsigned>("aqueous_phase_number",
33  0,
34  "The phase number of the aqueous phase. In simulations without "
35  "fluids, this parameter and the exponent parameter will not be "
36  "used: only the dry_thermal_conductivity will be used.");
37  params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity by "
38  "using a weighted sum. Thermal conductivity = "
39  "dry_thermal_conductivity + S^exponent * (wet_thermal_conductivity - "
40  "dry_thermal_conductivity), where S is the aqueous saturation");
41  return params;
42 }
43 
45  const InputParameters & parameters)
47  _la_dry(getParam<RealTensorValue>("dry_thermal_conductivity")),
48  _wet_and_dry_differ(parameters.isParamValid("wet_thermal_conductivity")),
49  _la_wet(_wet_and_dry_differ ? getParam<RealTensorValue>("wet_thermal_conductivity")
50  : getParam<RealTensorValue>("dry_thermal_conductivity")),
51  _exponent(getParam<Real>("exponent")),
52  _aqueous_phase(_num_phases > 0),
53  _aqueous_phase_number(getParam<unsigned>("aqueous_phase_number")),
54  _saturation_qp(_aqueous_phase
55  ? &getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")
56  : nullptr),
57  _dsaturation_qp_dvar(_aqueous_phase ? &getMaterialProperty<std::vector<std::vector<Real>>>(
58  "dPorousFlow_saturation_qp_dvar")
59  : nullptr)
60 {
62  mooseError("PorousFlowThermalConductivityIdeal: Your aqueous phase number, ",
64  " must not exceed the number of fluid phases in the system, which is ",
66  "\n");
67 }
68 
69 void
71 {
72  _la_qp[_qp] = _la_dry;
74  _la_qp[_qp] +=
76 
77  _dla_qp_dvar[_qp].assign(_num_var, RealTensorValue());
79  for (unsigned v = 0; v < _num_var; ++v)
80  _dla_qp_dvar[_qp][v] =
82  (*_dsaturation_qp_dvar)[_qp][_aqueous_phase_number][v] * (_la_wet - _la_dry);
83 }
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< 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.
Base class for materials that provide thermal conducitivity.
InputParameters validParams< PorousFlowThermalConductivityIdeal >()
registerMooseObject("PorousFlowApp", PorousFlowThermalConductivityIdeal)
This material computes thermal conductivity for a PorousMedium - fluid system, by using Thermal condu...
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.
MaterialProperty< RealTensorValue > & _la_qp
Thermal conducitivity at the qps.
const unsigned _aqueous_phase_number
Phase number of the aqueous phase.
InputParameters validParams< PorousFlowThermalConductivityBase >()