https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowPermeabilityConstFromVar.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.addRequiredCoupledVar("perm_xx", "The xx component of the permeability tensor");
21 params.addRequiredCoupledVar("perm_yy", "The yy component of the permeability tensor");
22 params.addRequiredCoupledVar("perm_zz", "The zz component of the permeability tensor");
23 params.addCoupledVar("perm_xy", 0.0, "The xy component of the permeability tensor");
24 params.addCoupledVar("perm_xz", 0.0, "The xz component of the permeability tensor");
25 params.addCoupledVar("perm_yx", 0.0, "The yx component of the permeability tensor");
26 params.addCoupledVar("perm_yz", 0.0, "The yz component of the permeability tensor");
27 params.addCoupledVar("perm_zx", 0.0, "The zx component of the permeability tensor");
28 params.addCoupledVar("perm_zy", 0.0, "The zy component of the permeability tensor");
30 "This Material calculates the permeability tensor given by the input variables");
31 return params;
32}
33
34template <bool is_ad>
36 const InputParameters & parameters)
37 : PorousFlowPermeabilityBaseTempl<is_ad>(parameters),
38 _perm_xx(coupledValue("perm_xx")),
39 _perm_xy(coupledValue("perm_xy")),
40 _perm_xz(coupledValue("perm_xz")),
41 _perm_yx(coupledValue("perm_yx")),
42 _perm_yy(coupledValue("perm_yy")),
43 _perm_yz(coupledValue("perm_yz")),
44 _perm_zx(coupledValue("perm_zx")),
45 _perm_zy(coupledValue("perm_zy")),
46 _perm_zz(coupledValue("perm_zz"))
47{
48}
49
50template <bool is_ad>
51void
53{
54 const RealTensorValue permeability(_perm_xx[_qp],
55 _perm_xy[_qp],
56 _perm_xz[_qp],
57 _perm_yx[_qp],
58 _perm_yy[_qp],
59 _perm_yz[_qp],
60 _perm_zx[_qp],
61 _perm_zy[_qp],
62 _perm_zz[_qp]);
63
64 _permeability_qp[_qp] = permeability;
65
66 if (!is_ad)
67 {
68 (*_dpermeability_qp_dvar)[_qp].resize(_num_var, RealTensorValue());
69 (*_dpermeability_qp_dgradvar)[_qp].resize(LIBMESH_DIM);
70
71 for (const auto i : make_range(Moose::dim))
72 (*_dpermeability_qp_dgradvar)[_qp][i].resize(_num_var, RealTensorValue());
73 }
74}
75
registerMooseObject("PorousFlowApp", PorousFlowPermeabilityConstFromVar)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
Base class Material designed to provide the permeability tensor.
Material to provide permeability taken from a variable.
PorousFlowPermeabilityConstFromVarTempl(const InputParameters &parameters)
static constexpr std::size_t dim