A finite difference python code for solving the conservation of energy, momentum and mass for incompressible (Newtonian) viscous flow
Python
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
obsolete
.gitignore
LICENSE
README
pylamp2.py
pylamp_const.py
pylamp_diff.py
pylamp_post.py
pylamp_stokes.py
pylamp_tool.py
pylamp_trac.py

README

==== PyLamp ====
                                                                               
 Python code to solve the conservation of energy, momentum and mass            
 for incompressible viscous flow. Some feature include:

 – finite differences
 – implicit (scipy direct solver), fully-staggered grid
 – marker-in-cell for material and temperature advection                       
 – linear (Newtonian) viscosity                                                
 – temperature dependent viscosity and density (buoyancy)

 Code is designed for 2D/3D but currently mostly only 2D features are
 implemented. Designed for rectilinear grid, although some implementations
 (e.g. tracer interpolation) currently rely on using a regular grid.


 Most of the implementations follow methods described in "Introduction
 to Numerical Geodynamic Modelling" by Taras Gerya (ISBN 978-0-521-99754-0).

 Other resources used:
  – Duretz et al., 2011. Discretization errors and free surface stabilization
    in the finite difference and marker‐in‐cell method for applied geodynamics: 
    A numerical study. Geochemistry Geophysics Geosystems, vol. 12, 7.
  – Meyer and Jenny, 2004. Conservative Velocity Interpolation for PDF Methods. 
    Proceedings in Applied Mathematics and Mechanics, vol. 4, 1.


USAGE:
-----

Modify pylamp2.py for initial and boundary conditions, run

  python3 pylamp2.py

Output will be in compressed numpy format (*.npz) which
can be converted to VTK files by running 

  python3 pylamp_post.py VTK 'tracs.*.npz'