ASL  0.1.6
Advanced Simulation Library
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Related Functions | List of all members
asl::LBGK Class Reference

Numerical method for fluid flow. More...

#include <aslLBGK.h>

Inheritance diagram for asl::LBGK:
Inheritance graph
[legend]
Collaboration diagram for asl::LBGK:
Collaboration graph
[legend]

Public Types

typedef SPDataWithGhostNodesACL Data
 
typedef SPDataWithGhostNodesACLData DataD
 
typedef acl::VectorOfElements Param
 

Public Member Functions

 LBGK ()
 
 LBGK (DataD v, Param nu, const VectorTemplate *vT)
 
 LBGK (Block b, Param nu, const VectorTemplate *vT, bool compVel=true, bool compRho=true, acl::CommandQueue queue=acl::hardware.defaultQueue)
 
void setViscosity (Param nu)
 
double getViscosity (unsigned int i=0)
 
void setOmega (Param w)
 sets angular velocity for Coriolis term in noninertial reference frame More...
 
void setVectorTemplate (const VectorTemplate *vT)
 
const VectorTemplategetVectorTemplate () const
 
Data getF ()
 
DataD getRho ()
 
DataD getVelocity ()
 
void setCompressible (bool flag=true)
 
const bool & getCompressible () const
 
- Public Member Functions inherited from asl::SingleKernelNM
virtual void execute ()
 Executes the numerical procedure. More...
 
virtual void init ()
 Builds the necesery internal data and kernels. More...
 
virtual ~SingleKernelNM ()
 
- Public Member Functions inherited from asl::NumMethod
virtual ~NumMethod ()
 

Public Attributes

const VectorTemplatevectorTemplate
 

Protected Member Functions

void createData (Block b, acl::CommandQueue queue, acl::TypeID type)
 
void createCopyKernels ()
 
virtual void preProcessing ()
 contains classical moving procedure More...
 
virtual void init0 ()
 full initialisation but without kernel->setup() More...
 
- Protected Member Functions inherited from asl::SingleKernelNM
virtual void postProcessing ()
 the function executed after kernel->compute() More...
 
 SingleKernelNM (const acl::KernelConfiguration &kernelCongig)
 

Protected Attributes

acl::VectorOfElementsData fPool
 
Data f
 
DataD v
 
DataD rho
 
std::shared_ptr< AVec< int > > fShifts
 
std::shared_ptr< AVec< int > > fShiftsIncrement
 
std::vector< acl::SPKernelcopyKernels
 
Param viscosity
 
Param deltat
 
Param force
 
Param omega
 
bool flagComputeVelocity
 
bool flagComputeRho
 
bool flagCompressible
 
- Protected Attributes inherited from asl::SingleKernelNM
acl::SPKernel kernel
 

Related Functions

(Note that these are not member functions.)

acl::VectorOfElements computeRho (acl::VectorOfElements f, const VectorTemplate *vt)
 returns VectorOfElements with values of rho More...
 
acl::VectorOfElements computeMomentum (acl::VectorOfElements f, const VectorTemplate *vt)
 returns VectorOfElements with values of velocity More...
 

Detailed Description

Numerical method for fluid flow.

The class realizes the Lattice-Boltzmann algorithm for the compressible and incompressible flows. This realization is valid for 2D as well as for 3D cases. The 2D realization uses D2Q9 (asl::d2q9) lattice, and 3D one uses D3Q15 (asl::d3q15) and D3Q19 (asl::d3q19) lattice. The kinetic eqaution is:

\[ f_i(\vec r+\vec a_i,t+1)=(1-\omega)f_i(\vec r,t)+\omega f^{eq}_i, \]

In the compressible case the equilibrium distribution functions are difined as follows:

\[ f^{eq}=\rho \left( 1+\frac{\vec a_i\cdot \vec v_i}{a_s^2}+ \frac{(\vec a_i \cdot \vec v)^2}{2a_s^4}-\frac{{\vec v}^2}{2a_s^2} \right),\]

where

\[ \rho=\sum_i w_i f_i,\;\;\; \vec v= \frac{1}{\rho}\left(\sum_i w_i\vec a_i f_i +\frac{1}{\omega}F\delta_t\right),\]

\[ a_s\equiv\sum_i w_i a_{ix}a_{ix}. \]

The local pressure is defined by the following expression:

\[ p = a_s^2 \rho. \]

In the case of incompressible flow the equilibrium distribution function is defined as follows:

\[ f^{eq}=p + p_0\left(\frac{\vec a_i\cdot \vec v_i}{a_s^2}+ \frac{(\vec a_i \cdot \vec v)^2}{2a_s^4}-\frac{{\vec v}^2}{2a_s^2} \right),\]

where

\[ p=\sum_i w_i f_i,\;\;\; \vec v= \frac{1}{p_0}\left(\sum_i w_i\vec a_i f_i +\frac{1}{\omega}F\delta_t\right),\]

\[ a_s\equiv\sum_i w_i a_{ix}a_{ix}. \]

The local pressure is defined by the following expression:

\[ p_0 = a_s^2 \rho_0. \]

it is assumed that \( p_0 \) value is 1.

The expression for the relaxation parameter is same for compressible and incompressible cases:

\[ w=\frac{2}{6\nu+1}, \]

where \(\nu\) is the kinematic viscosity.

see:X. He and L.S. Luo, "Lattice {B}oltzmann Model for the Incompressible Navier-Stokes Equation", J. Stat. Phys., v.88(1997), p.927-944, doi = {10.1023/B:JOSS.0000015179.12689.e4}

The class contains a noninertial force defined by the expression:

\[ F = - 2 \left[\vec \Omega, \vec v\right]. \]

Examples:
bus_wind.cc, compressor.cc, flow.cc, flow2.cc, flow3.cc, flowKDPGrowth.cc, flowRotatingCylinders.cc, locomotive_laminar.cc, locomotive_stability.cc, multicomponent_flow.cc, multiphase_flow.cc, and pitot_tube_ice.cc.

Definition at line 77 of file aslLBGK.h.

Member Typedef Documentation

Definition at line 80 of file aslLBGK.h.

Definition at line 81 of file aslLBGK.h.

Definition at line 82 of file aslLBGK.h.

Constructor & Destructor Documentation

asl::LBGK::LBGK ( )
asl::LBGK::LBGK ( DataD  v,
Param  nu,
const VectorTemplate vT 
)
asl::LBGK::LBGK ( Block  b,
Param  nu,
const VectorTemplate vT,
bool  compVel = true,
bool  compRho = true,
acl::CommandQueue  queue = acl::hardware.defaultQueue 
)

Member Function Documentation

void asl::LBGK::createCopyKernels ( )
protected
void asl::LBGK::createData ( Block  b,
acl::CommandQueue  queue,
acl::TypeID  type 
)
protected
const bool & asl::LBGK::getCompressible ( ) const
inline

Definition at line 203 of file aslLBGK.h.

LBGK::Data asl::LBGK::getF ( )
inline

Definition at line 178 of file aslLBGK.h.

LBGK::DataD asl::LBGK::getRho ( )
inline

Definition at line 183 of file aslLBGK.h.

const VectorTemplate * asl::LBGK::getVectorTemplate ( ) const
inline

Definition at line 193 of file aslLBGK.h.

LBGK::DataD asl::LBGK::getVelocity ( )
inline

Definition at line 188 of file aslLBGK.h.

double asl::LBGK::getViscosity ( unsigned int  i = 0)
virtual void asl::LBGK::init0 ( )
protectedvirtual

full initialisation but without kernel->setup()

Implements asl::SingleKernelNM.

Reimplemented in asl::LBGKTurbulence.

virtual void asl::LBGK::preProcessing ( )
protectedvirtual

contains classical moving procedure

Reimplemented from asl::SingleKernelNM.

void asl::LBGK::setCompressible ( bool  flag = true)
inline

Definition at line 198 of file aslLBGK.h.

void asl::LBGK::setOmega ( Param  w)

sets angular velocity for Coriolis term in noninertial reference frame

void asl::LBGK::setVectorTemplate ( const VectorTemplate vT)
void asl::LBGK::setViscosity ( Param  nu)

Friends And Related Function Documentation

acl::VectorOfElements computeMomentum ( acl::VectorOfElements  f,
const VectorTemplate vt 
)
related

returns VectorOfElements with values of velocity

\[ \vec m= \sum_i w_i\vec a_i f_i \]

where \( w_i \) is defined by vt

acl::VectorOfElements computeRho ( acl::VectorOfElements  f,
const VectorTemplate vt 
)
related

returns VectorOfElements with values of rho

\[ \rho=\sum_i w_i f_i\]

where \( w_i \) is defined by vt

Member Data Documentation

std::vector<acl::SPKernel> asl::LBGK::copyKernels
protected

Definition at line 94 of file aslLBGK.h.

Param asl::LBGK::deltat
protected

Definition at line 97 of file aslLBGK.h.

Data asl::LBGK::f
protected

Definition at line 87 of file aslLBGK.h.

bool asl::LBGK::flagCompressible
protected

Definition at line 103 of file aslLBGK.h.

bool asl::LBGK::flagComputeRho
protected

Definition at line 102 of file aslLBGK.h.

bool asl::LBGK::flagComputeVelocity
protected

Definition at line 101 of file aslLBGK.h.

Param asl::LBGK::force
protected

Definition at line 98 of file aslLBGK.h.

acl::VectorOfElementsData asl::LBGK::fPool
protected

Definition at line 86 of file aslLBGK.h.

std::shared_ptr<AVec<int> > asl::LBGK::fShifts
protected

Definition at line 91 of file aslLBGK.h.

std::shared_ptr<AVec<int> > asl::LBGK::fShiftsIncrement
protected

Definition at line 92 of file aslLBGK.h.

Param asl::LBGK::omega
protected

Definition at line 99 of file aslLBGK.h.

DataD asl::LBGK::rho
protected

Definition at line 89 of file aslLBGK.h.

DataD asl::LBGK::v
protected

Definition at line 88 of file aslLBGK.h.

const VectorTemplate* asl::LBGK::vectorTemplate

Definition at line 84 of file aslLBGK.h.

Param asl::LBGK::viscosity
protected

Definition at line 96 of file aslLBGK.h.


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