https://mooseframework.inl.gov
ADBoundaryFlux3EqnFreeOutflow.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 
11 #include "THMIndicesVACE.h"
12 #include "Numerics.h"
13 
14 registerMooseObject("ThermalHydraulicsApp", ADBoundaryFlux3EqnFreeOutflow);
15 
18 {
20 
21  params.addClassDescription("Computes the outflow boundary flux directly for the 1-D, 1-phase, "
22  "variable-area Euler equations");
23 
24  params.addRequiredParam<UserObjectName>("fluid_properties",
25  "Name of fluid properties user object");
26 
27  return params;
28 }
29 
31  : ADBoundaryFluxBase(parameters),
32 
33  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
34 {
35 }
36 
37 void
39  dof_id_type /*ielem*/,
40  const std::vector<ADReal> & U1,
41  const RealVectorValue & /*normal*/,
42  std::vector<ADReal> & flux) const
43 {
44  // extract the solution and area
45  const ADReal rhoA1 = U1[THMVACE1D::RHOA];
46  const ADReal rhouA1 = U1[THMVACE1D::RHOUA];
47  const ADReal rhoEA1 = U1[THMVACE1D::RHOEA];
48  const ADReal A1 = U1[THMVACE1D::AREA];
49 
50  const ADReal rho1 = rhoA1 / A1;
51  const ADReal vel1 = rhouA1 / rhoA1;
52  const ADReal v1 = 1.0 / rho1;
53  const ADReal e1 = rhoEA1 / rhoA1 - 0.5 * vel1 * vel1;
54  const ADReal p1 = _fp.p_from_v_e(v1, e1);
55 
56  flux.resize(THMVACE1D::N_FLUX_OUTPUTS);
57  flux[THMVACE1D::MASS] = vel1 * rhoA1;
58  flux[THMVACE1D::MOMENTUM] = (vel1 * rhouA1 + p1 * A1);
59  flux[THMVACE1D::ENERGY] = vel1 * (rhoEA1 + p1 * A1);
60 }
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
registerMooseObject("ThermalHydraulicsApp", ADBoundaryFlux3EqnFreeOutflow)
virtual void calcFlux(unsigned int iside, dof_id_type ielem, const std::vector< ADReal > &U1, const RealVectorValue &normal, std::vector< ADReal > &flux) const override
Solve the Riemann problem on the boundary face.
Computes the outflow boundary flux directly for the 1-D, 1-phase, variable-area Euler equations...
const SinglePhaseFluidProperties & _fp
Common class for single phase fluid properties.
A base class for computing/caching fluxes at boundaries.
static const unsigned int N_FLUX_OUTPUTS
Number of numerical flux function outputs for 1D.
void addClassDescription(const std::string &doc_string)
ADBoundaryFlux3EqnFreeOutflow(const InputParameters &parameters)
uint8_t dof_id_type