https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlow1PhaseFullySaturated.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("porepressure",
21 "Variable that represents the porepressure of the single phase");
22 params.addClassDescription("This Material is used for the fully saturated single-phase situation "
23 "where porepressure is the primary variable");
24 return params;
25}
26
27template <bool is_ad>
29 const InputParameters & parameters)
30 : PorousFlowVariableBaseTempl<is_ad>(parameters),
31
32 _porepressure_var(_nodal_material ? this->template coupledGenericDofValue<is_ad>("porepressure")
33 : this->template coupledGenericValue<is_ad>("porepressure")),
34 _gradp_qp_var(this->template coupledGenericGradient<is_ad>("porepressure")),
35 _porepressure_varnum(coupled("porepressure")),
36 _p_var_num(_dictator.isPorousFlowVariable(_porepressure_varnum)
37 ? _dictator.porousFlowVariableNum(_porepressure_varnum)
38 : 0)
39{
40 // These are read with coupledGenericDofValue when at_nodes = true, so they must be
41 // nodal (Lagrange) variables. See #33370.
42 if (this->_nodal_material)
43 this->checkNodalVariables({"porepressure"});
44 if (_num_phases != 1)
45 mooseError("The Dictator proclaims that the number of phases is ",
46 _dictator.numPhases(),
47 " whereas PorousFlow1PhaseFullySaturated can only be used for 1-phase simulations."
48 " Be aware that the Dictator has noted your mistake.");
49}
50
51template <bool is_ad>
52void
58
59template <bool is_ad>
60void
62{
63 // Size vectors correctly and prepare the derivative matrices with zeroes
65
66 buildQpPPSS();
67
68 if (!_nodal_material)
69 (*_gradp_qp)[_qp][0] = _gradp_qp_var[_qp];
70
71 // _porepressure is only dependent on _porepressure, and its derivative is 1
72 if (!is_ad && _dictator.isPorousFlowVariable(_porepressure_varnum))
73 {
74 // _porepressure is a PorousFlow variable
75 (*_dporepressure_dvar)[_qp][0][_p_var_num] = 1.0;
76 if (!_nodal_material)
77 (*_dgradp_qp_dgradv)[_qp][0][_p_var_num] = 1.0;
78 }
79}
80
81template <bool is_ad>
82void
84{
85 _porepressure[_qp][0] = _porepressure_var[_qp];
86 _saturation[_qp][0] = 1.0;
87}
88
void mooseError(Args &&... args)
registerMooseObject("PorousFlowApp", PorousFlow1PhaseFullySaturated)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Material designed to calculate fluid phase porepressure and saturation for the single-phase situation...
void buildQpPPSS()
Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.
PorousFlow1PhaseFullySaturatedTempl(const InputParameters &parameters)
Base class for thermophysical variable materials, which assemble materials for primary variables such...
virtual void computeQpProperties() override
const unsigned int _num_phases
Number of phases.
static InputParameters validParams()
virtual void initQpStatefulProperties() override