www.mooseframework.org
CNSFVFreeInflowBCUserObject.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
9 
10 template <>
11 InputParameters
13 {
14  InputParameters params = validParams<BCUserObject>();
15 
16  params.addClassDescription("A user object that computes the ghost cell values based on the free "
17  "inflow boundary condition.");
18 
19  params.addRequiredParam<UserObjectName>("fluid_properties",
20  "Name for fluid properties user object");
21 
22  params.addRequiredParam<Real>("infinity_density", "Infinity density");
23 
24  params.addRequiredParam<Real>("infinity_x_velocity",
25  "Infinity velocity component in x-direction");
26 
27  params.addParam<Real>("infinity_y_velocity", 0., "Infinity velocity component in y-direction");
28 
29  params.addParam<Real>("infinity_z_velocity", 0., "Infinity velocity component in z-direction");
30 
31  params.addRequiredParam<Real>("infinity_pressure", "Infinity pressure");
32 
33  return params;
34 }
35 
37  : BCUserObject(parameters),
38  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties")),
39  _inf_rho(getParam<Real>("infinity_density")),
40  _inf_uadv(getParam<Real>("infinity_x_velocity")),
41  _inf_vadv(getParam<Real>("infinity_y_velocity")),
42  _inf_wadv(getParam<Real>("infinity_z_velocity")),
43  _inf_pres(getParam<Real>("infinity_pressure"))
44 {
45 }
46 
47 std::vector<Real>
49  dof_id_type /*ielem*/,
50  const std::vector<Real> & /*uvec1*/,
51  const RealVectorValue & /*dwave*/) const
52 {
53  std::vector<Real> urigh(5, 0.);
54 
55  urigh[0] = _inf_rho;
56  urigh[1] = _inf_rho * _inf_uadv;
57  urigh[2] = _inf_rho * _inf_vadv;
58  urigh[3] = _inf_rho * _inf_wadv;
59  urigh[4] =
61  0.5 * (_inf_uadv * _inf_uadv + _inf_vadv * _inf_vadv + _inf_wadv * _inf_wadv));
62 
63  return urigh;
64 }
CNSFVFreeInflowBCUserObject(const InputParameters &parameters)
InputParameters validParams< BCUserObject >()
Definition: BCUserObject.C:12
Common class for single phase fluid properties.
const SinglePhaseFluidProperties & _fp
A base class of user object for calculating the variable values in ghost element according to specifi...
Definition: BCUserObject.h:42
InputParameters validParams< CNSFVFreeInflowBCUserObject >()
virtual std::vector< Real > getGhostCellValue(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const
compute the ghost cell variable values
virtual Real e(Real pressure, Real rho) const =0
Computes internal energy from pressure and density.