www.mooseframework.org
PorousFlowThermalConductivityFromPorosity.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>("lambda_s",
20  "The thermal conductivity of the solid matrix material");
21  params.addRequiredParam<RealTensorValue>("lambda_f",
22  "The thermal conductivity of the single fluid phase");
23  params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity "
24  "for the single phase, fully saturated case by using a linear "
25  "weighted average. "
26  "Thermal conductivity = phi * lambda_f + (1 - phi) * lambda_s, "
27  "where phi is porosity, and lambda_f, lambda_s are "
28  "thermal conductivities of the fluid and solid (assumed constant)");
29  return params;
30 }
31 
33  const InputParameters & parameters)
35  _la_s(getParam<RealTensorValue>("lambda_s")),
36  _la_f(getParam<RealTensorValue>("lambda_f")),
37  _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
38  _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar"))
39 {
40  if (_num_phases != 1)
41  paramError("fluid_phase",
42  "The Dictator proclaims that the number of phases is ",
43  _dictator.numPhases(),
44  " whereas this material can only be used for single phase "
45  "simulations. Be aware that the Dictator has noted your mistake.");
46 }
47 
48 void
50 {
51  _la_qp[_qp] = _la_s * (1.0 - _porosity_qp[_qp]) + _la_f * _porosity_qp[_qp];
52 
53  _dla_qp_dvar[_qp].assign(_num_var, RealTensorValue());
54  for (unsigned v = 0; v < _num_var; ++v)
55  _dla_qp_dvar[_qp][v] = (_la_f - _la_s) * _dporosity_qp_dvar[_qp][v];
56 }
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 >()
MaterialProperty< std::vector< RealTensorValue > > & _dla_qp_dvar
d(thermal conductivity at the qps)/d(PorousFlow variable)
Base class for materials that provide thermal conducitivity.
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)
registerMooseObject("PorousFlowApp", PorousFlowThermalConductivityFromPorosity)
const RealTensorValue _la_s
Thermal conductivity of the solid phase.
This Material calculates rock-fluid combined thermal conductivity for the single phase, fully saturated case by using a linear weighted average.
InputParameters validParams< PorousFlowThermalConductivityBase >()