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");
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.");
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.");
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")),
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
80  for (unsigned i = 0; i < LIBMESH_DIM; ++i)
81  {
83  for (unsigned int v = 0; v < _num_var; ++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
Base class Material designed to provide the permeability tensor.
const MaterialProperty< std::vector< Real > > & _dporosity_qp_dvar
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