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...
 
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...
 

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

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 {
61  for (unsigned int i = 0; i < _num_variables; ++i)
62  _moose_var_num[i] = coupled("porous_flow_vars", i);
63 
64  _pf_var_num.assign(_fe_problem.getNonlinearSystemBase().nVariables(),
65  _num_variables); // Note: the _num_variables assignment indicates that "this is
66  // not a PorousFlow variable"
67  for (unsigned int i = 0; i < _num_variables; ++i)
68  if (_moose_var_num[i] < _pf_var_num.size())
70  else
71  // should not couple AuxVariables to the Dictator (Jacobian entries are not calculated for
72  // them)
73  mooseError("PorousFlowDictator: AuxVariables variables must not be coupled into the Dictator "
74  "for this is against specification #1984. Variable number ",
75  i,
76  " is an AuxVariable.");
77 
79  mooseError("PorousflowDictator: The aqueous phase number must be less than the number of fluid "
80  "phases. The Dictator does not appreciate jokes.");
81 }
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
const unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
const unsigned int _num_components
Number of fluid components.
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
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 114 of file PorousFlowDictator.C.

115 {
116  return _aqueous_phase_number;
117 }
const unsigned int _aqueous_phase_number
Aqueous phase number.

◆ execute()

virtual void PorousFlowDictator::execute ( )
inlineoverridevirtual

Definition at line 78 of file PorousFlowDictator.h.

78 {};

◆ 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 130 of file PorousFlowDictator.C.

131 {
132  return !notPorousFlowVariable(moose_var_num);
133 }
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.

◆ 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 136 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().

137 {
138  return moose_var_num >= _pf_var_num.size() || _pf_var_num[moose_var_num] == _num_variables;
139 }
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 102 of file PorousFlowDictator.C.

Referenced by PorousFlowPropertyAux::PorousFlowPropertyAux().

103 {
105 }
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 108 of file PorousFlowDictator.C.

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

109 {
110  return _num_aqueous_kinetic;
111 }
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 84 of file PorousFlowDictator.C.

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

85 {
86  return _num_variables;
87 }
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 120 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().

121 {
122  if (moose_var_num >= _pf_var_num.size() || _pf_var_num[moose_var_num] == _num_variables)
123  mooseError("The Dictator proclaims that the moose variable with number ",
124  moose_var_num,
125  " is not a PorousFlow variable. Exiting with error code 1984.");
126  return _pf_var_num[moose_var_num];
127 }
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 147 of file PorousFlowDictator.h.

Referenced by aqueousPhaseNumber(), 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 151 of file PorousFlowDictator.h.

Referenced by PorousFlowDictator().

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowDictator::_num_aqueous_equilibrium
protected

Number of aqueous-equilibrium secondary species.

Definition at line 141 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 144 of file PorousFlowDictator.h.

Referenced by numAqueousKinetic().

◆ _num_components

const unsigned int PorousFlowDictator::_num_components
protected

Number of fluid components.

Definition at line 138 of file PorousFlowDictator.h.

Referenced by numComponents().

◆ _num_phases

const unsigned int PorousFlowDictator::_num_phases
protected

Number of fluid phases.

Definition at line 135 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 132 of file PorousFlowDictator.h.

Referenced by 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 154 of file PorousFlowDictator.h.

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


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