 # Diff of /trunk/doc/user/diffusion.tex

revision 1315 by elspeth, Thu Apr 27 02:08:50 2006 UTC revision 1316 by ksteube, Tue Sep 25 03:18:30 2007 UTC
# Line 1  Line 1
1    %
2  % $Id$  % $Id$
3  %  %
5  %               \url{http://www.access.edu.au  %
6  %         Primary Business: Queensland, Australia.  %           Copyright 2003-2007 by ACceSS MNRF
7  %   Licensed under the Open Software License version 3.0  %       Copyright 2007 by University of Queensland
9    %                http://esscc.uq.edu.au
10    %        Primary Business: Queensland, Australia
13    %
14    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
15  %  %
16
17  \section{The Diffusion Problem}  \section{The Diffusion Problem}
# Line 17  Line 24
24  \end{figure}  \end{figure}
25
26  \subsection{\label{DIFFUSION OUT SEC}Outline}  \subsection{\label{DIFFUSION OUT SEC}Outline}
27  In this chapter we will discuss how to solve the time dependent-temperature diffusion\index{diffusion equation} for  In this chapter we will discuss how to solve a time-dependent temperature diffusion\index{diffusion equation} PDE for
28  a block of material. Within the block there is a heat source which drives the temperature diffusion.  a given block of material. Within the block there is a heat source which drives the temperature diffusion.
29  On the surface, energy can radiate into the surrounding environment.  On the surface, energy can radiate into the surrounding environment.
30  \fig{DIFFUSION FIG 1} shows the configuration.  \fig{DIFFUSION FIG 1} shows the configuration.
31
# Line 39  in the interior of the domain is given b Line 46  in the interior of the domain is given b
46  \end{equation}  \end{equation}
47  where $\rho c\hackscore p$ and $\kappa$ are given material constants. In case of a composite  where $\rho c\hackscore p$ and $\kappa$ are given material constants. In case of a composite
48  material the parameters depend on their location in the domain. $q\hackscore H$ is  material the parameters depend on their location in the domain. $q\hackscore H$ is
49  a heat source (or sink) within the domain. We are using Einstein summation convention \index{summation convention}  a heat source (or sink) within the domain. We are using the Einstein summation convention \index{summation convention}
50  as introduced in \Chap{FirstSteps}. In our case we assume $q\hackscore H$ to be equal to a constant heat production rate  as introduced in \Chap{FirstSteps}. In our case we assume $q\hackscore H$ to be equal to a constant heat production rate
51  $q^{c}$ on a circle or sphere with center $x^c$ and radius $r$ and $0$ elsewhere:  $q^{c}$ on a circle or sphere with center $x^c$ and radius $r$ and $0$ elsewhere:
52  \begin{equation}  \begin{equation}
# Line 57  for all $x$ in the domain and all time Line 64  for all $x$ in the domain and all time
64
65  On the surface of the domain we are  On the surface of the domain we are
67  which precribes the normal component of the flux $\kappa T\hackscore{,i}$ to be proportional  which prescribes the normal component of the flux $\kappa T\hackscore{,i}$ to be proportional
68  to the difference of the current temperature to the surrounding temperature $T\hackscore{ref}$:      to the difference of the current temperature to the surrounding temperature $T\hackscore{ref}$:
69  \begin{equation}  \begin{equation}
70   \kappa T\hackscore{,i} n\hackscore i = \eta (T\hackscore{ref}-T)   \kappa T\hackscore{,i} n\hackscore i = \eta (T\hackscore{ref}-T)
71  \label{DIFFUSION TEMP EQ 2}  \label{DIFFUSION TEMP EQ 2}
72  \end{equation}  \end{equation}
73  $\eta$ is a given material coefficient depending on the material of the block and the surrounding medium.  $\eta$ is a given material coefficient depending on the material of the block and the surrounding medium.
74  As usual $n\hackscore i$ is the $i$-th component of the outer normal field \index{outer normal field}  $n\hackscore i$ is the $i$-th component of the outer normal field \index{outer normal field}
75  at the surface of the domain.  at the surface of the domain.
76
77  To solve the time dependent \eqn{DIFFUSION TEMP EQ 1} the initial temperature at time  To solve the time-dependent \eqn{DIFFUSION TEMP EQ 1} the initial temperature at time
78  $t=0$ has to be given. Here we assume that the initial temperature is the surrounding temperature:  $t=0$ has to be given. Here we assume that the initial temperature is the surrounding temperature:
79  \begin{equation}  \begin{equation}
80  T(x,0)=T\hackscore{ref}  T(x,0)=T\hackscore{ref}
# Line 278  when a given tolerance has been reached. Line 285  when a given tolerance has been reached.
285
286  \subsection{The Transition Problem}  \subsection{The Transition Problem}
287  \label{DIFFUSION TRANS SEC}  \label{DIFFUSION TRANS SEC}
288  Now we are ready to solve the original time dependent problem. The main  Now we are ready to solve the original time-dependent problem. The main
289  part of the script is the loop over time $t$ which takes the following form:  part of the script is the loop over time $t$ which takes the following form:
290  \begin{python}  \begin{python}
291  t=0  t=0
# Line 324  y\hackscore{i} Line 331  y\hackscore{i}
331  \end{equation}  \end{equation}
332  So \code{length(x-xc)} calculates the distances    So \code{length(x-xc)} calculates the distances
333  of the location \var{x} to the center of the circle \var{xc} where the heat source is acting.  of the location \var{x} to the center of the circle \var{xc} where the heat source is acting.
334  Note that the coordinates of \var{xc} are defined as a list of floating point numbers. It is independently  Note that the coordinates of \var{xc} are defined as a list of floating point numbers. It is automatically
335  converted into a \Data class object before being subtracted from \var{x}. The function \function{whereNegative}  converted into a \Data class object before being subtracted from \var{x}. The function \function{whereNegative}
336  applied to  applied to
337  \code{length(x-xc)-r}, returns a \Data class which is equal to one where the object is negative and  \code{length(x-xc)-r}, returns a \Data object which is equal to one where the object is negative (inside the circle) and
338  zero elsewhere. After multiplication with \var{qc} we get a function with the desired property.  zero elsewhere. After multiplication with \var{qc} we get a function with the desired property of having value \var{qc} inside
339    the circle and zero elsewhere.
340
341  Now we can put the components together to create the script \file{diffusion.py} which is available in the \ExampleDirectory:  Now we can put the components together to create the script \file{diffusion.py} which is available in the \ExampleDirectory:
342  \index{scripts!\file{diffusion.py}}:  \index{scripts!\file{diffusion.py}}:
# Line 381  temperature distributions at time steps Line 389  temperature distributions at time steps
389  \caption{Results of the Temperature Diffusion Problem for Time Steps $1$ $16$, $32$ and $48$.}  \caption{Results of the Temperature Diffusion Problem for Time Steps $1$ $16$, $32$ and $48$.}
390  \label{DIFFUSION FIG 2}  \label{DIFFUSION FIG 2}
391  \end{figure}  \end{figure}
392    \fig{DIFFUSION FIG 2} shows the result for some selected time steps.
393  An easy way to visualize the results is the command  An easy way to visualize the results is the command
394  \begin{verbatim}  \begin{verbatim}
395  mayavi -d T.1.xml -m SurfaceMap &  mayavi -d T.1.xml -m SurfaceMap &
396  \end{verbatim}  \end{verbatim}
397  Use the \texttt{Configure Data}  Use the \texttt{Configure Data} window in mayavi
398  to move forward and and backwards in time.  to move forward and and backwards in time.
\fig{DIFFUSION FIG 2} shows the result for some selected time steps.

Legend:
 Removed from v.1315 changed lines Added in v.1316