Line data Source code
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 : 10 : #include "PorousFlowPermeabilityConstFromVar.h" 11 : 12 : registerMooseObject("PorousFlowApp", PorousFlowPermeabilityConstFromVar); 13 : registerMooseObject("PorousFlowApp", ADPorousFlowPermeabilityConstFromVar); 14 : 15 : template <bool is_ad> 16 : InputParameters 17 443 : PorousFlowPermeabilityConstFromVarTempl<is_ad>::validParams() 18 : { 19 443 : InputParameters params = PorousFlowPermeabilityBase::validParams(); 20 886 : params.addRequiredCoupledVar("perm_xx", "The xx component of the permeability tensor"); 21 886 : params.addRequiredCoupledVar("perm_yy", "The yy component of the permeability tensor"); 22 886 : params.addRequiredCoupledVar("perm_zz", "The zz component of the permeability tensor"); 23 886 : params.addCoupledVar("perm_xy", 0.0, "The xy component of the permeability tensor"); 24 886 : params.addCoupledVar("perm_xz", 0.0, "The xz component of the permeability tensor"); 25 886 : params.addCoupledVar("perm_yx", 0.0, "The yx component of the permeability tensor"); 26 886 : params.addCoupledVar("perm_yz", 0.0, "The yz component of the permeability tensor"); 27 886 : params.addCoupledVar("perm_zx", 0.0, "The zx component of the permeability tensor"); 28 886 : params.addCoupledVar("perm_zy", 0.0, "The zy component of the permeability tensor"); 29 443 : params.addClassDescription( 30 : "This Material calculates the permeability tensor given by the input variables"); 31 443 : return params; 32 0 : } 33 : 34 : template <bool is_ad> 35 342 : PorousFlowPermeabilityConstFromVarTempl<is_ad>::PorousFlowPermeabilityConstFromVarTempl( 36 : const InputParameters & parameters) 37 : : PorousFlowPermeabilityBaseTempl<is_ad>(parameters), 38 342 : _perm_xx(coupledValue("perm_xx")), 39 342 : _perm_xy(coupledValue("perm_xy")), 40 342 : _perm_xz(coupledValue("perm_xz")), 41 342 : _perm_yx(coupledValue("perm_yx")), 42 342 : _perm_yy(coupledValue("perm_yy")), 43 342 : _perm_yz(coupledValue("perm_yz")), 44 342 : _perm_zx(coupledValue("perm_zx")), 45 342 : _perm_zy(coupledValue("perm_zy")), 46 684 : _perm_zz(coupledValue("perm_zz")) 47 : { 48 342 : } 49 : 50 : template <bool is_ad> 51 : void 52 677725 : PorousFlowPermeabilityConstFromVarTempl<is_ad>::computeQpProperties() 53 : { 54 677725 : const RealTensorValue permeability(_perm_xx[_qp], 55 677725 : _perm_xy[_qp], 56 677725 : _perm_xz[_qp], 57 677725 : _perm_yx[_qp], 58 677725 : _perm_yy[_qp], 59 677725 : _perm_yz[_qp], 60 677725 : _perm_zx[_qp], 61 677725 : _perm_zy[_qp], 62 677725 : _perm_zz[_qp]); 63 : 64 677725 : _permeability_qp[_qp] = permeability; 65 : 66 : if (!is_ad) 67 : { 68 425248 : (*_dpermeability_qp_dvar)[_qp].resize(_num_var, RealTensorValue()); 69 425248 : (*_dpermeability_qp_dgradvar)[_qp].resize(LIBMESH_DIM); 70 : 71 1700992 : for (const auto i : make_range(Moose::dim)) 72 1275744 : (*_dpermeability_qp_dgradvar)[_qp][i].resize(_num_var, RealTensorValue()); 73 : } 74 677725 : } 75 : 76 : template class PorousFlowPermeabilityConstFromVarTempl<false>; 77 : template class PorousFlowPermeabilityConstFromVarTempl<true>;