# Diff of /trunk/doc/cookbook/example02.tex

revision 3369 by jfenwick, Tue Oct 26 03:24:54 2010 UTC revision 3370 by ahallam, Sun Nov 21 23:22:25 2010 UTC
# Line 14  Line 14
14
15  \section{Example 2: One Dimensional Heat Diffusion in an Iron Rod}  \section{Example 2: One Dimensional Heat Diffusion in an Iron Rod}
16  \sslist{example02.py}  \sslist{example02.py}

17  \label{Sec:1DHDv0}  \label{Sec:1DHDv0}
\begin{figure}[ht]
\centerline{\includegraphics[width=4.in]{figures/onedheatdiff002}}
\caption{Example 2: One dimensional model of an Iron bar}
\label{fig:onedhdmodel}
\end{figure}
18
19  Our second example is of a cold iron bar at a constant temperature of  Our second example is of a cold iron bar at a constant temperature of
20  $T_{ref}=20^{\circ} C$, see \reffig{fig:onedhdmodel}. The bar is  $T_{ref}=20^{\circ} C$, see \reffig{fig:onedhdmodel}. The bar is
# Line 29  temperature at a constant level $T_0=100 Line 23 temperature at a constant level$T_0=100
23  applied energy will disperse along the bar via conduction. With time the bar  applied energy will disperse along the bar via conduction. With time the bar
24  will reach a constant temperature equivalent to that of the heat source.  will reach a constant temperature equivalent to that of the heat source.
25
26    \begin{figure}[ht]
27    \centerline{\includegraphics[width=4.in]{figures/onedheatdiff002}}
28    \caption{Example 2: One dimensional model of an Iron bar}
29    \label{fig:onedhdmodel}
30    \end{figure}
31
32  This problem is very similar to the example of temperature diffusion in granite  This problem is very similar to the example of temperature diffusion in granite
33  blocks presented in the previous Section~\ref{Sec:1DHDv00}. Thus, it is possible  blocks presented in the previous Section~\ref{Sec:1DHDv00}. Thus, it is possible
34  to modify the script we have already developed for the granite blocks to suit  to modify the script we have already developed for the granite blocks to suit
# Line 111  prescribed on the same location as any N Line 111  prescribed on the same location as any N
111  boundary condition will be \textbf{overwritten}. This applies to Neumann  boundary condition will be \textbf{overwritten}. This applies to Neumann
112  boundary conditions that \esc sets by default and those defined by the user.  boundary conditions that \esc sets by default and those defined by the user.
113
114  \begin{figure}  Besides some cosmetic modification this is all we need to change. The total
115    energy over time is shown in \reffig{fig:onedheatout1 002}. As heat
116    is transferred into the rod by the heater the total energy is growing over time
117    but reaches a plateau when the temperature is constant in the rod, see
118    \reffig{fig:onedheatout 002}.
119    You will notice that the time scale of this model is several order of
120    magnitudes faster than for the granite rock problem due to the different length
121    scale and material parameters.
122    In practice it can take a few model runs before the right time scale has been
123    chosen\footnote{An estimate of the
124    time scale for a diffusion problem is given by the formula $\frac{\rho 125 c_{p} L_{0}^2}{4 \kappa}$, see
126    \url{http://en.wikipedia.org/wiki/Fick\%27s_laws_of_diffusion}}.
127
128    \begin{figure}[ht]
129  \begin{center}  \begin{center}
130  \includegraphics[width=4in]{figures/ttrodpyplot150}  \includegraphics[width=4in]{figures/ttrodpyplot150}
131  \caption{Example 2: Total Energy in the Iron Rod over Time (in seconds)}  \caption{Example 2: Total Energy in the Iron Rod over Time (in seconds)}
# Line 119  boundary conditions that \esc sets by de Line 133  boundary conditions that \esc sets by de
133  \end{center}  \end{center}
134  \end{figure}  \end{figure}
135
136  \begin{figure}  \begin{figure}[ht]
137  \begin{center}  \begin{center}
138  \includegraphics[width=4in]{figures/rodpyplot001}  \includegraphics[width=4in]{figures/rodpyplot001}
139  \includegraphics[width=4in]{figures/rodpyplot050}  \includegraphics[width=4in]{figures/rodpyplot050}
# Line 130  $1$, $50$ and $200$} Line 144  $1$, $50$ and $200$}
144  \end{center}  \end{center}
145  \end{figure}  \end{figure}
146
Besides some cosmetic modification this is all we need to change. The total
energy over time is shown in \reffig{fig:onedheatout1 002}. As heat
is transferred into the rod by the heater the total energy is growing over time
but reaches a plateau when the temperature is constant in the rod, see
\reffig{fig:onedheatout 002}.
You will notice that the time scale of this model is several order of
magnitudes faster than for the granite rock problem due to the different length
scale and material parameters.
In practice it can take a few model runs before the right time scale has been
chosen\footnote{An estimate of the
time scale for a diffusion problem is given by the formula $\frac{\rho c_{p} L_{0}^2}{4 \kappa}$, see
\url{http://en.wikipedia.org/wiki/Fick\%27s_laws_of_diffusion}}.