Action to programatically add PorousFlowJoiner materials without having to manually enter them in the input file.
More...
#include <PorousFlowAddMaterialJoiner.h>
|
void | addJoiner (bool at_nodes, const std::string &material_property, const std::string &output_name) |
| Adds a PorousFlowJoiner for the given material property. More...
|
|
bool | hasJoiner (std::string property) |
| Helper method to determine if a PorousFLowJoiner material is already present in the input file for the given material property. More...
|
|
Action to programatically add PorousFlowJoiner materials without having to manually enter them in the input file.
Definition at line 23 of file PorousFlowAddMaterialJoiner.h.
◆ PorousFlowAddMaterialJoiner()
PorousFlowAddMaterialJoiner::PorousFlowAddMaterialJoiner |
( |
const InputParameters & |
params | ) |
|
◆ act()
void PorousFlowAddMaterialJoiner::act |
( |
| ) |
|
|
overridevirtual |
Definition at line 36 of file PorousFlowAddMaterialJoiner.C.
41 if (_current_task ==
"add_joiners")
44 std::vector<UserObject *> userobjects;
45 _problem->theWarehouse()
47 .condition<AttribSystem>(
"UserObject")
48 .condition<AttribThread>(0)
49 .queryInto(userobjects);
50 for (
auto & userobject : userobjects)
51 if (dynamic_cast<PorousFlowDictator *>(userobject))
55 auto materials = _problem->getMaterialWarehouse().getObjects();
56 for (
auto & mat : materials)
58 const InputParameters & params = mat->parameters();
61 if (params.isParamValid(
"pf_material_type"))
63 const std::string pf_material_type = params.get<std::string>(
"pf_material_type");
66 const bool at_nodes = params.get<
bool>(
"at_nodes");
69 if (pf_material_type ==
"fluid_properties")
72 if (params.get<
unsigned int>(
"phase") == 0)
75 if (params.get<
bool>(
"compute_density_and_viscosity"))
80 "PorousFlow_fluid_phase_density_nodal",
81 "PorousFlow_density_nodal_all");
82 addJoiner(at_nodes,
"PorousFlow_viscosity_nodal",
"PorousFlow_viscosity_nodal_all");
87 at_nodes,
"PorousFlow_fluid_phase_density_qp",
"PorousFlow_density_qp_all");
88 addJoiner(at_nodes,
"PorousFlow_viscosity_qp",
"PorousFlow_viscosity_qp_all");
93 if (params.get<
bool>(
"compute_enthalpy"))
97 "PorousFlow_fluid_phase_enthalpy_nodal",
98 "PorousFlow_enthalpy_nodal_all");
101 at_nodes,
"PorousFlow_fluid_phase_enthalpy_qp",
"PorousFlow_enthalpy_qp_all");
105 if (params.get<
bool>(
"compute_internal_energy"))
109 "PorousFlow_fluid_phase_internal_energy_nodal",
110 "PorousFlow_internal_energy_nodal_all");
113 "PorousFlow_fluid_phase_internal_energy_qp",
114 "PorousFlow_internal_energy_qp_all");
120 if (pf_material_type ==
"relative_permeability")
123 if (params.get<
unsigned int>(
"phase") == 0)
127 "PorousFlow_relative_permeability_nodal",
128 "PorousFlow_relative_permeability_nodal_all");
131 "PorousFlow_relative_permeability_qp",
132 "PorousFlow_relative_permeability_qp_all");
◆ addJoiner()
void PorousFlowAddMaterialJoiner::addJoiner |
( |
bool |
at_nodes, |
|
|
const std::string & |
material_property, |
|
|
const std::string & |
output_name |
|
) |
| |
|
protected |
Adds a PorousFlowJoiner for the given material property.
- Parameters
-
at_nodes | if true: produce a nodal material, otherwise: produce a qp material |
material_property | join this PorousFlow material property |
output_name | The unique name given to this PorousFlowJoiner in the input file |
Definition at line 141 of file PorousFlowAddMaterialJoiner.C.
145 bool is_joined =
false;
157 std::string material_type =
"PorousFlowJoiner";
158 InputParameters params = _factory.getValidParams(material_type);
159 params.set<UserObjectName>(
"PorousFlowDictator") =
_dictator_name;
160 params.set<
bool>(
"at_nodes") = at_nodes;
161 params.set<std::string>(
"material_property") = material_property;
162 _problem->addMaterial(material_type, output_name, params);
Referenced by act().
◆ hasJoiner()
bool PorousFlowAddMaterialJoiner::hasJoiner |
( |
std::string |
property | ) |
|
|
protected |
Helper method to determine if a PorousFLowJoiner material is already present in the input file for the given material property.
- Parameters
-
property | the material property to check |
- Returns
- true if a PorousFLowJoiner is already present for property, false otherwise
Definition at line 170 of file PorousFlowAddMaterialJoiner.C.
173 auto actions = _awh.getActions<AddMaterialAction>();
175 for (
auto & action : actions)
177 AddMaterialAction * material = const_cast<AddMaterialAction *>(action);
179 if (material->getMooseObjectType() ==
"PorousFlowJoiner")
183 mooseDeprecated(
"PorousFlowJoiner materials are no longer required in the input "
184 "file.\nPlease remove all PorousFlowJoiner materials from this input file to "
185 "get rid of this warning");
187 const std::string joiner_property =
188 material->getObjectParams().get<std::string>(
"material_property");
191 if (joiner_property == property)
Referenced by addJoiner().
◆ _already_joined
std::vector<std::string> PorousFlowAddMaterialJoiner::_already_joined |
|
protected |
◆ _dictator_name
std::string PorousFlowAddMaterialJoiner::_dictator_name |
|
protected |
The documentation for this class was generated from the following files: