https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowDiffusivityMillingtonQuirk.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
15template <bool is_ad>
18{
21 "This Material provides saturation-dependent diffusivity using the Millington-Quirk model");
22 return params;
23}
24
25template <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
42template <bool is_ad>
43void
45{
47
48 using std::cbrt, std::pow;
49
50 for (unsigned int ph = 0; ph < _num_phases; ++ph)
51 {
52 _tortuosity[_qp][ph] = cbrt(_porosity_qp[_qp]) * pow(_saturation_qp[_qp][ph], 10.0 / 3.0);
53
54 if (!is_ad)
55 for (unsigned int var = 0; var < _num_var; ++var)
56 (*_dtortuosity_dvar)[_qp][ph][var] = MetaPhysicL::raw_value(
57 1.0 / 3.0 * cbrt(_porosity_qp[_qp]) * 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
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
registerMooseObject("PorousFlowApp", PorousFlowDiffusivityMillingtonQuirk)
void addClassDescription(const std::string &doc_string)
Base class Material designed to provide the tortuosity and diffusion coefficents.
virtual void computeQpProperties() override
Material to provide saturation dependent diffusivity using the model of Millington and Quirk,...
PorousFlowDiffusivityMillingtonQuirkTempl(const InputParameters &parameters)
auto raw_value(const Eigen::Map< T > &in)