https://mooseframework.inl.gov
PCNSFVHLLCSpecifiedMassFluxAndTemperatureBC.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 "NS.h"
12 #include "Function.h"
14 
17 {
18  auto params = PCNSFVHLLCBC::validParams();
19  params.addRequiredParam<FunctionName>(NS::superficial_momentum_x,
20  "The x component of the inlet superficial momentum");
21  params.addParam<FunctionName>(NS::superficial_momentum_y,
22  "The y component of the inlet superficial momentum");
23  params.addParam<FunctionName>(NS::superficial_momentum_z,
24  "The z component of the inlet superficial momentum");
25  params.addRequiredParam<FunctionName>(NS::temperature, "temperature specified as a function");
26  return params;
27 }
28 
30  const InputParameters & parameters)
31  : PCNSFVHLLCBC(parameters),
32  _superficial_rhou_boundary(getFunction(NS::superficial_momentum_x)),
33  _superficial_rhov_boundary(isParamValid(NS::superficial_momentum_y)
34  ? &getFunction(NS::superficial_momentum_y)
35  : nullptr),
36  _superficial_rhow_boundary(isParamValid(NS::superficial_momentum_z)
37  ? &getFunction(NS::superficial_momentum_z)
38  : nullptr),
39  _temperature_boundary(getFunction(NS::temperature))
40 {
42  mooseError("If the mesh dimension is greater than 1, a function for the y superficial momentum "
43  "must be provided");
45  mooseError("If the mesh dimension is greater than 2, a function for the z superficial momentum "
46  "must be provided");
47 }
48 
49 void
51 {
52  // rho implicit -> 1 numerical bc
54 
56 
57  RealVectorValue mass_flux_boundary(
60  ADRealVectorValue(mass_flux_boundary(0) / _rho_boundary / _eps_boundary, 0, 0));
62  {
63  mass_flux_boundary(1) = _superficial_rhov_boundary->value(_t, _face_info->faceCentroid());
64  _vel_boundary(1) = mass_flux_boundary(1) / _rho_boundary / _eps_boundary;
65  }
67  {
68  mass_flux_boundary(2) = _superficial_rhow_boundary->value(_t, _face_info->faceCentroid());
69  _vel_boundary(2) = mass_flux_boundary(2) / _rho_boundary / _eps_boundary;
70  }
72 
74  const ADReal v_boundary = 1 / _rho_boundary;
75  _specific_internal_energy_boundary = _fluid.e_from_T_v(T_boundary, v_boundary);
78  _pressure_boundary = _fluid.p_from_T_v(T_boundary, v_boundary);
80 }
const FaceInfo * _face_info
const SinglePhaseFluidProperties & _fluid
fluid properties
Definition: PCNSFVHLLCBC.h:51
static const std::string superficial_momentum_y
Definition: NS.h:40
const Point & faceCentroid() const
static const std::string superficial_momentum_x
Definition: NS.h:39
ADReal _rho_boundary
Definition: PCNSFVHLLCBC.h:75
Real _eps_boundary
Definition: PCNSFVHLLCBC.h:82
static const std::string superficial_momentum_z
Definition: NS.h:41
Base clase for HLLC boundary conditions for the Euler equation.
Definition: PCNSFVHLLCBC.h:19
static const std::string temperature
Definition: NS.h:59
void preComputeWaveSpeed() override
this function is a call back for setting quantities for computing wave speed before calling the wave ...
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
Definition: PCNSFVHLLCBC.C:16
const unsigned int _qp
ADRealVectorValue _vel_boundary
Definition: PCNSFVHLLCBC.h:76
ADReal _specific_internal_energy_boundary
Definition: PCNSFVHLLCBC.h:77
virtual unsigned int dimension() const
ADReal _rho_et_boundary
Definition: PCNSFVHLLCBC.h:81
Real & _t
ADRealVectorValue _normal
ADReal _et_boundary
Definition: PCNSFVHLLCBC.h:80
ADReal _normal_speed_boundary
these quantities must be computed in preComputeWaveSpeed
Definition: PCNSFVHLLCBC.h:74
const ADMaterialProperty< Real > & _rho_elem
Definition: PCNSFVHLLCBC.h:57
void assign(const TypeVector< T2 > &)
void mooseError(Args &&... args) const
ADReal _pressure_boundary
Definition: PCNSFVHLLCBC.h:78
virtual Real value(Real t, const Point &p) const
ADReal _ht_boundary
Definition: PCNSFVHLLCBC.h:79
const MaterialProperty< Real > & _eps_elem
Definition: PCNSFVHLLCBC.h:61
MooseMesh & _mesh