www.mooseframework.org
CNSFVFreeOutflowBoundaryFlux.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<BoundaryFluxBase>();
15 
16  params.addClassDescription("A user object that computes the outflow boundary flux.");
17 
18  params.addRequiredParam<UserObjectName>("fluid_properties",
19  "Name for fluid properties user object");
20 
21  return params;
22 }
23 
25  : BoundaryFluxBase(parameters), _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
26 {
27 }
28 
30 
31 void
33  dof_id_type /*ielem*/,
34  const std::vector<Real> & uvec1,
35  const RealVectorValue & dwave,
36  std::vector<Real> & flux) const
37 {
39 
40  Real rho1 = uvec1[0];
41  Real rhou1 = uvec1[1];
42  Real rhov1 = uvec1[2];
43  Real rhow1 = uvec1[3];
44  Real rhoe1 = uvec1[4];
45 
46  Real nx = dwave(0);
47  Real ny = dwave(1);
48  Real nz = dwave(2);
49 
51 
52  flux.resize(5);
53 
55 
56  Real uadv1 = rhou1 / rho1;
57  Real vadv1 = rhov1 / rho1;
58  Real wadv1 = rhow1 / rho1;
59  Real v = 1. / rho1;
60  Real e = rhoe1 / rho1 - 0.5 * (uadv1 * uadv1 + vadv1 * vadv1 + wadv1 * wadv1);
61  Real pres1 = _fp.pressure(v, e);
62 
63  Real vdon1 = uadv1 * nx + vadv1 * ny + wadv1 * nz;
64 
65  flux[0] = vdon1 * rho1;
66  flux[1] = vdon1 * rhou1 + pres1 * nx;
67  flux[2] = vdon1 * rhov1 + pres1 * ny;
68  flux[3] = vdon1 * rhow1 + pres1 * nz;
69  flux[4] = vdon1 * (rhoe1 + pres1);
70 }
71 
72 void
74  dof_id_type /*ielem*/,
75  const std::vector<Real> & /*uvec1*/,
76  const RealVectorValue & /*dwave*/,
77  DenseMatrix<Real> & /*jac1*/) const
78 {
79 }
virtual void calcJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, DenseMatrix< Real > &jac1) const
Compute the Jacobian matrix on the boundary face.
InputParameters validParams< BoundaryFluxBase >()
virtual void calcFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, std::vector< Real > &flux) const
Solve the Riemann problem on the boundary face.
A base class for computing/caching fluxes at boundaries.
InputParameters validParams< CNSFVFreeOutflowBoundaryFlux >()
Common class for single phase fluid properties.
CNSFVFreeOutflowBoundaryFlux(const InputParameters &parameters)
const SinglePhaseFluidProperties & _fp
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.