www.mooseframework.org
Public Member Functions | Protected Attributes | Private Attributes | List of all members
PorousFlowDictator Class Reference

This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable number used internally by MOOSE, as well as the number of fluid phases and the number of fluid components. More...

#include <PorousFlowDictator.h>

Inheritance diagram for PorousFlowDictator:
[legend]

Public Member Functions

 PorousFlowDictator (const InputParameters &parameters)
 
virtual void initialize () override
 
virtual void execute () override
 
virtual void finalize () override
 
unsigned int numVariables () const
 The number of PorousFlow variables. More...
 
unsigned int numPhases () const
 The number of fluid phases. More...
 
unsigned int numComponents () const
 The number of fluid components. More...
 
unsigned int numAqueousEquilibrium () const
 The number of aqueous equilibrium secondary species. More...
 
unsigned int numAqueousKinetic () const
 The number of aqueous kinetic secondary species. More...
 
unsigned int aqueousPhaseNumber () const
 The aqueous phase number. More...
 
unsigned int porousFlowVariableNum (unsigned int moose_var_num) const
 The PorousFlow variable number. More...
 
unsigned int mooseVariableNum (unsigned int porous_flow_var_num) const
 The Moose variable number. More...
 
bool isPorousFlowVariable (unsigned int moose_var_num) const
 Returns true if moose_var_num is a porous flow variable. More...
 
bool notPorousFlowVariable (unsigned int moose_var_num) const
 Returns true if moose_var_num is not a porous flow variabe. More...
 
bool consistentFEType () const
 Whether the porous_flow_vars all have the same FEType or if no porous_flow_vars were provided. More...
 
FEType feType () const
 The FEType of the first porous_flow_variable. More...
 

Protected Attributes

const unsigned int _num_variables
 Number of PorousFlow variables. More...
 
const unsigned int _num_phases
 Number of fluid phases. More...
 
const unsigned int _num_components
 Number of fluid components. More...
 
const unsigned int _num_aqueous_equilibrium
 Number of aqueous-equilibrium secondary species. More...
 
const unsigned int _num_aqueous_kinetic
 Number of aqeuous-kinetic secondary species that are involved in mineralisation. More...
 
const unsigned int _aqueous_phase_number
 Aqueous phase number. More...
 

Private Attributes

bool _consistent_fe_type
 Whether the porous_flow_vars all have the same fe_type. More...
 
FEType _fe_type
 FE type used by the PorousFlow variables. More...
 
std::vector< unsigned int > _moose_var_num
 _moose_var_num[i] = the moose variable number corresponding to porous flow variable i More...
 
std::vector< unsigned int > _pf_var_num
 _pf_var_num[i] = the porous flow variable corresponding to moose variable i More...
 

Detailed Description

This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable number used internally by MOOSE, as well as the number of fluid phases and the number of fluid components.

The Dictator performs sanity checks on all PorousFlow simulations and helps users rectify errors (for instance if parts of the input file suggest it is a 2-phase simulation, while other parts suggest it is 1-phase).

All PorousFlow Materials and Kernels calculate and use derivatives with respect to all the variables mentioned in this Object, at least in principal (in practice they may be lazy and not compute all derivatives).
:;@;:.:::#@@'. ,@;@@@@@@@@@@'';''` ,;@@@@@@@@@@@@T@@@@@H@@@@@E@@@@@@@@++@@@+:.:. '@'@@@@@@@@@@@@@@@@@@@@.. ..,;@@@@@@@@@@@@@@I@@@@@@@@@@@@@@@@;. .:@@@@@@@@@@W@@@@@@@@@@@@@@@@@@#;:. .:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:,@@@@@@@@@@+ ,@@@@@@@@@@@';'@@@@@@@@@@:@@@@+@+:;@@@@@@@;:#';::'@@@@@@. `::;,..`::+:,;@@@@@@:. ‘’@@@'...,,.... ` ..:;@@@@@@@@+. @;;;;@;,, `:@@@@@@:` @@++';:,.;+@#:,. @@@@#+:. ‘,@@@@@@@@@@@@@@&rsquo;@@+:. ‘.:’::, @@@:,...,@@@@@, +@@@@@@@@@@@@;'@@# .,,,, @@@':::@@@@.@@@@@@@@@@@@@@@@. ,@@@` `.::, @@@@@@#@@@@@';. `@@@@@@@@;,@`@@@@@@@@@@@@@@@@@@@@@@@@@@@@@` .,@@@@.., @@@@@:.. @@@, ;@@@@@@@@@ ,@@@:@@@ ‘,’@@ . @@@@@':,,` @@@@:` @@@@@@@@@@@@@@@@@@ ,@@: `:@@@@@; ..:@@@` @@;:‘ @@@.. ’@@@@@@@@@ @@ .@@@,‘:’@. @@@@;:.@@@, `‘ @@@@@@@@@@@@@ ,@@@.’@@,‘ @+’:'';@@@@@@,, @@@@@@@@@@@' ‘.:@#@:@@’:. :;;;:@,,.@+, +. @@@@@@@@@@@@@@@@@@@@ . @@:';,,,.` .,,,,,,;;+;:.`..;,., ,,` @@@@@@@@@@@@@@@@` ,@, ` `......,,;+++#';@@@@@@. '@@@@@@; .;@@. ```,;'+@+;:'@@'@@@:. ‘ ,#@@+, .:+’@';::'+':,;,#@@@@@@@@@: .@@@@: :,,::,....,,..,,,,...,,,,,...:;@@@@; .....`,...,,,,,.....

Definition at line 72 of file PorousFlowDictator.h.

Constructor & Destructor Documentation

◆ PorousFlowDictator()

PorousFlowDictator::PorousFlowDictator ( const InputParameters &  parameters)

Definition at line 50 of file PorousFlowDictator.C.

51  : GeneralUserObject(parameters),
52  Coupleable(this, false),
53  _num_variables(coupledComponents("porous_flow_vars")),
54  _num_phases(getParam<unsigned int>("number_fluid_phases")),
55  _num_components(getParam<unsigned int>("number_fluid_components")),
56  _num_aqueous_equilibrium(getParam<unsigned int>("number_aqueous_equilibrium")),
57  _num_aqueous_kinetic(getParam<unsigned int>("number_aqueous_kinetic")),
58  _aqueous_phase_number(getParam<unsigned int>("aqueous_phase_number")),
59  _consistent_fe_type(false),
60  _fe_type(0)
61 {
63  for (unsigned int i = 0; i < _num_variables; ++i)
64  _moose_var_num[i] = coupled("porous_flow_vars", i);
65 
66  if (_num_variables > 0)
67  {
68  _consistent_fe_type = true;
69  _fe_type = FEType(getVar("porous_flow_vars", 0)->feType());
70  for (unsigned int i = 1; i < _num_variables; ++i)
71  if (getVar("porous_flow_vars", i)->feType() != _fe_type)
72  _consistent_fe_type = false;
73  }
74 
75  _pf_var_num.assign(_fe_problem.getNonlinearSystemBase().nVariables(),
76  _num_variables); // Note: the _num_variables assignment indicates that "this is
77  // not a PorousFlow variable"
78  for (unsigned int i = 0; i < _num_variables; ++i)
79  if (_moose_var_num[i] < _pf_var_num.size())
81  else
82  // should not couple AuxVariables to the Dictator (Jacobian entries are not calculated for
83  // them)
84  mooseError("PorousFlowDictator: AuxVariables variables must not be coupled into the Dictator "
85  "for this is against specification #1984. Variable number ",
86  i,
87  " is an AuxVariable.");
88 
90  mooseError("PorousflowDictator: The aqueous phase number must be less than the number of fluid "
91  "phases. The Dictator does not appreciate jokes.");
92 }
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
FEType feType() const
The FEType of the first porous_flow_variable.
const unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
bool _consistent_fe_type
Whether the porous_flow_vars all have the same fe_type.
const unsigned int _num_components
Number of fluid components.
const unsigned int _num_variables
Number of PorousFlow variables.
FEType _fe_type
FE type used by the PorousFlow variables.
std::vector< unsigned int > _pf_var_num
_pf_var_num[i] = the porous flow variable corresponding to moose variable i
const unsigned int _aqueous_phase_number
Aqueous phase number.
std::vector< unsigned int > _moose_var_num
_moose_var_num[i] = the moose variable number corresponding to porous flow variable i ...
const unsigned int _num_phases
Number of fluid phases.

Member Function Documentation

◆ aqueousPhaseNumber()

unsigned int PorousFlowDictator::aqueousPhaseNumber ( ) const

The aqueous phase number.

Definition at line 125 of file PorousFlowDictator.C.

126 {
127  return _aqueous_phase_number;
128 }
const unsigned int _aqueous_phase_number
Aqueous phase number.

◆ consistentFEType()

bool PorousFlowDictator::consistentFEType ( ) const

Whether the porous_flow_vars all have the same FEType or if no porous_flow_vars were provided.

Definition at line 163 of file PorousFlowDictator.C.

164 {
165  return _consistent_fe_type;
166 }
bool _consistent_fe_type
Whether the porous_flow_vars all have the same fe_type.

◆ execute()

virtual void PorousFlowDictator::execute ( )
inlineoverridevirtual

Definition at line 78 of file PorousFlowDictator.h.

78 {};

◆ feType()

FEType PorousFlowDictator::feType ( ) const

The FEType of the first porous_flow_variable.

Note, this is meaningless if there are no named porous_flow_variables: consistentFEType() should be used to check this

Definition at line 169 of file PorousFlowDictator.C.

Referenced by PorousFlowDictator().

170 {
171  return _fe_type;
172 }
FEType _fe_type
FE type used by the PorousFlow variables.

◆ finalize()

virtual void PorousFlowDictator::finalize ( )
inlineoverridevirtual

Definition at line 79 of file PorousFlowDictator.h.

79 {};

◆ initialize()

virtual void PorousFlowDictator::initialize ( )
inlineoverridevirtual

Definition at line 77 of file PorousFlowDictator.h.

77 {};

◆ isPorousFlowVariable()

bool PorousFlowDictator::isPorousFlowVariable ( unsigned int  moose_var_num) const

Returns true if moose_var_num is a porous flow variable.

Parameters
moose_var_numthe MOOSE variable number eg if porous_flow_vars = 'pwater pgas', and the variables in the simulation are 'energy pwater pgas shape' then isPorousFlowVariable(0) = false, isPorousFlowVariable(1) = true

Definition at line 151 of file PorousFlowDictator.C.

152 {
153  return !notPorousFlowVariable(moose_var_num);
154 }
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.

◆ mooseVariableNum()

unsigned int PorousFlowDictator::mooseVariableNum ( unsigned int  porous_flow_var_num) const

The Moose variable number.

Parameters
porous_flow_var_numthe PorousFlow variable number eg if porous_flow_vars = 'pwater pgas', and the variables in the simulation are 'energy pwater pgas shape' then mooseVariableNum(1) = 2

Definition at line 141 of file PorousFlowDictator.C.

Referenced by PorousFlowFluxLimitedTVDAdvection::computeJacobian().

142 {
143  if (porous_flow_var_num >= _num_variables)
144  mooseError("The Dictator proclaims that there is no such PorousFlow variable with number ",
145  porous_flow_var_num,
146  ". Exiting with error code 1984.");
147  return _moose_var_num[porous_flow_var_num];
148 }
const unsigned int _num_variables
Number of PorousFlow variables.
std::vector< unsigned int > _moose_var_num
_moose_var_num[i] = the moose variable number corresponding to porous flow variable i ...

◆ notPorousFlowVariable()

bool PorousFlowDictator::notPorousFlowVariable ( unsigned int  moose_var_num) const

Returns true if moose_var_num is not a porous flow variabe.

Parameters
moose_var_numthe MOOSE variable number eg if porous_flow_vars = 'pwater pgas', and the variables in the simulation are 'energy pwater pgas shape' then notPorousFlowVariable(0) = true, notPorousFlowVariable(1) = false

Definition at line 157 of file PorousFlowDictator.C.

Referenced by PorousFlowHeatVolumetricExpansion::computedEnergyQpJac(), PorousFlowMassVolumetricExpansion::computedMassQpJac(), PorousFlowHeatVolumetricExpansion::computedVolQpJac(), PorousFlowMassVolumetricExpansion::computedVolQpJac(), PorousFlowPolyLineSink::computeQpBaseOutflowJacobian(), PorousFlowPeacemanBorehole::computeQpBaseOutflowJacobian(), PorousFlowDispersiveFlux::computeQpJac(), PorousFlowDesorpedMassTimeDerivative::computeQpJac(), PorousFlowDesorpedMassVolumetricExpansion::computeQpJac(), PorousFlowPreDis::computeQpJacobian(), PorousFlowEffectiveStressCoupling::computeQpJacobian(), PorousFlowHeatConduction::computeQpOffDiagJacobian(), PorousFlowBasicAdvection::computeQpOffDiagJacobian(), PorousFlowPlasticHeatEnergy::computeQpOffDiagJacobian(), PorousFlowEnergyTimeDerivative::computeQpOffDiagJacobian(), PorousFlowFullySaturatedMassTimeDerivative::computeQpOffDiagJacobian(), PorousFlowPreDis::computeQpOffDiagJacobian(), PorousFlowFullySaturatedDarcyBase::computeQpOffDiagJacobian(), PorousFlowMassTimeDerivative::computeQpOffDiagJacobian(), PorousFlowEffectiveStressCoupling::computeQpOffDiagJacobian(), PorousFlowMassRadioactiveDecay::computeQpOffDiagJacobian(), PorousFlowDarcyBase::computeResidualAndJacobian(), PorousFlowDarcyBase::darcyQpJacobian(), isPorousFlowVariable(), PorousFlowLineSink::jac(), and PorousFlowSink::jac().

158 {
159  return moose_var_num >= _pf_var_num.size() || _pf_var_num[moose_var_num] == _num_variables;
160 }
const unsigned int _num_variables
Number of PorousFlow variables.
std::vector< unsigned int > _pf_var_num
_pf_var_num[i] = the porous flow variable corresponding to moose variable i

◆ numAqueousEquilibrium()

unsigned int PorousFlowDictator::numAqueousEquilibrium ( ) const

The number of aqueous equilibrium secondary species.

Definition at line 113 of file PorousFlowDictator.C.

Referenced by PorousFlowPropertyAux::PorousFlowPropertyAux().

114 {
116 }
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.

◆ numAqueousKinetic()

unsigned int PorousFlowDictator::numAqueousKinetic ( ) const

The number of aqueous kinetic secondary species.

Definition at line 119 of file PorousFlowDictator.C.

Referenced by PorousFlowPreDis::computeQpJac(), PorousFlowPreDis::computeQpResidual(), PorousFlowPreDis::PorousFlowPreDis(), and PorousFlowPropertyAux::PorousFlowPropertyAux().

120 {
121  return _num_aqueous_kinetic;
122 }
const unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.

◆ numComponents()

unsigned int PorousFlowDictator::numComponents ( ) const

◆ numPhases()

unsigned int PorousFlowDictator::numPhases ( ) const

◆ numVariables()

unsigned int PorousFlowDictator::numVariables ( ) const

The number of PorousFlow variables.

Materials and Kernels will calculate and use derivatives with respect to these variables in the Jacobian

Definition at line 95 of file PorousFlowDictator.C.

Referenced by PorousFlowFluxLimitedTVDAdvection::computeJacobian(), PorousFlowFluidMass::PorousFlowFluidMass(), and PorousFlowHeatEnergy::PorousFlowHeatEnergy().

96 {
97  return _num_variables;
98 }
const unsigned int _num_variables
Number of PorousFlow variables.

◆ porousFlowVariableNum()

unsigned int PorousFlowDictator::porousFlowVariableNum ( unsigned int  moose_var_num) const

The PorousFlow variable number.

Parameters
moose_var_numthe MOOSE variable number eg if porous_flow_vars = 'pwater pgas', and the variables in the simulation are 'energy pwater pgas shape' then porousFlowVariableNum(2) = 1

Definition at line 131 of file PorousFlowDictator.C.

Referenced by PorousFlowHeatVolumetricExpansion::computedEnergyQpJac(), PorousFlowMassVolumetricExpansion::computedMassQpJac(), PorousFlowHeatVolumetricExpansion::computedVolQpJac(), PorousFlowMassVolumetricExpansion::computedVolQpJac(), PorousFlowPolyLineSink::computeQpBaseOutflowJacobian(), PorousFlowPeacemanBorehole::computeQpBaseOutflowJacobian(), PorousFlowDispersiveFlux::computeQpJac(), PorousFlowDesorpedMassTimeDerivative::computeQpJac(), PorousFlowDesorpedMassVolumetricExpansion::computeQpJac(), PorousFlowEnergyTimeDerivative::computeQpJacobian(), PorousFlowFullySaturatedMassTimeDerivative::computeQpJacobian(), PorousFlowPreDis::computeQpJacobian(), PorousFlowMassTimeDerivative::computeQpJacobian(), PorousFlowMassRadioactiveDecay::computeQpJacobian(), PorousFlowEffectiveStressCoupling::computeQpJacobian(), PorousFlowHeatConduction::computeQpOffDiagJacobian(), PorousFlowBasicAdvection::computeQpOffDiagJacobian(), PorousFlowPlasticHeatEnergy::computeQpOffDiagJacobian(), PorousFlowEnergyTimeDerivative::computeQpOffDiagJacobian(), PorousFlowFullySaturatedMassTimeDerivative::computeQpOffDiagJacobian(), PorousFlowFullySaturatedDarcyBase::computeQpOffDiagJacobian(), PorousFlowPreDis::computeQpOffDiagJacobian(), PorousFlowMassTimeDerivative::computeQpOffDiagJacobian(), PorousFlowMassRadioactiveDecay::computeQpOffDiagJacobian(), PorousFlowEffectiveStressCoupling::computeQpOffDiagJacobian(), PorousFlowDarcyBase::computeResidualAndJacobian(), PorousFlowDarcyBase::darcyQpJacobian(), PorousFlowLineSink::jac(), and PorousFlowSink::jac().

132 {
133  if (moose_var_num >= _pf_var_num.size() || _pf_var_num[moose_var_num] == _num_variables)
134  mooseError("The Dictator proclaims that the moose variable with number ",
135  moose_var_num,
136  " is not a PorousFlow variable. Exiting with error code 1984.");
137  return _pf_var_num[moose_var_num];
138 }
const unsigned int _num_variables
Number of PorousFlow variables.
std::vector< unsigned int > _pf_var_num
_pf_var_num[i] = the porous flow variable corresponding to moose variable i

Member Data Documentation

◆ _aqueous_phase_number

const unsigned int PorousFlowDictator::_aqueous_phase_number
protected

Aqueous phase number.

Definition at line 169 of file PorousFlowDictator.h.

Referenced by aqueousPhaseNumber(), and PorousFlowDictator().

◆ _consistent_fe_type

bool PorousFlowDictator::_consistent_fe_type
private

Whether the porous_flow_vars all have the same fe_type.

Definition at line 173 of file PorousFlowDictator.h.

Referenced by consistentFEType(), and PorousFlowDictator().

◆ _fe_type

FEType PorousFlowDictator::_fe_type
private

FE type used by the PorousFlow variables.

Definition at line 176 of file PorousFlowDictator.h.

Referenced by feType(), and PorousFlowDictator().

◆ _moose_var_num

std::vector<unsigned int> PorousFlowDictator::_moose_var_num
private

_moose_var_num[i] = the moose variable number corresponding to porous flow variable i

Definition at line 179 of file PorousFlowDictator.h.

Referenced by mooseVariableNum(), and PorousFlowDictator().

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowDictator::_num_aqueous_equilibrium
protected

Number of aqueous-equilibrium secondary species.

Definition at line 163 of file PorousFlowDictator.h.

Referenced by numAqueousEquilibrium().

◆ _num_aqueous_kinetic

const unsigned int PorousFlowDictator::_num_aqueous_kinetic
protected

Number of aqeuous-kinetic secondary species that are involved in mineralisation.

Definition at line 166 of file PorousFlowDictator.h.

Referenced by numAqueousKinetic().

◆ _num_components

const unsigned int PorousFlowDictator::_num_components
protected

Number of fluid components.

Definition at line 160 of file PorousFlowDictator.h.

Referenced by numComponents().

◆ _num_phases

const unsigned int PorousFlowDictator::_num_phases
protected

Number of fluid phases.

Definition at line 157 of file PorousFlowDictator.h.

Referenced by numPhases(), and PorousFlowDictator().

◆ _num_variables

const unsigned int PorousFlowDictator::_num_variables
protected

Number of PorousFlow variables.

Definition at line 154 of file PorousFlowDictator.h.

Referenced by mooseVariableNum(), notPorousFlowVariable(), numVariables(), PorousFlowDictator(), and porousFlowVariableNum().

◆ _pf_var_num

std::vector<unsigned int> PorousFlowDictator::_pf_var_num
private

_pf_var_num[i] = the porous flow variable corresponding to moose variable i

Definition at line 182 of file PorousFlowDictator.h.

Referenced by notPorousFlowVariable(), PorousFlowDictator(), and porousFlowVariableNum().


The documentation for this class was generated from the following files: