Solving the Convection-Diffusion Equation in 1D Using Finite Differences
Solving the Convection-Diffusion Equation in 1D Using Finite Differences
This Demonstration shows the solution of the convection-diffusion partial differential equation (PDE) in one dimension with periodic boundary conditions. You can specify different initial conditions. Selected preconfigured test cases are available from the dropdown menu.
c=d+a
u
xx
u
t
u
x
The system is discretized in space and for each time step the solution is found using =A. The plot shown represents the solution . You can select a 3D or 2D view using the controls at the top of the display.
n+1
u
n
u
u(x,t)
Details
Details
The convection-diffusion partial differential equation (PDE) solved is , where is the diffusion parameter, is the advection parameter (also called the transport parameter), and is the convection parameter. The domain is with periodic boundary conditions. Initial conditions are given by . You can specify using the initial conditions button. The time step is , where is the multiplier, is the grid size, and is the diffusion parameter. You can change the multiplier using the slider. The total run time of the simulation is specified using the slider labeled "time".
c=d+a
u
xx
u
t
u
x
c
d
a
0≤x≤L
u(x,0)=g(x)
g(x)
Δt=m
2
h
c
m
Δt
h
c
Δt
The system solved at each time step is =A where is the solution of the PDE. The matrix is given by
n+1
u
n
u
u
A
n+1 u 1 |
n+1 u 2 |
⋮ |
n+1 u N-1 |
n+1 u N |
(1-2μ) | μ- ν 2 | 0 | ⋯ | μ+ ν 2 |
μ+ ν 2 | (1-2μ) | μ- ν 2 | ⋯ | 0 |
0 | μ+ ν 2 | ⋱ | μ- ν 2 | 0 |
⋮ | ⋮ | μ+ ν 2 | (1-2μ) | μ- ν 2 |
μ- ν 2 | 0 | 0 | μ+ ν 2 | (1-2μ) |
n u 1 |
n u 2 |
⋮ |
n u N-1 |
n u N |
where and . In the above is taken to be the vector of initial conditions. All values used are assumed to be in SI units.
μ=
cΔt
d
2
h
ν=
aΔt
dh
0
u
References
References
[1] S. J. Farlow, Partial Differential Equations for Scientists and Engineers, New York: Dover, 1993.
External Links
External Links
Permanent Citation
Permanent Citation
Nasser M. Abbasi
"Solving the Convection-Diffusion Equation in 1D Using Finite Differences"
http://demonstrations.wolfram.com/SolvingTheConvectionDiffusionEquationIn1DUsingFiniteDifferen/
Wolfram Demonstrations Project
Published: June 11, 2012