03 May 2014 09:32:03 AM
FD1D_ADVECTION_DIFFUSION_STEADY:
C++ version
Solve the 1D steady advection diffusion equation:,
v du/dx - k d2u/dx2 = 0
with constant, positive velocity V and diffusivity K
over the interval:
0.0 <= x <= 1.0
with boundary conditions:
u(0) = 0, u(1) = 1.
Use finite differences
d u/dx = (u(t,x+dx)-u(t,x-dx))/2/dx
d2u/dx2 = (u(x+dx)-2u(x)+u(x-dx))/dx^2
Diffusivity K = 0.05
Velocity V = 1
Number of nodes NX = 101
DX = 0.01
Maximum safe DX is 0.1
Gnuplot data written to file 'fd1d_advection_diffusion_steady_data.txt'.
Gnuplot commands written to 'fd1d_advection_diffusion_steady_commands.txt'
FD1D_ADVECTION_DIFFUSION_STEADY
Normal end of execution.
03 May 2014 09:32:04 AM