www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowActionBase Class Referenceabstract

Base class for PorousFlow actions. More...

#include <PorousFlowActionBase.h>

Inheritance diagram for PorousFlowActionBase:
[legend]

Public Member Functions

 PorousFlowActionBase (const InputParameters &params)
 
virtual void act () override
 

Protected Member Functions

virtual void addDictator ()=0
 Add the PorousFlowDictator object. 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 addVolumetricStrainMaterial (const std::vector< VariableName > &displacements, bool consistent_with_displaced_mesh)
 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)
 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)
 Adds a brine fluid Material. 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...
 

Protected Attributes

std::vector< std::string > _objects_to_add
 List of Kernels, AuxKernels, Materials, etc, to be added. More...
 
const std::string _dictator_name
 The name of the PorousFlowDictator object to be added. 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< NonlinearVariableName > & _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...
 
Moose::CoordinateSystemType _coord_system
 Coordinate system of the simulation (eg RZ, XYZ, etc) More...
 
DependencyResolver< std::string > _deps
 All dependencies of kernels, auxkernels, materials, etc, are stored in _dependencies. More...
 

Detailed Description

Base class for PorousFlow actions.

This act() method simply defines the name of the PorousFlowDictator. However, this class also contains a number of utility functions that may be used by derived classes

Definition at line 27 of file PorousFlowActionBase.h.

Constructor & Destructor Documentation

◆ PorousFlowActionBase()

PorousFlowActionBase::PorousFlowActionBase ( const InputParameters &  params)

Definition at line 69 of file PorousFlowActionBase.C.

70  : Action(params),
73  _dictator_name(getParam<std::string>("dictator_name")),
74  _num_aqueous_equilibrium(getParam<unsigned int>("number_aqueous_equilibrium")),
75  _num_aqueous_kinetic(getParam<unsigned int>("number_aqueous_kinetic")),
76  _gravity(getParam<RealVectorValue>("gravity")),
77  _mass_fraction_vars(getParam<std::vector<VariableName>>("mass_fraction_vars")),
79  _temperature_var(getParam<std::vector<VariableName>>("temperature")),
80  _displacements(getParam<std::vector<NonlinearVariableName>>("displacements")),
81  _ndisp(_displacements.size()),
83 {
84  // convert vector of NonlinearVariableName to vector of VariableName
85  for (unsigned int i = 0; i < _ndisp; ++i)
87 }
const std::vector< VariableName > & _mass_fraction_vars
Name of the mass-fraction variables (if any)
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 unsigned _ndisp
Number of displacement variables supplied.
std::vector< std::string > _objects_to_add
List of Kernels, AuxKernels, Materials, etc, to be added.
const RealVectorValue _gravity
Gravity.
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.
const std::vector< NonlinearVariableName > & _displacements
Displacement NonlinearVariable names (if any)
const unsigned int _num_aqueous_equilibrium
Number of aqueous-equilibrium secondary species.

Member Function Documentation

◆ act()

void PorousFlowActionBase::act ( )
overridevirtual

Reimplemented in PorousFlowBasicTHM, PorousFlowUnsaturated, PorousFlowFullySaturated, and PorousFlowSinglePhaseBase.

Definition at line 90 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

91 {
92  const auto & all_subdomains = _problem->mesh().meshSubdomains();
93  if (all_subdomains.empty())
94  mooseError("No subdomains found");
95  _coord_system = _problem->getCoordSystem(*all_subdomains.begin());
96  for (const auto & subdomain : all_subdomains)
97  if (_problem->getCoordSystem(subdomain) != _coord_system)
98  mooseError(
99  "The PorousFlow Actions require all subdomains to have the same coordinate system.");
100 
101  if (_current_task == "add_user_object")
102  addDictator();
103 }
Moose::CoordinateSystemType _coord_system
Coordinate system of the simulation (eg RZ, XYZ, etc)
virtual void addDictator()=0
Add the PorousFlowDictator object.

◆ addBrineMaterial()

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

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

Definition at line 384 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

390 {
391  if (_current_task == "add_material")
392  {
393  std::string material_type = "PorousFlowBrine";
394  InputParameters params = _factory.getValidParams(material_type);
395 
396  params.set<std::vector<VariableName>>("xnacl") = {nacl_brine};
397  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
398  params.set<unsigned int>("phase") = phase;
399  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
400  params.set<bool>("compute_internal_energy") = compute_internal_energy;
401  params.set<bool>("compute_enthalpy") = compute_enthalpy;
402 
403  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
404  if (at_nodes)
405  material_name = "PorousFlowActionBase_FluidProperties";
406 
407  params.set<bool>("at_nodes") = at_nodes;
408  _problem->addMaterial(material_type, material_name, params);
409  }
410 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addCapillaryPressureVG()

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

Adds a van Genuchten capillary pressure UserObject.

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

Definition at line 462 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::act().

463 {
464  if (_current_task == "add_user_object")
465  {
466  std::string userobject_type = "PorousFlowCapillaryPressureVG";
467  InputParameters params = _factory.getValidParams(userobject_type);
468  params.set<Real>("m") = m;
469  params.set<Real>("alpha") = alpha;
470  _problem->addUserObject(userobject_type, userobject_name, params);
471  }
472 }

◆ addDarcyAux()

void PorousFlowActionBase::addDarcyAux ( const RealVectorValue &  gravity)
protected

Add AuxVariables and AuxKernels to calculate Darcy velocity.

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

Definition at line 130 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

131 {
132  if (_current_task == "add_aux_variable")
133  {
134  _problem->addAuxVariable("darcy_vel_x",
135  FEType(Utility::string_to_enum<Order>("CONSTANT"),
136  Utility::string_to_enum<FEFamily>("MONOMIAL")));
137  _problem->addAuxVariable("darcy_vel_y",
138  FEType(Utility::string_to_enum<Order>("CONSTANT"),
139  Utility::string_to_enum<FEFamily>("MONOMIAL")));
140  _problem->addAuxVariable("darcy_vel_z",
141  FEType(Utility::string_to_enum<Order>("CONSTANT"),
142  Utility::string_to_enum<FEFamily>("MONOMIAL")));
143  }
144 
145  if (_current_task == "add_aux_kernel")
146  {
147  std::string aux_kernel_type = "PorousFlowDarcyVelocityComponent";
148  InputParameters params = _factory.getValidParams(aux_kernel_type);
149 
150  params.set<RealVectorValue>("gravity") = gravity;
151  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
152  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
153 
154  std::string aux_kernel_name = "PorousFlowActionBase_Darcy_x_Aux";
155  params.set<MooseEnum>("component") = "x";
156  params.set<AuxVariableName>("variable") = "darcy_vel_x";
157  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
158 
159  aux_kernel_name = "PorousFlowActionBase_Darcy_y_Aux";
160  params.set<MooseEnum>("component") = "y";
161  params.set<AuxVariableName>("variable") = "darcy_vel_y";
162  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
163 
164  aux_kernel_name = "PorousFlowActionBase_Darcy_z_Aux";
165  params.set<MooseEnum>("component") = "z";
166  params.set<AuxVariableName>("variable") = "darcy_vel_z";
167  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
168  }
169 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addDictator()

virtual void PorousFlowActionBase::addDictator ( )
protectedpure virtual

Add the PorousFlowDictator object.

Implemented in PorousFlowSinglePhaseBase.

Referenced by act().

◆ addEffectiveFluidPressureMaterial()

void PorousFlowActionBase::addEffectiveFluidPressureMaterial ( bool  at_nodes)
protected

Adds a nodal and a quadpoint effective fluid pressure material.

Parameters
at_nodesAdd nodal effective fluid pressure material

Definition at line 319 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

320 {
321  if (_current_task == "add_material")
322  {
323  std::string material_type = "PorousFlowEffectiveFluidPressure";
324  InputParameters params = _factory.getValidParams(material_type);
325 
326  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
327 
328  std::string material_name = "PorousFlowUnsaturated_EffectiveFluidPressure_qp";
329  if (at_nodes)
330  material_name = "PorousFlowUnsaturated_EffectiveFluidPressure";
331 
332  params.set<bool>("at_nodes") = at_nodes;
333  _problem->addMaterial(material_type, material_name, params);
334  }
335 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addMassFractionMaterial()

void PorousFlowActionBase::addMassFractionMaterial ( bool  at_nodes)
protected

Adds a nodal and a quadpoint MassFraction material.

Parameters
at_nodesAdd nodal mass-fraction material

Definition at line 294 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

295 {
296  if (_current_task == "add_material")
297  {
298  if (!(parameters().hasDefaultCoupledValue("mass_fraction_vars") ||
299  parameters().hasCoupledValue("mass_fraction_vars")))
300  mooseError("Attempt to add a PorousFlowMassFraction material without setting the "
301  "mass_fraction_vars");
302 
303  std::string material_type = "PorousFlowMassFraction";
304  InputParameters params = _factory.getValidParams(material_type);
305 
306  params.applySpecificParameters(parameters(), {"mass_fraction_vars"});
307  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
308 
309  std::string material_name = "PorousFlowActionBase_MassFraction_qp";
310  if (at_nodes)
311  material_name = "PorousFlowActionBase_MassFraction";
312 
313  params.set<bool>("at_nodes") = at_nodes;
314  _problem->addMaterial(material_type, material_name, params);
315  }
316 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addRelativePermeabilityCorey()

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

Adds a relative-permeability Material of the Corey variety.

Parameters
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 413 of file PorousFlowActionBase.C.

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

416 {
417  if (_current_task == "add_material")
418  {
419  std::string material_type = "PorousFlowRelativePermeabilityCorey";
420  InputParameters params = _factory.getValidParams(material_type);
421 
422  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
423  params.set<Real>("n") = n;
424  params.set<unsigned int>("phase") = phase;
425  params.set<Real>("s_res") = s_res;
426  params.set<Real>("sum_s_res") = sum_s_res;
427 
428  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
429  if (at_nodes)
430  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
431 
432  params.set<bool>("at_nodes") = at_nodes;
433  _problem->addMaterial(material_type, material_name, params);
434  }
435 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addRelativePermeabilityFLAC()

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

Adds a relative-permeability Material of the FLAC variety.

Parameters
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 438 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::act().

440 {
441  if (_current_task == "add_material")
442  {
443  std::string material_type = "PorousFlowRelativePermeabilityFLAC";
444  InputParameters params = _factory.getValidParams(material_type);
445 
446  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
447  params.set<Real>("m") = m;
448  params.set<unsigned int>("phase") = phase;
449  params.set<Real>("s_res") = s_res;
450  params.set<Real>("sum_s_res") = sum_s_res;
451 
452  std::string material_name = "PorousFlowActionBase_RelativePermeability_qp";
453  if (at_nodes)
454  material_name = "PorousFlowActionBase_RelativePermeability_nodal";
455 
456  params.set<bool>("at_nodes") = at_nodes;
457  _problem->addMaterial(material_type, material_name, params);
458  }
459 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addSaturationAux()

void PorousFlowActionBase::addSaturationAux ( unsigned  phase)
protected

Add an AuxVariable and AuxKernel to calculate saturation.

Parameters
phaseSaturation for this fluid phase

Definition at line 106 of file PorousFlowActionBase.C.

Referenced by PorousFlowUnsaturated::act().

107 {
108  std::string phase_str = Moose::stringify(phase);
109 
110  if (_current_task == "add_aux_variable")
111  _problem->addAuxVariable("saturation" + phase_str,
112  FEType(Utility::string_to_enum<Order>("CONSTANT"),
113  Utility::string_to_enum<FEFamily>("MONOMIAL")));
114 
115  if (_current_task == "add_aux_kernel")
116  {
117  std::string aux_kernel_type = "MaterialStdVectorAux";
118  InputParameters params = _factory.getValidParams(aux_kernel_type);
119 
120  std::string aux_kernel_name = "PorousFlowActionBase_SaturationAux" + phase_str;
121  params.set<MaterialPropertyName>("property") = "PorousFlow_saturation_qp";
122  params.set<unsigned>("index") = phase;
123  params.set<AuxVariableName>("variable") = "saturation" + phase_str;
124  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
125  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
126  }
127 }

◆ addSingleComponentFluidMaterial()

void PorousFlowActionBase::addSingleComponentFluidMaterial ( bool  at_nodes,
unsigned  phase,
bool  compute_density_and_viscosity,
bool  compute_internal_energy,
bool  compute_enthalpy,
const UserObjectName &  fp 
)
protected

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

Definition at line 355 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

361 {
362  if (_current_task == "add_material")
363  {
364  std::string material_type = "PorousFlowSingleComponentFluid";
365  InputParameters params = _factory.getValidParams(material_type);
366 
367  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
368  params.set<unsigned int>("phase") = phase;
369  params.set<bool>("compute_density_and_viscosity") = compute_density_and_viscosity;
370  params.set<bool>("compute_internal_energy") = compute_internal_energy;
371  params.set<bool>("compute_enthalpy") = compute_enthalpy;
372  params.set<UserObjectName>("fp") = fp;
373 
374  std::string material_name = "PorousFlowActionBase_FluidProperties_qp";
375  if (at_nodes)
376  material_name = "PorousFlowActionBase_FluidProperties";
377 
378  params.set<bool>("at_nodes") = at_nodes;
379  _problem->addMaterial(material_type, material_name, params);
380  }
381 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addStressAux()

void PorousFlowActionBase::addStressAux ( )
protected

Add AuxVariables and AuxKernels to compute effective stress.

Definition at line 172 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

173 {
174  if (_current_task == "add_aux_variable")
175  {
176  _problem->addAuxVariable("stress_xx",
177  FEType(Utility::string_to_enum<Order>("CONSTANT"),
178  Utility::string_to_enum<FEFamily>("MONOMIAL")));
179  _problem->addAuxVariable("stress_xy",
180  FEType(Utility::string_to_enum<Order>("CONSTANT"),
181  Utility::string_to_enum<FEFamily>("MONOMIAL")));
182  _problem->addAuxVariable("stress_xz",
183  FEType(Utility::string_to_enum<Order>("CONSTANT"),
184  Utility::string_to_enum<FEFamily>("MONOMIAL")));
185  _problem->addAuxVariable("stress_yx",
186  FEType(Utility::string_to_enum<Order>("CONSTANT"),
187  Utility::string_to_enum<FEFamily>("MONOMIAL")));
188  _problem->addAuxVariable("stress_yy",
189  FEType(Utility::string_to_enum<Order>("CONSTANT"),
190  Utility::string_to_enum<FEFamily>("MONOMIAL")));
191  _problem->addAuxVariable("stress_yz",
192  FEType(Utility::string_to_enum<Order>("CONSTANT"),
193  Utility::string_to_enum<FEFamily>("MONOMIAL")));
194  _problem->addAuxVariable("stress_zx",
195  FEType(Utility::string_to_enum<Order>("CONSTANT"),
196  Utility::string_to_enum<FEFamily>("MONOMIAL")));
197  _problem->addAuxVariable("stress_zy",
198  FEType(Utility::string_to_enum<Order>("CONSTANT"),
199  Utility::string_to_enum<FEFamily>("MONOMIAL")));
200  _problem->addAuxVariable("stress_zz",
201  FEType(Utility::string_to_enum<Order>("CONSTANT"),
202  Utility::string_to_enum<FEFamily>("MONOMIAL")));
203  }
204 
205  if (_current_task == "add_aux_kernel")
206  {
207  std::string aux_kernel_type = "RankTwoAux";
208  InputParameters params = _factory.getValidParams(aux_kernel_type);
209 
210  params.set<MaterialPropertyName>("rank_two_tensor") = "stress";
211  params.set<ExecFlagEnum>("execute_on") = EXEC_TIMESTEP_END;
212 
213  std::string aux_kernel_name = "PorousFlowAction_stress_xx";
214  params.set<AuxVariableName>("variable") = "stress_xx";
215  params.set<unsigned>("index_i") = 0;
216  params.set<unsigned>("index_j") = 0;
217  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
218 
219  aux_kernel_name = "PorousFlowAction_stress_xy";
220  params.set<AuxVariableName>("variable") = "stress_xy";
221  params.set<unsigned>("index_i") = 0;
222  params.set<unsigned>("index_j") = 1;
223  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
224 
225  aux_kernel_name = "PorousFlowAction_stress_xz";
226  params.set<AuxVariableName>("variable") = "stress_xz";
227  params.set<unsigned>("index_i") = 0;
228  params.set<unsigned>("index_j") = 2;
229  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
230 
231  aux_kernel_name = "PorousFlowAction_stress_yx";
232  params.set<AuxVariableName>("variable") = "stress_yx";
233  params.set<unsigned>("index_i") = 1;
234  params.set<unsigned>("index_j") = 0;
235  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
236 
237  aux_kernel_name = "PorousFlowAction_stress_yy";
238  params.set<AuxVariableName>("variable") = "stress_yy";
239  params.set<unsigned>("index_i") = 1;
240  params.set<unsigned>("index_j") = 1;
241  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
242 
243  aux_kernel_name = "PorousFlowAction_stress_yz";
244  params.set<AuxVariableName>("variable") = "stress_yz";
245  params.set<unsigned>("index_i") = 1;
246  params.set<unsigned>("index_j") = 2;
247  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
248 
249  aux_kernel_name = "PorousFlowAction_stress_zx";
250  params.set<AuxVariableName>("variable") = "stress_zx";
251  params.set<unsigned>("index_i") = 2;
252  params.set<unsigned>("index_j") = 0;
253  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
254 
255  aux_kernel_name = "PorousFlowAction_stress_zy";
256  params.set<AuxVariableName>("variable") = "stress_zy";
257  params.set<unsigned>("index_i") = 2;
258  params.set<unsigned>("index_j") = 1;
259  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
260 
261  aux_kernel_name = "PorousFlowAction_stress_zz";
262  params.set<AuxVariableName>("variable") = "stress_zz";
263  params.set<unsigned>("index_i") = 2;
264  params.set<unsigned>("index_j") = 2;
265  _problem->addAuxKernel(aux_kernel_type, aux_kernel_name, params);
266  }
267 }

◆ addTemperatureMaterial()

void PorousFlowActionBase::addTemperatureMaterial ( bool  at_nodes)
protected

Adds a nodal and a quadpoint Temperature material.

Parameters
at_nodesAdd nodal temperature Material

Definition at line 270 of file PorousFlowActionBase.C.

Referenced by PorousFlowSinglePhaseBase::act().

271 {
272  if (_current_task == "add_material")
273  {
274  if (!parameters().hasDefaultCoupledValue("temperature"))
275  mooseError(
276  "Attempt to add a PorousFlowTemperature material without setting a temperature variable");
277 
278  std::string material_type = "PorousFlowTemperature";
279  InputParameters params = _factory.getValidParams(material_type);
280 
281  params.applySpecificParameters(parameters(), {"temperature"});
282  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
283 
284  std::string material_name = "PorousFlowActionBase_Temperature_qp";
285  if (at_nodes)
286  material_name = "PorousFlowActionBase_Temperature";
287 
288  params.set<bool>("at_nodes") = at_nodes;
289  _problem->addMaterial(material_type, material_name, params);
290  }
291 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

◆ addVolumetricStrainMaterial()

void PorousFlowActionBase::addVolumetricStrainMaterial ( const std::vector< VariableName > &  displacements,
bool  consistent_with_displaced_mesh 
)
protected

Adds a quadpoint volumetric strain material.

Parameters
displacementsthe names of the displacement variables
consistent_with_displaced_meshThe volumetric strain should be consistent with the displaced mesh

Definition at line 338 of file PorousFlowActionBase.C.

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

340 {
341  if (_current_task == "add_material")
342  {
343  std::string material_type = "PorousFlowVolumetricStrain";
344  InputParameters params = _factory.getValidParams(material_type);
345 
346  std::string material_name = "PorousFlowActionBase_VolumetricStrain";
347  params.set<UserObjectName>("PorousFlowDictator") = _dictator_name;
348  params.set<std::vector<VariableName>>("displacements") = displacements;
349  params.set<bool>("consistent_with_displaced_mesh") = consistent_with_displaced_mesh;
350  _problem->addMaterial(material_type, material_name, params);
351  }
352 }
const std::string _dictator_name
The name of the PorousFlowDictator object to be added.

Member Data Documentation

◆ _coord_system

Moose::CoordinateSystemType PorousFlowActionBase::_coord_system
protected

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

Definition at line 73 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::act(), and act().

◆ _coupled_displacements

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

◆ _deps

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

◆ _dictator_name

const std::string PorousFlowActionBase::_dictator_name
protected

◆ _displacements

const std::vector<NonlinearVariableName>& PorousFlowActionBase::_displacements
protected

Displacement NonlinearVariable names (if any)

Definition at line 64 of file PorousFlowActionBase.h.

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

◆ _gravity

const RealVectorValue PorousFlowActionBase::_gravity
protected

◆ _mass_fraction_vars

const std::vector<VariableName>& PorousFlowActionBase::_mass_fraction_vars
protected

◆ _ndisp

const unsigned PorousFlowActionBase::_ndisp
protected

Number of displacement variables supplied.

Definition at line 67 of file PorousFlowActionBase.h.

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

◆ _num_aqueous_equilibrium

const unsigned int PorousFlowActionBase::_num_aqueous_equilibrium
protected

Number of aqueous-equilibrium secondary species.

Definition at line 46 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addDictator().

◆ _num_aqueous_kinetic

const unsigned int PorousFlowActionBase::_num_aqueous_kinetic
protected

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

Definition at line 49 of file PorousFlowActionBase.h.

Referenced by PorousFlowSinglePhaseBase::addDictator().

◆ _num_mass_fraction_vars

const unsigned PorousFlowActionBase::_num_mass_fraction_vars
protected

◆ _objects_to_add

std::vector<std::string> PorousFlowActionBase::_objects_to_add
protected

List of Kernels, AuxKernels, Materials, etc, to be added.

This list will be used to determine what Materials need to be added. Actions may add or remove things from this list

Definition at line 40 of file PorousFlowActionBase.h.

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

◆ _temperature_var

const std::vector<VariableName>& PorousFlowActionBase::_temperature_var
protected

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