This documentation is not for the latest stable Salvus version.
import os
PROJECT_DIR = "project_dir_central_europe"
MIN_PERIOD = 70.0
MAX_PERIOD = 120.0
SIMULATION_TIME_IN_SECONDS = 500.0
RANKS_PER_JOB = 4
SALVUS_FLOW_SITE_NAME = os.environ.get("SITE_NAME", "local")
period_band_name = f"{int(MIN_PERIOD)}_{int(MAX_PERIOD)}_seconds"
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=MIN_PERIOD,
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 * MIN_PERIOD
),
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=1.0 / MIN_PERIOD,
),
)
)
p.viz.nb.simulation_setup("my_first_simulation", events=p.events.list())
[2024-03-15 09:36:32,994] INFO: Creating mesh. Hang on.
Interpolating model: s362_ani.