www.mooseframework.org
PorousFlowDiffusivityMillingtonQuirk.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<PorousFlowDiffusivityBase>();
15  params.addClassDescription(
16  "This Material provides saturation-dependent diffusivity using the Millington-Quirk model");
17  return params;
18 }
19 
21  const InputParameters & parameters)
22  : PorousFlowDiffusivityBase(parameters),
23  _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
24  _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
25  _saturation_qp(getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
26  _dsaturation_qp_dvar(
27  getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_saturation_qp_dvar"))
28 {
29 }
30 
31 void
33 {
35 
36  _tortuosity[_qp].resize(_num_phases);
37  for (unsigned int ph = 0; ph < _num_phases; ++ph)
38  {
39  _tortuosity[_qp][ph] =
40  std::cbrt(_porosity_qp[_qp]) * std::pow(_saturation_qp[_qp][ph], 10.0 / 3.0);
41  for (unsigned int var = 0; var < _num_var; ++var)
42  _dtortuosity_dvar[_qp][ph][var] =
43  1.0 / 3.0 * std::cbrt(_porosity_qp[_qp]) * std::pow(_saturation_qp[_qp][ph], 7.0 / 3.0) *
44  (_saturation_qp[_qp][ph] / _porosity_qp[_qp] * _dporosity_qp_dvar[_qp][var] +
45  10.0 * _dsaturation_qp_dvar[_qp][ph][var]);
46  }
47 }
const unsigned int _num_phases
Number of phases.
virtual void computeQpProperties() override
InputParameters validParams< PorousFlowDiffusivityMillingtonQuirk >()
const MaterialProperty< std::vector< Real > > & _saturation_qp
Saturation of each phase at the qps.
const MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_qp_dvar
Derivative of saturation of each phase wrt PorousFlow variables (at the qps)
const MaterialProperty< std::vector< Real > > & _dporosity_qp_dvar
Derivative of porosity wrt PorousFlow variables (at the qps)
Base class Material designed to provide the tortuosity and diffusion coefficents. ...
const unsigned int _num_var
Number of PorousFlow variables.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
InputParameters validParams< PorousFlowDiffusivityBase >()
PorousFlowDiffusivityMillingtonQuirk(const InputParameters &parameters)
const MaterialProperty< Real > & _porosity_qp
Porosity at the qps.
MaterialProperty< std::vector< std::vector< Real > > > & _dtortuosity_dvar
Derivative of tortuosity wrt PorousFlow variables.
MaterialProperty< std::vector< Real > > & _tortuosity
Tortuosity tau_0 * tau_{alpha} for fluid phase alpha.