www.mooseframework.org
CNSFVSlipBCUserObject.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 slip "
17  "wall boundary condition.");
18 
19  params.addRequiredParam<UserObjectName>("fluid_properties",
20  "Name for fluid properties user object");
21 
22  return params;
23 }
24 
25 CNSFVSlipBCUserObject::CNSFVSlipBCUserObject(const InputParameters & parameters)
26  : BCUserObject(parameters), _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
27 {
28 }
29 
30 std::vector<Real>
32  dof_id_type /*ielem*/,
33  const std::vector<Real> & uvec1,
34  const RealVectorValue & dwave) const
35 {
37 
38  Real rho1 = uvec1[0];
39  Real rhou1 = uvec1[1];
40  Real rhov1 = uvec1[2];
41  Real rhow1 = uvec1[3];
42  Real rhoe1 = uvec1[4];
43 
44  Real nx = dwave(0);
45  Real ny = dwave(1);
46  Real nz = dwave(2);
47 
48  std::vector<Real> urigh(5, 0.);
49 
50  Real mdotn = rhou1 * nx + rhov1 * ny + rhow1 * nz;
51 
52  urigh[0] = rho1;
53  urigh[1] = rhou1 - 2. * mdotn * nx;
54  urigh[2] = rhov1 - 2. * mdotn * ny;
55  urigh[3] = rhow1 - 2. * mdotn * nz;
56  urigh[4] = rhoe1;
57 
58  return urigh;
59 }
InputParameters validParams< CNSFVSlipBCUserObject >()
InputParameters validParams< BCUserObject >()
Definition: BCUserObject.C:12
Common class for single phase fluid properties.
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
A base class of user object for calculating the variable values in ghost element according to specifi...
Definition: BCUserObject.h:42
CNSFVSlipBCUserObject(const InputParameters &parameters)