[cig-commits] commit 2283 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Wed Jan 29 14:21:30 PST 2014


Revision 2283

More text on a 3d convection box.

U   trunk/aspect/doc/manual/manual.tex


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2283&peg=2283

Diff:
Modified: trunk/aspect/doc/manual/manual.tex
===================================================================
--- trunk/aspect/doc/manual/manual.tex	2014-01-29 14:54:16 UTC (rev 2282)
+++ trunk/aspect/doc/manual/manual.tex	2014-01-29 22:21:26 UTC (rev 2283)
@@ -2495,7 +2495,7 @@
 \subsection{Simple setups}
 \label{sec:cookbooks-simple}
 
-\subsubsection{Convection in a box}
+\subsubsection{Convection in a 2d box}
 \label{sec:cookbooks-simple-box}
 
 In this first example, let us consider a simple situation: a 2d box of dimensions
@@ -3229,10 +3229,143 @@
 limits the accuracy.
 
 
+\subsubsection{Convection in a 3d box}
+
+The world is not two-dimensional. While the previous section introduced a number
+of the knobs one can play with with spect{}, things only really become
+interesting once one goes to 3d. The setup from the previous section is easily
+adjusted to this and in the following, let us walk through some of the changes
+we have to consider when going from 2d to 3d. The full input file that
+contains these modifications and that was used for the simulations we will show
+subsequently can be found at \url{cookbooks/convection-box-3d.prm}.
+
+The first set of changes has to do with the geometry: it is three-dimensional,
+and we will have to address the fact that a box in 3d has 6 sides, not the 4 we
+had previously. The documentation of the ``box'' geometry
+(see Section~
ef{parameters:Geometry_20model}) states that these sides are
+numbered as follows: ``	extit{in 3d, boundary indicators 0 through 5 indicate
+left, right, front, back, bottom and top boundaries}.'' Recalling that we want
+tangential flow all around and want to fix the temperature to known values at
+the bottom and top, the following will make sense:
+egin{lstlisting}[frame=single,language=prmfile,escapechar=\%]
+set Dimension                              = 3 % \index[prmindex]{Dimension} \index[prmindexfull]{Dimension} %
+
+subsection Geometry model
+  set Model name = box % \index[prmindex]{Model name} \index[prmindexfull]{Geometry model!Model name} %
+
+  subsection Box
+    set X extent = 1 % \index[prmindex]{X extent} \index[prmindexfull]{Geometry model!Box!X extent} %
+    set Y extent = 1 % \index[prmindex]{Y extent} \index[prmindexfull]{Geometry model!Box!Y extent} %
+    set Z extent = 1 % \index[prmindex]{Z extent} \index[prmindexfull]{Geometry model!Box!Z extent} %
+  end
+end
+
+subsection Boundary temperature model
+  set Model name = box % \index[prmindex]{Model name} \index[prmindexfull]{Boundary temperature model!Model name} %
+
+  subsection Box
+    set Bottom temperature = 1 % \index[prmindex]{Bottom temperature} \index[prmindexfull]{Boundary temperature model!Box!Bottom temperature} %
+    set Top temperature    = 0 % \index[prmindex]{Top temperature} \index[prmindexfull]{Boundary temperature model!Box!Top temperature} %
+  end
+end
+
+subsection Model settings
+  set Fixed temperature boundary indicators   = 4,5 % \index[prmindex]{Fixed temperature boundary indicators} \index[prmindexfull]{Model settings!Fixed temperature boundary indicators} %
+
+  set Zero velocity boundary indicators       = % \index[prmindex]{Zero velocity boundary indicators} \index[prmindexfull]{Model settings!Zero velocity boundary indicators} %
+  set Prescribed velocity boundary indicators = % \index[prmindex]{Prescribed velocity boundary indicators} \index[prmindexfull]{Model settings!Prescribed velocity boundary indicators} %
+  set Tangential velocity boundary indicators = 0,1,2,3,4,5 % \index[prmindex]{Tangential velocity boundary indicators} \index[prmindexfull]{Model settings!Tangential velocity boundary indicators} %
+end
+\end{lstlisting}
+
+The next step is to describe the initial conditions. As before, we will use an
+instably layered medium but the perturbation now needs to be both in $x$- and
+$y$-direction
+egin{lstlisting}[frame=single,language=prmfile,escapechar=\%]
+subsection Initial conditions
+  set Model name = function % \index[prmindex]{Model name} \index[prmindexfull]{Initial conditions!Model name} %
+
+  subsection Function
+    set Variable names      = x,y,z % \index[prmindex]{Variable names} \index[prmindexfull]{Initial conditions!Function!Variable names} %
+    set Function constants  = p=0.01, L=1, pi=3.1415926536, k=1 % \index[prmindex]{Function constants} \index[prmindexfull]{Initial conditions!Function!Function constants} %
+    set Function expression = (1.0-z) - p*cos(k*pi*x/L)*sin(pi*z)*y^3 % \index[prmindex]{Function expression} \index[prmindexfull]{Initial conditions!Function!Function expression} %
+  end
+end
+\end{lstlisting}
+
+The third issue we need to address is that we can likely not afford a mesh as
+fine as in 2d. We choose a mesh that is refined 3 times globally at the
+beginning, then 3 times adaptively, and is then adapted every 15 time steps. We
+also allow one additional mesh refinement in the first time step following
+$t=0.003$ once the initial instability has given way to a more stable pattern:
+egin{lstlisting}[frame=single,language=prmfile,escapechar=\%]
+subsection Mesh refinement
+  set Initial global refinement                = 3 % \index[prmindex]{Initial global refinement} \index[prmindexfull]{Mesh refinement!Initial global refinement} %
+  set Initial adaptive refinement              = 3 % \index[prmindex]{Initial adaptive refinement} \index[prmindexfull]{Mesh refinement!Initial adaptive refinement} %
+  set Time steps between mesh refinement       = 15 % \index[prmindex]{Time steps between mesh refinement} \index[prmindexfull]{Mesh refinement!Time steps between mesh refinement} %
+
+  set Additional refinement times              = 0.003 % \index[prmindex]{Additional refinement times} \index[prmindexfull]{Mesh refinement!Additional refinement times} %
+end
+\end{lstlisting}
+
+Finally, as we have seen in the previous section, a computation with $Ra=10^4$
+does not lead to a simulation that is exactly exciting. Let us choose $Ra=10^6$
+instead (the mesh chosen above with up to 7 refinement levels after some time
+is fine enough to resolve this). We can achieve this in the same way as in the
+previous section by choosing $lpha=10^{-10}$ and setting
+egin{lstlisting}[frame=single,language=prmfile,escapechar=\%] 
+subsection Gravity model
+  set Model name = vertical % \index[prmindex]{Model name} \index[prmindexfull]{Gravity model!Model name} %
+
+  subsection Vertical
+    set Magnitude = 1e16   # = Ra / Thermal expansion coefficient % \index[prmindex]{Magnitude} \index[prmindexfull]{Gravity model!Vertical!Magnitude} %
+  end
+end
+\end{lstlisting}
+This has some interesting implications. First, a higher Rayleigh number makes
+time scales correspondingly smaller; where we generated graphical output only
+once every 0.01 time units before, we now need to choose the corresponding
+increment smaller by a factor of 100:
+egin{lstlisting}[frame=single,language=prmfile,escapechar=\%]
+subsection Postprocess
+  set List of postprocessors = velocity statistics, temperature statistics, ...
+                       ...heat flux statistics, visualization % \index[prmindex]{List of postprocessors} \index[prmindexfull]{Postprocess!List of postprocessors} %
+
+  subsection Visualization
+    set Time between graphical output = 0.0001 % \index[prmindex]{Time between graphical output} \index[prmindexfull]{Postprocess!Visualization!Time between graphical output} %
+  end
+end
+\end{lstlisting}
+Secondly, a simulation like this -- in 3d, with a significant number of cells,
+and for a significant number of time steps -- will likely take a good amount of
+time. The computations for which we show results below was run using 64
+processors by running it using the command
+{	t{mpirun -n 64 ./aspect convection-box-3d.prm}}. If the machine should crash
+during such a run, a significant amount of compute time would be lost if we had
+to run everything from the start. However, we can avoid this by periodically
+checkpointing the state of the computation:
+egin{lstlisting}[frame=single,language=prmfile,escapechar=\%]
+subsection Checkpointing
+  set Steps between checkpoint = 50 % \index[prmindex]{Steps between checkpoint} \index[prmindexfull]{Checkpointing!Steps between checkpoint} %
+end
+\end{lstlisting}
+If the computation does crash (or if a computation runs out of the time limit
+imposed by a scheduling system), then it can be restarted from such
+checkpointing files (see the parameter {	t Resume computation}
+in Section~
ef{parameters:global}).
+
+Running with this input file requires a bit of patience since the number of
+degrees of freedom is just so large: it starts with a bit over 330,000\ldots
+
+but then increases quickly to around 2 million and, after time $t=0.003$ where
+we allow for an additional refinement, increases to over 10 million where it
+then hovers between 8 and 14 million with a maximum of 15,147,534.
+
+
 \subsubsection{Convection in a box with prescribed, variable velocity boundary conditions}
 
-A similarly simple setup is to equip the model we had in the previous section
-with a different set of boundary conditions. There, we used slip boundary
+A similarly simple setup to the ones considered in the previous subsections is
+to equip the model we had with a different set of boundary conditions. There, we used slip boundary
 conditions, i.e., the fluid can flow tangentially along the four sides of our
 box but this tangential velocity is unspecified. On the other hand, in many
 situations, one would like to actually prescribe the tangential flow velocity as


More information about the CIG-COMMITS mailing list