https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowDictator.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
10#pragma once
11
12#include "GeneralUserObject.h"
13#include "Coupleable.h"
14
15#include <optional>
16#include <set>
17
70{
71public:
73
75
76 virtual void initialize() override {};
77 virtual void execute() override {};
78 virtual void finalize() override {};
79
85 unsigned int numVariables() const;
86
88 unsigned int numPhases() const;
89
91 unsigned int numComponents() const;
92
94 unsigned int numAqueousEquilibrium() const;
95
97 unsigned int numAqueousKinetic() const;
98
100 unsigned int aqueousPhaseNumber() const;
101
109 unsigned int porousFlowVariableNum(unsigned int moose_var_num) const;
110
118 unsigned int mooseVariableNum(unsigned int porous_flow_var_num) const;
119
127 bool isPorousFlowVariable(unsigned int moose_var_num) const;
128
136 bool notPorousFlowVariable(unsigned int moose_var_num) const;
137
142 bool consistentFEType() const;
143
149 libMesh::FEType feType() const;
150
152 bool isFV() const;
153
159 bool usePermDerivs() const { return _perm_derivs; };
160
164 void usePermDerivs(bool flag) const { _perm_derivs = flag; };
165
182 void registerNodalVariable(const VariableName & var_name) const;
183
185 static std::string feTypeName(const libMesh::FEType & fe_type);
186
195 const std::optional<libMesh::FEType> & shareNodalVariableFEType() const { return _nodal_fe_type; }
196
197protected:
199 const unsigned int _num_variables;
200
202 const unsigned int _num_phases;
203
205 const unsigned int _num_components;
206
208 const unsigned int _num_aqueous_equilibrium;
209
211 const unsigned int _num_aqueous_kinetic;
212
214 const unsigned int _aqueous_phase_number;
215
217 mutable bool _perm_derivs;
218
219private:
221 mutable std::optional<libMesh::FEType> _nodal_fe_type;
222
225 mutable std::set<VariableName> _nodal_fe_type_vars;
226
229
232
234 bool _is_fv;
235
237 std::vector<unsigned int> _moose_var_num;
238
240 std::vector<unsigned int> _pf_var_num;
241};
const InputParameters & parameters() const
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
void registerNodalVariable(const VariableName &var_name) const
Register a variable that a nodal Material reads by degree of freedom.
unsigned int numPhases() const
The number of fluid phases.
bool usePermDerivs() const
Check if the simulation includes derivatives of permeability Note: when the permeability is constant,...
bool _consistent_fe_type
Whether the porous_flow_vars all have the same fe_type.
std::set< VariableName > _nodal_fe_type_vars
Names of the variables that have registered _nodal_fe_type, used to report a disagreement.
virtual void execute() override
unsigned int numVariables() const
The number of PorousFlow variables.
bool _is_fv
Whether the PorousFlow variables are finite-volume variables.
std::vector< unsigned int > _pf_var_num
_pf_var_num[i] = the porous flow variable corresponding to moose variable i
void usePermDerivs(bool flag) const
Set the _perm_derivs flag.
unsigned int numAqueousEquilibrium() const
The number of aqueous equilibrium secondary species.
unsigned int aqueousPhaseNumber() const
The aqueous phase number.
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
virtual void finalize() override
unsigned int numComponents() const
The number of fluid components.
virtual void initialize() override
libMesh::FEType feType() const
The FEType of the first porous_flow_variable.
bool _perm_derivs
Indicates whether the simulation includes derivatives of permeability.
unsigned int porousFlowVariableNum(unsigned int moose_var_num) const
The PorousFlow variable number.
static std::string feTypeName(const libMesh::FEType &fe_type)
A human-readable name for an FE type, eg "FIRST LAGRANGE", for error messages.
libMesh::FEType _fe_type
FE type used by the PorousFlow variables.
const unsigned int _aqueous_phase_number
Aqueous phase number.
unsigned int numAqueousKinetic() const
The number of aqueous kinetic secondary species.
const unsigned int _num_components
Number of fluid components.
bool isPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is a porous flow variable.
const unsigned int _num_phases
Number of fluid phases.
bool notPorousFlowVariable(unsigned int moose_var_num) const
Returns true if moose_var_num is not a porous flow variabe.
const std::optional< libMesh::FEType > & shareNodalVariableFEType() const
The FE type shared by every variable that nodal Materials read by degree of freedom,...
bool isFV() const
Whether the PorousFlow variables are finite-volume variables.
bool consistentFEType() const
Whether the porous_flow_vars all have the same FEType or if no porous_flow_vars were provided.
unsigned int mooseVariableNum(unsigned int porous_flow_var_num) const
The Moose variable 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_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
std::optional< libMesh::FEType > _nodal_fe_type
FE type shared by the variables that nodal Materials read by DOF; see registerNodalVariable.
static InputParameters validParams()
const unsigned int _num_variables
Number of PorousFlow variables.