17 {
"p_sat", 1}, {
"x_sat_ncg_from_p_T", 2}};
24 "Computes a property from a TwoPhaseNCGPartialPressureFluidProperties object.");
27 "The TwoPhaseNCGPartialPressureFluidProperties object");
29 MooseEnum property_call(
"p_sat x_sat_ncg_from_p_T");
32 params.
addParam<FunctionName>(
"arg1", 0,
"The first argument for the property call, if any");
33 params.
addParam<FunctionName>(
"arg2", 0,
"The second argument for the property call, if any");
42 _property_call(getParam<
MooseEnum>(
"property_call")),
43 _arg1_fn(getFunction(
"arg1")),
44 _arg2_fn(getFunction(
"arg2"))
49 bool args_are_valid =
true;
50 const unsigned int n_arg_params = 2;
52 std::vector<std::string> expected_args, provided_args;
53 for (
unsigned int i = 0; i < n_arg_params; i++)
55 const std::string arg_param =
"arg" + std::to_string(i + 1);
56 const std::string arg_str =
"'" + arg_param +
"'";
58 const bool arg_is_expected = i + 1 <= n_expected_args;
60 expected_args.push_back(arg_str);
64 provided_args.push_back(arg_str);
66 args_are_valid =
false;
71 args_are_valid =
false;
78 "' expects the parameter(s) {",
80 "} to be provided, but the provided argument(s) were {",
85 mooseError(
"Property call in MooseEnum but not _n_expected_args.");
91 _fp = &getUserObject<TwoPhaseNCGPartialPressureFluidProperties>(
"fluid_properties");
TwoPhaseNCGPartialPressureFunction(const InputParameters ¶meters)
const TwoPhaseNCGPartialPressureFluidProperties * _fp
Fluid properties object.
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
static InputParameters validParams()
Real x_sat_ncg_from_p_T(Real p, Real T) const
Computes the NCG mass fraction with the CG saturated at the given temperature.
static const std::map< std::string, unsigned int > _n_expected_args
Number of expected arguments for each property call.
virtual Real value(Real t, const Point &p) const override
virtual Real p_sat(Real T) const override
Computes the saturation pressure at a temperature.
registerMooseObject("FluidPropertiesApp", TwoPhaseNCGPartialPressureFunction)
const MooseEnum & _property_call
Property call.
const Function & _arg1_fn
Argument 1 function.
bool isParamSetByUser(const std::string &nm) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Function & _arg2_fn
Argument 2 function.
void mooseError(Args &&... args) const
Computes a property from a TwoPhaseNCGPartialPressureFluidProperties object.
virtual void initialSetup() override
virtual Real value(Real t, const Point &p) const
static InputParameters validParams()