https://mooseframework.inl.gov
TestTwoPhaseNCGFluidProperties.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
12 registerMooseObject("FluidPropertiesTestApp", TestTwoPhaseNCGFluidProperties);
13 
16 {
18 
19  params.addClassDescription("Test 2-phase NCG fluid properties");
20 
21  params.addRequiredParam<std::vector<UserObjectName>>(
22  "fp_ncgs", "Name of fluid properties user object(s) for non-condensable gases");
23 
24  return params;
25 }
26 
28  : TwoPhaseNCGFluidProperties(parameters)
29 {
30  // create liquid and vapor fluid properties
31  if (_tid == 0)
32  {
33  {
34  const std::string class_name = "IdealGasFluidProperties";
35  InputParameters params = _app.getFactory().getValidParams(class_name);
36  params.set<Real>("gamma") = 1.4;
37  params.set<Real>("molar_mass") = 0.030794295555555556;
38  _fe_problem.addUserObject(class_name, "test_fp_liquid", params);
39  }
40  {
41  const std::string class_name = "IdealGasFluidProperties";
42  InputParameters params = _app.getFactory().getValidParams(class_name);
43  params.set<Real>("gamma") = 1.1;
44  params.set<Real>("molar_mass") = 0.027714866;
45  params.set<Real>("T_c") = 100;
46  params.set<Real>("rho_c") = 300;
47  _fe_problem.addUserObject(class_name, "test_fp_vapor", params);
48  }
49  }
50 
51  // create 2-phase fluid properties
52  if (_tid == 0)
53  {
54  const std::string class_name = "TestTwoPhaseFluidProperties";
55  InputParameters params = _app.getFactory().getValidParams(class_name);
56  params.set<UserObjectName>("fp_liquid") = "test_fp_liquid";
57  params.set<UserObjectName>("fp_vapor") = "test_fp_vapor";
58  _fe_problem.addUserObject(class_name, _2phase_name, params);
59  }
61 
62  // create vapor mixture fluid properties
63  if (_tid == 0)
64  {
65  const std::string class_name = "IdealRealGasMixtureFluidProperties";
66  InputParameters params = _app.getFactory().getValidParams(class_name);
67  params.set<UserObjectName>("fp_primary") = getVaporName();
68  params.set<std::vector<UserObjectName>>("fp_secondary") =
69  getParam<std::vector<UserObjectName>>("fp_ncgs");
70  _fe_problem.addUserObject(class_name, _vapor_mixture_name, params);
71  }
74 }
Base class for fluid properties of vapor mixtures.
const UserObjectName _2phase_name
Two-phase fluid properties user object name.
T & getUserObject(const std::string &name, unsigned int tid=0) const
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present...
T & set(const std::string &name, bool quiet_mode=false)
TestTwoPhaseNCGFluidProperties(const InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
const UserObjectName & getVaporName() const override
Returns the name of the vapor single-phase fluid properties object.
registerMooseObject("FluidPropertiesTestApp", TestTwoPhaseNCGFluidProperties)
void addRequiredParam(const std::string &name, const std::string &doc_string)
Factory & getFactory()
static InputParameters validParams()
Base class for fluid properties used with two-phase flow.
const T & getParam(const std::string &name) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
const VaporMixtureFluidProperties * _fp_vapor_mixture
Vapor mixture fluid properties user object.
const TwoPhaseFluidProperties * _fp_2phase
Two-phase fluid properties user object.
void addClassDescription(const std::string &doc_string)
Test 2-phase NCG fluid properties.
const UserObjectName _vapor_mixture_name
Vapor mixture fluid properties user object name.