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

A boundary condition object for the CNS equations. More...

#include <CNSFVBC.h>

Inheritance diagram for CNSFVBC:
[legend]

Public Member Functions

 CNSFVBC (const InputParameters &parameters)
 
virtual ~CNSFVBC ()
 

Protected Member Functions

virtual Real computeQpResidual ()
 
virtual Real computeQpJacobian ()
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar)
 

Protected Attributes

MooseEnum _component
 choose an equation More...
 
const VariableValue & _rhoc1
 "1" denotes the "host" state "2" denotes the "ghost" state More...
 
const VariableValue & _rhouc1
 
const VariableValue & _rhovc1
 
const VariableValue & _rhowc1
 
const VariableValue & _rhoec1
 
const MaterialProperty< Real > & _rho1
 extrapolated variable values at side center More...
 
const MaterialProperty< Real > & _rhou1
 
const MaterialProperty< Real > & _rhov1
 
const MaterialProperty< Real > & _rhow1
 
const MaterialProperty< Real > & _rhoe1
 
const BoundaryFluxBase_flux
 fluid properties object More...
 
unsigned int _rho_var
 
unsigned int _rhou_var
 
unsigned int _rhov_var
 
unsigned int _rhow_var
 
unsigned int _rhoe_var
 
std::map< unsigned int, unsigned int > _jmap
 

Detailed Description

A boundary condition object for the CNS equations.

Notes:

  1. This BC does not do any complex calculation. It gets the flux vector and Jacobian matrix from the boundary flux user object being called.
  2. If a system of governing equations is being solved, the flux vector and Jacobian matrix are calculated only once for the first equation and cached for use for the rest of the equations in the system.
  3. On the "left" state of the boundary face, the variable value is interpolated from the reconstructed linear polynomial in the host element, which is provided from the corresponding material kernel.
  4. On the "right" state of the boundary face, the variable value should be obtained from the bc user object being called.

Definition at line 42 of file CNSFVBC.h.

Constructor & Destructor Documentation

CNSFVBC::CNSFVBC ( const InputParameters &  parameters)

Definition at line 37 of file CNSFVBC.C.

38  : IntegratedBC(parameters),
39  _component(getParam<MooseEnum>("component")),
40  _rhoc1(coupledValue("rho")),
41  _rhouc1(coupledValue("rhou")),
42  _rhovc1(isCoupled("rhov") ? coupledValue("rhov") : _zero),
43  _rhowc1(isCoupled("rhow") ? coupledValue("rhow") : _zero),
44  _rhoec1(coupledValue("rhoe")),
45  _rho1(getMaterialProperty<Real>("rho")),
46  _rhou1(getMaterialProperty<Real>("rhou")),
47  _rhov1(getMaterialProperty<Real>("rhov")),
48  _rhow1(getMaterialProperty<Real>("rhow")),
49  _rhoe1(getMaterialProperty<Real>("rhoe")),
50  _flux(getUserObject<BoundaryFluxBase>("flux")),
51  _rho_var(coupled("rho")),
52  _rhou_var(coupled("rhou")),
53  _rhov_var(isCoupled("rhov") ? coupled("rhov") : zero),
54  _rhow_var(isCoupled("rhow") ? coupled("rhow") : zero),
55  _rhoe_var(coupled("rhoe"))
56 {
57  _jmap.insert(std::pair<unsigned int, unsigned int>(_rho_var, 0));
58  _jmap.insert(std::pair<unsigned int, unsigned int>(_rhou_var, 1));
59  _jmap.insert(std::pair<unsigned int, unsigned int>(_rhov_var, 2));
60  _jmap.insert(std::pair<unsigned int, unsigned int>(_rhow_var, 3));
61  _jmap.insert(std::pair<unsigned int, unsigned int>(_rhoe_var, 4));
62 }
const VariableValue & _rhowc1
Definition: CNSFVBC.h:63
const MaterialProperty< Real > & _rho1
extrapolated variable values at side center
Definition: CNSFVBC.h:67
unsigned int _rhoe_var
Definition: CNSFVBC.h:80
const MaterialProperty< Real > & _rhoe1
Definition: CNSFVBC.h:71
std::map< unsigned int, unsigned int > _jmap
Definition: CNSFVBC.h:82
const BoundaryFluxBase & _flux
fluid properties object
Definition: CNSFVBC.h:74
const MaterialProperty< Real > & _rhow1
Definition: CNSFVBC.h:70
const VariableValue & _rhoec1
Definition: CNSFVBC.h:64
const MaterialProperty< Real > & _rhov1
Definition: CNSFVBC.h:69
MooseEnum _component
choose an equation
Definition: CNSFVBC.h:54
unsigned int _rhov_var
Definition: CNSFVBC.h:78
const VariableValue & _rhouc1
Definition: CNSFVBC.h:61
unsigned int _rhou_var
Definition: CNSFVBC.h:77
unsigned int _rhow_var
Definition: CNSFVBC.h:79
unsigned int _rho_var
Definition: CNSFVBC.h:76
const MaterialProperty< Real > & _rhou1
Definition: CNSFVBC.h:68
const VariableValue & _rhoc1
"1" denotes the "host" state "2" denotes the "ghost" state
Definition: CNSFVBC.h:60
const VariableValue & _rhovc1
Definition: CNSFVBC.h:62
virtual CNSFVBC::~CNSFVBC ( )
inlinevirtual

Definition at line 46 of file CNSFVBC.h.

46 {}

Member Function Documentation

Real CNSFVBC::computeQpJacobian ( )
protectedvirtual

input variables are the original constant monomial from the "left" and "right" cells

Definition at line 85 of file CNSFVBC.C.

Referenced by ~CNSFVBC().

86 {
87  std::vector<Real> uvec1 = {_rhoc1[_qp], _rhouc1[_qp], _rhovc1[_qp], _rhowc1[_qp], _rhoec1[_qp]};
88 
90 
91  const DenseMatrix<Real> & fjac1 =
92  _flux.getJacobian(_current_side, _current_elem->id(), uvec1, _normals[_qp], _tid);
93 
94  return fjac1(_component, _component) * _phi[_j][_qp] * _test[_i][_qp];
95 }
const VariableValue & _rhowc1
Definition: CNSFVBC.h:63
const BoundaryFluxBase & _flux
fluid properties object
Definition: CNSFVBC.h:74
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.
const VariableValue & _rhoec1
Definition: CNSFVBC.h:64
MooseEnum _component
choose an equation
Definition: CNSFVBC.h:54
const VariableValue & _rhouc1
Definition: CNSFVBC.h:61
const VariableValue & _rhoc1
"1" denotes the "host" state "2" denotes the "ghost" state
Definition: CNSFVBC.h:60
const VariableValue & _rhovc1
Definition: CNSFVBC.h:62
Real CNSFVBC::computeQpOffDiagJacobian ( unsigned int  jvar)
protectedvirtual

input variables are the original constant monomial from the "left" and "right" cells

Definition at line 98 of file CNSFVBC.C.

Referenced by ~CNSFVBC().

99 {
100  std::vector<Real> uvec1 = {_rhoc1[_qp], _rhouc1[_qp], _rhovc1[_qp], _rhowc1[_qp], _rhoec1[_qp]};
101 
103 
104  const DenseMatrix<Real> & fjac1 =
105  _flux.getJacobian(_current_side, _current_elem->id(), uvec1, _normals[_qp], _tid);
106 
107  return fjac1(_component, _jmap[jvar]) * _phi[_j][_qp] * _test[_i][_qp];
108 }
const VariableValue & _rhowc1
Definition: CNSFVBC.h:63
std::map< unsigned int, unsigned int > _jmap
Definition: CNSFVBC.h:82
const BoundaryFluxBase & _flux
fluid properties object
Definition: CNSFVBC.h:74
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.
const VariableValue & _rhoec1
Definition: CNSFVBC.h:64
MooseEnum _component
choose an equation
Definition: CNSFVBC.h:54
const VariableValue & _rhouc1
Definition: CNSFVBC.h:61
const VariableValue & _rhoc1
"1" denotes the "host" state "2" denotes the "ghost" state
Definition: CNSFVBC.h:60
const VariableValue & _rhovc1
Definition: CNSFVBC.h:62
Real CNSFVBC::computeQpResidual ( )
protectedvirtual

the size of flux vector is five 0 for mass 1 for x-momentum 2 for y-momentum 3 for z-momentum 4 for total-energy

input variables are the reconstructed linear monomial extrapolated at side center from "left" and "ghost" cells

Definition at line 65 of file CNSFVBC.C.

Referenced by ~CNSFVBC().

66 {
73 
74  std::vector<Real> uvec1 = {_rho1[_qp], _rhou1[_qp], _rhov1[_qp], _rhow1[_qp], _rhoe1[_qp]};
75 
77 
78  const std::vector<Real> & flux =
79  _flux.getFlux(_current_side, _current_elem->id(), uvec1, _normals[_qp], _tid);
80 
81  return flux[_component] * _test[_i][_qp];
82 }
const MaterialProperty< Real > & _rho1
extrapolated variable values at side center
Definition: CNSFVBC.h:67
const MaterialProperty< Real > & _rhoe1
Definition: CNSFVBC.h:71
const BoundaryFluxBase & _flux
fluid properties object
Definition: CNSFVBC.h:74
const MaterialProperty< Real > & _rhow1
Definition: CNSFVBC.h:70
const MaterialProperty< Real > & _rhov1
Definition: CNSFVBC.h:69
MooseEnum _component
choose an equation
Definition: CNSFVBC.h:54
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.
const MaterialProperty< Real > & _rhou1
Definition: CNSFVBC.h:68

Member Data Documentation

MooseEnum CNSFVBC::_component
protected

choose an equation

Definition at line 54 of file CNSFVBC.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

const BoundaryFluxBase& CNSFVBC::_flux
protected

fluid properties object

Definition at line 74 of file CNSFVBC.h.

Referenced by computeQpJacobian(), computeQpOffDiagJacobian(), and computeQpResidual().

std::map<unsigned int, unsigned int> CNSFVBC::_jmap
protected

Definition at line 82 of file CNSFVBC.h.

Referenced by CNSFVBC(), and computeQpOffDiagJacobian().

const MaterialProperty<Real>& CNSFVBC::_rho1
protected

extrapolated variable values at side center

Definition at line 67 of file CNSFVBC.h.

Referenced by computeQpResidual().

unsigned int CNSFVBC::_rho_var
protected

Definition at line 76 of file CNSFVBC.h.

Referenced by CNSFVBC().

const VariableValue& CNSFVBC::_rhoc1
protected

"1" denotes the "host" state "2" denotes the "ghost" state

piecewise constant variable values in host cells

Definition at line 60 of file CNSFVBC.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const MaterialProperty<Real>& CNSFVBC::_rhoe1
protected

Definition at line 71 of file CNSFVBC.h.

Referenced by computeQpResidual().

unsigned int CNSFVBC::_rhoe_var
protected

Definition at line 80 of file CNSFVBC.h.

Referenced by CNSFVBC().

const VariableValue& CNSFVBC::_rhoec1
protected

Definition at line 64 of file CNSFVBC.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const MaterialProperty<Real>& CNSFVBC::_rhou1
protected

Definition at line 68 of file CNSFVBC.h.

Referenced by computeQpResidual().

unsigned int CNSFVBC::_rhou_var
protected

Definition at line 77 of file CNSFVBC.h.

Referenced by CNSFVBC().

const VariableValue& CNSFVBC::_rhouc1
protected

Definition at line 61 of file CNSFVBC.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const MaterialProperty<Real>& CNSFVBC::_rhov1
protected

Definition at line 69 of file CNSFVBC.h.

Referenced by computeQpResidual().

unsigned int CNSFVBC::_rhov_var
protected

Definition at line 78 of file CNSFVBC.h.

Referenced by CNSFVBC().

const VariableValue& CNSFVBC::_rhovc1
protected

Definition at line 62 of file CNSFVBC.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().

const MaterialProperty<Real>& CNSFVBC::_rhow1
protected

Definition at line 70 of file CNSFVBC.h.

Referenced by computeQpResidual().

unsigned int CNSFVBC::_rhow_var
protected

Definition at line 79 of file CNSFVBC.h.

Referenced by CNSFVBC().

const VariableValue& CNSFVBC::_rhowc1
protected

Definition at line 63 of file CNSFVBC.h.

Referenced by computeQpJacobian(), and computeQpOffDiagJacobian().


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