Release version of the FD-PDE framework developed for magma dynamics and other applications in geodynamics.
The FD-PDE Framework was created within the RIFT-O-MAT (Magma-Assisted Tectonics) project, funded by the European Research Council under Horizon 2020 research and innovation program, and awarded to PI Richard Katz.
The goal of the RIFT-O-MAT project is to create analytical and numerical tools to understand how magmatism promotes and shapes rifts in continental and oceanic lithosphere.
- Adina E. Pusok
- Dave May
- Yuan Li
- Richard Katz
src/
: source code for FD-PDE frameworktests/
: tests for FD-PDE frameworkmodels/
: model applications using the FD-PDE Frameworkmodels/mbuoy3/
: mid-ocean ridge code used in Pusok et al. (GJI, 2022)utils/
: python routines for I/O of PETSc objects
The FD-PDE framework uses finite difference staggered grids for solving partial differential equations (PDEs) for single-/two-phase flow magma dynamics.
The FD-PDE framework is based on PETSc and make use of the new features for staggered grids, such as DMStag. Governing equations are discretized as default PDEs (i.e., FDPDE Type), and the user only specifies coefficients, constitutive equations, and boundary conditions.
Documentation for the FD-PDE Framework and tests can be found: FD-PDE Benchmarks.
Source code is located in /FD-PDE/src/
.
Tests are located in /FD-PDE/tests/
.
The current Petsc version (3.14) should be obtained from petsc:
git clone -b maint https://gitlab.com/petsc/petsc.git petsc
Do git pull
in the petsc directory anytime to obtain new patches that have been added.
Configure options (change <PATH>
accordingly):
DEBUG:
./configure --prefix=<PATH_DEBUG> --download-fblaslapack --download-hdf5 --download-mumps --download-scalapack --download-parmetis --download-metis --download-cmake --with-debugging --download-mpich --enable-shared --download-pastix --download-ptscotch --with-cxx-dialect=C++11 --download-superlu_dist --download-spooles --download-suitesparse --download-ml --download-hypre --download-hwloc --download-mpi4py --download-petsc4py --download-make
OPTIMIZED:
./configure --prefix=<PATH_OPT> --FOPTFLAGS=-O2 --CXXOPTFLAGS=-O2 --COPTFLAGS=-O2 --download-fblaslapack --download-hdf5 --download-mumps --download-scalapack --download-parmetis --download-metis --download-cmake --with-debugging=0 --download-mpich --enable-shared --download-pastix --download-ptscotch --with-cxx-dialect=C++11 --download-superlu_dist --download-spooles --download-suitesparse --download-ml --download-hypre --download-hwloc --download-mpi4py --download-petsc4py --download-make
Specify PETSc environment variable for bash (can be specified in ~/.bashrc
or ~/.bash_profile
):
export PETSC_DIR=<PATH>
We use python for testing and post-processing. A default 3.x python installation should be enough for tests.
Preferred way to install python is through anaconda3 (multi-platform), which will install all the right executables (especially conda, which is similar to brew/port). The executables should be installed in /Users/user/anaconda3/bin/
. Check: which python
and which conda
.
Update anaconda (occasionally) with: conda update --all
To use the visualization tools developed within the FD-PDE Framework, update the environmental variable (change <PATH_FDPDE>
accordingly):
export PYTHONPATH=<PATH_FDPDE>/utils:${PETSC_DIR}/lib/petsc/bin
In FD-PDE/src/
:
- Clean executables:
make clean_all
- Make executables:
make tests
- Run tests (example 1):
./tests/test_fdpde.app
- Run tests (example 2):
python runApplicationTests.py
in/FD-PDE/tests/python/
- Visualization: using python examples in
/FD-PDE/tests/python/
.
mbuoy3 is a 2-D mid-ocean ridge, two-phase flow model with buoyancy forces (porous, compositional, thermal).
Publication: Chemical heterogeneity, convection and asymmetry beneath mid-ocean ridges
Authors: Adina E. Pusok1, Richard F. Katz1, Dave A. May2, Yuan Li1
Affiliation: (1) Department of Earth Sciences, University of Oxford, Oxford, United Kingdom (2) Scripps Institution of Oceanography, UC San Diego, La Jolla, CA, USA
To compile the code, in FD-PDE/models/mbuoy3/
:
- Clean executable:
make clean_all
- Make executable:
make all
Running the model: ./mbuoy3.app -options_file model_half_ridge.opts > log_out.out
In mbuoy3/test/
run:
- Half-ridge model with:
../mbuoy3.app -options_file model_half_ridge.opts > log_out.out
- Full-ridge model with:
../mbuoy3.app -options_file model_full_ridge.opts > log_out.out
The input files are actually identical, except for the option to switch on full-ridge mode: -full_ridge 1
. This option will automatically extend the domain and adapt boundary conditions.
First, make sure the PYTHONPATH
is updated as indicated above. Then, install some cool Scientific Colormaps from Fabio Crameri with:
pip install cmcrameri
Example visualization for either the half-ridge/full-ridge test. In mbuoy3/python
run:
python plot_debug_output.py
python plot_time_series.py
plot_HR_sims_porosity.py
- for half-ridgeplot_FR_sims_porosity.py
- for full-ridge
More output routines can be found in vizMORBuoyancy.py
, which can be loaded as a module in any new script.
Input files to reproduce the simulations in Pusok et al. (GJI, 2022) are found in mbuoy3/publication/input_files/
. All parameter variations are indicated in the manuscript. Some nomenclature for half-ridge models:
- b000 - no buoyancy (passive flow)
- b100 - porous buoyancy
- b120 - porous and compositional buoyancy
Some nomenclature for full-ridge models:
- F1 - temperature forcing, can be modified with
-forcing 1 # 0-off, 1-Temp, 2-Comp
- F2 - compositional forcing
- dTdx, dCdx - indicates magnitude of forcing
The submit_job.run
are SLURM submission files, included to help with cpu and time usage, and how to restart a simulation from a specified timestep.
To install ThermoEngine
(Ghiorso et al., 2002, Ghiorso and Wolf, 2019), follow instructions from the ENKI website. In addition, you'll need to install and start Docker before running the ENKI server.
Copy the Jupyter notebooks:
MOR_beta_revised.ipynb
MOR_beta_revised_min.ipynb
in ThermoEngine/Notebooks/my_notebooks/
to reproduce the pMELTS simulations in this study.
In the ThermoEngine
directory, run the script ./run_docker_locally.sh
to start the ENKI server locally (JupyterLab session). Run the Jupyter notebooks within the JupyterLab session.