Ejemplo n.º 1
0
TwoPhaseFluidProperties::TwoPhaseFluidProperties(const InputParameters & parameters)
  : FluidProperties(parameters),

    _liquid_name(isParamValid("fp_liquid") ? getParam<UserObjectName>("fp_liquid")
                                           : UserObjectName(name() + ":liquid")),
    _vapor_name(isParamValid("fp_vapor") ? getParam<UserObjectName>("fp_vapor")
                                         : UserObjectName(name() + ":vapor"))
{
  // If the single-phase fluid properties user object names are not provided, it
  // is implied that these objects will be created by a derived class. In this
  // case, we need to check that these user objects do not already exist.
  if (!isParamValid("fp_liquid"))
    if (_fe_problem.hasUserObject(_liquid_name))
      paramError("fp_liquid",
                 "The two-phase fluid properties object '" + name() + "' is ",
                 "trying to create a single-phase fluid properties object with ",
                 "name '",
                 _liquid_name,
                 "', but a single-phase fluid properties ",
                 "object with this name already exists.");
  if (!isParamValid("fp_vapor"))
    if (_fe_problem.hasUserObject(_vapor_name))
      paramError("fp_vapor",
                 "The two-phase fluid properties object '" + name() + "' is ",
                 "trying to create a single-phase fluid properties object with ",
                 "name '",
                 _vapor_name,
                 "', but a single-phase fluid properties ",
                 "object with this name already exists.");
}
Ejemplo n.º 2
0
TwoPhaseNCGFluidProperties::TwoPhaseNCGFluidProperties(const InputParameters & parameters)
  : TwoPhaseFluidProperties(parameters),
    _2phase_name(isParamValid("fp_2phase") ? getParam<UserObjectName>("fp_2phase")
                                           : UserObjectName(name() + ":2phase")),
    _vapor_mixture_name(name() + ":vapor_mixture")
{
  // check that the user has not already created user objects of the same name
  if (_tid == 0 && _fe_problem.hasUserObject(_vapor_mixture_name))
    mooseError(name(), ": A user object with the name '", _vapor_mixture_name, "' already exists.");
}