www.mooseframework.org
PorousFlow1PhaseFullySaturated.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<PorousFlowVariableBase>();
15  params.addRequiredCoupledVar("porepressure",
16  "Variable that represents the porepressure of the single phase");
17  params.addClassDescription("This Material is used for the fully saturated single-phase situation "
18  "where porepressure is the primary variable");
19  return params;
20 }
21 
23  : PorousFlowVariableBase(parameters),
24 
25  _porepressure_var(_nodal_material ? coupledNodalValue("porepressure")
26  : coupledValue("porepressure")),
27  _gradp_qp_var(coupledGradient("porepressure")),
28  _porepressure_varnum(coupled("porepressure")),
29  _p_var_num(_dictator.isPorousFlowVariable(_porepressure_varnum)
30  ? _dictator.porousFlowVariableNum(_porepressure_varnum)
31  : 0)
32 {
33  if (_num_phases != 1)
34  mooseError("The Dictator proclaims that the number of phases is ",
35  _dictator.numPhases(),
36  " whereas PorousFlow1PhaseFullySaturated can only be used for 1-phase simulations."
37  " Be aware that the Dictator has noted your mistake.");
38 }
39 
40 void
42 {
44  buildQpPPSS();
45 }
46 
47 void
49 {
50  // Size vectors correctly and prepare the derivative matrices with zeroes
52 
53  buildQpPPSS();
54 
55  if (!_nodal_material)
56  (*_gradp_qp)[_qp][0] = _gradp_qp_var[_qp];
57 
58  // _porepressure is only dependent on _porepressure, and its derivative is 1
59  if (_dictator.isPorousFlowVariable(_porepressure_varnum))
60  {
61  // _porepressure is a PorousFlow variable
62  _dporepressure_dvar[_qp][0][_p_var_num] = 1.0;
63  if (!_nodal_material)
64  (*_dgradp_qp_dgradv)[_qp][0][_p_var_num] = 1.0;
65  }
66 }
67 
68 void
70 {
71  _porepressure[_qp][0] = _porepressure_var[_qp];
72  _saturation[_qp][0] = 1.0;
73 }
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
const unsigned int _p_var_num
the PorousFlow variable number of the porepressure
InputParameters validParams< PorousFlow1PhaseFullySaturated >()
PorousFlow1PhaseFullySaturated(const InputParameters &parameters)
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
InputParameters validParams< PorousFlowVariableBase >()
virtual void initQpStatefulProperties() override
void buildQpPPSS()
Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.
const VariableValue & _porepressure_var
Nodal or quadpoint value of porepressure of the fluid phase.
virtual void computeQpProperties() override
const unsigned int _porepressure_varnum
Moose variable number of the porepressure.
const unsigned int _num_phases
Number of phases.
const VariableGradient & _gradp_qp_var
Gradient(_porepressure at quadpoints)
Base class for thermophysical variable materials, which assemble materials for primary variables such...
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.