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

Boundary terms for inflow/outflow of advected quantities, e.g. More...

#include <AdvectionBC.h>

Inheritance diagram for AdvectionBC:
[legend]

Public Member Functions

 AdvectionBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual () override
 
virtual Real computeQpJacobian () override
 

Protected Attributes

const unsigned int _dim
 
const bool _outflow
 
std::vector< const VariableValue * > _velocity
 

Detailed Description

Boundary terms for inflow/outflow of advected quantities, e.g.

u: u * velocity * normal

Definition at line 24 of file AdvectionBC.h.

Constructor & Destructor Documentation

◆ AdvectionBC()

AdvectionBC::AdvectionBC ( const InputParameters &  parameters)

Definition at line 29 of file AdvectionBC.C.

30  : IntegratedBC(parameters), _dim(_mesh.dimension()), _outflow(getParam<bool>("outflow"))
31 {
32  // check if # components matches mesh's dim
33  if (_dim != coupledComponents("velocity_vector"))
34  paramError("velocity_vector",
35  "Number of components of velocity_vector must match mesh dimension");
36 
37  _velocity.resize(_dim);
38  for (unsigned int j = 0; j < _dim; ++j)
39  _velocity[j] = &coupledValue("velocity_vector", j);
40 }
std::vector< const VariableValue * > _velocity
Definition: AdvectionBC.h:35
const unsigned int _dim
Definition: AdvectionBC.h:33
const bool _outflow
Definition: AdvectionBC.h:34

Member Function Documentation

◆ computeQpJacobian()

Real AdvectionBC::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 54 of file AdvectionBC.C.

55 {
56  RealVectorValue vel;
57  for (unsigned int j = 0; j < _dim; ++j)
58  vel(j) = (*_velocity[j])[_qp];
59  if ((vel * _normals[_qp] > 0) == _outflow)
60  return _test[_i][_qp] * _phi[_j][_qp] * vel * _normals[_qp];
61  return 0;
62 }
std::vector< const VariableValue * > _velocity
Definition: AdvectionBC.h:35
const unsigned int _dim
Definition: AdvectionBC.h:33
const bool _outflow
Definition: AdvectionBC.h:34

◆ computeQpResidual()

Real AdvectionBC::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 43 of file AdvectionBC.C.

44 {
45  RealVectorValue vel;
46  for (unsigned int j = 0; j < _dim; ++j)
47  vel(j) = (*_velocity[j])[_qp];
48  if ((vel * _normals[_qp] > 0) == _outflow)
49  return _test[_i][_qp] * _u[_qp] * vel * _normals[_qp];
50  return 0;
51 }
std::vector< const VariableValue * > _velocity
Definition: AdvectionBC.h:35
const unsigned int _dim
Definition: AdvectionBC.h:33
const bool _outflow
Definition: AdvectionBC.h:34

Member Data Documentation

◆ _dim

const unsigned int AdvectionBC::_dim
protected

Definition at line 33 of file AdvectionBC.h.

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

◆ _outflow

const bool AdvectionBC::_outflow
protected

Definition at line 34 of file AdvectionBC.h.

Referenced by computeQpJacobian(), and computeQpResidual().

◆ _velocity

std::vector<const VariableValue *> AdvectionBC::_velocity
protected

Definition at line 35 of file AdvectionBC.h.

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


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