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