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

Free outflow BC based boundary flux user object for the advection equation using a cell-centered finite volume method. More...

#include <AEFVFreeOutflowBoundaryFlux.h>

Inheritance diagram for AEFVFreeOutflowBoundaryFlux:
[legend]

Public Member Functions

 AEFVFreeOutflowBoundaryFlux (const InputParameters &parameters)
 
virtual ~AEFVFreeOutflowBoundaryFlux ()
 
virtual void calcFlux (unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave, std::vector< Real > &flux) const override
 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 override
 Compute the Jacobian matrix on the boundary face. More...
 
virtual void execute () override
 
virtual void initialize () override
 
virtual void finalize () override
 
virtual void threadJoin (const UserObject &) override
 
virtual const std::vector< Real > & getFlux (unsigned int iside, dof_id_type ielem, const std::vector< Real > &uvec1, const RealVectorValue &dwave) 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) const
 Get the boundary Jacobian matrix. More...
 

Protected Attributes

const Real _velocity
 advective velocity More...
 
unsigned int _cached_flux_elem_id
 element ID of the cached flux values More...
 
unsigned int _cached_flux_side_id
 side ID of the cached flux values More...
 
unsigned int _cached_jacobian_elem_id
 element ID of the cached Jacobian values More...
 
unsigned int _cached_jacobian_side_id
 side ID of the cached Jacobian values More...
 
std::vector< Real > _flux
 Cached flux. More...
 
DenseMatrix< Real > _jac1
 Cached flux Jacobian. More...
 

Detailed Description

Free outflow BC based boundary flux user object for the advection equation using a cell-centered finite volume method.

Definition at line 26 of file AEFVFreeOutflowBoundaryFlux.h.

Constructor & Destructor Documentation

◆ AEFVFreeOutflowBoundaryFlux()

AEFVFreeOutflowBoundaryFlux::AEFVFreeOutflowBoundaryFlux ( const InputParameters &  parameters)

Definition at line 25 of file AEFVFreeOutflowBoundaryFlux.C.

26  : BoundaryFluxBase(parameters), _velocity(getParam<Real>("velocity"))
27 {
28 }
const Real _velocity
advective velocity
BoundaryFluxBase(const InputParameters &parameters)

◆ ~AEFVFreeOutflowBoundaryFlux()

AEFVFreeOutflowBoundaryFlux::~AEFVFreeOutflowBoundaryFlux ( )
virtual

Definition at line 30 of file AEFVFreeOutflowBoundaryFlux.C.

30 {}

Member Function Documentation

◆ calcFlux()

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

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

Implements BoundaryFluxBase.

Definition at line 33 of file AEFVFreeOutflowBoundaryFlux.C.

38 {
39  mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
40 
41  // assume the velocity vector is constant
42  RealVectorValue uadv1(_velocity, 0.0, 0.0);
43 
44  // assign the size of flux vector, e.g. = 1 for the advection equation
45  flux.resize(1);
46 
47  // finally calculate the flux
48  flux[0] = (uadv1 * dwave) * uvec1[0];
49 }
const Real _velocity
advective velocity

◆ calcJacobian()

void AEFVFreeOutflowBoundaryFlux::calcJacobian ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave,
DenseMatrix< Real > &  jac1 
) const
overridevirtual

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 52 of file AEFVFreeOutflowBoundaryFlux.C.

57 {
58  mooseAssert(uvec1.size() == 1, "Invalid size for uvec1. Must be single variable coupling.");
59  jac1.resize(1, 1);
60  // assume the velocity vector is constant
61  const RealVectorValue uadv1(_velocity, 0.0, 0.0);
62  jac1(0, 0) = uadv1 * dwave;
63 }
const Real _velocity
advective velocity

◆ execute()

void BoundaryFluxBase::execute ( )
overridevirtualinherited

Definition at line 39 of file BoundaryFluxBase.C.

40 {
41 }

◆ finalize()

void BoundaryFluxBase::finalize ( )
overridevirtualinherited

Definition at line 44 of file BoundaryFluxBase.C.

45 {
46 }

◆ getFlux()

const std::vector< Real > & BoundaryFluxBase::getFlux ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave 
) 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 54 of file BoundaryFluxBase.C.

Referenced by AEFVBC::computeQpResidual().

58 {
59  if (_cached_flux_elem_id != ielem || _cached_flux_side_id != iside)
60  {
61  _cached_flux_elem_id = ielem;
62  _cached_flux_side_id = iside;
63 
64  calcFlux(iside, ielem, uvec1, dwave, _flux);
65  }
66  return _flux;
67 }
unsigned int _cached_flux_side_id
side ID of the cached flux values
std::vector< Real > _flux
Cached flux.
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.
unsigned int _cached_flux_elem_id
element ID of the cached flux values

◆ getJacobian()

const DenseMatrix< Real > & BoundaryFluxBase::getJacobian ( unsigned int  iside,
dof_id_type  ielem,
const std::vector< Real > &  uvec1,
const RealVectorValue &  dwave 
) 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 70 of file BoundaryFluxBase.C.

Referenced by AEFVBC::computeQpJacobian().

74 {
75  if (_cached_jacobian_elem_id != ielem || _cached_jacobian_side_id != iside)
76  {
79 
80  calcJacobian(iside, ielem, uvec1, dwave, _jac1);
81  }
82  return _jac1;
83 }
DenseMatrix< Real > _jac1
Cached flux Jacobian.
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
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.

◆ initialize()

void BoundaryFluxBase::initialize ( )
overridevirtualinherited

Definition at line 30 of file BoundaryFluxBase.C.

31 {
32  _cached_flux_elem_id = libMesh::invalid_uint;
33  _cached_flux_side_id = libMesh::invalid_uint;
34  _cached_jacobian_elem_id = libMesh::invalid_uint;
35  _cached_jacobian_side_id = libMesh::invalid_uint;
36 }
unsigned int _cached_flux_side_id
side ID of the cached flux values
unsigned int _cached_jacobian_side_id
side ID of the cached Jacobian values
unsigned int _cached_jacobian_elem_id
element ID of the cached Jacobian values
unsigned int _cached_flux_elem_id
element ID of the cached flux values

◆ threadJoin()

void BoundaryFluxBase::threadJoin ( const UserObject &  )
overridevirtualinherited

Definition at line 49 of file BoundaryFluxBase.C.

50 {
51 }

Member Data Documentation

◆ _cached_flux_elem_id

unsigned int BoundaryFluxBase::_cached_flux_elem_id
mutableprotectedinherited

element ID of the cached flux values

Definition at line 95 of file BoundaryFluxBase.h.

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

◆ _cached_flux_side_id

unsigned int BoundaryFluxBase::_cached_flux_side_id
mutableprotectedinherited

side ID of the cached flux values

Definition at line 97 of file BoundaryFluxBase.h.

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

◆ _cached_jacobian_elem_id

unsigned int BoundaryFluxBase::_cached_jacobian_elem_id
mutableprotectedinherited

element ID of the cached Jacobian values

Definition at line 100 of file BoundaryFluxBase.h.

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

◆ _cached_jacobian_side_id

unsigned int BoundaryFluxBase::_cached_jacobian_side_id
mutableprotectedinherited

side ID of the cached Jacobian values

Definition at line 102 of file BoundaryFluxBase.h.

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

◆ _flux

std::vector<Real> BoundaryFluxBase::_flux
mutableprotectedinherited

Cached flux.

Definition at line 105 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getFlux().

◆ _jac1

DenseMatrix<Real> BoundaryFluxBase::_jac1
mutableprotectedinherited

Cached flux Jacobian.

Definition at line 108 of file BoundaryFluxBase.h.

Referenced by BoundaryFluxBase::getJacobian().

◆ _velocity

const Real AEFVFreeOutflowBoundaryFlux::_velocity
protected

advective velocity

Definition at line 46 of file AEFVFreeOutflowBoundaryFlux.h.

Referenced by calcFlux(), and calcJacobian().


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