Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
PorousFlowSinglePhaseBase Class Reference

Base class for actions involving a single fluid phase. More...

#include <PorousFlowSinglePhaseBase.h>

Inheritance diagram for PorousFlowSinglePhaseBase:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PorousFlowSinglePhaseBase (const InputParameters &params)
 
virtual void act () override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type) override
 
virtual void addRelationshipManagers (Moose::RelationshipManagerType when_type)
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
void timedAct ()
 
MooseObjectName uniqueActionName () const
 
const std::string & specificTaskName () const
 
const std::set< std::string > & getAllTasks () const
 
void appendTask (const std::string &task)
 
MooseAppgetMooseApp () const
 
const std::string & type () const
 
virtual const std::string & name () const
 
std::string typeAndName () const
 
std::string errorPrefix (const std::string &error_type) const
 
void callMooseError (std::string msg, const bool with_prefix) const
 
MooseObjectParameterName uniqueParameterName (const std::string &parameter_name) const
 
const InputParametersparameters () const
 
MooseObjectName uniqueName () const
 
const T & getParam (const std::string &name) const
 
std::vector< std::pair< T1, T2 > > getParam (const std::string &param1, const std::string &param2) const
 
const T & getRenamedParam (const std::string &old_name, const std::string &new_name) const
 
getCheckedPointerParam (const std::string &name, const std::string &error_string="") const
 
bool isParamValid (const std::string &name) const
 
bool isParamSetByUser (const std::string &nm) const
 
void paramError (const std::string &param, Args... args) const
 
void paramWarning (const std::string &param, Args... args) const
 
void paramInfo (const std::string &param, Args... args) const
 
void connectControllableParams (const std::string &parameter, const std::string &object_type, const std::string &object_name, const std::string &object_parameter) const
 
void mooseError (Args &&... args) const
 
void mooseErrorNonPrefixed (Args &&... args) const
 
void mooseDocumentedError (const std::string &repo_name, const unsigned int issue_num, Args &&... args) const
 
void mooseWarning (Args &&... args) const
 
void mooseWarningNonPrefixed (Args &&... args) const
 
void mooseDeprecated (Args &&... args) const
 
void mooseInfo (Args &&... args) const
 
std::string getDataFileName (const std::string &param) const
 
std::string getDataFileNameByName (const std::string &relative_path) const
 
std::string getDataFilePath (const std::string &relative_path) const
 
PerfGraphperfGraph ()
 
const Parallel::Communicator & comm () const
 
processor_id_type n_processors () const
 
processor_id_type processor_id () const
 

Static Public Member Functions

static InputParameters validParams ()
 

Public Attributes

const ConsoleStream _console
 

Static Public Attributes

static constexpr auto SYSTEM
 
static constexpr auto NAME
 

Protected Types

enum  CouplingTypeEnum { CouplingTypeEnum::Hydro, CouplingTypeEnum::ThermoHydro, CouplingTypeEnum::HydroMechanical, CouplingTypeEnum::ThermoHydroMechanical }
 Determines the coupling type. More...
 
enum  FluidPropertiesTypeEnum { FluidPropertiesTypeEnum::PorousFlowSingleComponentFluid, FluidPropertiesTypeEnum::PorousFlowBrine, FluidPropertiesTypeEnum::Custom }
 Determines the fluid-properties type. More...
 
enum  StabilizationEnum { StabilizationEnum::None, StabilizationEnum::Full, StabilizationEnum::KT }
 

Protected Member Functions

virtual void addDictator () override
 Add the PorousFlowDictator object. More...
 
virtual void addKernels () override
 Add all Kernels. More...
 
virtual void addAuxObjects () override
 Add all AuxVariables and AuxKernels. More...
 
virtual void addMaterialDependencies () override
 Add all material dependencies so that the correct version of each material can be added. More...
 
virtual void addMaterials () override
 Add all Materials. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
virtual void addUserObjects ()
 Add all other UserObjects. More...
 
void addSaturationAux (unsigned phase)
 Add an AuxVariable and AuxKernel to calculate saturation. More...
 
void addDarcyAux (const RealVectorValue &gravity)
 Add AuxVariables and AuxKernels to calculate Darcy velocity. More...
 
void addStressAux ()
 Add AuxVariables and AuxKernels to compute effective stress. More...
 
void addTemperatureMaterial (bool at_nodes)
 Adds a nodal and a quadpoint Temperature material. More...
 
void addMassFractionMaterial (bool at_nodes)
 Adds a nodal and a quadpoint MassFraction material. More...
 
void addEffectiveFluidPressureMaterial (bool at_nodes)
 Adds a nodal and a quadpoint effective fluid pressure material. More...
 
void addNearestQpMaterial ()
 Adds a PorousFlowNearestQp material. More...
 
void addVolumetricStrainMaterial (const std::vector< VariableName > &displacements, const std::string &base_name)
 Adds a quadpoint volumetric strain material. More...
 
void addSingleComponentFluidMaterial (bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const UserObjectName &fp, const MooseEnum &temperature_unit, const MooseEnum &pressure_unit, const MooseEnum &time_unit)
 Adds a single-component fluid Material. More...
 
void addBrineMaterial (const VariableName xnacl, bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const MooseEnum &temperature_unit)
 Adds a brine fluid Material. More...
 
void addRelativePermeabilityConst (bool at_nodes, unsigned phase, Real kr)
 Adds a relative-permeability Material of the constant variety (primarily to add kr = 1 in actions that add a default relatively permeability for objects that require kr even when the flow is fully saturated with a single phase) More...
 
void addRelativePermeabilityCorey (bool at_nodes, unsigned phase, Real n, Real s_res, Real sum_s_res)
 Adds a relative-permeability Material of the Corey variety. More...
 
void addRelativePermeabilityFLAC (bool at_nodes, unsigned phase, Real m, Real s_res, Real sum_s_res)
 Adds a relative-permeability Material of the FLAC variety. More...
 
void addCapillaryPressureVG (Real m, Real alpha, std::string userobject_name)
 Adds a van Genuchten capillary pressure UserObject. More...
 
void addAdvectiveFluxCalculatorSaturated (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorUnsaturated (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorSaturatedHeat (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorUnsaturatedHeat (unsigned phase, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorSaturatedMultiComponent (unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
 
void addAdvectiveFluxCalculatorUnsaturatedMultiComponent (unsigned phase, unsigned fluid_component, bool multiply_by_density, std::string userobject_name)
 
void associateWithParameter (const std::string &param_name, InputParameters &params) const
 
void associateWithParameter (const InputParameters &from_params, const std::string &param_name, InputParameters &params) const
 
const T & getMeshProperty (const std::string &data_name, const std::string &prefix)
 
const T & getMeshProperty (const std::string &data_name)
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name, const std::string &prefix) const
 
bool hasMeshProperty (const std::string &data_name) const
 
bool hasMeshProperty (const std::string &data_name) const
 
std::string meshPropertyName (const std::string &data_name) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level) const
 
PerfID registerTimedSection (const std::string &section_name, const unsigned int level, const std::string &live_message, const bool print_dots=true) const
 
std::string timedSectionName (const std::string &section_name) const
 

Static Protected Member Functions

static std::string meshPropertyName (const std::string &data_name, const std::string &prefix)
 

Protected Attributes

const VariableName _pp_var
 Porepressure NonlinearVariable name. More...
 
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
 
const bool _thermal
 Flags to indicate whether thermal or mechanical effects are included. More...
 
const bool _mechanical
 
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type
 
UserObjectName _fp
 Name of the fluid-properties UserObject. More...
 
const Real _biot_coefficient
 Fluid specific heat capacity at constant volume. More...
 
const bool _add_darcy_aux
 Add a AuxVariables to record Darcy velocity. More...
 
const bool _add_stress_aux
 Add AuxVariables for stress. More...
 
VariableName _nacl_name
 Name of the NaCl variable. More...
 
const std::vector< AuxVariableName > _save_component_rate_in
 Name of the variables (if any) that will record the fluid-components' rate of change. More...
 
const MooseEnum _temperature_unit
 Unit used for temperature. More...
 
const MooseEnum _pressure_unit
 Unit used for porepressure. More...
 
const MooseEnum _time_unit
 Unit used for time. More...
 
const std::string _base_name
 base_name used in the TensorMechanics strain calculator More...
 
std::vector< std::string > _included_objects
 List of Kernels, AuxKernels, Materials, etc, that are added in this input file. More...
 
const std::string _dictator_name
 The name of the PorousFlowDictator object to be added. More...
 
std::vector< SubdomainName > _subdomain_names
 if this vector is not empty the variables, kernels and materials are restricted to these subdomains More...
 
const bool _subdomain_names_set
 indicates, if the vector of subdomain names is set (dont set block restrictions, if not) 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 RealVectorValue _gravity
 Gravity. More...
 
const std::vector< VariableName > _mass_fraction_vars
 Name of the mass-fraction variables (if any) More...
 
const unsigned _num_mass_fraction_vars
 Number of mass-fraction variables. More...
 
const std::vector< VariableName > _temperature_var
 Name of the temperature variable (if any) More...
 
const std::vector< VariableName > & _displacements
 Displacement NonlinearVariable names (if any) More...
 
const unsigned _ndisp
 Number of displacement variables supplied. More...
 
std::vector< VariableName > _coupled_displacements
 Displacement Variable names. More...
 
const MooseEnum _flux_limiter_type
 Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme. More...
 
enum PorousFlowActionBase::StabilizationEnum _stabilization
 
const bool _strain_at_nearest_qp
 Evaluate strain at the nearest quadpoint for porosity that depends on strain. More...
 
Moose::CoordinateSystemType _coord_system
 Coordinate system of the simulation (eg RZ, XYZ, etc) More...
 
bool _transient
 Flag to denote if the simulation is transient. More...
 
std::string _registered_identifier
 
std::string _specific_task_name
 
std::set< std::string > _all_tasks
 
ActionWarehouse_awh
 
const std::string & _current_task
 
std::shared_ptr< MooseMesh > & _mesh
 
std::shared_ptr< MooseMesh > & _displaced_mesh
 
std::shared_ptr< FEProblemBase > & _problem
 
PerfID _act_timer
 
MooseApp_app
 
const std::string _type
 
const std::string _name
 
const InputParameters_pars
 
Factory_factory
 
ActionFactory_action_factory
 
MooseApp_pg_moose_app
 
const std::string _prefix
 
const Parallel::Communicator & _communicator
 
DependencyResolver< std::string > _deps
 All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies. More...
 

Detailed Description

Base class for actions involving a single fluid phase.

Definition at line 17 of file PorousFlowSinglePhaseBase.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

Determines the coupling type.

Enumerator
Hydro 
ThermoHydro 
HydroMechanical 
ThermoHydroMechanical 

Definition at line 35 of file PorousFlowSinglePhaseBase.h.

35  {
36  Hydro,
37  ThermoHydro,
38  HydroMechanical,
39  ThermoHydroMechanical
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type

◆ FluidPropertiesTypeEnum

Determines the fluid-properties type.

Enumerator
PorousFlowSingleComponentFluid 
PorousFlowBrine 
Custom 

Definition at line 47 of file PorousFlowSinglePhaseBase.h.

47  {
50  Custom
PorousFlowSingleComponentFluidTempl< false > PorousFlowSingleComponentFluid
Fluid properties of Brine.
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type

◆ StabilizationEnum

enum PorousFlowActionBase::StabilizationEnum
strongprotectedinherited
Enumerator
None 
Full 
KT 

Definition at line 89 of file PorousFlowActionBase.h.

89 { None, Full, KT } _stabilization;
enum PorousFlowActionBase::StabilizationEnum _stabilization

Constructor & Destructor Documentation

◆ PorousFlowSinglePhaseBase()

PorousFlowSinglePhaseBase::PorousFlowSinglePhaseBase ( const InputParameters params)

Definition at line 111 of file PorousFlowSinglePhaseBase.C.

112  : PorousFlowActionBase(params),
113  _pp_var(getParam<VariableName>("porepressure")),
114  _coupling_type(getParam<MooseEnum>("coupling_type").getEnum<CouplingTypeEnum>()),
120  getParam<MooseEnum>("fluid_properties_type").getEnum<FluidPropertiesTypeEnum>()),
121  _biot_coefficient(getParam<Real>("biot_coefficient")),
122  _add_darcy_aux(getParam<bool>("add_darcy_aux")),
123  _add_stress_aux(getParam<bool>("add_stress_aux")),
124  _save_component_rate_in(getParam<std::vector<AuxVariableName>>("save_component_rate_in")),
125  _temperature_unit(getParam<MooseEnum>("temperature_unit")),
126  _pressure_unit(getParam<MooseEnum>("pressure_unit")),
127  _time_unit(getParam<MooseEnum>("time_unit")),
128  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : "")
129 {
130  if (_thermal && _temperature_var.size() != 1)
131  mooseError("PorousFlowSinglePhaseBase: You need to specify a temperature variable to perform "
132  "non-isothermal simulations");
133 
135  {
136  if (params.isParamValid("nacl_name"))
137  paramError("nacl_name",
138  "PorousFlowSinglePhaseBase: You should not specify a nacl_name when "
139  "fluid_properties_type = PorousFlowSingleComponentFluid");
140  if (!params.isParamValid("fp"))
141  paramError("fp",
142  "PorousFlowSinglePhaseBase: You must specify fp when fluid_properties_type = "
143  "PorousFlowSingleComponentFluid");
144  _fp = getParam<UserObjectName>("fp");
145  }
146 
148  {
149  if (!params.isParamValid("nacl_name"))
150  paramError("nacl_name",
151  "PorousFlowSinglePhaseBase: You must specify nacl_name when "
152  "fluid_properties_type = PorousFlowBrine");
153  if (params.isParamValid("fp"))
154  paramError("fp",
155  "PorousFlowSinglePhaseBase: You should not specify fp when "
156  "fluid_properties_type = PorousFlowBrine");
157  if (_pressure_unit != "Pa")
158  paramError("pressure_unit",
159  "Must use pressure_unit = Pa for fluid_properties_type = PorousFlowBrine");
160  if (_time_unit != "seconds")
161  paramError("time_unit",
162  "Must use time_unit = seconds for fluid_properties_type = PorousFlowBrine");
163  _nacl_name = getParam<VariableName>("nacl_name");
164  }
165 
166  auto save_component_rate_in_size = _save_component_rate_in.size();
167  if (save_component_rate_in_size && save_component_rate_in_size != _num_mass_fraction_vars + 1)
168  paramError("save_component_rate_in",
169  "The number of save_component_rate_in variables must be the number of fluid "
170  "components + 1");
171 }
UserObjectName _fp
Name of the fluid-properties UserObject.
const Real _biot_coefficient
Fluid specific heat capacity at constant volume.
PorousFlowActionBase(const InputParameters &params)
const bool _add_stress_aux
Add AuxVariables for stress.
const MooseEnum _temperature_unit
Unit used for temperature.
const VariableName _pp_var
Porepressure NonlinearVariable name.
const std::vector< AuxVariableName > _save_component_rate_in
Name of the variables (if any) that will record the fluid-components&#39; rate of change.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
bool isParamValid(const std::string &name) const
VariableName _nacl_name
Name of the NaCl variable.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
const T & getParam(const std::string &name) const
const MooseEnum _time_unit
Unit used for time.
void paramError(const std::string &param, Args... args) const
const std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
const MooseEnum _pressure_unit
Unit used for porepressure.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
void mooseError(Args &&... args) const
enum PorousFlowSinglePhaseBase::CouplingTypeEnum _coupling_type
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type
const std::string _base_name
base_name used in the TensorMechanics strain calculator
bool isParamValid(const std::string &name) const

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtualinherited

Implements Action.

Definition at line 139 of file PorousFlowActionBase.C.

140 {
141  // Check if the simulation is transient (note: can't do this in the ctor)
142  _transient = _problem->isTransient();
143 
144  // get subdomain IDs
145  std::set<SubdomainID> _subdomain_ids;
146  for (auto & name : _subdomain_names)
147  {
148  auto id = _mesh->getSubdomainID(name);
149  if (id == Moose::INVALID_BLOCK_ID)
150  paramError("block", "Subdomain \"" + name + "\" not found in mesh.");
151  else
152  _subdomain_ids.insert(id);
153  }
154 
155  // Make sure that all mesh subdomains have the same coordinate system
156  const auto & all_subdomains =
157  _subdomain_names.empty() ? _problem->mesh().meshSubdomains() : _subdomain_ids;
158 
159  if (all_subdomains.empty())
160  mooseError("No subdomains found");
161  _coord_system = _problem->getCoordSystem(*all_subdomains.begin());
162  for (const auto & subdomain : all_subdomains)
163  if (_problem->getCoordSystem(subdomain) != _coord_system)
164  mooseError(
165  "The PorousFlow Actions require all subdomains to have the same coordinate system.");
166 
167  // Note: this must be called before addMaterials!
169 
170  // Make the vector of added objects unique
171  std::sort(_included_objects.begin(), _included_objects.end());
172  _included_objects.erase(std::unique(_included_objects.begin(), _included_objects.end()),
173  _included_objects.end());
174 
175  if (_current_task == "add_user_object")
176  addUserObjects();
177 
178  if (_current_task == "add_aux_variable" || _current_task == "add_aux_kernel")
179  addAuxObjects();
180 
181  if (_current_task == "add_kernel")
182  addKernels();
183 
184  if (_current_task == "add_material")
185  addMaterials();
186 }
Moose::CoordinateSystemType _coord_system
Coordinate system of the simulation (eg RZ, XYZ, etc)
virtual void addKernels()
Add all Kernels.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
virtual void addMaterials()
Add all Materials.
virtual const std::string & name() const
const SubdomainID INVALID_BLOCK_ID
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
void paramError(const std::string &param, Args... args) const
bool _transient
Flag to denote if the simulation is transient.
std::shared_ptr< MooseMesh > & _mesh
virtual void addAuxObjects()
Add all AuxVariables and AuxKernels.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
virtual void addUserObjects()
Add all other UserObjects.
virtual void addMaterialDependencies()
Add all material dependencies so that the correct version of each material can be added...

◆ addAdvectiveFluxCalculatorSaturated()

void PorousFlowActionBase::addAdvectiveFluxCalculatorSaturated ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 665 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

668 {
669  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
670  {
671  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturated";
672  InputParameters params = _factory.getValidParams(userobject_type);
674  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
675  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
676  params.set<RealVectorValue>("gravity") = _gravity;
677  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
678  params.set<unsigned>("phase") = phase;
679  params.set<bool>("multiply_by_density") = multiply_by_density;
680  _problem->addUserObject(userobject_type, userobject_name, params);
681  }
682 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorSaturatedHeat()

void PorousFlowActionBase::addAdvectiveFluxCalculatorSaturatedHeat ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 705 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

708 {
709  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
710  {
711  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedHeat";
712  InputParameters params = _factory.getValidParams(userobject_type);
714  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
715  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
716  params.set<RealVectorValue>("gravity") = _gravity;
717  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
718  params.set<unsigned>("phase") = phase;
719  params.set<bool>("multiply_by_density") = multiply_by_density;
720  _problem->addUserObject(userobject_type, userobject_name, params);
721  }
722 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorSaturatedMultiComponent()

void PorousFlowActionBase::addAdvectiveFluxCalculatorSaturatedMultiComponent ( unsigned  phase,
unsigned  fluid_component,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 745 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addUserObjects().

749 {
750  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
751  {
752  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent";
753  InputParameters params = _factory.getValidParams(userobject_type);
755  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
756  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
757  params.set<RealVectorValue>("gravity") = _gravity;
758  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
759  params.set<unsigned>("phase") = phase;
760  params.set<bool>("multiply_by_density") = multiply_by_density;
761  params.set<unsigned>("fluid_component") = fluid_component;
762  _problem->addUserObject(userobject_type, userobject_name, params);
763  }
764 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorUnsaturated()

void PorousFlowActionBase::addAdvectiveFluxCalculatorUnsaturated ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 685 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

688 {
689  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
690  {
691  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturated";
692  InputParameters params = _factory.getValidParams(userobject_type);
694  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
695  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
696  params.set<RealVectorValue>("gravity") = _gravity;
697  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
698  params.set<unsigned>("phase") = phase;
699  params.set<bool>("multiply_by_density") = multiply_by_density;
700  _problem->addUserObject(userobject_type, userobject_name, params);
701  }
702 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorUnsaturatedHeat()

void PorousFlowActionBase::addAdvectiveFluxCalculatorUnsaturatedHeat ( unsigned  phase,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 725 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

728 {
729  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
730  {
731  const std::string userobject_type = "PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat";
732  InputParameters params = _factory.getValidParams(userobject_type);
734  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
735  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
736  params.set<RealVectorValue>("gravity") = _gravity;
737  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
738  params.set<unsigned>("phase") = phase;
739  params.set<bool>("multiply_by_density") = multiply_by_density;
740  _problem->addUserObject(userobject_type, userobject_name, params);
741  }
742 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAdvectiveFluxCalculatorUnsaturatedMultiComponent()

void PorousFlowActionBase::addAdvectiveFluxCalculatorUnsaturatedMultiComponent ( unsigned  phase,
unsigned  fluid_component,
bool  multiply_by_density,
std::string  userobject_name 
)
protectedinherited

Definition at line 767 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

769 {
770  if (_stabilization == StabilizationEnum::KT && _current_task == "add_user_object")
771  {
772  const std::string userobject_type =
773  "PorousFlowAdvectiveFluxCalculatorUnsaturatedMultiComponent";
774  InputParameters params = _factory.getValidParams(userobject_type);
776  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
777  params.set<MooseEnum>("flux_limiter_type") = _flux_limiter_type;
778  params.set<RealVectorValue>("gravity") = _gravity;
779  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
780  params.set<unsigned>("phase") = phase;
781  params.set<bool>("multiply_by_density") = multiply_by_density;
782  params.set<unsigned>("fluid_component") = fluid_component;
783  _problem->addUserObject(userobject_type, userobject_name, params);
784  }
785 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const RealVectorValue _gravity
Gravity.
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem
const MooseEnum _flux_limiter_type
Flux limiter type in the Kuzmin-Turek FEM-TVD stabilization scheme.
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addAuxObjects()

void PorousFlowSinglePhaseBase::addAuxObjects ( )
overrideprotectedvirtual

Add all AuxVariables and AuxKernels.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowUnsaturated.

Definition at line 297 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowUnsaturated::addAuxObjects().

298 {
300 
301  if (_add_darcy_aux)
303 
305  addStressAux();
306 }
void addStressAux()
Add AuxVariables and AuxKernels to compute effective stress.
const bool _add_stress_aux
Add AuxVariables for stress.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
void addDarcyAux(const RealVectorValue &gravity)
Add AuxVariables and AuxKernels to calculate Darcy velocity.
const RealVectorValue _gravity
Gravity.
virtual void addAuxObjects()
Add all AuxVariables and AuxKernels.

◆ addBrineMaterial()

void PorousFlowActionBase::addBrineMaterial ( const VariableName  xnacl,
bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const MooseEnum temperature_unit 
)
protectedinherited

Adds a brine fluid Material.

Parameters
xnaclthe variable containing the mass fraction of NaCl in the fluid
phasethe phase number of the fluid
compute_density_and_viscositycompute the density and viscosity of the fluid
compute_internal_energycompute the fluid internal energy
compute_enthalpycompute the fluid enthalpy
at_nodesadd a nodal material
temperature_unitthe unit of temperature (Kelvin or Celsius)

Definition at line 543 of file PorousFlowActionBase.C.

Referenced by addMaterials().

550 {
551  if (_current_task == "add_material")
552  {
553  std::string material_type = "PorousFlowBrine";
554  InputParameters params = _factory.getValidParams(material_type);
556  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
557 
558  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
559  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
560  params.set<unsigned int>("phase") = phase;
561  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
562  params.set<bool>("compute_internal_energy") = compute_internal_energy;
563  params.set<bool>("compute_enthalpy") = compute_enthalpy;
564  params.set<MooseEnum>("temperature_unit") = temperature_unit;
565 
566  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
567  if (at_nodes)
568  material_name = "PorousFlowActionBase_FluidProperties";
569 
570  params.set<bool>("at_nodes") = at_nodes;
571  _problem->addMaterial(material_type, material_name, params);
572  }
573 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addCapillaryPressureVG()

void PorousFlowActionBase::addCapillaryPressureVG ( Real  m,
Real  alpha,
std::string  userobject_name 
)
protectedinherited

Adds a van Genuchten capillary pressure UserObject.

Parameters
mvan Genuchten exponent
alphavan Genuchten alpha
userobject_namename of the user object

Definition at line 650 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addUserObjects().

651 {
652  if (_current_task == "add_user_object")
653  {
654  std::string userobject_type = "PorousFlowCapillaryPressureVG";
655  InputParameters params = _factory.getValidParams(userobject_type);
657  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
658  params.set<Real>("m") = m;
659  params.set<Real>("alpha") = alpha;
660  _problem->addUserObject(userobject_type, userobject_name, params);
661  }
662 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string alpha
Definition: NS.h:134
std::shared_ptr< FEProblemBase > & _problem

◆ addDarcyAux()

void PorousFlowActionBase::addDarcyAux ( const RealVectorValue gravity)
protectedinherited

Add AuxVariables and AuxKernels to calculate Darcy velocity.

Parameters
gravitygravitational acceleration pointing downwards (eg (0, 0, -9.8))

Definition at line 269 of file PorousFlowActionBase.C.

Referenced by addAuxObjects().

270 {
271  if (_current_task == "add_aux_variable")
272  {
273  auto var_params = _factory.getValidParams("MooseVariableConstMonomial");
275  var_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
276 
277  _problem->addAuxVariable("MooseVariableConstMonomial", "darcy_vel_x", var_params);
278  _problem->addAuxVariable("MooseVariableConstMonomial", "darcy_vel_y", var_params);
279  _problem->addAuxVariable("MooseVariableConstMonomial", "darcy_vel_z", var_params);
280  }
281 
282  if (_current_task == "add_aux_kernel")
283  {
284  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
285  InputParameters params = _factory.getValidParams(aux_kernel_type);
287  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
288 
289  params.set<RealVectorValue>("gravity") = gravity;
290  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
291  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
292 
293  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
294  params.set<MooseEnum>("component") = "x";
295  params.set<AuxVariableName>("variable") = "darcy_vel_x";
296  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
297 
298  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
299  params.set<MooseEnum>("component") = "y";
300  params.set<AuxVariableName>("variable") = "darcy_vel_y";
301  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
302 
303  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
304  params.set<MooseEnum>("component") = "z";
305  params.set<AuxVariableName>("variable") = "darcy_vel_z";
306  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
307  }
308 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addDictator()

void PorousFlowSinglePhaseBase::addDictator ( )
overrideprotectedvirtual

Add the PorousFlowDictator object.

Implements PorousFlowActionBase.

Definition at line 383 of file PorousFlowSinglePhaseBase.C.

384 {
385  const std::string uo_name = _dictator_name;
386  const std::string uo_type = "PorousFlowDictator";
387  InputParameters params = _factory.getValidParams(uo_type);
388  std::vector<VariableName> pf_vars = _mass_fraction_vars;
389  pf_vars.push_back(_pp_var);
390  if (_thermal)
391  pf_vars.push_back(_temperature_var[0]);
392  if (_mechanical)
393  pf_vars.insert(pf_vars.end(), _coupled_displacements.begin(), _coupled_displacements.end());
394  params.set<std::vector<VariableName>>("porous_flow_vars") = pf_vars;
395  params.set<unsigned int>("number_fluid_phases") = 1;
396  params.set<unsigned int>("number_fluid_components") = _num_mass_fraction_vars + 1;
397  params.set<unsigned int>("number_aqueous_equilibrium") = _num_aqueous_equilibrium;
398  params.set<unsigned int>("number_aqueous_kinetic") = _num_aqueous_kinetic;
399  _problem->addUserObject(uo_type, uo_name, params);
400 }
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
const VariableName _pp_var
Porepressure NonlinearVariable name.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const unsigned int _num_aqueous_kinetic
Number of aqeuous-kinetic secondary species that are involved in mineralisation.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
Factory & _factory
const std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
std::shared_ptr< FEProblemBase > & _problem
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (if any)

◆ addEffectiveFluidPressureMaterial()

void PorousFlowActionBase::addEffectiveFluidPressureMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint effective fluid pressure material.

Parameters
at_nodesAdd nodal effective fluid pressure material

Definition at line 447 of file PorousFlowActionBase.C.

Referenced by addMaterials().

448 {
449  if (_current_task == "add_material")
450  {
451  std::string material_type = "PorousFlowEffectiveFluidPressure";
452  InputParameters params = _factory.getValidParams(material_type);
454  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
455 
456  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
457 
458  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
459  if (at_nodes)
460  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
461 
462  params.set<bool>("at_nodes") = at_nodes;
463  _problem->addMaterial(material_type, material_name, params);
464  }
465 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addKernels()

void PorousFlowSinglePhaseBase::addKernels ( )
overrideprotectedvirtual

Add all Kernels.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 204 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowFullySaturated::addKernels(), PorousFlowUnsaturated::addKernels(), and PorousFlowBasicTHM::addKernels().

205 {
207 
208  if (_mechanical)
209  {
210  for (unsigned i = 0; i < _ndisp; ++i)
211  {
212  std::string kernel_name = "PorousFlowUnsaturated_grad_stress" + Moose::stringify(i);
213  std::string kernel_type = "StressDivergenceTensors";
215  kernel_type = "StressDivergenceRZTensors";
216  InputParameters params = _factory.getValidParams(kernel_type);
218  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
219  params.set<NonlinearVariableName>("variable") = _displacements[i];
220  params.set<std::vector<VariableName>>("displacements") = _coupled_displacements;
221  if (_thermal)
222  {
223  params.set<std::vector<VariableName>>("temperature") = _temperature_var;
224  if (parameters().isParamValid("eigenstrain_names"))
225  {
226  params.set<std::vector<MaterialPropertyName>>("eigenstrain_names") =
227  getParam<std::vector<MaterialPropertyName>>("eigenstrain_names");
228  }
229  }
230  params.set<unsigned>("component") = i;
231  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
232  _problem->addKernel(kernel_type, kernel_name, params);
233 
234  if (_gravity(i) != 0)
235  {
236  kernel_name = "PorousFlowUnsaturated_gravity" + Moose::stringify(i);
237  kernel_type = "Gravity";
238  params = _factory.getValidParams(kernel_type);
240  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
241  params.set<NonlinearVariableName>("variable") = _displacements[i];
242  params.set<Real>("value") = _gravity(i);
243  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
244  _problem->addKernel(kernel_type, kernel_name, params);
245  }
246 
247  kernel_name = "PorousFlowUnsaturated_EffStressCoupling" + Moose::stringify(i);
248  kernel_type = "PorousFlowEffectiveStressCoupling";
249  params = _factory.getValidParams(kernel_type);
251  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
252  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
253  params.set<NonlinearVariableName>("variable") = _displacements[i];
254  params.set<Real>("biot_coefficient") = _biot_coefficient;
255  params.set<unsigned>("component") = i;
256  params.set<bool>("use_displaced_mesh") = getParam<bool>("use_displaced_mesh");
257  _problem->addKernel(kernel_type, kernel_name, params);
258  }
259  }
260 
261  if (_thermal)
262  {
263  std::string kernel_name = "PorousFlowUnsaturated_HeatConduction";
264  std::string kernel_type = "PorousFlowHeatConduction";
265  InputParameters params = _factory.getValidParams(kernel_type);
266  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
267  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
268  _problem->addKernel(kernel_type, kernel_name, params);
269 
270  if (_transient)
271  {
272  kernel_name = "PorousFlowUnsaturated_EnergyTimeDerivative";
273  kernel_type = "PorousFlowEnergyTimeDerivative";
274  params = _factory.getValidParams(kernel_type);
275  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
276  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
277  params.set<bool>("strain_at_nearest_qp") = _strain_at_nearest_qp;
278  if (!_base_name.empty())
279  params.set<std::string>("base_name") = _base_name;
280  _problem->addKernel(kernel_type, kernel_name, params);
281  }
282  }
283 
284  if (_thermal && _mechanical && _transient)
285  {
286  std::string kernel_name = "PorousFlowUnsaturated_HeatVolumetricExpansion";
287  std::string kernel_type = "PorousFlowHeatVolumetricExpansion";
288  InputParameters params = _factory.getValidParams(kernel_type);
289  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
290  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
291  params.set<bool>("strain_at_nearest_qp") = _strain_at_nearest_qp;
292  _problem->addKernel(kernel_type, kernel_name, params);
293  }
294 }
Moose::CoordinateSystemType _coord_system
Coordinate system of the simulation (eg RZ, XYZ, etc)
virtual void addKernels()
Add all Kernels.
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
const Real _biot_coefficient
Fluid specific heat capacity at constant volume.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const unsigned _ndisp
Number of displacement variables supplied.
const T & getParam(const std::string &name) const
std::string stringify(const T &t)
const RealVectorValue _gravity
Gravity.
const std::vector< VariableName > _temperature_var
Name of the temperature variable (if any)
bool _transient
Flag to denote if the simulation is transient.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
const bool _strain_at_nearest_qp
Evaluate strain at the nearest quadpoint for porosity that depends on strain.
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const
const std::vector< VariableName > & _displacements
Displacement NonlinearVariable names (if any)
const std::string _base_name
base_name used in the TensorMechanics strain calculator
bool isParamValid(const std::string &name) const

◆ addMassFractionMaterial()

void PorousFlowActionBase::addMassFractionMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint MassFraction material.

Parameters
at_nodesAdd nodal mass-fraction material

Definition at line 420 of file PorousFlowActionBase.C.

Referenced by addMaterials().

421 {
422  if (_current_task == "add_material")
423  {
424  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
425  parameters().hasCoupledValue("mass_fraction_vars")))
426  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
427  "mass_fraction_vars");
428 
429  std::string material_type = "PorousFlowMassFraction";
430  InputParameters params = _factory.getValidParams(material_type);
432  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
433 
434  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
435  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
436 
437  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
438  if (at_nodes)
439  material_name = "PorousFlowActionBase_MassFraction";
440 
441  params.set<bool>("at_nodes") = at_nodes;
442  _problem->addMaterial(material_type, material_name, params);
443  }
444 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const

◆ addMaterialDependencies()

void PorousFlowSinglePhaseBase::addMaterialDependencies ( )
overrideprotectedvirtual

Add all material dependencies so that the correct version of each material can be added.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 174 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowFullySaturated::addMaterialDependencies(), PorousFlowUnsaturated::addMaterialDependencies(), and PorousFlowBasicTHM::addMaterialDependencies().

175 {
177 
178  // Add necessary objects to list of PorousFlow objects added by this action
179  if (_mechanical)
180  {
181  _included_objects.push_back("StressDivergenceTensors");
182  _included_objects.push_back("Gravity");
183  _included_objects.push_back("PorousFlowEffectiveStressCoupling");
184  }
185 
186  if (_thermal)
187  {
188  _included_objects.push_back("PorousFlowHeatConduction");
189  if (_transient)
190  _included_objects.push_back("PorousFlowEnergyTimeDerivative");
191  }
192 
193  if (_thermal && _mechanical && _transient)
194  _included_objects.push_back("PorousFlowHeatVolumetricExpansion");
195 
196  if (_add_darcy_aux)
197  _included_objects.push_back("PorousFlowDarcyVelocityComponent");
198 
200  _included_objects.push_back("StressAux");
201 }
const bool _add_stress_aux
Add AuxVariables for stress.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
const bool _add_darcy_aux
Add a AuxVariables to record Darcy velocity.
bool _transient
Flag to denote if the simulation is transient.
virtual void addMaterialDependencies()
Add all material dependencies so that the correct version of each material can be added...

◆ addMaterials()

void PorousFlowSinglePhaseBase::addMaterials ( )
overrideprotectedvirtual

Add all Materials.

Reimplemented from PorousFlowActionBase.

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 309 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowFullySaturated::addMaterials(), PorousFlowUnsaturated::addMaterials(), and PorousFlowBasicTHM::addMaterials().

310 {
312 
313  // add Materials
314  if (_deps.dependsOn(_included_objects, "temperature_qp"))
315  addTemperatureMaterial(false);
316 
317  if (_deps.dependsOn(_included_objects, "temperature_nodal"))
319 
320  if (_deps.dependsOn(_included_objects, "mass_fraction_qp"))
322 
323  if (_deps.dependsOn(_included_objects, "mass_fraction_nodal"))
325 
326  const bool compute_rho_mu_qp = _deps.dependsOn(_included_objects, "density_qp") ||
327  _deps.dependsOn(_included_objects, "viscosity_qp");
328  const bool compute_e_qp = _deps.dependsOn(_included_objects, "internal_energy_qp");
329  const bool compute_h_qp = _deps.dependsOn(_included_objects, "enthalpy_qp");
330 
331  if (compute_rho_mu_qp || compute_e_qp || compute_h_qp)
332  {
335  _nacl_name, false, 0, compute_rho_mu_qp, compute_e_qp, compute_h_qp, _temperature_unit);
338  0,
339  compute_rho_mu_qp,
340  compute_e_qp,
341  compute_h_qp,
342  _fp,
345  _time_unit);
346  }
347 
348  const bool compute_rho_mu_nodal = _deps.dependsOn(_included_objects, "density_nodal") ||
349  _deps.dependsOn(_included_objects, "viscosity_nodal");
350  const bool compute_e_nodal = _deps.dependsOn(_included_objects, "internal_energy_nodal");
351  const bool compute_h_nodal = _deps.dependsOn(_included_objects, "enthalpy_nodal");
352 
353  if (compute_rho_mu_nodal || compute_e_nodal || compute_h_nodal)
354  {
357  true,
358  0,
359  compute_rho_mu_nodal,
360  compute_e_nodal,
361  compute_h_nodal,
365  0,
366  compute_rho_mu_nodal,
367  compute_e_nodal,
368  compute_h_nodal,
369  _fp,
372  _time_unit);
373  }
374 
375  if (_deps.dependsOn(_included_objects, "effective_pressure_qp"))
377 
378  if (_deps.dependsOn(_included_objects, "effective_pressure_nodal"))
380 }
UserObjectName _fp
Name of the fluid-properties UserObject.
const MooseEnum _temperature_unit
Unit used for temperature.
void addEffectiveFluidPressureMaterial(bool at_nodes)
Adds a nodal and a quadpoint effective fluid pressure material.
bool dependsOn(const std::string &key, const std::string &value)
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
virtual void addMaterials()
Add all Materials.
void addSingleComponentFluidMaterial(bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const UserObjectName &fp, const MooseEnum &temperature_unit, const MooseEnum &pressure_unit, const MooseEnum &time_unit)
Adds a single-component fluid Material.
VariableName _nacl_name
Name of the NaCl variable.
void addBrineMaterial(const VariableName xnacl, bool at_nodes, unsigned phase, bool compute_density_and_viscosity, bool compute_internal_energy, bool compute_enthalpy, const MooseEnum &temperature_unit)
Adds a brine fluid Material.
const MooseEnum _time_unit
Unit used for time.
void addTemperatureMaterial(bool at_nodes)
Adds a nodal and a quadpoint Temperature material.
void addMassFractionMaterial(bool at_nodes)
Adds a nodal and a quadpoint MassFraction material.
const MooseEnum _pressure_unit
Unit used for porepressure.
enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum _fluid_properties_type
DependencyResolver< std::string > _deps
All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies.

◆ addNearestQpMaterial()

void PorousFlowActionBase::addNearestQpMaterial ( )
protectedinherited

Adds a PorousFlowNearestQp material.

Definition at line 468 of file PorousFlowActionBase.C.

Referenced by PorousFlowActionBase::addMaterials().

469 {
470  if (_current_task == "add_material")
471  {
472  std::string material_type = "PorousFlowNearestQp";
473  InputParameters params = _factory.getValidParams(material_type);
475  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
476 
477  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
478  params.set<bool>("nodal_material") = true;
479 
480  std::string material_name = "PorousFlowActionBase_NearestQp";
481  _problem->addMaterial(material_type, material_name, params);
482  }
483 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addRelationshipManagers() [1/3]

virtual void Action::addRelationshipManagers
inherited

◆ addRelationshipManagers() [2/3]

bool Action::addRelationshipManagers
inherited

◆ addRelationshipManagers() [3/3]

void PorousFlowActionBase::addRelationshipManagers ( Moose::RelationshipManagerType  when_type)
overridevirtualinherited

Reimplemented from Action.

Definition at line 130 of file PorousFlowActionBase.C.

131 {
133  ? _factory.getValidParams("PorousFlowAdvectiveFluxCalculatorSaturated")
135  addRelationshipManagers(input_rm_type, ips);
136 }
InputParameters getValidParams(const std::string &name) const
InputParameters emptyInputParameters()
Factory & _factory
virtual void addRelationshipManagers(Moose::RelationshipManagerType when_type) override
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addRelativePermeabilityConst()

void PorousFlowActionBase::addRelativePermeabilityConst ( bool  at_nodes,
unsigned  phase,
Real  kr 
)
protectedinherited

Adds a relative-permeability Material of the constant variety (primarily to add kr = 1 in actions that add a default relatively permeability for objects that require kr even when the flow is fully saturated with a single phase)

Parameters
at_nodeswhether the material is nodal
phasethe phase number of the fluid
krthe relative permeability

Definition at line 576 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addMaterials(), and PorousFlowBasicTHM::addMaterials().

577 {
578  if (_current_task == "add_material")
579  {
580  std::string material_type = "PorousFlowRelativePermeabilityConst";
581  InputParameters params = _factory.getValidParams(material_type);
583  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
584 
585  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
586  params.set<unsigned int>("phase") = phase;
587  params.set<Real>("kr") = kr;
588  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
589  if (at_nodes)
590  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
591 
592  params.set<bool>("at_nodes") = at_nodes;
593  _problem->addMaterial(material_type, material_name, params);
594  }
595 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addRelativePermeabilityCorey()

void PorousFlowActionBase::addRelativePermeabilityCorey ( bool  at_nodes,
unsigned  phase,
Real  n,
Real  s_res,
Real  sum_s_res 
)
protectedinherited

Adds a relative-permeability Material of the Corey variety.

Parameters
at_nodeswhether the material is nodal
phasethe phase number of the fluid
nThe Corey exponent
s_resThe residual saturation for this phase
sum_s_resThe sum of residual saturations over all phases

Definition at line 598 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addMaterials().

600 {
601  if (_current_task == "add_material")
602  {
603  std::string material_type = "PorousFlowRelativePermeabilityCorey";
604  InputParameters params = _factory.getValidParams(material_type);
606  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
607 
608  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
609  params.set<Real>("n") = n;
610  params.set<unsigned int>("phase") = phase;
611  params.set<Real>("s_res") = s_res;
612  params.set<Real>("sum_s_res") = sum_s_res;
613 
614  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
615  if (at_nodes)
616  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
617 
618  params.set<bool>("at_nodes") = at_nodes;
619  _problem->addMaterial(material_type, material_name, params);
620  }
621 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addRelativePermeabilityFLAC()

void PorousFlowActionBase::addRelativePermeabilityFLAC ( bool  at_nodes,
unsigned  phase,
Real  m,
Real  s_res,
Real  sum_s_res 
)
protectedinherited

Adds a relative-permeability Material of the FLAC variety.

Parameters
at_nodeswhether the material is nodal
phasethe phase number of the fluid
mThe FLAC exponent
s_resThe residual saturation for this phase
sum_s_resThe sum of residual saturations over all phases

Definition at line 624 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addMaterials().

626 {
627  if (_current_task == "add_material")
628  {
629  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
630  InputParameters params = _factory.getValidParams(material_type);
632  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
633 
634  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
635  params.set<Real>("m") = m;
636  params.set<unsigned int>("phase") = phase;
637  params.set<Real>("s_res") = s_res;
638  params.set<Real>("sum_s_res") = sum_s_res;
639 
640  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
641  if (at_nodes)
642  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
643 
644  params.set<bool>("at_nodes") = at_nodes;
645  _problem->addMaterial(material_type, material_name, params);
646  }
647 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addSaturationAux()

void PorousFlowActionBase::addSaturationAux ( unsigned  phase)
protectedinherited

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 242 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::addAuxObjects().

243 {
244  std::string phase_str = Moose::stringify(phase);
245 
246  if (_current_task == "add_aux_variable")
247  {
248  auto var_params = _factory.getValidParams("MooseVariableConstMonomial");
250  var_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
251  _problem->addAuxVariable("MooseVariableConstMonomial", "saturation" + phase_str, var_params);
252  }
253 
254  if (_current_task == "add_aux_kernel")
255  {
256  std::string aux_kernel_type = "MaterialStdVectorAux";
257  InputParameters params = _factory.getValidParams(aux_kernel_type);
258 
259  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
260  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
261  params.set<unsigned>("index") = phase;
262  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
263  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
264  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
265  }
266 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
std::string stringify(const T &t)
std::shared_ptr< FEProblemBase > & _problem

◆ addSingleComponentFluidMaterial()

void PorousFlowActionBase::addSingleComponentFluidMaterial ( bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const UserObjectName &  fp,
const MooseEnum temperature_unit,
const MooseEnum pressure_unit,
const MooseEnum time_unit 
)
protectedinherited

Adds a single-component fluid Material.

Parameters
phasethe phase number of the fluid
fpthe name of the FluidProperties UserObject
compute_density_and_viscositycompute the density and viscosity of the fluid
compute_internal_energycompute the fluid internal energy
compute_enthalpycompute the fluid enthalpy
at_nodesadd a nodal material
temperature_unitthe unit of temperature (Kelvin or Celsius)
pressure_unitthe unit of pressure (MPa or Pa)
time_unitthe unit of time (seconds, days, hours, etc)

Definition at line 506 of file PorousFlowActionBase.C.

Referenced by addMaterials().

515 {
516  if (_current_task == "add_material")
517  {
518  std::string material_type = "PorousFlowSingleComponentFluid";
519  InputParameters params = _factory.getValidParams(material_type);
521  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
522 
523  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
524  params.set<unsigned int>("phase") = phase;
525  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
526  params.set<bool>("compute_internal_energy") = compute_internal_energy;
527  params.set<bool>("compute_enthalpy") = compute_enthalpy;
528  params.set<UserObjectName>("fp") = fp;
529  params.set<MooseEnum>("temperature_unit") = temperature_unit;
530  params.set<MooseEnum>("pressure_unit") = pressure_unit;
531  params.set<MooseEnum>("time_unit") = time_unit;
532 
533  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
534  if (at_nodes)
535  material_name = "PorousFlowActionBase_FluidProperties";
536 
537  params.set<bool>("at_nodes") = at_nodes;
538  _problem->addMaterial(material_type, material_name, params);
539  }
540 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ addStressAux()

void PorousFlowActionBase::addStressAux ( )
protectedinherited

Add AuxVariables and AuxKernels to compute effective stress.

Definition at line 311 of file PorousFlowActionBase.C.

Referenced by addAuxObjects().

312 {
313  if (_current_task == "add_aux_variable")
314  {
315  auto var_params = _factory.getValidParams("MooseVariableConstMonomial");
317  var_params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
318  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_xx", var_params);
319  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_xy", var_params);
320  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_xz", var_params);
321  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_yx", var_params);
322  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_yy", var_params);
323  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_yz", var_params);
324  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_zx", var_params);
325  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_zy", var_params);
326  _problem->addAuxVariable("MooseVariableConstMonomial", "stress_zz", var_params);
327  }
328 
329  if (_current_task == "add_aux_kernel")
330  {
331  std::string aux_kernel_type = "RankTwoAux";
332  InputParameters params = _factory.getValidParams(aux_kernel_type);
333 
334  params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
335  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
336 
337  std::string aux_kernel_name = "PorousFlowAction_stress_xx";
338  params.set<AuxVariableName>("variable") = "stress_xx";
339  params.set<unsigned>("index_i") = 0;
340  params.set<unsigned>("index_j") = 0;
341  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
342 
343  aux_kernel_name = "PorousFlowAction_stress_xy";
344  params.set<AuxVariableName>("variable") = "stress_xy";
345  params.set<unsigned>("index_i") = 0;
346  params.set<unsigned>("index_j") = 1;
347  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
348 
349  aux_kernel_name = "PorousFlowAction_stress_xz";
350  params.set<AuxVariableName>("variable") = "stress_xz";
351  params.set<unsigned>("index_i") = 0;
352  params.set<unsigned>("index_j") = 2;
353  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
354 
355  aux_kernel_name = "PorousFlowAction_stress_yx";
356  params.set<AuxVariableName>("variable") = "stress_yx";
357  params.set<unsigned>("index_i") = 1;
358  params.set<unsigned>("index_j") = 0;
359  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
360 
361  aux_kernel_name = "PorousFlowAction_stress_yy";
362  params.set<AuxVariableName>("variable") = "stress_yy";
363  params.set<unsigned>("index_i") = 1;
364  params.set<unsigned>("index_j") = 1;
365  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
366 
367  aux_kernel_name = "PorousFlowAction_stress_yz";
368  params.set<AuxVariableName>("variable") = "stress_yz";
369  params.set<unsigned>("index_i") = 1;
370  params.set<unsigned>("index_j") = 2;
371  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
372 
373  aux_kernel_name = "PorousFlowAction_stress_zx";
374  params.set<AuxVariableName>("variable") = "stress_zx";
375  params.set<unsigned>("index_i") = 2;
376  params.set<unsigned>("index_j") = 0;
377  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
378 
379  aux_kernel_name = "PorousFlowAction_stress_zy";
380  params.set<AuxVariableName>("variable") = "stress_zy";
381  params.set<unsigned>("index_i") = 2;
382  params.set<unsigned>("index_j") = 1;
383  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
384 
385  aux_kernel_name = "PorousFlowAction_stress_zz";
386  params.set<AuxVariableName>("variable") = "stress_zz";
387  params.set<unsigned>("index_i") = 2;
388  params.set<unsigned>("index_j") = 2;
389  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
390  }
391 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
std::shared_ptr< FEProblemBase > & _problem

◆ addTemperatureMaterial()

void PorousFlowActionBase::addTemperatureMaterial ( bool  at_nodes)
protectedinherited

Adds a nodal and a quadpoint Temperature material.

Parameters
at_nodesAdd nodal temperature Material

Definition at line 394 of file PorousFlowActionBase.C.

Referenced by addMaterials().

395 {
396  if (_current_task == "add_material")
397  {
398  if (!parameters().hasDefaultCoupledValue("temperature"))
399  mooseError("Attempt to add a PorousFlowTemperature material without setting a temperature "
400  "variable");
401 
402  std::string material_type = "PorousFlowTemperature";
403  InputParameters params = _factory.getValidParams(material_type);
405  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
406 
407  params.applySpecificParameters(parameters(), {"temperature"});
408  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
409 
410  std::string material_name = "PorousFlowActionBase_Temperature_qp";
411  if (at_nodes)
412  material_name = "PorousFlowActionBase_Temperature";
413 
414  params.set<bool>("at_nodes") = at_nodes;
415  _problem->addMaterial(material_type, material_name, params);
416  }
417 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
void applySpecificParameters(const InputParameters &common, const std::vector< std::string > &include, bool allow_private=false)
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
void mooseError(Args &&... args) const
std::shared_ptr< FEProblemBase > & _problem
const InputParameters & parameters() const

◆ addUserObjects()

void PorousFlowActionBase::addUserObjects ( )
protectedvirtualinherited

Add all other UserObjects.

Reimplemented in PorousFlowUnsaturated, and PorousFlowFullySaturated.

Definition at line 219 of file PorousFlowActionBase.C.

Referenced by PorousFlowActionBase::act(), PorousFlowFullySaturated::addUserObjects(), and PorousFlowUnsaturated::addUserObjects().

220 {
221  addDictator();
222 }
virtual void addDictator()=0
Add the PorousFlowDictator object.

◆ addVolumetricStrainMaterial()

void PorousFlowActionBase::addVolumetricStrainMaterial ( const std::vector< VariableName > &  displacements,
const std::string &  base_name 
)
protectedinherited

Adds a quadpoint volumetric strain material.

Parameters
displacementsthe names of the displacement variables
base_nameThe base_name used in the TensorMechanics strain calculator displaced mesh

Definition at line 486 of file PorousFlowActionBase.C.

Referenced by PorousFlowFullySaturated::addMaterials(), PorousFlowBasicTHM::addMaterials(), and PorousFlowUnsaturated::addMaterials().

488 {
489  if (_current_task == "add_material")
490  {
491  std::string material_type = "PorousFlowVolumetricStrain";
492  InputParameters params = _factory.getValidParams(material_type);
494  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
495 
496  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
497  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
498  params.set<std::vector<VariableName>>("displacements") = displacements;
499  if (!base_name.empty())
500  params.set<std::string>("base_name") = base_name;
501  _problem->addMaterial(material_type, material_name, params);
502  }
503 }
const bool _subdomain_names_set
indicates, if the vector of subdomain names is set (dont set block restrictions, if not) ...
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
Factory & _factory
std::vector< SubdomainName > _subdomain_names
if this vector is not empty the variables, kernels and materials are restricted to these subdomains ...
const std::string & _current_task
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.
std::shared_ptr< FEProblemBase > & _problem

◆ validParams()

InputParameters PorousFlowSinglePhaseBase::validParams ( )
static

Definition at line 17 of file PorousFlowSinglePhaseBase.C.

Referenced by PorousFlowFullySaturated::validParams(), PorousFlowUnsaturated::validParams(), and PorousFlowBasicTHM::validParams().

18 {
20  params.addParam<bool>("add_darcy_aux", true, "Add AuxVariables that record Darcy velocity");
21  params.addParam<bool>("add_stress_aux", true, "Add AuxVariables that record effective stress");
22  params.addDeprecatedParam<bool>("use_brine",
23  false,
24  "Whether to use a PorousFlowBrine Material",
25  "This parameter should no longer be used. Instead use "
26  "fluid_properties_type = PorousFlowBrine");
27  params.addRequiredParam<VariableName>("porepressure", "The name of the porepressure variable");
28  MooseEnum coupling_type("Hydro ThermoHydro HydroMechanical ThermoHydroMechanical", "Hydro");
29  params.addParam<MooseEnum>("coupling_type",
30  coupling_type,
31  "The type of simulation. For simulations involving Mechanical "
32  "deformations, you will need to supply the correct Biot coefficient. "
33  "For simulations involving Thermal flows, you will need an associated "
34  "ConstantThermalExpansionCoefficient Material");
35  MooseEnum fluid_properties_type("PorousFlowSingleComponentFluid PorousFlowBrine Custom",
36  "PorousFlowSingleComponentFluid");
37  params.addParam<MooseEnum>(
38  "fluid_properties_type",
39  fluid_properties_type,
40  "Type of fluid properties to use. For 'PorousFlowSingleComponentFluid' you must provide a "
41  "fp UserObject. For 'PorousFlowBrine' you must supply a nacl_name. For "
42  "'Custom' your input file must include a Material that provides fluid properties such as "
43  "density, viscosity, enthalpy and internal energy");
44  MooseEnum simulation_type_choice("steady transient", "transient");
46  "simulation_type",
47  simulation_type_choice,
48  "Whether a transient or steady-state simulation is being performed",
49  "The execution type is now determined automatically. This parameter should no longer be "
50  "used");
51  params.addParam<UserObjectName>(
52  "fp",
53  "The name of the user object for fluid "
54  "properties. Only needed if fluid_properties_type = PorousFlowSingleComponentFluid");
55  params.addCoupledVar("mass_fraction_vars",
56  {},
57  "List of variables that represent the mass fractions. With only one fluid "
58  "component, this may be left empty. With N fluid components, the format is "
59  "'f_0 f_1 f_2 ... f_(N-1)'. That is, the N^th component need not be "
60  "specified because f_N = 1 - (f_0 + f_1 + ... + f_(N-1)). It is best "
61  "numerically to choose the N-1 mass fraction variables so that they "
62  "represent the fluid components with small concentrations. This Action "
63  "will associated the i^th mass fraction variable to the equation for the "
64  "i^th fluid component, and the pressure variable to the N^th fluid "
65  "component.");
66  params.addDeprecatedParam<unsigned>(
67  "nacl_index",
68  0,
69  "Index of NaCl variable in mass_fraction_vars, for "
70  "calculating brine properties. Only required if use_brine is true.",
71  "This parameter should no longer be used. Instead use nacl_name = the_nacl_variable_name");
72  params.addParam<VariableName>(
73  "nacl_name",
74  "Name of the NaCl variable. Only required if fluid_properties_type = PorousFlowBrine");
75  params.addParam<Real>(
76  "biot_coefficient",
77  1.0,
78  "The Biot coefficient (relevant only for mechanically-coupled simulations)");
79  params.addParam<std::vector<AuxVariableName>>(
80  "save_component_rate_in",
81  {},
82  "List of AuxVariables into which the rate-of-change of each fluid component at each node "
83  "will be saved. There must be exactly N of these to match the N fluid components. The "
84  "result will be measured in kg/s, where the kg is the mass of the fluid component at the "
85  "node (or m^3/s if multiply_by_density=false). Note that this saves the result from the "
86  "MassTimeDerivative Kernels, but NOT from the MassVolumetricExpansion Kernels.");
87  MooseEnum temp_unit_choice("Kelvin Celsius", "Kelvin");
88  params.addParam<MooseEnum>(
89  "temperature_unit", temp_unit_choice, "The unit of the temperature variable");
90  MooseEnum p_unit_choice("Pa MPa", "Pa");
91  params.addParam<MooseEnum>(
92  "pressure_unit",
93  p_unit_choice,
94  "The unit of the pressure variable used everywhere in the input file "
95  "except for in the FluidProperties-module objects. This can be set to the non-default value "
96  "only for fluid_properties_type = PorousFlowSingleComponentFluid");
97  MooseEnum time_unit_choice("seconds hours days years", "seconds");
98  params.addParam<MooseEnum>(
99  "time_unit",
100  time_unit_choice,
101  "The unit of time used everywhere in the input file except for in the "
102  "FluidProperties-module objects. This can be set to the non-default value only for "
103  "fluid_properties_type = PorousFlowSingleComponentFluid");
104  params.addParam<std::string>("base_name",
105  "The base_name used in the TensorMechanics strain calculator. This "
106  "is only relevant for mechanically-coupled models.");
107  params.addClassDescription("Base class for single-phase simulations");
108  return params;
109 }
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
static InputParameters validParams()
void addCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _add_darcy_aux

const bool PorousFlowSinglePhaseBase::_add_darcy_aux
protected

Add a AuxVariables to record Darcy velocity.

Definition at line 60 of file PorousFlowSinglePhaseBase.h.

Referenced by addAuxObjects(), and addMaterialDependencies().

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protected

Add AuxVariables for stress.

Definition at line 63 of file PorousFlowSinglePhaseBase.h.

Referenced by addAuxObjects(), and addMaterialDependencies().

◆ _base_name

const std::string PorousFlowSinglePhaseBase::_base_name
protected

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protected

Fluid specific heat capacity at constant volume.

Definition at line 57 of file PorousFlowSinglePhaseBase.h.

Referenced by addKernels(), and PorousFlowBasicTHM::addKernels().

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protectedinherited

Coordinate system of the simulation (eg RZ, XYZ, etc)

Definition at line 95 of file PorousFlowActionBase.h.

Referenced by PorousFlowActionBase::act(), and addKernels().

◆ _coupled_displacements

std::vector<VariableName> PorousFlowActionBase::_coupled_displacements
protectedinherited

◆ _coupling_type

enum PorousFlowSinglePhaseBase::CouplingTypeEnum PorousFlowSinglePhaseBase::_coupling_type
protected

◆ _deps

DependencyResolver<std::string> PorousFlowDependencies::_deps
protectedinherited

◆ _dictator_name

const std::string PorousFlowActionBase::_dictator_name
protectedinherited

◆ _displacements

const std::vector<VariableName>& PorousFlowActionBase::_displacements
protectedinherited

Displacement NonlinearVariable names (if any)

Definition at line 78 of file PorousFlowActionBase.h.

Referenced by addKernels().

◆ _fluid_properties_type

enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum PorousFlowSinglePhaseBase::_fluid_properties_type
protected

◆ _flux_limiter_type

const MooseEnum PorousFlowActionBase::_flux_limiter_type
protectedinherited

◆ _fp

UserObjectName PorousFlowSinglePhaseBase::_fp
protected

Name of the fluid-properties UserObject.

Definition at line 54 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protectedinherited

◆ _included_objects

std::vector<std::string> PorousFlowActionBase::_included_objects
protectedinherited

◆ _mass_fraction_vars

const std::vector<VariableName> PorousFlowActionBase::_mass_fraction_vars
protectedinherited

Name of the mass-fraction variables (if any)

Definition at line 69 of file PorousFlowActionBase.h.

Referenced by addDictator(), PorousFlowFullySaturated::addKernels(), and PorousFlowUnsaturated::addKernels().

◆ _mechanical

const bool PorousFlowSinglePhaseBase::_mechanical
protected

◆ _nacl_name

VariableName PorousFlowSinglePhaseBase::_nacl_name
protected

Name of the NaCl variable.

Definition at line 66 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

Number of displacement variables supplied.

Definition at line 81 of file PorousFlowActionBase.h.

Referenced by addKernels().

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protectedinherited

Number of aqueous-equilibrium secondary species.

Definition at line 60 of file PorousFlowActionBase.h.

Referenced by addDictator().

◆ _num_aqueous_kinetic

const unsigned int PorousFlowActionBase::_num_aqueous_kinetic
protectedinherited

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

Definition at line 63 of file PorousFlowActionBase.h.

Referenced by addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protectedinherited

◆ _pp_var

const VariableName PorousFlowSinglePhaseBase::_pp_var
protected

◆ _pressure_unit

const MooseEnum PorousFlowSinglePhaseBase::_pressure_unit
protected

Unit used for porepressure.

Definition at line 75 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().

◆ _save_component_rate_in

const std::vector<AuxVariableName> PorousFlowSinglePhaseBase::_save_component_rate_in
protected

Name of the variables (if any) that will record the fluid-components' rate of change.

Definition at line 69 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowFullySaturated::addKernels(), PorousFlowUnsaturated::addKernels(), PorousFlowBasicTHM::addKernels(), and PorousFlowSinglePhaseBase().

◆ _stabilization

enum PorousFlowActionBase::StabilizationEnum PorousFlowActionBase::_stabilization
protectedinherited

◆ _strain_at_nearest_qp

const bool PorousFlowActionBase::_strain_at_nearest_qp
protectedinherited

Evaluate strain at the nearest quadpoint for porosity that depends on strain.

Definition at line 92 of file PorousFlowActionBase.h.

Referenced by PorousFlowFullySaturated::addKernels(), addKernels(), PorousFlowUnsaturated::addKernels(), PorousFlowActionBase::addMaterialDependencies(), and PorousFlowActionBase::addMaterials().

◆ _subdomain_names

std::vector<SubdomainName> PorousFlowActionBase::_subdomain_names
protectedinherited

◆ _subdomain_names_set

const bool PorousFlowActionBase::_subdomain_names_set
protectedinherited

◆ _temperature_unit

const MooseEnum PorousFlowSinglePhaseBase::_temperature_unit
protected

Unit used for temperature.

Definition at line 72 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials().

◆ _temperature_var

const std::vector<VariableName> PorousFlowActionBase::_temperature_var
protectedinherited

◆ _thermal

const bool PorousFlowSinglePhaseBase::_thermal
protected

◆ _time_unit

const MooseEnum PorousFlowSinglePhaseBase::_time_unit
protected

Unit used for time.

Definition at line 78 of file PorousFlowSinglePhaseBase.h.

Referenced by addMaterials(), and PorousFlowSinglePhaseBase().

◆ _transient

bool PorousFlowActionBase::_transient
protectedinherited

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