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

This class imposes a velocity direction component as a Dirichlet condition on the appropriate momentum equation. More...

#include <NSImposedVelocityDirectionBC.h>

Inheritance diagram for NSImposedVelocityDirectionBC:
[legend]

Public Member Functions

 NSImposedVelocityDirectionBC (const InputParameters &parameters)
 

Protected Member Functions

virtual Real computeQpResidual ()
 

Protected Attributes

const VariableValue & _rho
 
const VariableValue & _u_vel
 
const VariableValue & _v_vel
 
const VariableValue & _w_vel
 
Real _desired_unit_velocity_component
 

Detailed Description

This class imposes a velocity direction component as a Dirichlet condition on the appropriate momentum equation.

For example, in the x-direction, the residual equation becomes:

u1/|u| - u1_hat_desired = 0

or

u1 - u1_hat_desired*|u| = 0

or

rho*u1 - rho*u1_hat_desired*|u| = 0

where: u1 = the x-momentum component |u| = velocity magnitude u1_hat_desired = The desired velocity direction, \( \in (0,1) \)

Definition at line 39 of file NSImposedVelocityDirectionBC.h.

Constructor & Destructor Documentation

NSImposedVelocityDirectionBC::NSImposedVelocityDirectionBC ( const InputParameters &  parameters)

Definition at line 37 of file NSImposedVelocityDirectionBC.C.

38  : NodalBC(parameters),
39  _rho(coupledValue(NS::density)),
40  _u_vel(coupledValue(NS::velocity_x)),
41  _v_vel(_mesh.dimension() == 2 ? coupledValue(NS::velocity_y) : _zero),
42  _w_vel(_mesh.dimension() == 3 ? coupledValue(NS::velocity_z) : _zero),
43  _desired_unit_velocity_component(getParam<Real>("desired_unit_velocity_component"))
44 {
45 }
Definition: NS.h:13
const std::string velocity_z
Definition: NS.h:23
const std::string density
Definition: NS.h:15
const std::string velocity_x
Definition: NS.h:21
const std::string velocity_y
Definition: NS.h:22

Member Function Documentation

Real NSImposedVelocityDirectionBC::computeQpResidual ( )
protectedvirtual

Definition at line 48 of file NSImposedVelocityDirectionBC.C.

49 {
50  // The velocity vector
51  RealVectorValue vel(_u_vel[_qp], _v_vel[_qp], _w_vel[_qp]);
52 
53  // Specify desired velocity component
54  return _u[_qp] - _rho[_qp] * _desired_unit_velocity_component * vel.norm();
55 }

Member Data Documentation

Real NSImposedVelocityDirectionBC::_desired_unit_velocity_component
protected

Definition at line 57 of file NSImposedVelocityDirectionBC.h.

Referenced by computeQpResidual().

const VariableValue& NSImposedVelocityDirectionBC::_rho
protected

Definition at line 51 of file NSImposedVelocityDirectionBC.h.

Referenced by computeQpResidual().

const VariableValue& NSImposedVelocityDirectionBC::_u_vel
protected

Definition at line 52 of file NSImposedVelocityDirectionBC.h.

Referenced by computeQpResidual().

const VariableValue& NSImposedVelocityDirectionBC::_v_vel
protected

Definition at line 53 of file NSImposedVelocityDirectionBC.h.

Referenced by computeQpResidual().

const VariableValue& NSImposedVelocityDirectionBC::_w_vel
protected

Definition at line 54 of file NSImposedVelocityDirectionBC.h.

Referenced by computeQpResidual().


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