https://mooseframework.inl.gov
Loading...
Searching...
No Matches
IdealRealGasMixtureFluidPropertiesTest.h
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
10#pragma once
11
12#include "MooseObjectUnitTest.h"
16
18{
19public:
24
25protected:
27 {
28 const std::string fp_steam_name = "fp_steam";
29 const std::string fp_nitrogen_name = "fp_nitrogen";
30 const std::string fp_mix_name = "fp_mix";
31
32 // steam; parameters correspond to T in range 298 K to 473 K
33 {
34 const std::string class_name = "StiffenedGasFluidProperties";
35 InputParameters params = _factory.getValidParams(class_name);
36 params.set<Real>("gamma") = 1.43;
37 params.set<Real>("q") = 2030e3;
38 params.set<Real>("q_prime") = -23e3;
39 // This parameter is supposed to be 0 for steam, but then de/dp = 0. For
40 // the used mixture model, the derivative dp/de is computed as (de/dp)^-1,
41 // so this is artificially changed to a non-zero number here.
42 params.set<Real>("p_inf") = 1e4;
43 params.set<Real>("cv") = 1040;
44 params.set<Real>("M") = 0.01801488;
45 params.set<Real>("mu") = 0.000013277592; // at 400 K and 1.e5 Pa
46 params.set<Real>("k") = 0.026824977826; // at 400 K and 1.e5 Pa
47 params.set<Real>("T_c") = 647.096;
48 params.set<Real>("rho_c") = 322.;
49 params.set<Real>("e_c") = 2015734.52419;
50 _fe_problem->addUserObject(class_name, fp_steam_name, params);
52 }
53
54 // nitrogen
55 {
56 const std::string class_name = "IdealGasFluidProperties";
57 InputParameters params = _factory.getValidParams(class_name);
58 params.set<Real>("gamma") = 1.4;
59 params.set<Real>("molar_mass") = 0.028012734746133888;
60 params.set<Real>("mu") = 0.0000222084; // at 400 K and 1.e5 Pa
61 params.set<Real>("k") = 0.032806168; // at 400 K and 1.e5 Pa
62 _fe_problem->addUserObject(class_name, fp_nitrogen_name, params);
64 }
65
66 // mixture
67 {
68 const std::string class_name = "IdealRealGasMixtureFluidProperties";
69 InputParameters params = _factory.getValidParams(class_name);
70 params.set<UserObjectName>("fp_primary") = fp_steam_name;
71 params.set<std::vector<UserObjectName>>("fp_secondary") = {fp_nitrogen_name};
72 params.set<bool>("allow_imperfect_jacobians") = true;
73 _fe_problem->addUserObject(class_name, fp_mix_name, params);
75 }
76 }
77
81};
InputParameters getValidParams(const std::string &name) const
Ideal gas fluid properties Default parameters are for air at atmospheric pressure and temperature.
const IdealRealGasMixtureFluidProperties * _fp_mix
Class for fluid properties of an arbitrary vapor mixture.
T & set(const std::string &name, bool quiet_mode=false)
std::shared_ptr< FEProblem > _fe_problem
Stiffened gas fluid properties.
const T & getUserObject(const std::string &param_name, bool is_dependency=true) const