ASL
0.1.7
Advanced Simulation Library
|
Numerical method for fluid flow. More...
#include <aslLBGK.h>
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 VectorTemplate * | getVectorTemplate () const |
Data | getF () |
DataD | getRho () |
DataD | getVelocity () |
void | setCompressible (bool flag=true) |
const bool & | getCompressible () const |
![]() | |
virtual void | execute () |
Executes the numerical procedure. More... | |
virtual void | init () |
Builds the necesery internal data and kernels. More... | |
virtual | ~SingleKernelNM () |
![]() | |
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... | |
![]() | |
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 |
![]() | |
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... | |
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]. \]
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 |
||
) |
|
protected |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
double asl::LBGK::getViscosity | ( | unsigned int | i = 0 | ) |
|
protectedvirtual |
full initialisation but without kernel->setup()
Implements asl::SingleKernelNM.
Reimplemented in asl::LBGKTurbulence.
|
protectedvirtual |
contains classical moving procedure
Reimplemented from asl::SingleKernelNM.
|
inline |
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 | ) |
|
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
|
related |
returns VectorOfElements with values of rho
\[ \rho=\sum_i w_i f_i\]
where \( w_i \) is defined by vt
|
protected |
|
protected |
|
protected |
const VectorTemplate* asl::LBGK::vectorTemplate |