https://mooseframework.inl.gov
FlowModelGasMixAux.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 
10 #include "FlowModelGasMixAux.h"
11 #include "FlowModelGasMixUtils.h"
12 #include "THMIndicesGasMix.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", FlowModelGasMixAux);
15 
18 {
20 
21  MooseEnum quantity("p T");
22  params.addRequiredParam<MooseEnum>("quantity", quantity, "Quantity to compute");
23 
24  params.addRequiredCoupledVar("xirhoA", "xi*rho*A variable");
25  params.addRequiredCoupledVar("rhoA", "rho*A variable");
26  params.addRequiredCoupledVar("rhouA", "rho*u*A variable");
27  params.addRequiredCoupledVar("rhoEA", "rho*E*A variable");
28  params.addRequiredCoupledVar("area", "Cross-sectional area variable");
29 
30  params.addRequiredParam<UserObjectName>("fluid_properties",
31  "The VaporMixtureFluidProperties object");
32 
33  params.addClassDescription("Computes various quantities for FlowModelGasMix.");
34 
35  return params;
36 }
37 
39  : AuxKernel(parameters),
40  _quantity(getParam<MooseEnum>("quantity").getEnum<Quantity>()),
41  _xirhoA(coupledValue("xirhoA")),
42  _rhoA(coupledValue("rhoA")),
43  _rhouA(coupledValue("rhouA")),
44  _rhoEA(coupledValue("rhoEA")),
45  _area(coupledValue("area")),
46  _fp(getUserObject<VaporMixtureFluidProperties>("fluid_properties"))
47 {
48 }
49 
50 Real
52 {
53  std::vector<Real> U(THMGasMix1D::N_FLUX_INPUTS);
59 
60  const auto W = FlowModelGasMixUtils::computePrimitiveSolution<false>(U, _fp);
61 
62  switch (_quantity)
63  {
64  case Quantity::PRESSURE:
65  {
66  return W[THMGasMix1D::PRESSURE];
67  break;
68  }
70  {
71  return W[THMGasMix1D::TEMPERATURE];
72  break;
73  }
74  default:
75  mooseAssert(false, "Invalid 'quantity' parameter.");
76  return 0;
77  }
78 }
const VariableValue & _rhoA
Base class for fluid properties of vapor mixtures.
const VariableValue & _area
const VariableValue & _rhoEA
Quantity
Quantity type.
const VaporMixtureFluidProperties & _fp
Fluid properties.
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
Computes various quantities for FlowModelGasMix.
const VariableValue & _xirhoA
const VariableValue & _rhouA
const Quantity _quantity
Which quantity to compute.
registerMooseObject("ThermalHydraulicsApp", FlowModelGasMixAux)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual Real computeValue() override
void addClassDescription(const std::string &doc_string)
FlowModelGasMixAux(const InputParameters &parameters)
static InputParameters validParams()
static const unsigned int N_FLUX_INPUTS
Number of numerical flux function inputs.