 # Diff of /trunk/doc/cookbook/twodheatdiff001.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{Two Dimensional Heat Diffusion for a basic Magmatic Intrusion}  \section{Two Dimensional Heat Diffusion for a basic Magmatic Intrusion}
15  %\label{Sec:2DHD}  %\label{Sec:2DHD}
16   Building upon our success from the 1D models it is now prudent to expand our domain by another dimension. For this example we will again be using an intrusion as the basis for our model. The simulattion will be a single event where some molten granite has formed a hemisphericle dome at the base of some cold sandstone country rock. \editor{the aim of this example is to introduce the second dimension, as well as some more complicated boundary and initial conditions} . A hemisphere is semetric so taking a cross-section through its centre will effectively model a 3D problem in 2D.   Building upon our success from the 1D models it is now prudent to expand our domain by another dimension. For this example we will be using a very simple magmatic intrusion as the basis for our model. The simulation will be a single event where some molten granite has formed a hemisphericle dome at the base of some cold sandstone country rock. A hemisphere is semetric so taking a cross-section through its centre will effectively model a 3D problem in 2D. New concepts will include non-linear boundaries and the abilitity to prescribe location specific variables.
17
18  To expand upon our 1D problem, the domain must first be expanded. This will be done in our definition phase by creating a square domain in $x$ and $y$ that is 600 meters along eacy side. The number of discrete spatial cells will be 100. The radius of the intrusion will be 200 meters  And the location of the centre of the intrusion will be at the 300 meter mark on the x-axis. This is done with the following block of code:  \begin{figure}[h!]
19    \centerline{\includegraphics[width=4.in]{figures/twodheatdiff}}
20    \caption{2D model: granitic intrusion of sandstone country rock.}
21    \label{fig:twodhdmodel}
22    \end{figure}
23
24    To expand upon our 1D problem, the domain must first be expanded. This will be done in our definition phase by creating a square domain in $x$ and $y$ that is 600 meters along eacy side \reffig{fig:twodhdmodel}. The number of discrete spatial cells will be 100. The radius of the intrusion will be 200 meters  And the location of the centre of the intrusion will be at the 300 meter mark on the x-axis. The domain variables are;
25  \begin{verbatim}  \begin{verbatim}
26  mx = 600 # model lenght  mx = 600 # model lenght
27  my = 600 # model width  my = 600 # model width
# Line 43  Our PDE has now been properly establishe Line 49  Our PDE has now been properly establishe
49  \begin{verbatim}  \begin{verbatim}
50   T= Ti*whereNegative(bound)+Tc*wherePositive(bound) #defining the initial temperatures.   T= Ti*whereNegative(bound)+Tc*wherePositive(bound) #defining the initial temperatures.
51  \end{verbatim}  \end{verbatim}
52  The itteration process now begins as before, but using our new conditions for \verb D  as defined above. Additionally we will also save a copy of the boundary to *.xml so that it can be used for visualisation purposes in \verb mayavi .  The itteration process now begins as before, but using our new conditions for \verb D  as defined above.
53
54    \subsection{Contouring escript data}
55    \begin{verbatim}
56    # rearrage mymesh to suit solution function space
57    oldspacecoords=model.getX()
58    coords=Data(oldspacecoords, T.getFunctionSpace())
59    coords = np.array(coords.toListOfTuples())
60    coordX = coords[:,0]
61    coordY = coords[:,1]
62    # create regular grid
63    xi = np.linspace(0.0,600.0,100)
64    yi = np.linspace(0.0,600.0,100)
65    \end{verbatim}
66

Legend:
 Removed from v.2401 changed lines Added in v.2606

 ViewVC Help Powered by ViewVC 1.1.26