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 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...
 
const VariableName pressureVariableNameDummy () const
 Dummy pressure variable name for use in derivatives using the DerivativeMaterialInterface. More...
 
const VariableName saturationVariableNameDummy () const
 Dummy saturation variable name for use in derivatives using the DerivativeMaterialInterface. More...
 
const VariableName temperatureVariableNameDummy () const
 Dummy temperature variable name for use in derivatives using the DerivativeMaterialInterface. More...
 
const VariableName massFractionVariableNameDummy () const
 Dummy mass fraction variable name for use in derivatives using the DerivativeMaterialInterface. 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...
 

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@@@@@@@@@@@@@@@@@@#;:. .:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@:,@@@@@@@@@@+ ,@@@@@@@@@@@';'@@@@@@@@@@:@@@@+@+:;@@@@@@@;:#';::'@@@@@@. `::;,..`::+:,;@@@@@@:. `'@@@'...,,.... ` ..:;@@@@@@@@+. @;;;;@;,, `:@@@@@@:` @@++';:,.;+@#:,. @@@@#+:. `,@@@@@@@@@@@@@@@'@@+:. `.:'::, @@@:,...,@@@@@, +@@@@@@@@@@@@;'@@# .,,,, @@@':::@@@@.@@@@@@@@@@@@@@@@. ,@@@` `.::, @@@@@@#@@@@@';. `@@@@@@@@;,@`@@@@@@@@@@@@@@@@@@@@@@@@@@@@@` .,@@@@.., @@@@@:.. @@@, ;@@@@@@@@@ ,@@@:@@@ `,'@@ . @@@@@':,,` @@@@:` @@@@@@@@@@@@@@@@@@ ,@@: `:@@@@@; ..:@@@` @@;:` @@@.. '@@@@@@@@@ @@ .@@@,`:'@. @@@@;:.@@@, `` @@@@@@@@@@@@@ ,@@@.'@@,` @+':'';@@@@@@,, @@@@@@@@@@@' `.:@#@:@@':. :;;;:@,,.@+, +. @@@@@@@@@@@@@@@@@@@@ . @@:';,,,.` .,,,,,,;;+;:.`..;,., ,,` @@@@@@@@@@@@@@@@` ,@, ` `......,,;+++#';@@@@@@. '@@@@@@; .;@@. ```,;'+@+;:'@@'@@@:. ` ,#@@+, .:+'@';::'+':,;,#@@@@@@@@@: .@@@@: :,,::,....,,..,,,,...,,,,,...:;@@@@; .....`,...,,,,,.....

Definition at line 71 of file PorousFlowDictator.h.

Constructor & Destructor Documentation

PorousFlowDictator::PorousFlowDictator ( const InputParameters &  parameters)

Definition at line 32 of file PorousFlowDictator.C.

33  : GeneralUserObject(parameters),
34  Coupleable(this, false),
35  ZeroInterface(parameters),
36  _num_variables(coupledComponents("porous_flow_vars")),
37  _num_phases(getParam<unsigned int>("number_fluid_phases")),
38  _num_components(getParam<unsigned int>("number_fluid_components"))
39 {
41  for (unsigned int i = 0; i < _num_variables; ++i)
42  _moose_var_num[i] = coupled("porous_flow_vars", i);
43 
44  _pf_var_num.assign(_fe_problem.getNonlinearSystemBase().nVariables(),
45  _num_variables); // Note: the _num_variables assignment indicates that "this is
46  // not a PorousFlow variable"
47  for (unsigned int i = 0; i < _num_variables; ++i)
48  if (_moose_var_num[i] < _pf_var_num.size())
50  else
51  // should not couple AuxVariables to the Dictator (Jacobian entries are not calculated for
52  // them)
53  mooseError("PorousFlowDictator: AuxVariables variables must not be coupled into the Dictator "
54  "for this is against specification #1984. Variable number ",
55  i,
56  " is an AuxVariable.");
57 }
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
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

virtual void PorousFlowDictator::execute ( )
inlineoverridevirtual

Definition at line 77 of file PorousFlowDictator.h.

77 {};
virtual void PorousFlowDictator::finalize ( )
inlineoverridevirtual

Definition at line 78 of file PorousFlowDictator.h.

78 {};
virtual void PorousFlowDictator::initialize ( )
inlineoverridevirtual

Definition at line 76 of file PorousFlowDictator.h.

76 {};
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 88 of file PorousFlowDictator.C.

Referenced by finalize().

89 {
90  return !notPorousFlowVariable(moose_var_num);
91 }
bool notPorousFlowVariable(unsigned int moose_var_num) const
returns true if moose_var_num is not a porous flow variabe
const VariableName PorousFlowDictator::massFractionVariableNameDummy ( ) const

Dummy mass fraction variable name for use in derivatives using the DerivativeMaterialInterface.

Definition at line 118 of file PorousFlowDictator.C.

Referenced by finalize().

119 {
120  return "mass_fraction_variable_dummy";
121 }
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 94 of file PorousFlowDictator.C.

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

95 {
96  return moose_var_num >= _pf_var_num.size() || _pf_var_num[moose_var_num] == _num_variables;
97 }
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
unsigned int PorousFlowDictator::numComponents ( ) const
unsigned int PorousFlowDictator::numPhases ( ) const
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 60 of file PorousFlowDictator.C.

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

61 {
62  return _num_variables;
63 }
const unsigned int _num_variables
number of porousflow variables
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 78 of file PorousFlowDictator.C.

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

79 {
80  if (moose_var_num >= _pf_var_num.size() || _pf_var_num[moose_var_num] == _num_variables)
81  mooseError("The Dictator proclaims that the moose variable with number ",
82  moose_var_num,
83  " is not a PorousFlow variable. Exiting with error code 1984.");
84  return _pf_var_num[moose_var_num];
85 }
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 VariableName PorousFlowDictator::pressureVariableNameDummy ( ) const

Dummy pressure variable name for use in derivatives using the DerivativeMaterialInterface.

Definition at line 100 of file PorousFlowDictator.C.

Referenced by finalize().

101 {
102  return "pressure_variable_dummy";
103 }
const VariableName PorousFlowDictator::saturationVariableNameDummy ( ) const

Dummy saturation variable name for use in derivatives using the DerivativeMaterialInterface.

Definition at line 106 of file PorousFlowDictator.C.

Referenced by finalize().

107 {
108  return "saturation_variable_dummy";
109 }
const VariableName PorousFlowDictator::temperatureVariableNameDummy ( ) const

Dummy temperature variable name for use in derivatives using the DerivativeMaterialInterface.

Definition at line 112 of file PorousFlowDictator.C.

Referenced by finalize().

113 {
114  return "temperature_variable_dummy";
115 }

Member Data Documentation

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 156 of file PorousFlowDictator.h.

Referenced by PorousFlowDictator().

const unsigned int PorousFlowDictator::_num_components
protected

number of fluid components

Definition at line 152 of file PorousFlowDictator.h.

Referenced by numComponents().

const unsigned int PorousFlowDictator::_num_phases
protected

number of fluid phases

Definition at line 149 of file PorousFlowDictator.h.

Referenced by numPhases().

const unsigned int PorousFlowDictator::_num_variables
protected

number of porousflow variables

Definition at line 146 of file PorousFlowDictator.h.

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

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 159 of file PorousFlowDictator.h.

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


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