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