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