This code solves steady advective-diffusion in 1-D using a central-difference
representation of advection. This method can have negative coefficients when F=F/D>2.
Don't use it for real problems!
m-file diffusion_SS_1D_adv.m runs several different values of nz,
number of finite volumes in z direction.
Different Peclet numbers are associated with each dz.
Some are >2, some are <2.
Execution "Pauses"
after each nz is selected. Press any key to continue.
SS 1-D Advective Diffusion, Power-Law scheme
Solves steady 1-D advective diffusion for a series of models with
various Peclet numbers and grid sizes. and for either central-difference scheme
(bad) or power-law scheme (good).
Hits "pause"
after each plot - press any key to resume.
SS 2-D Advective Diffusion
This code puts finite-volume edges on boundaries, but also includes
extra nodes on those boundaries to facilitate incorporation of either phi-value
or phi-gradient Boundary Conditions at every boundary node.
(Patankar Practice B, p. 69).
Patankar's Power-law advective scheme is used.
SS Illustration of False Diffusion in 2-D
SS 2-D Adv-Diff code above is used to run a sequence of models illustrating
false diffusion when strong flow is not aligned with coordinate axes.
Transient 2-D Advective Diffusion
By incorporating minor changes to the SS 2-D Advective Diffusion code above,
this code solves transient problems.
phi-Dependent Coefficients
This variation on 2-D advective diffusive code solves a steady 1-D problem
where the coefficient Gamma depends on solution phi
Internal BC
Sometimes you may want to fix the value of phi at
volumes remote from the actual domain boundary.
Following Patankar (1980) p. 145, this can be done with the source term.
The example uses the 2-D transient advective diffusive code, with a block of
volumes held at a constant value of phi.
SH Wave Propagation
By converting the first tme derivative into a second time derivative,
the diffusion equation can be transformed into a wave equation, applicable to
SH waves traveling through the Earth.
phi becomes displacement u,
and Gamma becomes shear modulus.
1D Stability Analysis
This code finds wavenumber transfer functions for 1D transient diffusion,
for specified kappa, dx, and dt. It then carries out a corresponding 1D
time-domain finite difference simulation.
Users can see how the transfer functions are useful.
One-point Transient Response
Code evaluates the response of a single node
when adjacent points are held fixed. Solutions are shown for 3 levels of discretization:
- no discretization
- only space discretized
- space and time discretized