https://mooseframework.inl.gov
TestNumericalFluxGasMixBase.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 
12 #include "FlowModelGasMixUtils.h"
13 
16  _fp_mix_name("fp_mix")
17 {
19 }
20 
21 std::vector<ADReal>
23  const ADReal & A) const
24 {
25  return FlowModelGasMixUtils::computeConservativeSolution<true>(W, A, *_fp_mix);
26 }
27 
28 std::vector<ADReal>
30  const ADReal & A) const
31 {
32  return FlowModelGasMixUtils::computeFluxFromPrimitive<true>(W, A, *_fp_mix);
33 }
34 
35 void
37 {
38  const std::string fp_steam_name = "fp_steam";
39  const std::string fp_nitrogen_name = "fp_nitrogen";
40 
41  // steam fluid properties; parameters correspond to T in range 298 K to 473 K
42  {
43  const std::string class_name = "IdealGasFluidProperties";
44  InputParameters params = _factory.getValidParams(class_name);
45  params.set<Real>("gamma") = 1.43;
46  params.set<Real>("molar_mass") = 0.01801488;
47  params.set<Real>("mu") = 0.000013277592; // at 400 K and 1.e5 Pa
48  params.set<Real>("k") = 0.026824977826; // at 400 K and 1.e5 Pa
49  _fe_problem->addUserObject(class_name, fp_steam_name, params);
50  }
51 
52  // nitrogen fluid properties
53  {
54  const std::string class_name = "IdealGasFluidProperties";
55  InputParameters params = _factory.getValidParams(class_name);
56  params.set<Real>("gamma") = 1.4;
57  params.set<Real>("molar_mass") = 0.028012734746133888;
58  params.set<Real>("mu") = 0.0000222084; // at 400 K and 1.e5 Pa
59  params.set<Real>("k") = 0.032806168; // at 400 K and 1.e5 Pa
60  _fe_problem->addUserObject(class_name, fp_nitrogen_name, params);
61  }
62 
63  // mixture fluid properties
64  {
65  const std::string class_name = "IdealGasMixtureFluidProperties";
66  InputParameters params = _factory.getValidParams(class_name);
67  params.set<std::vector<UserObjectName>>("component_fluid_properties") = {fp_steam_name, fp_nitrogen_name};
68  _fe_problem->addUserObject(class_name, _fp_mix_name, params);
70  }
71 }
virtual std::vector< ADReal > computeFluxFromPrimitive(const std::vector< ADReal > &W, const ADReal &A) const override
Computes the 1D flux vector from the primitive solution.
std::shared_ptr< FEProblem > _fe_problem
const IdealGasMixtureFluidProperties * _fp_mix
Fluid properties user object.
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual std::vector< ADReal > computeConservativeSolution(const std::vector< ADReal > &W, const ADReal &A) const override
Computes the conservative solution from the primitive solution.
Base class for testing NumericalFlux1D objects.
const UserObjectName _fp_mix_name
Mixture fluid properties name.
void addFluidProperties()
Adds fluid properties objects needed for testing.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Class for fluid properties of an ideal gas mixture.