https://mooseframework.inl.gov
TestNumericalFluxGasMixHLLC.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 "THMIndicesGasMix.h"
13 
15 {
16  testSymmetry();
17 }
18 
20 {
21  testConsistency();
22 }
23 
25 {
26 }
27 
28 const NumericalFlux1D &
30 {
31  const std::string class_name = "NumericalFluxGasMixHLLC";
32  const std::string flux_mix_name = "flux_mix";
33  InputParameters params = _factory.getValidParams(class_name);
34  params.set<UserObjectName>("fluid_properties") = _fp_mix_name;
35  _fe_problem->addUserObject(class_name, flux_mix_name, params);
36 
37  return _fe_problem->getUserObject<NumericalFluxGasMixHLLC>(flux_mix_name);
38 }
39 
40 std::vector<std::pair<std::vector<ADReal>, std::vector<ADReal>>>
42 {
43  // sL < 0 < sM
44  std::vector<ADReal> W1(THMGasMix1D::N_PRIM_VARS);
46  W1[THMGasMix1D::PRESSURE] = 1e5;
47  W1[THMGasMix1D::TEMPERATURE] = 300;
48  W1[THMGasMix1D::VELOCITY] = 20;
49 
50  std::vector<ADReal> W2(THMGasMix1D::N_PRIM_VARS);
52  W2[THMGasMix1D::PRESSURE] = 2e5;
53  W2[THMGasMix1D::TEMPERATURE] = 310;
54  W2[THMGasMix1D::VELOCITY] = 1.2;
55 
56  // sL > 0
57  std::vector<ADReal> W3(THMGasMix1D::N_PRIM_VARS);
59  W3[THMGasMix1D::PRESSURE] = 1e5;
60  W3[THMGasMix1D::TEMPERATURE] = 300;
61  W3[THMGasMix1D::VELOCITY] = 500;
62 
63  std::vector<ADReal> W4(THMGasMix1D::N_PRIM_VARS);
65  W4[THMGasMix1D::PRESSURE] = 2e5;
66  W4[THMGasMix1D::TEMPERATURE] = 310;
67  W4[THMGasMix1D::VELOCITY] = 550;
68 
69  std::vector<std::pair<std::vector<ADReal>, std::vector<ADReal>>> W_pairs;
70  W_pairs.push_back(std::pair<std::vector<ADReal>, std::vector<ADReal>>(W1, W2));
71  W_pairs.push_back(std::pair<std::vector<ADReal>, std::vector<ADReal>>(W3, W4));
72 
73  return W_pairs;
74 }
75 
76 std::vector<std::vector<ADReal>>
78 {
79  std::vector<ADReal> W1(THMGasMix1D::N_PRIM_VARS);
81  W1[THMGasMix1D::PRESSURE] = 1e5;
82  W1[THMGasMix1D::TEMPERATURE] = 300;
83  W1[THMGasMix1D::VELOCITY] = 1.5;
84 
85  std::vector<std::vector<ADReal>> W_list;
86  W_list.push_back(W1);
87 
88  return W_list;
89 }
std::shared_ptr< FEProblem > _fe_problem
Abstract base class for computing and caching internal or boundary fluxes for 1D conservation law sys...
static const unsigned int N_PRIM_VARS
T & set(const std::string &name, bool quiet_mode=false)
InputParameters getValidParams(const std::string &name) const
virtual const NumericalFlux1D & createFluxObject() override
Creates the flux object to be tested.
Tests NumericalFluxGasMixHLLC.
const UserObjectName _fp_mix_name
Mixture fluid properties name.
TEST_F(TestNumericalFluxGasMixHLLC, testSymmetry)
Computes the numerical flux for FlowModelGasMix using the HLLC approximate Riemann solver...
virtual std::vector< std::pair< std::vector< ADReal >, std::vector< ADReal > > > getPrimitiveSolutionsSymmetryTest() const override
Gets a vector of pairs of primitive solution vectors to use for symmetry test.
Base class for testing NumericalFluxGasMix objects.
virtual std::vector< std::vector< ADReal > > getPrimitiveSolutionsConsistencyTest() const override
Gets a vector of primitive solution vectors to use for consistency test.