www.mooseframework.org
PorousFlowPermeabilityExponential.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<PorousFlowPermeabilityBase>();
15  MooseEnum poroperm_function("log_k ln_k exp_k", "exp_k");
16  params.addParam<MooseEnum>("poroperm_function",
17  poroperm_function,
18  "Form of the function relating porosity and permeability. The options "
19  "are: log_k (log k = A phi + B); ln_k (ln k = A phi + B); exp_k (k = "
20  "B exp(A phi)); where k is permeability, phi is porosity, A and B are "
21  "empirical constants.");
22  params.addParam<RealTensorValue>("k_anisotropy",
23  "A tensor to multiply the calculated scalar "
24  "permeability, in order to obtain anisotropy if "
25  "required. Defaults to isotropic permeability "
26  "if not specified.");
27  params.addRequiredParam<Real>("A", "Empirical constant; see poroperm_function.");
28  params.addRequiredParam<Real>("B", "Empirical constant; see poroperm_function.");
29  params.addClassDescription(
30  "This Material calculates the permeability tensor from an exponential function of porosity: "
31  "k = k_ijk * BB exp(AA phi), where k_ijk is a tensor providing the anisotropy, phi is "
32  "porosity, and AA and BB are empirical constants. The user can provide input for the "
33  "function expressed in ln k, log k or exponential forms (see poroperm_function).");
34  return params;
35 }
36 
38  const InputParameters & parameters)
39  : PorousFlowPermeabilityBase(parameters),
40  _A(getParam<Real>("A")),
41  _B(getParam<Real>("B")),
42  _k_anisotropy(parameters.isParamValid("k_anisotropy")
43  ? getParam<RealTensorValue>("k_anisotropy")
44  : RealTensorValue(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)),
45  _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
46  _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar")),
47  _dporosity_qp_dgradvar(
48  getMaterialProperty<std::vector<RealGradient>>("dPorousFlow_porosity_qp_dgradvar")),
49  _poroperm_function(getParam<MooseEnum>("poroperm_function").getEnum<PoropermFunction>())
50 {
51  switch (_poroperm_function)
52  {
54  _AA = _A * std::log(10.0);
55  _BB = std::pow(10.0, _B);
56  break;
57 
59  _AA = _A;
60  _BB = std::exp(_B);
61  break;
62 
64  _AA = _A;
65  _BB = _B;
66  break;
67  }
68 }
69 
70 void
72 {
73  _permeability_qp[_qp] = _k_anisotropy * _BB * std::exp(_porosity_qp[_qp] * _AA);
74 
75  _dpermeability_qp_dvar[_qp].resize(_num_var, RealTensorValue());
76  for (unsigned int v = 0; v < _num_var; ++v)
77  _dpermeability_qp_dvar[_qp][v] = _AA * _permeability_qp[_qp] * _dporosity_qp_dvar[_qp][v];
78 
79  _dpermeability_qp_dgradvar[_qp].resize(LIBMESH_DIM);
80  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
81  {
82  _dpermeability_qp_dgradvar[_qp][i].resize(_num_var, RealTensorValue());
83  for (unsigned int v = 0; v < _num_var; ++v)
84  _dpermeability_qp_dgradvar[_qp][i][v] =
85  _AA * _permeability_qp[_qp] * _dporosity_qp_dgradvar[_qp][v](i);
86  }
87 }
Real _AA
Empirical constant AA in k = k_ijk * BB * exp(AA * phi)
enum PorousFlowPermeabilityExponential::PoropermFunction _poroperm_function
PorousFlowPermeabilityExponential(const InputParameters &parameters)
MaterialProperty< std::vector< std::vector< RealTensorValue > > > & _dpermeability_qp_dgradvar
d(quadpoint permeability)/d(grad(PorousFlow variable))
Base class Material designed to provide the permeability tensor.
const MaterialProperty< std::vector< RealGradient > > & _dporosity_qp_dgradvar
d(quadpoint porosity)/d(grad(PorousFlow variable))
const MaterialProperty< std::vector< Real > > & _dporosity_qp_dvar
d(quadpoint porosity)/d(PorousFlow variable)
const unsigned int _num_var
Number of PorousFlow variables.
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
MaterialProperty< std::vector< RealTensorValue > > & _dpermeability_qp_dvar
d(quadpoint permeability)/d(PorousFlow variable)
Real _BB
Empirical constant BB in k = k_ijk * BB * exp(AA * phi)
MaterialProperty< RealTensorValue > & _permeability_qp
quadpoint permeability
InputParameters validParams< PorousFlowPermeabilityExponential >()
PoropermFunction
Name of porosity-permeability relationship.
InputParameters validParams< PorousFlowPermeabilityBase >()
const MaterialProperty< Real > & _porosity_qp
quadpoint porosity
const RealTensorValue _k_anisotropy
Tensor multiplier k_ijk in k = k_ijk * A * phi^n / (1 - phi)^m.