13 


14 
\documentclass{manual} 
\documentclass{manual} 
15 
\title{One Dimensional Heat Equation Var 001} 
\title{One Dimensional Heat Equation Var 001} 
16 

\newcommand{\editor}[1] {\textcolor{red}{#1}} 
17 


18 


19 
\begin{document} 
\begin{document} 
20 
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 T 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 untill 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 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. 
21 


22 

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: 
23 

\begin{verbatim} 
24 

Tref=2273 # Kelvin #the starting temperature of our intrusion 
25 

rho = 2750 #kg/m^{3} density 
26 

cp = 790 #j/kg specific heat 
27 

rhocp = rho*cp #DENSITY * SPECIFIC HEAT 
28 

eta=0. # RADIATION CONDITION  A closed model. 
29 

kappa=2.2 # Watts/(meter*Kelvin) DIFFUSION CONSTANT/HEAT PERMEABILITY 
30 

\end{verbatim} 
31 


32 
Only a small segment of code needs to be adapted for these new initial and boundary conditions. As there is no heat source our q variable can be set to zero. Now the initial conditions must be modified to represent the temperatures of the two blocks side by side. Taking the middle of the domain as the contact between the two blocks the new initial conditions are defined using the following: 
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}. 
33 
\begin{verbatim} 
\begin{verbatim} 
34 
T= 1*Tref*whereNegative(x[0]0.025)+Tref*wherePositive(x[0]0.025) 
#Script/Iteration Related 
35 

t=0. #our start time, usually zero 
36 

tday=2000. #the time we want to end the simulation in days 
37 

tend=tday*24*60*60 
38 

outputs = 400 #number of timesteps required 
39 

h=(tendt)/outputs #size of time step 
40 
\end{verbatim} 
\end{verbatim} 
41 
This chooses all values along the x axis less than \verb 0.025 (which is half the length of our domain) to be equal to the negative of \verb Tref while all values greater than \verb 0.025 will be equal to the positive of \verb Tref . The new PDE can now be solved as before. 

42 

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: 
43 

\begin{verbatim} 
44 

bound = x[0]mx/(ndx/250.) #where the boundary will be located 
45 

T= 0*Tref*whereNegative(bound)+Tref*wherePositive(bound) #defining the initial temperatures 
46 

\end{verbatim} 
47 

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. 
48 


49 

The PDE can then be solved as before. 
50 


51 
FOR THE READER: 
FOR THE READER: 
52 
\begin{enumerate} 
\begin{enumerate} 

\item Try changing the initial conditions so that the temperatures are unbalanced. 

53 
\item Move the boundary line between the two blocks to another part of the domain. 
\item Move the boundary line between the two blocks to another part of the domain. 
54 
\item Try splitting the domain in to multiple blocks with varying temperatures. 
\item Try splitting the domain in to multiple blocks with varying temperatures. 
55 
\end{enumerate} 
\end{enumerate} 