Skip to content

D2q9 bc


The d2q9 model is a basic 2D Lattice Boltzmann Method model for flow simulation.

It is a implementation of a simple Multiple-Relaxation-Time collision operator.

The model has one option: BC. This option turns on custom fields for setting non-standard profiles on inlets and other things.


Model description files files for this model: Dynamics.c Dynamics.R

Zonal Settings

Name Comment
VelocityX inlet/outlet/init velocity
VelocityY inlet/outlet/init velocity
Pressure inlet/outlet/init density
PressureLossInObj Weight of [pressure loss] in objective
OutletFluxInObj Weight of [pressure loss] in objective
InletFluxInObj Weight of [pressure loss] in objective

Global Settings

Name Derived Comment
RelaxationRate 1.0/(3*Viscosity + 0.5) one over relaxation time
Viscosity viscosity
GravitationX GravitationX
GravitationY GravitationY
S2 1-RelaxationRate MRT Sx
Threshold Parameters threshold

Exported Quantities (VTK, etc)

Name Unit Comment
Rho kg/m3 Rho
U m/s U

Exported Global Integrals (CSV, etc)

Name Unit Comment
PressureLoss 1mPa pressure loss
OutletFlux 1m2/s pressure loss
InletFlux 1m2/s pressure loss
Objective 1 Objective function

Node Types

Group Types
BOUNDARY EPressure, WPressure, NVelocity, SVelocity, WVelocity, EVelocity, NSymmetry, SSymmetry, Solid, Wall
OBJECTIVE Inlet, Outlet

Solved fields

Name Access pattern Comment
f[0] stencil f[0]
f[1] stencil f[1]
f[2] stencil f[2]
f[3] stencil f[3]
f[4] stencil f[4]
f[5] stencil f[5]
f[6] stencil f[6]
f[7] stencil f[7]
f[8] stencil f[8]
BC[0] stencil BC[0]
BC[1] stencil BC[1]

Densities - default accessors

Name Field Pulling field from Comment
f[0] f[0] stencil f[0]
f[1] f[1] stencil f[1]
f[2] f[2] stencil f[2]
f[3] f[3] stencil f[3]
f[4] f[4] stencil f[4]
f[5] f[5] stencil f[5]
f[6] f[6] stencil f[6]
f[7] f[7] stencil f[7]
f[8] f[8] stencil f[8]
BC[0] BC[0] stencil BC[0]
BC[1] BC[1] stencil BC[1]

Action stages

Name Main procedure Preloaded densities Pushed fields
BaseIteration Run f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], BC[0], BC[1] f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], BC[0], BC[1]
BaseInit Init none f[0], f[1], f[2], f[3], f[4], f[5], f[6], f[7], f[8], BC[0], BC[1]


Name Stages
Iteration BaseIteration
Init BaseInit