25 "Adds PorousFlowJoiner materials as required for each phase-dependent property");
30 :
Action(params), _already_joined()
43 std::vector<UserObject *> userobjects;
47 .condition<AttribThread>(0)
48 .queryInto(userobjects);
49 for (
auto & userobject : userobjects)
50 if (dynamic_cast<PorousFlowDictator *>(userobject))
54 auto materials =
_problem->getMaterialWarehouse().getObjects();
55 for (
auto & mat : materials)
62 const std::string pf_material_type = params.
get<std::string>(
"pf_material_type");
66 (pf_material_type ==
"fluid_properties" || pf_material_type ==
"relative_permeability"))
70 std::set<SubdomainName> unique_blocks;
71 for (
auto & mat2 :
_problem->getMaterialWarehouse().getObjects())
75 params2.
get<std::string>(
"pf_material_type") == pf_material_type)
84 const std::vector<SubdomainName> & bl =
85 params2.
get<std::vector<SubdomainName>>(
"block");
86 std::copy(bl.begin(), bl.end(), std::inserter(unique_blocks, unique_blocks.end()));
89 _blocks.assign(unique_blocks.begin(), unique_blocks.end());
93 const bool at_nodes = params.
get<
bool>(
"at_nodes");
96 if (pf_material_type ==
"fluid_properties")
99 const bool is_ad = params.
get<
bool>(
"is_ad");
102 if (params.
get<
unsigned int>(
"phase") == 0)
105 if (params.
get<
bool>(
"compute_density_and_viscosity"))
111 "PorousFlow_fluid_phase_density_nodal",
112 "PorousFlow_density_nodal_all");
115 "PorousFlow_viscosity_nodal",
116 "PorousFlow_viscosity_nodal_all");
122 "PorousFlow_fluid_phase_density_qp",
123 "PorousFlow_density_qp_all");
125 at_nodes, is_ad,
"PorousFlow_viscosity_qp",
"PorousFlow_viscosity_qp_all");
130 if (params.
get<
bool>(
"compute_enthalpy"))
135 "PorousFlow_fluid_phase_enthalpy_nodal",
136 "PorousFlow_enthalpy_nodal_all");
140 "PorousFlow_fluid_phase_enthalpy_qp",
141 "PorousFlow_enthalpy_qp_all");
145 if (params.
get<
bool>(
"compute_internal_energy"))
150 "PorousFlow_fluid_phase_internal_energy_nodal",
151 "PorousFlow_internal_energy_nodal_all");
155 "PorousFlow_fluid_phase_internal_energy_qp",
156 "PorousFlow_internal_energy_qp_all");
162 if (pf_material_type ==
"relative_permeability")
165 const bool is_ad = params.
get<
bool>(
"is_ad");
168 if (params.
get<
unsigned int>(
"phase") == 0)
173 "PorousFlow_relative_permeability_nodal",
174 "PorousFlow_relative_permeability_nodal_all");
178 "PorousFlow_relative_permeability_qp",
179 "PorousFlow_relative_permeability_qp_all");
190 const std::string & material_property,
191 const std::string & output_name)
193 bool is_joined =
false;
205 std::string material_type;
206 is_ad ? material_type =
"ADPorousFlowJoiner" : material_type =
"PorousFlowJoiner";
209 params.
set<
bool>(
"at_nodes") = at_nodes;
210 params.
set<std::string>(
"material_property") = material_property;
212 params.
set<std::vector<SubdomainName>>(
"block") =
_blocks;
213 _problem->addMaterial(material_type, output_name, params);
226 for (
auto & action : actions)
234 mooseDeprecated(
"PorousFlowJoiner materials are no longer required in the input " 235 "file.\nPlease remove all PorousFlowJoiner materials from this input file to " 236 "get rid of this warning");
238 const std::string joiner_property =
242 if (joiner_property == property)
void mooseDeprecated(Args &&... args) const
InputParameters getValidParams(const std::string &name) const
virtual void act() override
std::string _dictator_name
Name of the PorousFlowDictator.
registerMooseAction("PorousFlowApp", PorousFlowAddMaterialJoiner, "add_joiners")
static InputParameters validParams()
InputParameters & getObjectParams()
PorousFlowAddMaterialJoiner(const InputParameters ¶ms)
const std::string & _current_task
std::vector< SubdomainName > _blocks
if _block_restricted == true, then these are the blocks that the Joiner will be restricted to ...
void addJoiner(bool at_nodes, bool is_ad, const std::string &material_property, const std::string &output_name)
Adds a PorousFlowJoiner for the given material property.
static InputParameters validParams()
const std::string & getMooseObjectType() const
Action to programatically add PorousFlowJoiner materials without having to manually enter them in the...
bool hasJoiner(std::string property)
Helper method to determine if a PorousFLowJoiner material is already present in the input file for th...
std::shared_ptr< FEProblemBase > & _problem
bool _block_restricted
whether the Material that is currently being Joined is block-restricted
std::vector< const T *> getActions()
std::vector< std::string > _already_joined
Vector of already joined materials (to avoid joining them again)