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 
14 
15 template <bool is_ad>
18 {
20  params.addClassDescription(
21  "This Material provides saturation-dependent diffusivity using the Millington-Quirk model");
22  return params;
23 }
24 
25 template <bool is_ad>
27  const InputParameters & parameters)
28  : PorousFlowDiffusivityBaseTempl<is_ad>(parameters),
29  _porosity_qp(this->template getGenericMaterialProperty<Real, is_ad>("PorousFlow_porosity_qp")),
30  _dporosity_qp_dvar(is_ad ? nullptr
31  : &this->template getMaterialProperty<std::vector<Real>>(
32  "dPorousFlow_porosity_qp_dvar")),
33  _saturation_qp(this->template getGenericMaterialProperty<std::vector<Real>, is_ad>(
34  "PorousFlow_saturation_qp")),
35  _dsaturation_qp_dvar(is_ad
36  ? nullptr
37  : &this->template getMaterialProperty<std::vector<std::vector<Real>>>(
38  "dPorousFlow_saturation_qp_dvar"))
39 {
40 }
41 
42 template <bool is_ad>
43 void
45 {
47 
48  for (unsigned int ph = 0; ph < _num_phases; ++ph)
49  {
50  _tortuosity[_qp][ph] =
51  std::cbrt(_porosity_qp[_qp]) * std::pow(_saturation_qp[_qp][ph], 10.0 / 3.0);
52 
53  if (!is_ad)
54  for (unsigned int var = 0; var < _num_var; ++var)
55  (*_dtortuosity_dvar)[_qp][ph][var] = MetaPhysicL::raw_value(
56  1.0 / 3.0 * std::cbrt(_porosity_qp[_qp]) *
57  std::pow(_saturation_qp[_qp][ph], 7.0 / 3.0) *
58  (_saturation_qp[_qp][ph] / _porosity_qp[_qp] * (*_dporosity_qp_dvar)[_qp][var] +
59  10.0 * (*_dsaturation_qp_dvar)[_qp][ph][var]));
60  }
61 }
62 
PorousFlowDiffusivityMillingtonQuirkTempl(const InputParameters &parameters)
auto raw_value(const Eigen::Map< T > &in)
Base class Material designed to provide the tortuosity and diffusion coefficents. ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
MooseUnits pow(const MooseUnits &, int)
registerMooseObject("PorousFlowApp", PorousFlowDiffusivityMillingtonQuirk)
Material to provide saturation dependent diffusivity using the model of Millington and Quirk...
virtual void computeQpProperties() override