]>
tutorial1
This tutorial introduces several new concepts:
 Distribution domains
 Distributed parameters, variables and equations
 Setting boundary conditions (Neumann and Dirichlet type)
 Setting initial conditions
In this example we model a simple heat conduction problem: a conduction through
a very thin, rectangular copper plate.
For this problem, we need a twodimensional Cartesian grid (x,y)
(here, for simplicity, divided into 10 x 10 segments):
.. codeblock:: none
y axis
^

Ly  L T T T T T T T T T R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
 L + + + + + + + + + R
0  L B B B B B B B B B R
> x axis
0 Lx
Points 'B' at the bottom edge of the plate (for y = 0), and the points 'T' at the
top edge of the plate (for y = Ly) represent the points where the heat is applied.
The plate is considered insulated at the left (x = 0) and the right edges (x = Lx)
of the plate (points 'L' and 'R'). To model this type of problem, we have to write
a heat balance equation for all interior points except the left, right, top and
bottom edges, where we need to specify boundary conditions.
In this problem we have to define two distribution domains:
 x (x axis, length Lx = 0.1 m)
 y (y axis, length Ly = 0.1 m)
the following parameters:
 rho: copper density, 8960 kg/m3
 cp: copper specific heat capacity, 385 J/(kgK)
 k: copper heat conductivity, 401 W/(mK)
 Qb: heat flux at the bottom edge, 1E6 W/m2 (or 100 W/cm2)
 Tt: temperature at the top edge, 300 K
and a single variable:
 T: the temperature of the plate (distributed on x and y domains)
The model consists of 5 equations (1 distributed equation + 4 boundary conditions):
1) Heat balance::
rho * cp * dT(x,y)/dt = k * [d2T(x,y)/dx2 + d2T(x,y)/dy2]; x in (0, Lx), y in (0, Ly)
2) Neumann boundary conditions at the bottom edge::
k * dT(x,y)/dy = Qb; x in (0, Lx), y = 0
3) Dirichlet boundary conditions at the top edge::
T(x,y) = Tt; x in (0, Lx), y = Ly
4) Neumann boundary conditions at the left edge (insulated)::
dT(x,y)/dx = 0; y in [0, Ly], x = 0
5) Neumann boundary conditions at the right edge (insulated)::
dT(x,y)/dx = 0; y in [0, Ly], x = Lx
The temperature plot (at t=100s, x=0.5, y=*):
.. image:: _static/tutorial1results.png
:width: 500px
$\mathit{tutorial1}$BC_bottomNeumann boundary conditions at the bottom edge (constant flux)${\mathit{BC}}_{\mathit{bottom}}$eAlgebraic$${ \left( { \left( { \left(  { \lambda_p } \right) } \right) \cdot \left( { { \partial { { \left( { T \left( { x, y } \right) } \right) } } } \over { \partial {y} } } \right) } \right)  { Q_b } } = 0; {\forall { x } \in \left( { x } _{0}, { x } _{n} \right) }, {{ y } = { y } _{0}}$$x$\mathit{x}$$\mathit{x}$
xeOpenOpeny$\mathit{y}$$\mathit{y}$
yeLowerBoundBC_topDirichlet boundary conditions at the top edge (constant temperature)${\mathit{BC}}_{\mathit{top}}$eAlgebraic$${ { T \left( { x, y } \right) }  { T_t } } = 0; {\forall { x } \in \left( { x } _{0}, { x } _{n} \right) }, {{ y } = { y } _{n}}$$x$\mathit{x}$$\mathit{x}$
xeOpenOpeny$\mathit{y}$$\mathit{y}$
yeUpperBoundBC_leftNeumann boundary conditions at the left edge (insulated)${\mathit{BC}}_{\mathit{left}}$eAlgebraic$${ { \partial { { \left( { T \left( { x, y } \right) } \right) } } } \over { \partial {x} } } = 0; {{ x } = { x } _{0}}, {\forall { y } \in \left[ { y } _{0}, { y } _{n} \right] }$$x$\mathit{x}$$\mathit{x}$
xeLowerBoundy$\mathit{y}$$\mathit{y}$
yeClosedClosedBC_rightNeumann boundary conditions at the right edge (insulated)${\mathit{BC}}_{\mathit{right}}$eAlgebraic$${ { \partial { { \left( { T \left( { x, y } \right) } \right) } } } \over { \partial {x} } } = 0; {{ x } = { x } _{n}}, {\forall { y } \in \left[ { y } _{0}, { y } _{n} \right] }$$x$\mathit{x}$$\mathit{x}$
xeUpperBoundy$\mathit{y}$$\mathit{y}$
yeClosedClosed