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 
13 
14 template <>
15 InputParameters
17 {
18  InputParameters params = validParams<PorousFlowVariableBase>();
19  params.addRequiredCoupledVar("porepressure",
20  "Variable that represents the porepressure of the single phase");
21  params.addClassDescription("This Material is used for the fully saturated single-phase situation "
22  "where porepressure is the primary variable");
23  return params;
24 }
25 
27  : PorousFlowVariableBase(parameters),
28 
29  _porepressure_var(_nodal_material ? coupledDofValues("porepressure")
30  : coupledValue("porepressure")),
31  _gradp_qp_var(coupledGradient("porepressure")),
32  _porepressure_varnum(coupled("porepressure")),
33  _p_var_num(_dictator.isPorousFlowVariable(_porepressure_varnum)
34  ? _dictator.porousFlowVariableNum(_porepressure_varnum)
35  : 0)
36 {
37  if (_num_phases != 1)
38  mooseError("The Dictator proclaims that the number of phases is ",
39  _dictator.numPhases(),
40  " whereas PorousFlow1PhaseFullySaturated can only be used for 1-phase simulations."
41  " Be aware that the Dictator has noted your mistake.");
42 }
43 
44 void
46 {
48  buildQpPPSS();
49 }
50 
51 void
53 {
54  // Size vectors correctly and prepare the derivative matrices with zeroes
56 
57  buildQpPPSS();
58 
59  if (!_nodal_material)
60  (*_gradp_qp)[_qp][0] = _gradp_qp_var[_qp];
61 
62  // _porepressure is only dependent on _porepressure, and its derivative is 1
63  if (_dictator.isPorousFlowVariable(_porepressure_varnum))
64  {
65  // _porepressure is a PorousFlow variable
66  _dporepressure_dvar[_qp][0][_p_var_num] = 1.0;
67  if (!_nodal_material)
68  (*_dgradp_qp_dgradv)[_qp][0][_p_var_num] = 1.0;
69  }
70 }
71 
72 void
74 {
75  _porepressure[_qp][0] = _porepressure_var[_qp];
76  _saturation[_qp][0] = 1.0;
77 }
PorousFlowVariableBase::computeQpProperties
virtual void computeQpProperties() override
Definition: PorousFlowVariableBase.C:74
registerMooseObject
registerMooseObject("PorousFlowApp", PorousFlow1PhaseFullySaturated)
PorousFlow1PhaseFullySaturated.h
PorousFlow1PhaseFullySaturated::computeQpProperties
virtual void computeQpProperties() override
Definition: PorousFlow1PhaseFullySaturated.C:52
PorousFlowVariableBase::_num_phases
const unsigned int _num_phases
Number of phases.
Definition: PorousFlowVariableBase.h:35
PorousFlow1PhaseFullySaturated::_gradp_qp_var
const VariableGradient & _gradp_qp_var
Gradient(_porepressure at quadpoints)
Definition: PorousFlow1PhaseFullySaturated.h:41
PorousFlowVariableBase
Base class for thermophysical variable materials, which assemble materials for primary variables such...
Definition: PorousFlowVariableBase.h:25
PorousFlow1PhaseFullySaturated::buildQpPPSS
void buildQpPPSS()
Assemble std::vectors of porepressure, saturation and temperature at the quadpoints.
Definition: PorousFlow1PhaseFullySaturated.C:73
PorousFlowVariableBase::_porepressure
MaterialProperty< std::vector< Real > > & _porepressure
Computed nodal or quadpoint values of porepressure of the phases.
Definition: PorousFlowVariableBase.h:44
PorousFlow1PhaseFullySaturated
Base material designed to calculate fluid phase porepressure and saturation for the single-phase situ...
Definition: PorousFlow1PhaseFullySaturated.h:24
PorousFlow1PhaseFullySaturated::PorousFlow1PhaseFullySaturated
PorousFlow1PhaseFullySaturated(const InputParameters &parameters)
Definition: PorousFlow1PhaseFullySaturated.C:26
PorousFlowVariableBase::_dporepressure_dvar
MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
d(porepressure)/d(PorousFlow variable)
Definition: PorousFlowVariableBase.h:47
PorousFlow1PhaseFullySaturated::_porepressure_var
const VariableValue & _porepressure_var
Nodal or quadpoint value of porepressure of the fluid phase.
Definition: PorousFlow1PhaseFullySaturated.h:39
PorousFlow1PhaseFullySaturated::_porepressure_varnum
const unsigned int _porepressure_varnum
Moose variable number of the porepressure.
Definition: PorousFlow1PhaseFullySaturated.h:43
PorousFlow1PhaseFullySaturated::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: PorousFlow1PhaseFullySaturated.C:45
validParams< PorousFlow1PhaseFullySaturated >
InputParameters validParams< PorousFlow1PhaseFullySaturated >()
Definition: PorousFlow1PhaseFullySaturated.C:16
PorousFlow1PhaseFullySaturated::_p_var_num
const unsigned int _p_var_num
The PorousFlow variable number of the porepressure.
Definition: PorousFlow1PhaseFullySaturated.h:45
PorousFlowVariableBase::initQpStatefulProperties
virtual void initQpStatefulProperties() override
Definition: PorousFlowVariableBase.C:66
PorousFlowVariableBase::_saturation
MaterialProperty< std::vector< Real > > & _saturation
Computed nodal or qp saturation of the phases.
Definition: PorousFlowVariableBase.h:59
validParams< PorousFlowVariableBase >
InputParameters validParams< PorousFlowVariableBase >()
Definition: PorousFlowVariableBase.C:14