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

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

#include <CNSFVFreeOutflowBoundaryFlux.h>

Inheritance diagram for CNSFVFreeOutflowBoundaryFlux:
[legend]

Public Member Functions

 CNSFVFreeOutflowBoundaryFlux (const InputParameters &parameters)
 
virtual ~CNSFVFreeOutflowBoundaryFlux ()
 
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 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 outflow boundary flux.

Definition at line 23 of file CNSFVFreeOutflowBoundaryFlux.h.

Constructor & Destructor Documentation

CNSFVFreeOutflowBoundaryFlux::CNSFVFreeOutflowBoundaryFlux ( const InputParameters &  parameters)

Definition at line 24 of file CNSFVFreeOutflowBoundaryFlux.C.

25  : BoundaryFluxBase(parameters), _fp(getUserObject<SinglePhaseFluidProperties>("fluid_properties"))
26 {
27 }
const SinglePhaseFluidProperties & _fp
BoundaryFluxBase(const InputParameters &parameters)
CNSFVFreeOutflowBoundaryFlux::~CNSFVFreeOutflowBoundaryFlux ( )
virtual

Definition at line 29 of file CNSFVFreeOutflowBoundaryFlux.C.

29 {}

Member Function Documentation

void CNSFVFreeOutflowBoundaryFlux::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

derived variables on the left

Implements BoundaryFluxBase.

Definition at line 32 of file CNSFVFreeOutflowBoundaryFlux.C.

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 }
const SinglePhaseFluidProperties & _fp
virtual Real pressure(Real v, Real u) const =0
Pressure as a function of specific internal energy and specific volume.
void CNSFVFreeOutflowBoundaryFlux::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 73 of file CNSFVFreeOutflowBoundaryFlux.C.

78 {
79 }
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

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& CNSFVFreeOutflowBoundaryFlux::_fp
protected

Definition at line 42 of file CNSFVFreeOutflowBoundaryFlux.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: