Environmental Engineering Reference
In-Depth Information
Table 4.1 Implementation of transport boundary condition, using MATLAB
'pdepe'
®
Type
Name
Representation
Formula
p
q
First
Dirichlet
(
4.13
), (
4.12
)
u ¼ u
1
u u
1
0
Second
Neumann
(
4.13
)
D
@u
p
1
1
@x
¼p
1
Third
Cauchy or Robin
(
4.12
)
q
1
D
@u
u u
1
q
1
@x
¼ u
1
u
“
“
(
4.13
)
D
@u
@x
v u ¼
0
0
1
“
“
(
4.12
)
p
1
1
D
@u
@x
v u ¼ p
1
In the notation in Table
4.1
a single unknown variable
u
is used, representing a
single unknown component. The boundary conditions, even the type of the bound-
ary conditions may be different for each component of the vector
u
.
The reference to the equation representation indicates, which processes are
included in the flux term
f
, either in case of diffusion/dispersion alone, or with
advection. In case of several unknown variables the representation can be chosen
differently for the different components.
Sidebar 4.3: Syntax of the MATLAB
pdepe-command
®
Syntax
sol
¼
pdepe(
m,pdefun,icfun,bcfun,xmesh,tspan
)
sol
¼
pdepe(
m,pdefun,icfun,bcfun,xmesh,tspan,options
)
sol
¼
pdepe(
m,pdefun,icfun,bcfun,xmesh,tspan,options,p1,p2..
.)
Arguments
m
2).
m
geometry parameter (slab
¼
0, cylindrical
¼
1, spherical
¼
2).
pdefun
function submodule for coefficients of the differential equation
(c, f and s).
icfun
function submodule for initial condition (u
0
).
bcfun
function submodule for boundary conditions (p and q at
x
0
and
x
n
).
geometry parameter (slab
¼
0, cylindrical
¼
1, spherical
¼
xmesh
vector [x
0
,x
1
,
,x
n
], positions, at which the solution vector is
calculated; elements of
xmesh
need to fulfill: x
0
<
...
x
1
< ... <
x
n
and there must be at least three entries
tspan
vector [t
0
,t
1
,
,t
f
], time instants, at the solution vector is
calculated; elements of
tspan
need to fulfill: t
0
<
...
t
1
< ... <
t
f
and there must be at least three entries
options
options concerning the numerical algorithm:
RelTol
,
AbsTol
,
NormControl
,
InitialStep
, and
MaxStep
; see‚ odeset' in help
system for details; use default first
€
p1,p2
,
...
optional parameters f
ur
pdefun
,
icfun
und
bcfun
sol
solution matrix, containing values for all elements at all
positions of
xmesh
at all time instants of
tspan
.