https://mooseframework.inl.gov
ADBoundaryFlux3EqnGhostPressure.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 "THMIndicesVACE.h"
13 #include "Numerics.h"
14 
16 
19 {
21 
22  params.addClassDescription("Computes boundary flux from a specified pressure for the 1-D, "
23  "1-phase, variable-area Euler equations");
24 
25  params.addRequiredParam<Real>("p", "Pressure");
26 
27  params.addRequiredParam<UserObjectName>("fluid_properties",
28  "Name of fluid properties user object");
29 
30  params.declareControllable("p");
31  return params;
32 }
33 
35  : ADBoundaryFlux3EqnGhostBase(parameters),
36 
37  _p(getParam<Real>("p")),
38  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
39 {
40 }
41 
42 std::vector<ADReal>
44  const Point & /*point*/) const
45 {
46  const ADReal rhoA = U[THMVACE1D::RHOA];
47  const ADReal rhouA = U[THMVACE1D::RHOUA];
48  const ADReal A = U[THMVACE1D::AREA];
49 
50  const ADReal rho = rhoA / A;
51  const ADReal vel = rhouA / rhoA;
52  const ADReal E = _fp.e_from_p_rho(_p, rho) + 0.5 * vel * vel;
53 
54  auto U_ghost = U;
55  U_ghost[THMVACE1D::RHOEA] = rhoA * E;
56 
57  return U_ghost;
58 }
static InputParameters validParams()
Computes boundary flux from a specified pressure for the 1-D, 1-phase, variable-area Euler equations...
void addRequiredParam(const std::string &name, const std::string &doc_string)
const SinglePhaseFluidProperties & _fp
Fluid properties object.
ADBoundaryFlux3EqnGhostPressure(const InputParameters &parameters)
registerMooseObject("ThermalHydraulicsApp", ADBoundaryFlux3EqnGhostPressure)
const double rho
Computes boundary fluxes for the 1-D, variable-area Euler equations using a numerical flux user objec...
Common class for single phase fluid properties.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
virtual std::vector< ADReal > getGhostCellSolution(const std::vector< ADReal > &U1, const Point &point) const override
Gets the solution vector in the ghost cell.
void addClassDescription(const std::string &doc_string)
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})