Skip to content

Commit

Permalink
Merge pull request #241 from PrincetonUniversity/issue-158
Browse files Browse the repository at this point in the history
Fluid solid bathymetry
  • Loading branch information
Rohit-Kakodkar authored Dec 17, 2024
2 parents d11bc97 + 0e55182 commit 8c5acab
Show file tree
Hide file tree
Showing 17 changed files with 977 additions and 13 deletions.
20 changes: 10 additions & 10 deletions docs/source_description/source_discription.rst
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Force Source Description
Moment Tensor Source Description
================================

**Parameter Name** : ``sources.moment_tensor``
**Parameter Name** : ``sources.moment-tensor``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -93,7 +93,7 @@ Moment Tensor Source Description

**Description** : Definition of moment tensor source

**Parameter Name** : ``sources.moment_tensor.x``
**Parameter Name** : ``sources.moment-tensor.x``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -102,7 +102,7 @@ Moment Tensor Source Description

**Description** : X coordinate location of the moment tensor source.

**Parameter Name** : ``sources.moment_tensor.z``
**Parameter Name** : ``sources.moment-tensor.z``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -111,7 +111,7 @@ Moment Tensor Source Description

**Description** : Z coordinate location of the moment tensor source.

**Parameter Name** : ``sources.moment_tensor.Mxx``
**Parameter Name** : ``sources.moment-tensor.Mxx``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -120,7 +120,7 @@ Moment Tensor Source Description

**Description** : Mxx moment tensor component.

**Parameter Name** : ``sources.moment_tensor.Mzz``
**Parameter Name** : ``sources.moment-tensor.Mzz``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -129,7 +129,7 @@ Moment Tensor Source Description

**Description** : Mzz moment tensor component.

**Parameter Name** : ``sources.moment_tensor.Mxz``
**Parameter Name** : ``sources.moment-tensor.Mxz``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -138,7 +138,7 @@ Moment Tensor Source Description

**Description** : Mxz moment tensor component.

**Parameter Name** : ``sources.moment_tensor.Dirac`` [optional]
**Parameter Name** : ``sources.moment-tensor.Dirac`` [optional]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -147,7 +147,7 @@ Moment Tensor Source Description

**Description** : Definition of Dirac source :ref:`dirac_source_description`

**Parameter Name** : ``sources.moment_tensor.Ricker`` [optional]
**Parameter Name** : ``sources.moment-tensor.Ricker`` [optional]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -156,7 +156,7 @@ Moment Tensor Source Description

**Description** : Definition of Ricker source :ref:`ricker_source_description`

**Parameter Name** : ``sources.moment_tensor.External`` [optional]
**Parameter Name** : ``sources.moment-tensor.External`` [optional]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

**dafault value** : None
Expand All @@ -169,7 +169,7 @@ Moment Tensor Source Description

.. code-block:: yaml
moment_tensor:
moment-tensor:
x: 0.0
z: 0.0
Mxx: 1e10
Expand Down
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ cmake_minimum_required(VERSION 3.17.5)
add_subdirectory(homogeneous-medium-flat-topography)
add_subdirectory(fluid-solid-interface)
add_subdirectory(Tromp_2005)
add_subdirectory(fluid-solid-bathymetry)
4 changes: 4 additions & 0 deletions examples/Tromp_2005/CMakeFiles/Snakefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ rule plot_kernels:
run:
from plot import plot_kernels

# Set matplotlib gui off
import matplotlib
matplotlib.use("Agg")

plot_kernels(input.kernels, output.plot)


Expand Down
4 changes: 4 additions & 0 deletions examples/fluid-solid-bathymetry/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
specfem_config.yaml
Par_File
line_sources.yaml
__pycache__
143 changes: 143 additions & 0 deletions examples/fluid-solid-bathymetry/CMakeFiles/Par_File.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
#-----------------------------------------------------------
#
# Simulation input parameters
#
#-----------------------------------------------------------

# title of job
title = fluid-solid-bathymetry

# parameters concerning partitioning
NPROC = 1 # number of processes

# Output folder to store mesh related files
OUTPUT_FILES = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES

#-----------------------------------------------------------
#
# Mesh
#
#-----------------------------------------------------------

# Partitioning algorithm for decompose_mesh
PARTITIONING_TYPE = 3 # SCOTCH = 3, ascending order (very bad idea) = 1

# number of control nodes per element (4 or 9)
NGNOD = 9

# location to store the mesh
database_filename = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/database.bin

#-----------------------------------------------------------
#
# Receivers
#
#-----------------------------------------------------------

# use an existing STATION file found in ./DATA or create a new one from the receiver positions below in this Par_file
use_existing_STATIONS = .false.

# number of receiver sets (i.e. number of receiver lines to create below)
nreceiversets = 2

# orientation
anglerec = 0.d0 # angle to rotate components at receivers
rec_normal_to_surface = .false. # base anglerec normal to surface (external mesh and curve file needed)

# first receiver set (repeat these 6 lines and adjust nreceiversets accordingly)
nrec = 1 # number of receivers
xdeb = 1.000d+04 # first receiver x in meters
zdeb = 8.082d+03 # first receiver z in meters
xfin = 1.000d+04 # last receiver x in meters (ignored if only one receiver)
zfin = 8.082d+03 # last receiver z in meters (ignored if only one receiver)
record_at_surface_same_vertical = .false. # receivers inside the medium or at the surface


# second receiver set (repeat these 6 lines and adjust nreceiversets accordingly)
nrec = 1 # number of receivers
xdeb = 1.000d+04 # first receiver x in meters
zdeb = 5.472d+03 # first receiver z in meters
xfin = 1.000d+04 # last receiver x in meters (ignored if only one receiver)
zfin = 5.472d+03 # last receiver z in meters (ignored if only one receiver)
record_at_surface_same_vertical = .false. # receivers inside the medium or at the surface

# filename to store stations file
stations_filename = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/STATIONS

#-----------------------------------------------------------
#
# Velocity and density models
#
#-----------------------------------------------------------

# number of model materials
nbmodels = 2
# available material types (see user manual for more information)
# acoustic: model_number 1 rho Vp 0 0 0 QKappa Qmu 0 0 0 0 0 0
# elastic: model_number 1 rho Vp Vs 0 0 QKappa Qmu 0 0 0 0 0 0
# anistoropic: model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 0 0 0
# poroelastic: model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu
# tomo: model_number -1 0 9999 9999 A 0 0 9999 9999 0 0 0 0 0
1 1 2500.d0 3400.d0 1963.d0 0 0 9999 9999 0 0 0 0 0 0
2 1 1020.d0 1500.d0 0.d0 0 0 9999 9999 0 0 0 0 0 0

# external tomography file
TOMOGRAPHY_FILE = ./DATA/tomo_file.xyz

# use an external mesh created by an external meshing tool or use the internal mesher
read_external_mesh = .false.

#-----------------------------------------------------------
#
# PARAMETERS FOR EXTERNAL MESHING
#
#-----------------------------------------------------------

# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model

#-----------------------------------------------------------
#
# PARAMETERS FOR INTERNAL MESHING
#
#-----------------------------------------------------------

# file containing interfaces for internal mesh
interfacesfile = @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/topography_file.dat

# geometry of the model (origin lower-left corner = 0,0) and mesh description
xmin = 0.d0 # abscissa of left side of the model
xmax = 2.000d+04 # abscissa of right side of the model
nx = 250 # number of elements along X

STACEY_ABSORBING_CONDITIONS = .true. # use Stacey absorbing boundary conditions

# absorbing boundary parameters (see absorbing_conditions above)
absorbbottom = .true.
absorbright = .true.
absorbtop = .false.
absorbleft = .true.

# define the different regions of the model in the (nx,nz) spectral-element mesh
nbregions = 2 # then set below the different regions and model number for each region
1 250 1 62 1
1 250 63 120 2

#-----------------------------------------------------------
#
# DISPLAY PARAMETERS
#
#-----------------------------------------------------------

# meshing output
output_grid_Gnuplot = .false. # generate a GNUPLOT file containing the grid, and a script to plot it
output_grid_ASCII = .false. # dump the grid in an ASCII text file consisting of a set of X,Y,Z points or not
56 changes: 56 additions & 0 deletions examples/fluid-solid-bathymetry/CMakeFiles/specfem_config.yaml.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
parameters:

header:
## Header information is used for logging. It is good practice to give your simulations explicit names
title: fluid-solid-bathymetry # name for your simulation
# A detailed description for your simulation
description: |
Material systems : Elastic domain (1), Acoustic domain (1)
Interfaces : Acoustic-elastic interface (1) (orientation horizontal with acoustic domain on top)
Sources : Moment-tensor (234)
Boundary conditions : Neumann BCs on all edges

simulation-setup:
## quadrature setup
quadrature:
quadrature-type: GLL4

## Solver setup
solver:
time-marching:
type-of-simulation: forward
time-scheme:
type: Newmark
dt: 1.000e-3
nstep: 32500

simulation-mode:
forward:
writer:
seismogram:
format: ascii
directory: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/results

display:
format: PNG
directory: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/display
field: displacement
simulation-field: forward
time-interval: 100

receivers:
stations-file: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/STATIONS
angle: 0.0
seismogram-type:
- pressure
nstep_between_samples: 10

## Runtime setup
run-setup:
number-of-processors: 1
number-of-runs: 1

## databases
databases:
mesh-database: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/OUTPUT_FILES/database.bin
source-file: @CMAKE_SOURCE_DIR@/examples/fluid-solid-bathymetry/line_sources.yaml
5 changes: 5 additions & 0 deletions examples/fluid-solid-bathymetry/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

CMAKE_MINIMUM_REQUIRED(VERSION 3.17.5)

configure_file(CMakeFiles/specfem_config.yaml.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-bathymetry/specfem_config.yaml)
configure_file(CMakeFiles/Par_File.in ${CMAKE_SOURCE_DIR}/examples/fluid-solid-bathymetry/Par_File)
39 changes: 39 additions & 0 deletions examples/fluid-solid-bathymetry/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Wave propagration through fluid-solid interface

This example simulates a tele-seismic plane wave within a fluid-solid domain. This example is contributed by Sirawich Pipatprathanporn and is part of the publication [Pipatprathanporn et al. (2024)](https://doi.org/10.1093/gji/ggae238)

## Running the examples

To run the examples, you first need to install poetry following these [instructions](https://python-poetry.org/docs/#installation). Once you've done so, you can install the dependencies for the examples by running the following command in the current directory:

```bash
# verify poetry is installed
poetry --version

# install dependencies
poetry install

```

After installing the dependencies, you can run the examples by running the following command within the example directory you want to run:

```bash

# run the example
poetry run snakemake -j 1

# or to run the example on a slurm cluster
poetry run snakemake --executor slurm -j 1

```

## Cleaning up

To clean up the example directory, you can run the following command in the directory of the example you want to clean up:

```bash

# clean up the example
poetry run snakemake clean

```
Loading

0 comments on commit 8c5acab

Please sign in to comment.