1D semi-infinite diffusion (Lab 3 From Alexiades PDE course). Sort of a little hack: its really a D2Q5 2d lattice (not a D1Q3), but both sides are periodic so it only varies along one axis. This is just a little sanity check/tutorial for using Palabos and getting used to the units.
parameter | description | expression [unit] |
---|---|---|
Relaxation time | variable |
|
|
Diffusivity (or Conductivity) |
|
mesh resolution (lattice units per physical unit) | [-] | |
time step (seconds per iteration) | ||
iterations to yield 1 second simulation |
|
For the base case we will use the regular D2Q5 BGK lattice to fix tau, ch and
ct, then we will modify the diffusion coefficient without having to change tau.
We want to make Diffusivity / Conductivity = 0.1
For this case
parameter | expression [unit] |
---|---|
64 | |
4096 |
Testing out the program: this means that the LBM program must undergo 4096 iterations to equal 1 second of physical time.
To be honest I am not exactly sure why you use the pointer syntax to make the boundary condition, but this is how they do it in Palabos. You can look at the documentation for the OnLatticeAdvectionDiffusionBoundaryCondition to see more.
void domain_setup( MultiBlockLattice2D<T,ADESCRIPTOR>& adLattice, IncomprFlowParam<T>& parameters )
{
...
...
...
// INITIAL CONDITION
initializeAtEquilibrium( adLattice,....)
// BOUNDARY CONDITION
// bc is a pointer to the boundary condition
OnLatticeAdvectionDiffusionBoundaryCondition2D<T, ADESCRIPTOR>*
bc = createLocalAdvectionDiffusionBoundaryCondition2D<T,ADESCRIPTOR>();
// the '->' syntax in c++ references the virtual method of a pointed to object
bc->addTemperatureBoundary1N(south_boundary,adLattice);
setBoundaryDensity(adLattice,south_boundary,(T)1.0);
...
}