asl::LBGK Class Reference
Physics » Transport Processes | Numerics » Numerical Methods

Numerical method for fluid flow. More...

`#include <aslLBGK.h>`

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

## Public Types

typedef SPDataWithGhostNodesACL | Data
typedef SPDataWithGhostNodesACLData | DataD
typedef acl::VectorOfElements | Param
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 VectorTemplate * | getVectorTemplate () const
Data | getF ()
DataD | getRho ()
DataD | getVelocity ()
void | setCompressible (bool flag=true)
const bool & | getCompressible () const
| 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 VectorTemplate * | getVectorTemplate () 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 ()
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 ()
virtual | ~NumMethod ()

## Public Attributes

const VectorTemplate * | vectorTemplate

## 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...
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)
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::SPKernel > | copyKernels
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...
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

## Data [1/2]

typedef SPDataWithGhostNodesACL asl::LBGK::Data

Definition at line 80 of file aslLBGK.h.

## Data [2/2]

typedef SPDataWithGhostNodesACL asl::LBGK::Data

Definition at line 80 of file aslLBGK.h.

## DataD [1/2]

typedef SPDataWithGhostNodesACLData asl::LBGK::DataD

Definition at line 81 of file aslLBGK.h.

## DataD [2/2]

typedef SPDataWithGhostNodesACLData asl::LBGK::DataD

Definition at line 81 of file aslLBGK.h.

## Param [1/2]

typedef acl::VectorOfElements asl::LBGK::Param

Definition at line 82 of file aslLBGK.h.

## Param [2/2]

typedef acl::VectorOfElements asl::LBGK::Param

Definition at line 82 of file aslLBGK.h.

## Constructor & Destructor Documentation

## LBGK() [1/6]

asl::LBGK::LBGK | ( |  | ) |

## LBGK() [2/6]

asl::LBGK::LBGK | ( | DataD | v,
|  | Param | nu,
|  | const VectorTemplate * | vT
| ) |  |

## LBGK() [3/6]

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

## LBGK() [4/6]

asl::LBGK::LBGK | ( |  | ) |

## LBGK() [5/6]

asl::LBGK::LBGK | ( | DataD | v,
|  | Param | nu,
|  | const VectorTemplate * | vT
| ) |  |

## LBGK() [6/6]

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

## createCopyKernels() [1/2]

void asl::LBGK::createCopyKernels | ( |  | ) |

protected

## createCopyKernels() [2/2]

void asl::LBGK::createCopyKernels | ( |  | ) |

protected

## createData() [1/2]

void asl::LBGK::createData | ( | Block | b,
|  | acl::CommandQueue | queue,
|  | acl::TypeID | type
| ) |  |

protected

## createData() [2/2]

void asl::LBGK::createData | ( | Block | b,
|  | acl::CommandQueue | queue,
|  | acl::TypeID | type
| ) |  |

protected

## getCompressible() [1/2]

const bool & asl::LBGK::getCompressible | ( |  | ) | const

inline

Definition at line 203 of file aslLBGK.h.

## getCompressible() [2/2]

const bool& asl::LBGK::getCompressible | ( |  | ) | const

inline

## getF() [1/2]

LBGK::Data asl::LBGK::getF | ( |  | ) |

inline

Definition at line 178 of file aslLBGK.h.

## getF() [2/2]

Data asl::LBGK::getF | ( |  | ) |

inline

## getRho() [1/2]

LBGK::DataD asl::LBGK::getRho | ( |  | ) |

inline

Definition at line 183 of file aslLBGK.h.

## getRho() [2/2]

DataD asl::LBGK::getRho | ( |  | ) |

inline

## getVectorTemplate() [1/2]

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

inline

Definition at line 193 of file aslLBGK.h.

## getVectorTemplate() [2/2]

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

inline

## getVelocity() [1/2]

LBGK::DataD asl::LBGK::getVelocity | ( |  | ) |

inline

Definition at line 188 of file aslLBGK.h.

## getVelocity() [2/2]

DataD asl::LBGK::getVelocity | ( |  | ) |

inline

## getViscosity() [1/2]

double asl::LBGK::getViscosity | ( | unsigned int | i = `0` | ) |

## getViscosity() [2/2]

double asl::LBGK::getViscosity | ( | unsigned int | i = `0` | ) |

## init0() [1/2]

virtual void asl::LBGK::init0 | ( |  | ) |

protected virtual

full initialisation but without kernel->setup()

Implements asl::SingleKernelNM.

Reimplemented in asl::LBGKTurbulence, and asl::LBGKTurbulence.

## init0() [2/2]

virtual void asl::LBGK::init0 | ( |  | ) |

protected virtual

full initialisation but without kernel->setup()

Implements asl::SingleKernelNM.

Reimplemented in asl::LBGKTurbulence, and asl::LBGKTurbulence.

## preProcessing() [1/2]

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

protected virtual

contains classical moving procedure

Reimplemented from asl::SingleKernelNM.

## preProcessing() [2/2]

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

protected virtual

contains classical moving procedure

Reimplemented from asl::SingleKernelNM.

## setCompressible() [1/2]

void asl::LBGK::setCompressible | ( | bool | flag = `true` | ) |

inline

Definition at line 198 of file aslLBGK.h.

## setCompressible() [2/2]

void asl::LBGK::setCompressible | ( | bool | flag = `true` | ) |

inline

## setOmega() [1/2]

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

sets angular velocity for Coriolis term in noninertial reference frame

## setOmega() [2/2]

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

sets angular velocity for Coriolis term in noninertial reference frame

## setVectorTemplate() [1/2]

void asl::LBGK::setVectorTemplate | ( | const VectorTemplate * | vT | ) |

## setVectorTemplate() [2/2]

void asl::LBGK::setVectorTemplate | ( | const VectorTemplate * | vT | ) |

## setViscosity() [1/2]

void asl::LBGK::setViscosity | ( | Param | nu | ) |

## setViscosity() [2/2]

void asl::LBGK::setViscosity | ( | Param | nu | ) |

## Friends And Related Function Documentation

## computeMomentum() [1/2]

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`

## computeMomentum() [2/2]

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`

## computeRho() [1/2]

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`

## computeRho() [2/2]

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

## copyKernels

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

protected

Definition at line 94 of file aslLBGK.h.

## deltat

Param asl::LBGK::deltat

protected

Definition at line 97 of file aslLBGK.h.

## f

Data asl::LBGK::f

protected

Definition at line 87 of file aslLBGK.h.

## flagCompressible

bool asl::LBGK::flagCompressible

protected

Definition at line 103 of file aslLBGK.h.

## flagComputeRho

bool asl::LBGK::flagComputeRho

protected

Definition at line 102 of file aslLBGK.h.

## flagComputeVelocity

bool asl::LBGK::flagComputeVelocity

protected

Definition at line 101 of file aslLBGK.h.

## force

Param asl::LBGK::force

protected

Definition at line 98 of file aslLBGK.h.

## fPool

acl::VectorOfElementsData asl::LBGK::fPool

protected

Definition at line 86 of file aslLBGK.h.

## fShifts

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

protected

Definition at line 91 of file aslLBGK.h.

## fShiftsIncrement

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

protected

Definition at line 92 of file aslLBGK.h.

## omega

Param asl::LBGK::omega

protected

Definition at line 99 of file aslLBGK.h.

## rho

DataD asl::LBGK::rho

protected

Definition at line 89 of file aslLBGK.h.

## v

DataD asl::LBGK::v

protected

Definition at line 88 of file aslLBGK.h.

## vectorTemplate

const VectorTemplate * asl::LBGK::vectorTemplate

Definition at line 84 of file aslLBGK.h.

## viscosity

Param asl::LBGK::viscosity

protected

Definition at line 96 of file aslLBGK.h.

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

- /build/asl-1Fw6fH/asl-0.1.7/debian/tmp/usr/include/ASL/num/aslLBGK.h