import os
import pathlib
from frequency_band import FrequencyBand
PROJECT_DIR = "project_dir_central_europe"
SIMULATION_TIME_IN_SECONDS = 500.0
RANKS_PER_JOB = 4
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
fband_file = pathlib.Path("./frequency_band_70_120.pkl")
fband = FrequencyBand.load(fband_file)
fband
FrequencyBand(min_frequency_in_hertz=0.008333333333333333, max_frequency_in_hertz=0.014285714285714285)
from salvus import namespace as sn
p = sn.Project(path=PROJECT_DIR)
data
subdirectory. Before using the model later on for a simulation, we'll first have to add it to our project as below.p.add_to_project(
sn.model.volume.seismology.GenericModel(
name="s362_ani", data="data/s362ani.nc", parameters=["VSV", "VSH"]
)
)
GenericModel
function -- in contrast to the possible MantleModel
or CrustalModel
options. This is, again, due to the relatively limited resources present on the training cluster. While GenericModel
will interpolate the provided model without any consideration of radial discontinuities, the other two classes will ensure that interpolation only happens in the specified regions. In the standard use case we can use multiple 3-D models in a simulation, within and across target regions.UtmDomain
, but that is beyond the scope of this tutorial. We can register this topography model with the project as below.p.add_to_project(
sn.topography.spherical.SurfaceTopography(
name="surface_topography", data="data/topography.nc"
)
)
p.add_to_project(
sn.bathymetry.spherical.OceanLoad(
name="ocean_bathymetry", data="data/bathymetry.nc"
)
)
SimulationConfiguration
. It's a bit verbose, so let's go through the settings one by one! First, let's start with some fundamental ones.p.add_to_project(
sn.SimulationConfiguration(
name="my_first_simulation",
max_depth_in_meters=1750e3,
elements_per_wavelength=1.25,
min_period_in_seconds=fband.min_period_in_seconds,
model_configuration=sn.ModelConfiguration(
background_model="prem_ani_one_crust", volume_models=["s362_ani"]
),
topography_configuration=sn.TopographyConfiguration(
"surface_topography"
),
bathymetry_configuration=sn.BathymetryConfiguration(
"ocean_bathymetry"
),
event_configuration=sn.EventConfiguration(
wavelet=sn.simple_config.stf.GaussianRate(
half_duration_in_seconds=2 * fband.min_period_in_seconds
),
waveform_simulation_configuration=sn.WaveformSimulationConfiguration(
end_time_in_seconds=SIMULATION_TIME_IN_SECONDS,
attenuation=True,
),
),
absorbing_boundaries=sn.AbsorbingBoundaryParameters(
reference_velocity=3700.0,
number_of_wavelengths=0.0,
reference_frequency=fband.max_frequency_in_hertz,
),
)
)
p.viz.nb.simulation_setup("my_first_simulation", events=p.events.list())
[2025-02-07 20:49:40,824] INFO: Creating mesh. Hang on.
Interpolating model: s362_ani.