www.mooseframework.org
PorousFlowDiffusivityMillingtonQuirk.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<PorousFlowDiffusivityBase>();
19  params.addClassDescription(
20  "This Material provides saturation-dependent diffusivity using the Millington-Quirk model");
21  return params;
22 }
23 
25  const InputParameters & parameters)
26  : PorousFlowDiffusivityBase(parameters),
27  _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
28  _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
29  _saturation_qp(getMaterialProperty<std::vector<Real>>("PorousFlow_saturation_qp")),
30  _dsaturation_qp_dvar(
31  getMaterialProperty<std::vector<std::vector<Real>>>("dPorousFlow_saturation_qp_dvar"))
32 {
33 }
34 
35 void
37 {
39 
40  _tortuosity[_qp].resize(_num_phases);
41  for (unsigned int ph = 0; ph < _num_phases; ++ph)
42  {
43  _tortuosity[_qp][ph] =
44  std::cbrt(_porosity_qp[_qp]) * std::pow(_saturation_qp[_qp][ph], 10.0 / 3.0);
45  for (unsigned int var = 0; var < _num_var; ++var)
46  _dtortuosity_dvar[_qp][ph][var] =
47  1.0 / 3.0 * std::cbrt(_porosity_qp[_qp]) * std::pow(_saturation_qp[_qp][ph], 7.0 / 3.0) *
48  (_saturation_qp[_qp][ph] / _porosity_qp[_qp] * _dporosity_qp_dvar[_qp][var] +
49  10.0 * _dsaturation_qp_dvar[_qp][ph][var]);
50  }
51 }
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.
registerMooseObject("PorousFlowApp", PorousFlowDiffusivityMillingtonQuirk)
Material to provide saturation dependent diffusivity using the model of Millington and Quirk...