/[escript]/trunk/doc/cookbook/example02.tex
ViewVC logotype

Contents of /trunk/doc/cookbook/example02.tex

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (show annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 9 months ago) by jfenwick
Original Path: trunk/doc/cookbook/onedheatdiff002.tex
File MIME type: application/x-tex
File size: 4223 byte(s)
Don't panic.
Updating copyright stamps

1
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % Copyright (c) 2003-2010 by University of Queensland
5 % Earth Systems Science Computational Center (ESSCC)
6 % http://www.uq.edu.au/esscc
7 %
8 % Primary Business: Queensland, Australia
9 % Licensed under the Open Software License version 3.0
10 % http://www.opensource.org/licenses/osl-3.0.php
11 %
12 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
13
14 \section{One Dimensional Heat Diffusion accross an Interface}
15 \sslist{onedheatdiff002.py and cblib.py}
16 %\label{Sec:1DHDv1}
17 It is quite simple to now expand upon the 1D heat diffusion problem we just tackled. Suppose we have two blocks of isotropic material which are very large in all directions to the point that the interface between the two blocks appears infinite in length compared to the distance we are modelling perpendicular to the interface and accross the two blocks. If \textit{Block 1} is of a temperature \verb 0 and \textit{Block 2} is at a temperature \verb T what would happen to the temperature distribution in each block if we placed them next to each other. This problem is very similar to our Iron Rod but instead of a constant heat source we instead have a heat disparity with a fixed amount of energy. In such a situation it is common knowledge that the heat energy in the warmer block will gradually conduct into the cooler block until the temperature between the blocks is balanced.
18
19 \begin{figure}[h!]
20 \centerline{\includegraphics[width=4.in]{figures/onedheatdiff002}}
21 \caption{Temperature differential along a single interface between two granite blocks.}
22 \label{fig:onedgbmodel}
23 \end{figure}
24
25 By modifying our previous code it is possible to solve this new problem. In doing so we will also try to tackle a real world example and as a result, introduce and discuss some new variables. The linear model of the two blocks is very similar to the effect a large magmatic intrusion would have on a cold country rock. It is however, simpler at this stage to have both materials the same and for this example we will use granite \reffig{fig:onedgbmodel}. The intrusion will have an initial temperature defined by \verb Tref and the granite properties required are:
26 \begin{python}
27 #PDE related
28 mx = 500*m #meters - model length
29 my = 100*m #meters - model width
30 ndx = 500 # mesh steps in x direction
31 ndy = 1 # mesh steps in y direction
32 boundloc = mx/2 # location of boundary between two blocks
33 q=0.*Celsius #our heat source temperature is now zero
34 Tref=2273.*Celsius # Kelvin -the starting temperature of our RHS Block
35 rho = 2750*kg/m**3 #kg/m^{3} density of granite
36 cp = 790.*J/(kg*K) #j/Kg.K thermal capacity
37 rhocp = rho*cp #DENSITY * SPECIFIC HEAT
38 eta=0. # RADIATION CONDITION
39 kappa=2.2*W/m/K #watts/m.K thermal conductivity
40 \end{python}
41
42 Since the scale and values involved in our problem have changed, the length and step size of the iteration must be considered. Instead of seconds which our units are in, it may be more prudent to decide the number of days or years we would like to run the simulation over.
43 \begin{python}
44 #Script/Iteration Related
45 t=0. #our start time, usually zero
46 tend=10*yr #the time we want to end the simulation in years
47 outputs = 400 # number of time steps required.
48 h=(tend-t)/outputs #size of time step
49 \end{python}
50
51 If we assume that the dimensions of the blocks are continuous and extremely large compared with the model size then we need only model a small proportion of the boundary. It is practical to locate the boundary between the two blocks at the center of our model. As there is no heat source our \verb q variable can be set to zero. The new initial conditions are defined using the following:
52 \begin{python}
53 #establish location of boundary between two blocks
54 bound = x[0]-boundloc
55 #set initial temperature
56 T= 0*Tref*whereNegative(bound)+Tref*wherePositive(bound)
57 \end{python}
58 The \verb bound statement sets the boundary to the location along the \textit{x-axis} defined by \verb boundloc .
59 The PDE can then be solved as before.
60
61 FOR THE READER:
62 \begin{enumerate}
63 \item Move the boundary line between the two blocks to another part of the domain.
64 \item Try splitting the domain in to multiple blocks with varying temperatures.
65 \end{enumerate}
66

  ViewVC Help
Powered by ViewVC 1.1.26