Unit Conversion

The unit conversion is an important part between the Lattice Unit and Physical Unit.

Basics

The numerical parameters, including lattice spacing, Re number, and kinematic viscosity, are computed as follows:

$$\delta_x = \frac{L_x}{N_x-1}$$ $$Re=\frac{UL_x}{\nu}=\frac{U_lb(N_x-1)}{\nu_{lb}}$$ $$\dashrightarrow \nu_{lb}=\frac{U_lb(N_x-1)}{Re}$$

Alternatively, define the kinematic viscosity:

$$U = \frac{\delta_x}{\delta_t}U_{lb}$$ $$\nu_{lb}=\nu\frac{\delta_t}{{\delta_x}^2}$$

Setup of a simulation

Pick Nx (number of lattice sites) and calculate: $$\delta_x = \frac{L_x}{N_x-1}$$ Pick: $$U_{lb} << 1$$ and calculate time step: $$\delta_t = \delta_x\frac{U_{lb}}{U}$$

Now, calculate kinematic viscosity and relaxation factor:

$$\nu_{lb}=\nu\frac{\delta_t}{{\delta_x}^2}$$ $$\dashrightarrow \omega=1/(3\nu_{lb}+1/2)$$

Evaluation of simulation results

Evaluate the physical variables from the numerical values, including fluid velocity and pressure:

$$U = \frac{\delta_x}{\delta_t}U_{lb}$$ $$p=\rho_0\frac{1}{3}\nu\frac{{\delta_x}^2}{\delta_t}(\rho_{lb}-1)$$

Code examples in Palabos:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
template <typename Real, typename Int>
Numerics<Real, Int>& Numerics<Real, Int>::initLrefReUlb(Int l_ref_lu_,
                                                           Real re, Real u_lb_,
                                                           Int lx_lu, Int ly_lu,
                                                           Int lz_lu) {
    l_ref_lu = l_ref_lu_;
    setTau(3. * (u_lb_ * l_ref_lu_ / re) + 0.5);
    setUlb(u_lb_);
    lx_domain = lx_lu;
    ly_domain = ly_lu;
    lz_domain = lz_lu;
    is_initialized = true;
    dimless->initReLxLyLz(l_ref_lu_ * u_lb_ / getNulu(tau), lx_lu / l_ref_lu_,
                          ly_lu / l_ref_lu_, lz_lu / l_ref_lu_);
    return *this;
}

template <typename Real, typename Int>
Numerics<Real, Int>& Numerics<Real, Int>::initLrefReTau(Int l_ref_lu_,
                                                           Real re, Real tau_,
                                                           Int lx_lu, Int ly_lu,
                                                           Int lz_lu) {
    l_ref_lu = l_ref_lu_;
    setTau(tau_);
    setUlb(re * getNulu(tau_) / l_ref_lu_);
    lx_domain = lx_lu;
    ly_domain = ly_lu;
    lz_domain = lz_lu;
    is_initialized = true;
    dimless->initReLxLyLz(l_ref_lu_ * u_lb / getNulu(tau), lx_lu / l_ref_lu_,
                          ly_lu / l_ref_lu_, lz_lu / l_ref_lu_);
    return *this;
}

A PDF file can be found at: LINK

updatedupdated2020-08-012020-08-01