19 MooseEnum poroperm_function(
"kozeny_carman_fd2=0 kozeny_carman_phi0=1",
"kozeny_carman_fd2");
20 params.addParam<MooseEnum>(
23 "Function relating porosity and permeability. The options are: kozeny_carman_fd2 = f d^2 "
24 "phi^n/(1-phi)^m (where phi is porosity, f is a scalar constant with typical values "
25 "0.01-0.001, and d is grain size). kozeny_carman_phi0 = k0 (1-phi0)^m/phi0^n * "
26 "phi^n/(1-phi)^m (where phi is porosity, and k0 is the permeability at porosity phi0)");
27 params.addRangeCheckedParam<Real>(
"k0",
29 "The permeability scalar value (usually in "
30 "m^2) at the reference porosity, required for "
31 "kozeny_carman_phi0");
32 params.addParam<RealTensorValue>(
"k_anisotropy",
33 "A tensor to multiply the calculated scalar "
34 "permeability, in order to obtain anisotropy if "
35 "required. Defaults to isotropic permeability "
37 params.addRangeCheckedParam<Real>(
38 "phi0",
"phi0 > 0 & phi0 < 1",
"The reference porosity, required for kozeny_carman_phi0");
39 params.addRangeCheckedParam<Real>(
40 "f",
"f > 0",
"The multiplying factor, required for kozeny_carman_fd2");
41 params.addRangeCheckedParam<Real>(
42 "d",
"d > 0",
"The grain diameter, required for kozeny_carman_fd2");
43 params.addRequiredRangeCheckedParam<Real>(
"n",
"n >= 0",
"Porosity exponent");
44 params.addRequiredRangeCheckedParam<Real>(
"m",
"m >= 0",
"(1-porosity) exponent");
45 params.addClassDescription(
46 "This Material calculates the permeability tensor from a form of the Kozeny-Carman equation, "
47 "k = k_ijk * A * phi^n / (1 - phi)^m, where k_ijk is a tensor providing the anisotropy, phi "
48 "is porosity, n and m are positive scalar constants and A is given in one of the following "
49 "forms: A = k0 * (1 - phi0)^m / phi0^n (where k0 and phi0 are a reference permeability and "
50 "porosity) or A = f * d^2 (where f is a scalar constant and d is grain diameter.");
55 const InputParameters & parameters)
57 _k0(parameters.isParamValid(
"k0") ? getParam<Real>(
"k0") : -1),
58 _phi0(parameters.isParamValid(
"phi0") ? getParam<Real>(
"phi0") : -1),
59 _f(parameters.isParamValid(
"f") ? getParam<Real>(
"f") : -1),
60 _d(parameters.isParamValid(
"d") ? getParam<Real>(
"d") : -1),
61 _m(getParam<Real>(
"m")),
62 _n(getParam<Real>(
"n")),
63 _k_anisotropy(parameters.isParamValid(
"k_anisotropy")
64 ? getParam<RealTensorValue>(
"k_anisotropy")
65 : RealTensorValue(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0)),
66 _porosity_qp(getMaterialProperty<Real>(
"PorousFlow_porosity_qp")),
67 _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>(
"dPorousFlow_porosity_qp_dvar")),
68 _dporosity_qp_dgradvar(
69 getMaterialProperty<std::vector<
RealGradient>>(
"dPorousFlow_porosity_qp_dgradvar")),
70 _poroperm_function(getParam<MooseEnum>(
"poroperm_function").getEnum<
PoropermFunction>())
75 if (!(parameters.isParamValid(
"f") && parameters.isParamValid(
"d")))
76 mooseError(
"You must specify f and d in order to use kozeny_carman_fd2 in "
77 "PorousFlowPermeabilityKozenyCarman");
82 if (!(parameters.isParamValid(
"k0") && parameters.isParamValid(
"phi0")))
83 mooseError(
"You must specify k0 and phi0 in order to use kozeny_carman_phi0 in "
84 "PorousFlowPermeabilityKozenyCarman");
90 _dictator.usePermDerivs(
true);
100 for (
unsigned int v = 0; v <
_num_var; ++v)
105 for (
unsigned i = 0; i < LIBMESH_DIM; ++i)
108 for (
unsigned int v = 0; v <
_num_var; ++v)