https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
42std::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}
registerMooseObject("ThermalHydraulicsApp", ADBoundaryFlux3EqnGhostPressure)
DualNumber< Real, DNDerivativeType, true > ADReal
const double rho
Computes boundary fluxes for the 1-D, variable-area Euler equations using a numerical flux user objec...
Computes boundary flux from a specified pressure for the 1-D, 1-phase, variable-area Euler equations.
virtual std::vector< ADReal > getGhostCellSolution(const std::vector< ADReal > &U1, const Point &point) const override
Gets the solution vector in the ghost cell.
ADBoundaryFlux3EqnGhostPressure(const InputParameters &parameters)
const SinglePhaseFluidProperties & _fp
Fluid properties object.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Common class for single phase fluid properties.