https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowDiffusivityConst.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{
20 params.addRequiredParam<std::vector<Real>>(
21 "tortuosity", "List of tortuosities. Order is i) phase 0; ii) phase 1; etc");
23 "This Material provides constant tortuosity and diffusion coefficients");
24 return params;
25}
26
27template <bool is_ad>
29 const InputParameters & parameters)
30 : PorousFlowDiffusivityBaseTempl<is_ad>(parameters),
31 _input_tortuosity(this->template getParam<std::vector<Real>>("tortuosity"))
32{
33 // Check that the number of tortuosities entered is equal to the number of phases
34 if (_input_tortuosity.size() != _num_phases)
35 this->paramError("tortuosity",
36 "The number of tortuosity values entered is not equal to the number of phases "
37 "specified in the Dictator");
38
39 // Check that all tortuosities are (0, 1]
40 for (unsigned int i = 0; i < _num_phases; ++i)
41 if (_input_tortuosity[i] <= 0.0 || _input_tortuosity[i] > 1)
42 this->paramError(
43 "tortuosity",
44 "All tortuosities must be greater than zero and less than (or equal to) one"
45 ".\nNote: the definition of tortuosity used is l/le, where l is the straight line "
46 "length and le is the effective flow length");
47}
48
49template <bool is_ad>
50void
52{
54
55 for (unsigned int ph = 0; ph < _num_phases; ++ph)
56 _tortuosity[_qp][ph] = _input_tortuosity[ph];
57}
58
registerMooseObject("PorousFlowApp", PorousFlowDiffusivityConst)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Base class Material designed to provide the tortuosity and diffusion coefficents.
virtual void computeQpProperties() override
Material designed to provide constant tortuosity and diffusion coefficents.
PorousFlowDiffusivityConstTempl(const InputParameters &parameters)
const std::vector< Real > _input_tortuosity
Input tortuosity.
const unsigned int _num_phases
Number of phases.