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 unsigned int _coupled_components
 
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 27 of file AdvectionBC.C.

28  : IntegratedBC(parameters),
29  _dim(_mesh.dimension()),
30  _coupled_components(coupledComponents("velocity_vector"))
31 {
33  paramError(
34  "velocity_vector",
35  "Number of components of velocity_vector must be at least equal to the mesh dimension");
36  if (_coupled_components > 3)
37  paramError("velocity_vector",
38  "You cannot supply more than 3 components for the velocity vector");
39 
41  for (unsigned int j = 0; j < _coupled_components; ++j)
42  _velocity[j] = &coupledValue("velocity_vector", j);
43 }

Member Function Documentation

◆ computeQpJacobian()

Real AdvectionBC::computeQpJacobian ( )
overrideprotectedvirtual

Definition at line 57 of file AdvectionBC.C.

58 {
59  RealVectorValue vel;
60  for (unsigned int j = 0; j < _coupled_components; ++j)
61  vel(j) = (*_velocity[j])[_qp];
62  if (vel * _normals[_qp] > 0)
63  return _test[_i][_qp] * _phi[_j][_qp] * vel * _normals[_qp];
64  return 0;
65 }

◆ computeQpResidual()

Real AdvectionBC::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 46 of file AdvectionBC.C.

47 {
48  RealVectorValue vel;
49  for (unsigned int j = 0; j < _coupled_components; ++j)
50  vel(j) = (*_velocity[j])[_qp];
51  if (vel * _normals[_qp] > 0)
52  return _test[_i][_qp] * _u[_qp] * vel * _normals[_qp];
53  return 0;
54 }

Member Data Documentation

◆ _coupled_components

const unsigned int AdvectionBC::_coupled_components
protected

Definition at line 34 of file AdvectionBC.h.

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

◆ _dim

const unsigned int AdvectionBC::_dim
protected

Definition at line 33 of file AdvectionBC.h.

Referenced by AdvectionBC().

◆ _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:
AdvectionBC::_dim
const unsigned int _dim
Definition: AdvectionBC.h:33
AdvectionBC::_coupled_components
const unsigned int _coupled_components
Definition: AdvectionBC.h:34
AdvectionBC::_velocity
std::vector< const VariableValue * > _velocity
Definition: AdvectionBC.h:35