www.mooseframework.org
Public Member Functions | Protected Attributes | List of all members
CNSFVCharacteristicBCUserObject Class Reference

A user object that computes the ghost cell values based on the characteristic boundary condition. More...

#include <CNSFVCharacteristicBCUserObject.h>

Inheritance diagram for CNSFVCharacteristicBCUserObject:
[legend]

Public Member Functions

 CNSFVCharacteristicBCUserObject (const InputParameters &parameters)
 
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 More...
 
virtual void initialize ()
 
virtual void execute ()
 
virtual void finalize ()
 

Protected Attributes

const SinglePhaseFluidProperties_fp
 
Real _inf_rho
 
Real _inf_uadv
 
Real _inf_vadv
 
Real _inf_wadv
 
Real _inf_pres
 

Detailed Description

A user object that computes the ghost cell values based on the characteristic boundary condition.

Definition at line 22 of file CNSFVCharacteristicBCUserObject.h.

Constructor & Destructor Documentation

CNSFVCharacteristicBCUserObject::CNSFVCharacteristicBCUserObject ( const InputParameters &  parameters)

Definition at line 36 of file CNSFVCharacteristicBCUserObject.C.

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 }
const SinglePhaseFluidProperties & _fp
BCUserObject(const InputParameters &parameters)
Definition: BCUserObject.C:18

Member Function Documentation

void BCUserObject::execute ( )
virtualinherited

Definition at line 26 of file BCUserObject.C.

27 {
28 }
void BCUserObject::finalize ( )
virtualinherited

Definition at line 31 of file BCUserObject.C.

32 {
33 }
std::vector< Real > CNSFVCharacteristicBCUserObject::getGhostCellValue ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave 
) const
virtual

compute the ghost cell variable values

Parameters
[in]isidelocal index of current side
[in]ielemglobal index of the current element
[in]uvec1vector of variables on the host side
[in]dwavevector of unit normal

pass the inputs to local

compute the local Mach number with state variables on the left

subsonic inflow case – fix pressure (but also OK to extrapolate pressure) – fix temperature – fix velocity – fix mass fractions

subsonic outflow case – fix pressure – extrapolate temperature – extrapolate velocities – extrapolate mass fractions

supersonic inflow case – fix pressure – fix temperature – fix velocity – fix mass fractions

supersonic outflow case – extrapolate pressure – extrapolate temperature – extrapolate velocity – extrapolate mass fractions

Implements BCUserObject.

Definition at line 48 of file CNSFVCharacteristicBCUserObject.C.

52 {
54 
55  Real rho1 = uvec1[0];
56  Real rhou1 = uvec1[1];
57  Real rhov1 = uvec1[2];
58  Real rhow1 = uvec1[3];
59  Real rhoe1 = uvec1[4];
60 
61  std::vector<Real> urigh(5, 0.);
62 
64 
65  Real rhom1 = 1. / rho1;
66  Real uadv1 = rhou1 * rhom1;
67  Real vadv1 = rhov1 * rhom1;
68  Real wadv1 = rhow1 * rhom1;
69  Real vdov1 = uadv1 * uadv1 + vadv1 * vadv1 + wadv1 * wadv1;
70  Real eint1 = rhoe1 * rhom1 - 0.5 * vdov1;
71  Real mach1 = std::sqrt(vdov1) / _fp.c(rhom1, eint1);
72 
73  if (mach1 > -1. && mach1 < 0.)
74  {
80 
81  urigh[0] = _inf_rho;
82  urigh[1] = _inf_rho * _inf_uadv;
83  urigh[2] = _inf_rho * _inf_vadv;
84  urigh[3] = _inf_rho * _inf_wadv;
85  urigh[4] =
87  0.5 * (_inf_uadv * _inf_uadv + _inf_vadv * _inf_vadv + _inf_wadv * _inf_wadv));
88  }
89  else if (mach1 >= 0. && mach1 < 1.)
90  {
96 
97  urigh[0] = rho1;
98  urigh[1] = rhou1;
99  urigh[2] = rhov1;
100  urigh[3] = rhow1;
101  urigh[4] = rho1 * _fp.e(_inf_pres, rho1) +
102  0.5 * (rhou1 * rhou1 + rhov1 * rhov1 + rhow1 * rhow1) / rho1;
103  }
104  else if (mach1 <= -1.)
105  {
111 
112  urigh[0] = _inf_rho;
113  urigh[1] = _inf_rho * _inf_uadv;
114  urigh[2] = _inf_rho * _inf_vadv;
115  urigh[3] = _inf_rho * _inf_wadv;
116  urigh[4] =
118  0.5 * (_inf_uadv * _inf_uadv + _inf_vadv * _inf_vadv + _inf_wadv * _inf_wadv));
119  }
120  else if (mach1 >= 1.)
121  {
127 
128  urigh[0] = rho1;
129  urigh[1] = rhou1;
130  urigh[2] = rhov1;
131  urigh[3] = rhow1;
132  urigh[4] = rhoe1;
133  }
134  else
135  mooseError("Something is wrong in ",
136  name(),
137  ": ",
138  __FUNCTION__,
139  "\n",
140  "ielem = ",
141  ielem,
142  "\n",
143  "iside = ",
144  iside,
145  "\n",
146  "mach1 = ",
147  mach1,
148  "\n");
149 
150  return urigh;
151 }
const SinglePhaseFluidProperties & _fp
virtual Real c(Real v, Real u) const =0
Sound speed.
virtual Real e(Real pressure, Real rho) const =0
Computes internal energy from pressure and density.
void BCUserObject::initialize ( )
virtualinherited

Definition at line 21 of file BCUserObject.C.

22 {
23 }

Member Data Documentation

const SinglePhaseFluidProperties& CNSFVCharacteristicBCUserObject::_fp
protected

Definition at line 33 of file CNSFVCharacteristicBCUserObject.h.

Referenced by getGhostCellValue().

Real CNSFVCharacteristicBCUserObject::_inf_pres
protected

Definition at line 39 of file CNSFVCharacteristicBCUserObject.h.

Referenced by getGhostCellValue().

Real CNSFVCharacteristicBCUserObject::_inf_rho
protected

Definition at line 35 of file CNSFVCharacteristicBCUserObject.h.

Referenced by getGhostCellValue().

Real CNSFVCharacteristicBCUserObject::_inf_uadv
protected

Definition at line 36 of file CNSFVCharacteristicBCUserObject.h.

Referenced by getGhostCellValue().

Real CNSFVCharacteristicBCUserObject::_inf_vadv
protected

Definition at line 37 of file CNSFVCharacteristicBCUserObject.h.

Referenced by getGhostCellValue().

Real CNSFVCharacteristicBCUserObject::_inf_wadv
protected

Definition at line 38 of file CNSFVCharacteristicBCUserObject.h.

Referenced by getGhostCellValue().


The documentation for this class was generated from the following files: