# Diff of /trunk/doc/user/levelset.tex

revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2881 by jfenwick, Thu Jan 28 02:03:15 2010 UTC
# Line 1  Line 1
1
2  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3  %  %
4  % Copyright (c) 2003-2009 by University of Queensland  % Copyright (c) 2003-2010 by University of Queensland
5  % Earth Systems Science Computational Center (ESSCC)  % Earth Systems Science Computational Center (ESSCC)
6  % http://www.uq.edu.au/esscc  % http://www.uq.edu.au/esscc
7  %  %
# Line 255  where $\Delta \rho$ is the difference in Line 255  where $\Delta \rho$ is the difference in
255  %  %
256  The following PYTHON code is for the Rayleigh-Taylor instability problem, which is available in the example directory as 'RT2D.py'. This script uses the 'StokesProblemCartesian' class for solving the Stokes equation, along with the incompressibility condition. A class called 'LevelSet' is also used, which performs the advection and reinitialization procedures to track the movement of the interface of the fluids. The details and use of these classes are described in Chapter \ref{MODELS CHAPTER} (Models Chapter).  The following PYTHON code is for the Rayleigh-Taylor instability problem, which is available in the example directory as 'RT2D.py'. This script uses the 'StokesProblemCartesian' class for solving the Stokes equation, along with the incompressibility condition. A class called 'LevelSet' is also used, which performs the advection and reinitialization procedures to track the movement of the interface of the fluids. The details and use of these classes are described in Chapter \ref{MODELS CHAPTER} (Models Chapter).
257
258  The script starts off by importing the necessary classes. The physical properties of the two fluids are defined, such as density and viscosity. Acceleration due to gravity is taken as 10.0 $ms^{-2}$. Solver settings are set for solving the Stokes problem, with the number of time-steps, solver tolerance, maximum solver iterations, and the option to use the Uzawa scheme or not; the default solver is the PCG solver. A regular mesh is defined with 200$\times$200 elements. Level set parameters are set for the reinitialization procedure, such as the convergence tolerance, number of reinitialization steps, the frequency of the reinitialization, for example, every third time-step, and the smoothing parameter to smooth the physical properties across the interface. A no-slip boundary condition is set for the top and bottom of the domain, while on the left and right-hand sides there is a slip condition. The initial interface between the two fluids is defined as in Figure \ref{RT2DSETUP}. Instances of the StokesProblemCartesian and LevelSet class are created. The iteration throughout the time-steps involves the update of the physical parameters of the fluids; the initialization of the boundary conditions, viscosity, and body forces; the solving of the Stokes problem for velocity and pressure; then the level set procedure. The output of the level set function, velocity and pressure is saved to file. The time-step size is selected based on the Courant condition. Due to the number of elements in the computational mesh, the simulation may take a long time to complete on a desktop computer, so it is recommended to run it on the super computer. At present, the fine mesh is required to capture the details of the fluid motion and for numerical stability.    The script starts off by importing the necessary classes. The physical properties of the two fluids are defined, such as density and viscosity.
259    Acceleration due to gravity is taken as 10.0 $ms^{-2}$.
260    Solver settings are set for solving the Stokes problem, with the number of time-steps, solver tolerance, maximum solver iterations,
261    and the option to use the Uzawa scheme or not; the default solver is the PCG solver. A regular mesh is defined with 200$\times$200 elements.
262    Level set parameters are set for the reinitialization procedure, such as the convergence tolerance, number of
263    reinitialization steps, the frequency of the reinitialization, for example, every third time-step, and the smoothing
264     parameter to smooth the physical properties across the interface.
265     A no-slip boundary condition is set for the top and bottom of the domain, while on the left and right-hand sides
266     there is a slip condition.
267    The initial interface between the two fluids is defined as in Figure \ref{RT2DSETUP}. Instances of the StokesProblemCartesian and LevelSet class are created.
268    The iteration throughout the time-steps involves the update of the physical parameters of the fluids; the initialization of
269    the boundary conditions, viscosity, and body forces; the solving of the Stokes problem for velocity and pressure; then the
270    level set procedure.
271    The output of the level set function, velocity and pressure is saved to file.
272    The time-step size is selected based on the Courant condition.
273    Due to the number of elements in the computational mesh, the simulation may take a long time to complete on a desktop computer,
274    so it is preferable to run it on the super computer.
275    At present, the fine mesh is required to capture the details of the fluid motion and for numerical stability.
276  %  %
277  \begin{python}  \begin{python}
278

Legend:
 Removed from v.2548 changed lines Added in v.2881