https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
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");
71 }
73}
registerMooseObject("FluidPropertiesTestApp", TestTwoPhaseNCGFluidProperties)
T & getUserObject(const std::string &name, unsigned int tid=0) const
virtual std::vector< std::shared_ptr< UserObject > > addUserObject(const std::string &user_object_name, const std::string &name, InputParameters &parameters)
InputParameters getValidParams(const std::string &name) const
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
T & set(const std::string &name, bool quiet_mode=false)
Factory & getFactory()
const T & getParam(const std::string &name) const
Test 2-phase NCG fluid properties.
TestTwoPhaseNCGFluidProperties(const InputParameters &parameters)
Base class for fluid properties used with two-phase flow.
Base class for fluid properties used with 2-phase flow with non-condensable gases (NCGs) present.
const VaporMixtureFluidProperties * _fp_vapor_mixture
Vapor mixture fluid properties user object.
static InputParameters validParams()
const UserObjectName _2phase_name
Two-phase fluid properties user object name.
const UserObjectName & getVaporName() const override
Returns the name of the vapor single-phase fluid properties object.
const TwoPhaseFluidProperties * _fp_2phase
Two-phase fluid properties user object.
const UserObjectName _vapor_mixture_name
Vapor mixture fluid properties user object name.
FEProblemBase & _fe_problem
Base class for fluid properties of vapor mixtures.