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

A user object that computes the inflow boundary flux. More...

#include <CNSFVFreeInflowBoundaryFlux.h>

Inheritance diagram for CNSFVFreeInflowBoundaryFlux:
[legend]

Public Member Functions

 CNSFVFreeInflowBoundaryFlux (const InputParameters &parameters)
 
virtual ~CNSFVFreeInflowBoundaryFlux ()
 
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. More...
 
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. More...
 
virtual void execute ()
 
virtual void initialize ()
 
virtual void finalize ()
 
virtual const std::vector< Real > & getFlux (unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, THREAD_ID tid) const
 Get the boundary flux vector. More...
 
virtual const DenseMatrix< Real > & getJacobian (unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, THREAD_ID tid) const
 Get the boundary Jacobian matrix. More...
 

Protected Attributes

const BCUserObject_bc_uo
 
const SinglePhaseFluidProperties_fp
 
unsigned int _cached_side_id
 
dof_id_type _cached_elem_id
 
std::vector< std::vector< Real > > _flux
 Threaded storage for fluxes. More...
 
std::vector< DenseMatrix< Real > > _jac1
 Threaded storage for jacobians. More...
 

Detailed Description

A user object that computes the inflow boundary flux.

Definition at line 24 of file CNSFVFreeInflowBoundaryFlux.h.

Constructor & Destructor Documentation

CNSFVFreeInflowBoundaryFlux::CNSFVFreeInflowBoundaryFlux ( const InputParameters &  parameters)

Definition at line 26 of file CNSFVFreeInflowBoundaryFlux.C.

27  : BoundaryFluxBase(parameters),
28  _bc_uo(getUserObject<BCUserObject>("bc_uo")),
29  _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
30 {
31 }
const SinglePhaseFluidProperties & _fp
BoundaryFluxBase(const InputParameters &parameters)
CNSFVFreeInflowBoundaryFlux::~CNSFVFreeInflowBoundaryFlux ( )
virtual

Definition at line 33 of file CNSFVFreeInflowBoundaryFlux.C.

33 {}

Member Function Documentation

void CNSFVFreeInflowBoundaryFlux::calcFlux ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
std::vector< Real > &  flux 
) const
virtual

Solve the Riemann problem on the boundary face.

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
[out]fluxflux vector for conservation equations

pass the inputs to local

assign the proper size for the flux vector

Implements BoundaryFluxBase.

Definition at line 36 of file CNSFVFreeInflowBoundaryFlux.C.

41 {
43 
44  Real nx = dwave(0);
45  Real ny = dwave(1);
46  Real nz = dwave(2);
47 
49 
50  flux.resize(5);
51 
52  std::vector<Real> U2(5, 0.);
53 
54  U2 = _bc_uo.getGhostCellValue(iside, ielem, uvec1, dwave);
55 
56  Real rho2 = U2[0];
57  Real rhou2 = U2[1];
58  Real rhov2 = U2[2];
59  Real rhow2 = U2[3];
60  Real rhoe2 = U2[4];
61 
62  Real uadv2 = rhou2 / rho2;
63  Real vadv2 = rhov2 / rho2;
64  Real wadv2 = rhow2 / rho2;
65  Real vdov2 = uadv2 * uadv2 + vadv2 * vadv2 + wadv2 * wadv2;
66  Real v2 = 1. / rho2;
67  Real e2 = rhoe2 / rho2 - 0.5 * vdov2;
68  Real pres2 = _fp.pressure(v2, e2);
69 
70  Real vdon2 = uadv2 * nx + vadv2 * ny + wadv2 * nz;
71 
72  flux[0] = vdon2 * rho2;
73  flux[1] = vdon2 * rho2 * uadv2 + pres2 * nx;
74  flux[2] = vdon2 * rho2 * vadv2 + pres2 * ny;
75  flux[3] = vdon2 * rho2 * wadv2 + pres2 * nz;
76  flux[4] = vdon2 * (rhoe2 + pres2);
77 }
const SinglePhaseFluidProperties & _fp
virtual std::vector< Real > getGhostCellValue(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) const =0
compute the ghost cell variable values
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.
void CNSFVFreeInflowBoundaryFlux::calcJacobian ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
DenseMatrix< Real > &  jac1 
) const
virtual

Compute the Jacobian matrix on the boundary face.

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
[out]jac1Jacobian matrix contribution

Implements BoundaryFluxBase.

Definition at line 80 of file CNSFVFreeInflowBoundaryFlux.C.

85 {
86 }
void BoundaryFluxBase::execute ( )
virtualinherited

Definition at line 36 of file BoundaryFluxBase.C.

37 {
38 }
void BoundaryFluxBase::finalize ( )
virtualinherited

Definition at line 41 of file BoundaryFluxBase.C.

42 {
43 }
const std::vector< Real > & BoundaryFluxBase::getFlux ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
THREAD_ID  tid 
) const
virtualinherited

Get the boundary flux vector.

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

Definition at line 46 of file BoundaryFluxBase.C.

Referenced by CNSFVBC::computeQpResidual(), and AEFVBC::computeQpResidual().

51 {
52  Threads::spin_mutex::scoped_lock lock(_mutex);
53  if (_cached_elem_id != ielem || _cached_side_id != iside)
54  {
55  _cached_elem_id = ielem;
56  _cached_side_id = iside;
57 
58  calcFlux(iside, ielem, uvec1, dwave, _flux[tid]);
59  }
60  return _flux[tid];
61 }
unsigned int _cached_side_id
static Threads::spin_mutex _mutex
std::vector< std::vector< Real > > _flux
Threaded storage for fluxes.
dof_id_type _cached_elem_id
virtual void calcFlux(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, std::vector< Real > &flux) const =0
Solve the Riemann problem on the boundary face.
const DenseMatrix< Real > & BoundaryFluxBase::getJacobian ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
THREAD_ID  tid 
) const
virtualinherited

Get the boundary Jacobian matrix.

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

Definition at line 64 of file BoundaryFluxBase.C.

Referenced by CNSFVBC::computeQpJacobian(), AEFVBC::computeQpJacobian(), and CNSFVBC::computeQpOffDiagJacobian().

69 {
70  Threads::spin_mutex::scoped_lock lock(_mutex);
71  if (_cached_elem_id != ielem || _cached_side_id != iside)
72  {
73  _cached_elem_id = ielem;
74  _cached_side_id = iside;
75 
76  calcJacobian(iside, ielem, uvec1, dwave, _jac1[tid]);
77  }
78  return _jac1[tid];
79 }
unsigned int _cached_side_id
static Threads::spin_mutex _mutex
std::vector< DenseMatrix< Real > > _jac1
Threaded storage for jacobians.
virtual void calcJacobian(unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, DenseMatrix< Real > &jac1) const =0
Compute the Jacobian matrix on the boundary face.
dof_id_type _cached_elem_id
void BoundaryFluxBase::initialize ( )
virtualinherited

Definition at line 29 of file BoundaryFluxBase.C.

30 {
31  _cached_elem_id = 0;
32  _cached_side_id = libMesh::invalid_uint;
33 }
unsigned int _cached_side_id
dof_id_type _cached_elem_id

Member Data Documentation

const BCUserObject& CNSFVFreeInflowBoundaryFlux::_bc_uo
protected

Definition at line 43 of file CNSFVFreeInflowBoundaryFlux.h.

Referenced by calcFlux().

dof_id_type BoundaryFluxBase::_cached_elem_id
mutableprotectedinherited
unsigned int BoundaryFluxBase::_cached_side_id
mutableprotectedinherited
std::vector<std::vector<Real> > BoundaryFluxBase::_flux
mutableprotectedinherited

Threaded storage for fluxes.

Definition at line 98 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::BoundaryFluxBase(), and BoundaryFluxBase::getFlux().

const SinglePhaseFluidProperties& CNSFVFreeInflowBoundaryFlux::_fp
protected

Definition at line 44 of file CNSFVFreeInflowBoundaryFlux.h.

Referenced by calcFlux().

std::vector<DenseMatrix<Real> > BoundaryFluxBase::_jac1
mutableprotectedinherited

Threaded storage for jacobians.

Definition at line 101 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::BoundaryFluxBase(), and BoundaryFluxBase::getJacobian().


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