www.mooseframework.org
PorousFlow1PhaseFullySaturated.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.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 
27 template <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  if (_num_phases != 1)
41  mooseError("The Dictator proclaims that the number of phases is ",
42  _dictator.numPhases(),
43  " whereas PorousFlow1PhaseFullySaturated can only be used for 1-phase simulations."
44  " Be aware that the Dictator has noted your mistake.");
45 }
46 
47 template <bool is_ad>
48 void
50 {
52  buildQpPPSS();
53 }
54 
55 template <bool is_ad>
56 void
58 {
59  // Size vectors correctly and prepare the derivative matrices with zeroes
61 
62  buildQpPPSS();
63 
64  if (!_nodal_material)
65  (*_gradp_qp)[_qp][0] = _gradp_qp_var[_qp];
66 
67  // _porepressure is only dependent on _porepressure, and its derivative is 1
68  if (!is_ad && _dictator.isPorousFlowVariable(_porepressure_varnum))
69  {
70  // _porepressure is a PorousFlow variable
71  (*_dporepressure_dvar)[_qp][0][_p_var_num] = 1.0;
72  if (!_nodal_material)
73  (*_dgradp_qp_dgradv)[_qp][0][_p_var_num] = 1.0;
74  }
75 }
76 
77 template <bool is_ad>
78 void
80 {
81  _porepressure[_qp][0] = _porepressure_var[_qp];
82  _saturation[_qp][0] = 1.0;
83 }
84 
virtual void computeQpProperties() override
void mooseError(Args &&... args)
PorousFlow1PhaseFullySaturatedTempl(const InputParameters &parameters)
static InputParameters validParams()
Base class for thermophysical variable materials, which assemble materials for primary variables such...
virtual void initQpStatefulProperties() override
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
const unsigned int _num_phases
Number of phases.
void buildQpPPSS()
Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.
registerMooseObject("PorousFlowApp", PorousFlow1PhaseFullySaturated)
void addClassDescription(const std::string &doc_string)
Material designed to calculate fluid phase porepressure and saturation for the single-phase situation...