https://mooseframework.inl.gov
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
PorousFlowFullySaturated Class Reference

Action for simulation involving a single phase fully saturated fluid. More...

#include <PorousFlowFullySaturated.h>

Inheritance diagram for PorousFlowFullySaturated:
[legend]

Public Types

typedef DataFileName DataFileParameterType
 

Public Member Functions

 PorousFlowFullySaturated (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 * queryParam (const std::string &name) 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 addKernels () override
 Add all Kernels. 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...
 
virtual void addUserObjects () override
 Add all other UserObjects. More...
 
virtual void addDictator () override
 Add the PorousFlowDictator object. More...
 
virtual void addAuxObjects () override
 Add all AuxVariables and AuxKernels. More...
 
bool addRelationshipManagers (Moose::RelationshipManagerType when_type, const InputParameters &moose_object_pars)
 
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 bool _multiply_by_density
 
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

Action for simulation involving a single phase fully saturated fluid.

Definition at line 17 of file PorousFlowFullySaturated.h.

Member Enumeration Documentation

◆ CouplingTypeEnum

enum PorousFlowSinglePhaseBase::CouplingTypeEnum
strongprotectedinherited

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

◆ PorousFlowFullySaturated()

PorousFlowFullySaturated::PorousFlowFullySaturated ( const InputParameters params)

Definition at line 50 of file PorousFlowFullySaturated.C.

51  : PorousFlowSinglePhaseBase(params), _multiply_by_density(getParam<bool>("multiply_by_density"))
52 {
53 }
PorousFlowSinglePhaseBase(const InputParameters &params)

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 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 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 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 ( )
overrideprotectedvirtualinherited

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 PorousFlowSinglePhaseBase::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 PorousFlowSinglePhaseBase::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 ( )
overrideprotectedvirtualinherited

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 PorousFlowSinglePhaseBase::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 PorousFlowFullySaturated::addKernels ( )
overrideprotectedvirtual

Add all Kernels.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 95 of file PorousFlowFullySaturated.C.

96 {
98 
100  {
101  const std::string kernel_type = "PorousFlowFullySaturatedDarcyFlow";
102  InputParameters params = _factory.getValidParams(kernel_type);
103  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
104  params.set<RealVectorValue>("gravity") = _gravity;
105  params.set<bool>("multiply_by_density") = _multiply_by_density;
106 
107  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
108  {
109  const std::string kernel_name = "PorousFlowFullySaturated_DarcyFlow" + Moose::stringify(i);
110  params.set<unsigned int>("fluid_component") = i;
111  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
112  _problem->addKernel(kernel_type, kernel_name, params);
113  }
114 
115  const std::string kernel_name =
116  "PorousFlowFullySaturated_DarcyFlow" + Moose::stringify(_num_mass_fraction_vars);
117  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
118  params.set<NonlinearVariableName>("variable") = _pp_var;
119  _problem->addKernel(kernel_type, kernel_name, params);
120  }
122  {
123  const std::string kernel_type = "PorousFlowFullySaturatedAdvectiveFlux";
124  InputParameters params = _factory.getValidParams(kernel_type);
125  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
126  params.set<RealVectorValue>("gravity") = _gravity;
127  params.set<bool>("multiply_by_density") = _multiply_by_density;
128 
129  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
130  {
131  const std::string kernel_name =
132  "PorousFlowFullySaturated_AdvectiveFlux" + Moose::stringify(i);
133  params.set<unsigned int>("fluid_component") = i;
134  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
135  _problem->addKernel(kernel_type, kernel_name, params);
136  }
137 
138  const std::string kernel_name =
139  "PorousFlowFullySaturated_AdvectiveFlux" + Moose::stringify(_num_mass_fraction_vars);
140  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
141  params.set<NonlinearVariableName>("variable") = _pp_var;
142  _problem->addKernel(kernel_type, kernel_name, params);
143  }
145  {
146  const std::string kernel_type = "PorousFlowFluxLimitedTVDAdvection";
147  InputParameters params = _factory.getValidParams(kernel_type);
148  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
149 
150  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
151  {
152  const std::string kernel_name = "PorousFlowFluxLimited_DarcyFlow" + Moose::stringify(i);
153  params.set<UserObjectName>("advective_flux_calculator") =
154  "PorousFlowFullySaturated_AC_" + Moose::stringify(i);
155  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
156  _problem->addKernel(kernel_type, kernel_name, params);
157  }
158 
159  const std::string kernel_name =
160  "PorousFlowFluxLimited_DarcyFlow" + Moose::stringify(_num_mass_fraction_vars);
161  params.set<NonlinearVariableName>("variable") = _pp_var;
162  params.set<UserObjectName>("advective_flux_calculator") =
163  "PorousFlowFullySaturated_AC_" + Moose::stringify(_num_mass_fraction_vars);
164  _problem->addKernel(kernel_type, kernel_name, params);
165  }
166 
167  if (_transient)
168  {
169  std::string kernel_name = "PorousFlowFullySaturated_MassTimeDerivative";
170  std::string kernel_type = "PorousFlowMassTimeDerivative";
171  InputParameters params = _factory.getValidParams(kernel_type);
172  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
173  params.set<bool>("multiply_by_density") = _multiply_by_density;
174  params.set<bool>("strain_at_nearest_qp") = _strain_at_nearest_qp;
175  if (!_base_name.empty())
176  params.set<std::string>("base_name") = _base_name;
177 
178  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
179  {
180  kernel_name = "PorousFlowFullySaturated_MassTimeDerivative" + Moose::stringify(i);
181  params.set<unsigned int>("fluid_component") = i;
182  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
183  if (_save_component_rate_in.size() != 0)
184  params.set<std::vector<AuxVariableName>>("save_in") = {_save_component_rate_in[i]};
185  _problem->addKernel(kernel_type, kernel_name, params);
186  }
187 
188  kernel_name =
189  "PorousFlowFullySaturated_MassTimeDerivative" + Moose::stringify(_num_mass_fraction_vars);
190  params.set<unsigned int>("fluid_component") = _num_mass_fraction_vars;
191  params.set<NonlinearVariableName>("variable") = _pp_var;
192  if (_save_component_rate_in.size() != 0)
193  params.set<std::vector<AuxVariableName>>("save_in") = {
195  _problem->addKernel(kernel_type, kernel_name, params);
196  }
197 
198  if (_mechanical && _transient)
199  {
200  std::string kernel_name = "PorousFlowFullySaturated_MassVolumetricExpansion";
201  std::string kernel_type = "PorousFlowMassVolumetricExpansion";
202  InputParameters params = _factory.getValidParams(kernel_type);
203  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
204  params.set<bool>("multiply_by_density") = _multiply_by_density;
205  params.set<bool>("strain_at_nearest_qp") = _strain_at_nearest_qp;
206 
207  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
208  {
209  kernel_name = "PorousFlowFullySaturated_MassVolumetricExpansion" + Moose::stringify(i);
210  params.set<unsigned>("fluid_component") = i;
211  params.set<NonlinearVariableName>("variable") = _mass_fraction_vars[i];
212  _problem->addKernel(kernel_type, kernel_name, params);
213  }
214 
215  kernel_name = "PorousFlowFullySaturated_MassVolumetricExpansion" +
217  params.set<unsigned>("fluid_component") = _num_mass_fraction_vars;
218  params.set<NonlinearVariableName>("variable") = _pp_var;
219  _problem->addKernel(kernel_type, kernel_name, params);
220  }
221 
222  if (_thermal)
223  {
225  {
226  std::string kernel_name = "PorousFlowFullySaturated_HeatAdvection";
227  std::string kernel_type = "PorousFlowFullySaturatedHeatAdvection";
228  InputParameters params = _factory.getValidParams(kernel_type);
229  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
230  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
231  params.set<RealVectorValue>("gravity") = _gravity;
232  params.set<bool>("multiply_by_density") = true;
233  _problem->addKernel(kernel_type, kernel_name, params);
234  }
236  {
237  std::string kernel_name = "PorousFlowFullySaturatedUpwind_HeatAdvection";
238  std::string kernel_type = "PorousFlowFullySaturatedUpwindHeatAdvection";
239  InputParameters params = _factory.getValidParams(kernel_type);
240  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
241  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
242  params.set<RealVectorValue>("gravity") = _gravity;
243  _problem->addKernel(kernel_type, kernel_name, params);
244  }
246  {
247  const std::string kernel_name = "PorousFlowFullySaturated_HeatAdvection";
248  const std::string kernel_type = "PorousFlowFluxLimitedTVDAdvection";
249  InputParameters params = _factory.getValidParams(kernel_type);
250  params.set<NonlinearVariableName>("variable") = _temperature_var[0];
251  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
252  params.set<UserObjectName>("advective_flux_calculator") = "PorousFlowFullySaturatedHeat_AC";
253  _problem->addKernel(kernel_type, kernel_name, params);
254  }
255  }
256 }
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
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.
Factory & _factory
virtual void addKernels() override
Add all Kernels.
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.
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.
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
std::shared_ptr< FEProblemBase > & _problem
const std::string _base_name
base_name used in the TensorMechanics strain calculator
enum PorousFlowActionBase::StabilizationEnum _stabilization
const std::vector< VariableName > _mass_fraction_vars
Name of the mass-fraction variables (if any)

◆ 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 PorousFlowSinglePhaseBase::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 PorousFlowFullySaturated::addMaterialDependencies ( )
overrideprotectedvirtual

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

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 56 of file PorousFlowFullySaturated.C.

57 {
59 
60  // Add necessary objects to list of PorousFlow objects added by this action
62  _included_objects.push_back("PorousFlowFullySaturatedDarcyFlow");
64  _included_objects.push_back("PorousFlowFullySaturatedAdvectiveFlux");
66  _included_objects.push_back("PorousFlowFluxLimitedTVDAdvection");
67 
68  if (_transient)
69  _included_objects.push_back("PorousFlowMassTimeDerivative");
70 
71  if (_mechanical && _transient)
72  _included_objects.push_back("PorousFlowMassVolumetricExpansion");
73 
74  if (_thermal)
75  {
77  _included_objects.push_back("PorousFlowFullySaturatedHeatAdvection");
79  _included_objects.push_back("PorousFlowFullySaturatedUpwindHeatAdvection");
81  _included_objects.push_back("PorousFlowFluxLimitedTVDAdvection");
82  }
83 
85  _included_objects.push_back("PorousFlowAdvectiveFluxCalculatorSaturatedHeat");
86 
88  _included_objects.push_back("PorousFlowAdvectiveFluxCalculatorSaturatedMultiComponent");
89 
91  _included_objects.push_back("PorousFlowAdvectiveFluxCalculatorSaturatedHeat");
92 }
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.
bool _transient
Flag to denote if the simulation is transient.
virtual void addMaterialDependencies() override
Add all material dependencies so that the correct version of each material can be added...
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ addMaterials()

void PorousFlowFullySaturated::addMaterials ( )
overrideprotectedvirtual

Add all Materials.

Reimplemented from PorousFlowSinglePhaseBase.

Definition at line 292 of file PorousFlowFullySaturated.C.

293 {
295 
296  // add Materials
297  if (_deps.dependsOn(_included_objects, "pressure_saturation_qp"))
298  {
299  // saturation is always unity, so is trivially calculated using PorousFlow1PhaseFullySaturated
300  std::string material_type = "PorousFlow1PhaseFullySaturated";
301  std::string material_name = "PorousFlowFullySaturated_1PhaseP_qp";
302  InputParameters params = _factory.getValidParams(material_type);
304  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
305  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
306  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
307  params.set<bool>("at_nodes") = false;
308  _problem->addMaterial(material_type, material_name, params);
309  }
310 
311  if (_deps.dependsOn(_included_objects, "pressure_saturation_nodal"))
312  {
313  std::string material_type = "PorousFlow1PhaseFullySaturated";
314  std::string material_name = "PorousFlowFullySaturated_1PhaseP";
315  InputParameters params = _factory.getValidParams(material_type);
317  params.set<std::vector<SubdomainName>>("block") = _subdomain_names;
318  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
319  params.set<std::vector<VariableName>>("porepressure") = {_pp_var};
320  params.set<bool>("at_nodes") = true;
321  _problem->addMaterial(material_type, material_name, params);
322  }
323 
324  if (_deps.dependsOn(_included_objects, "volumetric_strain_qp") ||
325  _deps.dependsOn(_included_objects, "volumetric_strain_nodal"))
327 
328  // Relative permeability might be needed by Darcy-velocity Aux, so add a material
329  // setting kr=1
330  if (_deps.dependsOn(_included_objects, "relative_permeability_qp"))
331  addRelativePermeabilityConst(false, 0, 1.0);
332 
333  // Some obects not added by this action might have a use_mobility = true param,
334  // which needs a nodal relative permeability
335  if (_deps.dependsOn(_included_objects, "relative_permeability_nodal"))
336  addRelativePermeabilityConst(true, 0, 1.0);
337 }
virtual void addMaterials() override
Add all Materials.
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
bool dependsOn(const std::string &key, const std::string &value)
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 tha...
const VariableName _pp_var
Porepressure NonlinearVariable name.
std::vector< VariableName > _coupled_displacements
Displacement Variable names.
std::vector< std::string > _included_objects
List of Kernels, AuxKernels, Materials, etc, that are added in this input file.
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 _dictator_name
The name of the PorousFlowDictator object to be added.
void addVolumetricStrainMaterial(const std::vector< VariableName > &displacements, const std::string &base_name)
Adds a quadpoint volumetric strain material.
std::shared_ptr< FEProblemBase > & _problem
const std::string _base_name
base_name used in the TensorMechanics strain calculator
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 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 PorousFlowSinglePhaseBase::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 PorousFlowSinglePhaseBase::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 PorousFlowSinglePhaseBase::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 PorousFlowFullySaturated::addUserObjects ( )
overrideprotectedvirtual

Add all other UserObjects.

Reimplemented from PorousFlowActionBase.

Definition at line 259 of file PorousFlowFullySaturated.C.

260 {
262 
263  // add Advective Flux calculator UserObjects, if required
265  {
266  for (unsigned i = 0; i < _num_mass_fraction_vars; ++i)
267  {
268  const std::string userobject_name = "PorousFlowFullySaturated_AC_" + Moose::stringify(i);
270  0, i, _multiply_by_density, userobject_name);
271  }
272 
273  const std::string userobject_name =
274  "PorousFlowFullySaturated_AC_" + Moose::stringify(_num_mass_fraction_vars);
275 
276  if (_num_mass_fraction_vars == 0)
278  0, _multiply_by_density, userobject_name); // 1 component only
279  else
281  0, _num_mass_fraction_vars, _multiply_by_density, userobject_name);
282 
283  if (_thermal)
284  {
285  const std::string userobject_name = "PorousFlowFullySaturatedHeat_AC";
286  addAdvectiveFluxCalculatorSaturatedHeat(0, true, userobject_name);
287  }
288  }
289 }
const bool _thermal
Flags to indicate whether thermal or mechanical effects are included.
void addAdvectiveFluxCalculatorSaturated(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)
std::string stringify(const T &t)
const unsigned _num_mass_fraction_vars
Number of mass-fraction variables.
virtual void addUserObjects()
Add all other UserObjects.
void addAdvectiveFluxCalculatorSaturatedHeat(unsigned phase, bool multiply_by_density, std::string userobject_name)
enum PorousFlowActionBase::StabilizationEnum _stabilization

◆ 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 addMaterials(), PorousFlowUnsaturated::addMaterials(), and PorousFlowBasicTHM::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 PorousFlowFullySaturated::validParams ( )
static

Definition at line 27 of file PorousFlowFullySaturated.C.

28 {
30  params.addParam<bool>(
31  "multiply_by_density",
32  true,
33  "If true, then the Kernels for fluid flow are multiplied by "
34  "the fluid density. If false, this multiplication is not "
35  "performed, which means the problem becomes more linear, but care must be taken when using "
36  "other PorousFlow objects, since MOOSE will be computing volume fluxes, not mass fluxes.");
37  params.addClassDescription(
38  "Adds Kernels and fluid-property Materials necessary to simulate a "
39  "single-phase fully-saturated flow problem. Numerical stabilization options for the fluid "
40  "and heat flow are: no upwinding, full-upwinding or KT stabilization. No Kernels for "
41  "diffusion and dispersion of "
42  "fluid components are added. To run a simulation you will also "
43  "need to provide various other Materials for each mesh "
44  "block, depending on your simulation type, viz: permeability, "
45  "porosity, elasticity tensor, strain calculator, stress calculator, "
46  "matrix internal energy, thermal conductivity, diffusivity");
47  return params;
48 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
static InputParameters validParams()
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _add_darcy_aux

const bool PorousFlowSinglePhaseBase::_add_darcy_aux
protectedinherited

Add a AuxVariables to record Darcy velocity.

Definition at line 60 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects(), and PorousFlowSinglePhaseBase::addMaterialDependencies().

◆ _add_stress_aux

const bool PorousFlowSinglePhaseBase::_add_stress_aux
protectedinherited

Add AuxVariables for stress.

Definition at line 63 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::addAuxObjects(), and PorousFlowSinglePhaseBase::addMaterialDependencies().

◆ _base_name

const std::string PorousFlowSinglePhaseBase::_base_name
protectedinherited

◆ _biot_coefficient

const Real PorousFlowSinglePhaseBase::_biot_coefficient
protectedinherited

Fluid specific heat capacity at constant volume.

Definition at line 57 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::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 PorousFlowSinglePhaseBase::addKernels().

◆ _coupled_displacements

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

◆ _coupling_type

enum PorousFlowSinglePhaseBase::CouplingTypeEnum PorousFlowSinglePhaseBase::_coupling_type
protectedinherited

◆ _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 PorousFlowSinglePhaseBase::addKernels().

◆ _fluid_properties_type

enum PorousFlowSinglePhaseBase::FluidPropertiesTypeEnum PorousFlowSinglePhaseBase::_fluid_properties_type
protectedinherited

◆ _flux_limiter_type

const MooseEnum PorousFlowActionBase::_flux_limiter_type
protectedinherited

◆ _fp

UserObjectName PorousFlowSinglePhaseBase::_fp
protectedinherited

◆ _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 PorousFlowSinglePhaseBase::addDictator(), addKernels(), and PorousFlowUnsaturated::addKernels().

◆ _mechanical

const bool PorousFlowSinglePhaseBase::_mechanical
protectedinherited

◆ _multiply_by_density

const bool PorousFlowFullySaturated::_multiply_by_density
protected

Definition at line 31 of file PorousFlowFullySaturated.h.

Referenced by addKernels(), and addUserObjects().

◆ _nacl_name

VariableName PorousFlowSinglePhaseBase::_nacl_name
protectedinherited

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protectedinherited

Number of displacement variables supplied.

Definition at line 81 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::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 PorousFlowSinglePhaseBase::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 PorousFlowSinglePhaseBase::addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protectedinherited

◆ _pp_var

const VariableName PorousFlowSinglePhaseBase::_pp_var
protectedinherited

◆ _pressure_unit

const MooseEnum PorousFlowSinglePhaseBase::_pressure_unit
protectedinherited

◆ _save_component_rate_in

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

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 addKernels(), PorousFlowUnsaturated::addKernels(), PorousFlowBasicTHM::addKernels(), and PorousFlowSinglePhaseBase::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 addKernels(), PorousFlowSinglePhaseBase::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
protectedinherited

Unit used for temperature.

Definition at line 72 of file PorousFlowSinglePhaseBase.h.

Referenced by PorousFlowSinglePhaseBase::addMaterials().

◆ _temperature_var

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

◆ _thermal

const bool PorousFlowSinglePhaseBase::_thermal
protectedinherited

◆ _time_unit

const MooseEnum PorousFlowSinglePhaseBase::_time_unit
protectedinherited

◆ _transient

bool PorousFlowActionBase::_transient
protectedinherited

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