This page will look better in a graphical browser that supports web standards, but is accessible to any browser or internet device.

Served by Samwise.

# TwoSlabDiffusion

Diffusion through two adjoining slabs with different diffusion coefficients.

Model number: 0212

 Run Model: Help running a JSim model.
Java runtime required. Web browser must support Java Applets.
(JSim model applet may take 10-20 seconds to load.)

## Description

   Two slabs with different diffusion coefficients are placed next to each other. They are
insulated along their lengths, but exposed at their ends. The discontinuity in diffusion
coefficients where the slabs meet is modeled by a continuous function over a single spatial
step. It is essential that the functional equation for the discontinuous diffusion coefficient
be represented by a continuous function for the partial differential equation solvers. Two
approaches are given:

1.) The diffusion is given as a piecewise continuous function joining the two different diffusion
coefficients and linearly changing value from D1 to D2 from b-x.delta/2 to b+x.delta/2.

2.) The diffusion is given by a smooth hyperbolic function.

The analytic steady state solution is from the problem where the diffusion coefficients form a
discontinuous function. The solution for the Steady State Problem is derived from

CanalyticSS(x) = if (x<=b) C1*x+C2 else C3*x+C4,

where the coefficients C1, C2, C3, and C4 satisfy

at x=x.min:   C1*x.min + C2 = Cleft
at x=b:       C1*b     + C2 = C3*b       +C4  (concentration is continuous at x=b)
D1*C1         = D2*C3           (flux on both sides of x=b are in equilibrium)
at x=x.max:   C3*x.max + C4 = Cright.


## Equations

#### Two separate partial differential equation models

$\large {\frac {\partial }{\partial t}}C \left( x,t \right) ={\frac {\partial }{\partial x}} \left( {\it Dx}\,{\frac {\partial }{\partial x}}C \left( x,t \right) \right)$
$\large {\frac {\partial }{\partial t}}{\it C_{tanh}} \left( x,t \right) ={\frac {\partial }{\partial x}} \left( {\it Dx_{tanh}} \left( x \right) {\frac {\partial }{ \partial x}}{\it C_{tanh}} \left( x,t \right) \right)$

#### where the diffusion coefficients as a function of x are given respectively by

$\large {\it Dx(x)} = \left { \begin{array} {l l } {D1} & \quad { x.min \le x
$\large {\it Dx_{tanh}} \left( x \right) ={\it D1}+1/2\, \left( {\it D2}-{\it D1} \right) \left( \tanh \left( {\frac {x-b}{{\it Steepness}}} \right) + 1 \right)$

$\large {\it C_{analyticSS}(x)} = \left { \begin{array} {l l } {\frac { \left( {\it Cleft}-{\it Cright} \right) \left( {\it D2}\,x+{ \it D1} \right) }{{\it D1}\,b-{\it D1}\,{\it x.max}-b{\it D2}+{\it x.min }\,{\it D2}}} & \quad x \le b \\ { } & \quad {} \\ {{\frac {{\it D1}\,x{\it Cleft}-{\it D1}\,x{\it Cright}-{\it Cleft}\,{ \it D1}\,{\it x.max}+{\it Cright}\,{\it D1}\,b-{\it Cright}\,b{\it D2}+ {\it x.min}\,{\it D2}\,{\it Cright}}{{\it D1}\,b-{\it D1}\,{\it x.max}-b {\it D2}+{\it x.min}\,{\it D2}}}} & \quad {x>b} \\ \end{array}\right}$

The equations for this model may also be viewed by running the JSim model applet and clicking on the Source tab at the bottom left of JSim's Run Time graphical user interface. The equations are written in JSim's Mathematical Modeling Language (MML). See the Introduction to MML and the MML Reference Manual. Additional documentation for MML can be found by using the search option at the Physiome home page.

## References

 None.



## Key Terms

Diffusion, slab, two slabs, PDE