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

revision 2401 by ahallam, Wed Apr 29 04:23:07 2009 UTC revision 2606 by ahallam, Thu Aug 13 04:32:23 2009 UTC
# Line 13  Line 13
13
14  \section{One Dimensional Heat Diffusion accross an Interface}  \section{One Dimensional Heat Diffusion accross an Interface}
15  %\label{Sec:1DHDv1}  %\label{Sec:1DHDv1}
16   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 they seem infinite in size compared to the size of our problem. 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.   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.
17
18  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 \editor{picture here would be helpful}.  The intrusion will have an initial temperature defined by \verb Tref and the granite properties required are:  \begin{figure}[h!]
19    \centerline{\includegraphics[width=4.in]{figures/onedheatdiff002}}
20    \caption{Temperature differential along a single interface between two granite blocks.}
21    \label{fig:onedgbmodel}
22    \end{figure}
23
24    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:
25  \begin{verbatim}  \begin{verbatim}
26  Tref=2273 # Kelvin #the starting temperature of our intrusion  #PDE related
27  rho = 2750 #kg/m^{3} density  mx = 500*m #meters - model length
28  cp = 790 #j/(kg.K) specific heat  my = 100*m #meters - model width
29  rhocp = rho*cp   #DENSITY * SPECIFIC HEAT  ndx = 500 # mesh steps in x direction
30  eta=0.  # RADIATION CONDITION - A closed model.  ndy = 1 # mesh steps in y direction
31  kappa=2.2 # Watts/(meter*Kelvin) DIFFUSION CONSTANT/HEAT PERMEABILITY  boundloc = mx/2 # location of boundary between two blocks
32    q=0.*Celsius #our heat source temperature is now zero
33    Tref=2273.*Celsius # Kelvin -the starting temperature of our RHS Block
34    rho = 2750*kg/m**3 #kg/m^{3} density of granite
35    cp = 790.*J/(kg*K) #j/Kg.K thermal capacity
36    rhocp = rho*cp  #DENSITY * SPECIFIC HEAT
38    kappa=2.2*W/m/K #watts/m.K thermal conductivity
39  \end{verbatim}  \end{verbatim}
40
41  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. These can then be converted accordingly to SI units \editor{lutz new schema in here}.  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. These can then be converted accordingly to SI units \editor{lutz new schema in here}.
42  \begin{verbatim}  \begin{verbatim}
43  #Script/Iteration Related  #Script/Iteration Related
44  t=0. #our start time, usually zero  t=0. #our start time, usually zero
45  tday=2000. #the time we want to end the simulation in days  tday=10*365. #the time we want to end the simulation in days
46  tend=tday*24*60*60  tend=tday*24*60*60
47  outputs = 400 #number of timesteps required  outputs = 400 # number of time steps required.
48  h=(tend-t)/outputs #size of time step  h=(tend-t)/outputs #size of time step
49  \end{verbatim}  \end{verbatim}
50
51  If we assume that the intrusion and surrounding block are extremely large compared to the model size; it is practical to locate the boundary between the two at the center of our model. By doing this the energy between the two block becomes balanced resulting in a more realistic result. As there is no heat source our \verb q variable can be set to zero. The new initial conditions are defined using the following:  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{verbatim}  \begin{verbatim}
53  bound = x[0]-mx/(ndx/250.) #where the boundary will be located  #establish location of boundary between two blocks
54  T= 0*Tref*whereNegative(bound)+Tref*wherePositive(bound) #defining the initial temperatures  bound = x[0]-boundloc
55    #set initial temperature
56    T= 0*Tref*whereNegative(bound)+Tref*wherePositive(bound)
57  \end{verbatim}  \end{verbatim}
58  The \verb bound statement chooses the boundary by taking a percentage of the maximum length \verb mx defined by the number of x steps \verb ndx divided by a specified position \verb 250 . In this case as \verb ndx is equal to 500, the chosen boundary is exactly halfway along the length of the model.  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.  The PDE can then be solved as before.
60