Science&Enigneering

Boltzmann equation and LBM

##- 2023. 3. 10. 11:32
728x90

The Boltzmann equation is a fundamental equation in statistical mechanics that describes the time evolution of the distribution function of a large number of particles in a gas or plasma. The equation was first proposed by Ludwig Boltzmann in the 1870s and has since been used to study a wide range of physical phenomena, including the transport of heat, mass, and momentum in fluids and plasmas.

 

The Boltzmann equation is a kinetic equation that describes the evolution of the probability distribution function f(r, p, t) of the positions and momenta of a large number of particles in a gas or plasma. The equation is given by:

 

∂f/∂t + v · ∇_r f + F/m · ∇_p f = C[f],

 

where v is the particle velocity, r is the position vector, p is the momentum vector, F is the force acting on the particle, m is the particle mass, and C[f] is the collision term that describes the interactions between particles. The collision term takes into account the probabilities of collisions between particles and their resulting changes in momentum and energy.

 

The Boltzmann equation is a highly nonlinear partial differential equation and is difficult to solve analytically. However, it can be solved numerically using various methods, such as the Monte Carlo method, the Direct Simulation Monte Carlo method, and the Lattice Boltzmann method. These methods are used to study a wide range of phenomena, such as rarefied gas dynamics, plasma physics, and fluid dynamics.

 

From the distribution function, various macroscopic properties of the system can be derived. Here are some of the properties that can be derived from the Boltzmann equation:

 

Density: The density of the system is given by integrating the distribution function over all particle velocities:

  • ρ = ∫ f(r,p,t) dp^3

Velocity: The mean velocity of the system is given by integrating the distribution function multiplied by the particle velocity over all velocities and then dividing by the density.

  • u = ∫ p f(r,p,t) dp^3 / ρ

Pressure: The pressure of the system is related to the stress tensor, which can be derived from the distribution function

  • P = ∫ (p ⊗ p - I) f(r,p,t) dp^3 / (3ρ)

where ⊗ denotes the outer product and I is the identity matrix.

 

Heat flux: The heat flux can be derived from the energy-momentum tensor, which can also be derived from the distribution function:

  • q = ∫ p (p · u - (1/2) |p|^2) f(r,p,t) dp^3 / (3ρ)

where q is the heat flux vector.

 

Viscosity: The viscosity of the system can also be derived from the distribution function. In the case of a simple fluid, the viscosity coefficient is given by:

  • η = (5/16) ρ ∫ (p · u) (p · u - 3/2 |p|^2) τ(p) dp^3

where τ(p) is the collision operator, which accounts for the interactions between particles.

 

These are just a few examples of the macroscopic properties that can be derived from the Boltzmann equation. Other properties, such as thermal conductivity and diffusion coefficients, can also be derived from the distribution function.

 

 

The Lattice Boltzmann Method (LBM) is a numerical technique used for simulating the behavior of fluids and gases at a mesoscopic scale, which is intermediate between the microscopic and macroscopic scales. The method was first introduced in the 1990s as a novel alternative to traditional computational fluid dynamics methods.

 

In the LBM, the fluid is represented by a set of particles that move on a lattice, and their behavior is described by a simplified kinetic equation, known as the lattice Boltzmann equation. This equation describes the evolution of the probability distribution function of particle velocities on the lattice.

 

The lattice Boltzmann equation is a discrete version of the Boltzmann equation, and it has the form:

 

fi(x + ciΔt, t + Δt) - fi(x, t) = -Ωi

 

where fi(x,t) is the probability distribution function of particle velocities at position x and time t, ci is the velocity of the i-th particle, Δt is the time step, and Ωi is the collision operator.

 

The collision operator is responsible for ensuring that the probability distribution function satisfies the appropriate conservation laws for mass, momentum, and energy. It also incorporates the effects of viscosity and other fluid properties.

 

The lattice Boltzmann equation is solved iteratively on the lattice, and the resulting distribution function is used to compute the macroscopic properties of the fluid, such as density, velocity, and pressure. These properties can then be used to simulate fluid flow and other phenomena.

 

The LBM has several advantages over traditional computational fluid dynamics methods. It is computationally efficient, can handle complex geometries, and is well-suited for parallel computing. It is also easy to implement and can be used to model a wide range of fluids and gases, including multi-phase flows and non-Newtonian fluids.

반응형
import numpy as np

# Define the lattice velocities
c = np.array([[0,0],[1,0],[-1,0],[0,1],[0,-1],[1,1],[-1,-1],[1,-1],[-1,1]])

# Define the lattice weights
w = np.array([4/9,1/9,1/9,1/9,1/9,1/36,1/36,1/36,1/36])

# Define the fluid parameters
viscosity = 0.1
density = 1.0
dt = 1.0
dx = 1.0
timesteps = 100

# Initialize the fluid density and velocity
rho = np.ones((100,100))
u = np.zeros((100,100,2))

# Define the equilibrium distribution function
def equilibrium(rho,u,c):
    u2 = u.dot(u)
    eu = c.dot(u.T)
    return w * rho * (1 + 3 * eu + 9/2 * eu**2 - 3/2 * u2)

# Define the collision step
def collision(feq,f,rho,u,c,viscosity):
    omega = 1 / (3 * viscosity + 0.5)
    rho[:] = f.sum(axis=0)
    u[:] = (c[:,np.newaxis,np.newaxis,:] * f).sum(axis=0) / rho[:,np.newaxis,np.newaxis]
    u2 = u.dot(u)
    eu = c.dot(u.T)
    f[:] = (1 - omega) * f + omega * feq(rho,u,c) + omega * rho[:,np.newaxis,np.newaxis] * (c[:,np.newaxis,np.newaxis,:] * u[:,np.newaxis,np.newaxis,:]).sum(axis=3) * (3 * eu[:,np.newaxis,np.newaxis] + 9/2 * eu[:,np.newaxis,np.newaxis]**2 - 3/2 * u2[:,np.newaxis,np.newaxis])

# Define the streaming step
def streaming(f):
    for i in range(9):
        f[i,:,:] = np.roll(np.roll(f[i,:,:],c[i,0],axis=0),c[i,1],axis=1)

# Main simulation loop
for i in range(timesteps):
    feq = equilibrium(rho,u,c)
    collision(feq,f,rho,u,c,viscosity)
    streaming(f)
300x250