The compute backbone for domain-driven simulation apps.
This tutorial will show you how to run SPlisHSPlasH simulations using the Inductiva API.
We will cover the DamBreakModel use case from the SPlisHSPlasH GitHub repository to help you get started with simulations.
.json file here and the additional geometry file here. Once downloaded, place both files into a folder named SimulationFiles..json file: update the geometryFile path to UnitBox.obj and add "stopAt": 1 as a configuration parameter.Then, youโll be ready to send your simulation to the Cloud.
Here is the code required to run a SPlisHSPlasH simulation using the Inductiva API:
"""SPlisHSPlasH example."""
import inductiva
# Allocate cloud machine on Google Cloud Platform
cloud_machine = inductiva.resources.MachineGroup( \
provider="GCP",
machine_type="c2d-highcpu-4",
spot=True)
# Initialize the Simulator
splishsplash = inductiva.simulators.SplishSplash(\
version="2.13.0")
# Run simulation
task = splishsplash.run(input_dir="/Path/to/SimulationFiles",
sim_config_filename="DamBreakModel.json",
on=cloud_machine)
# Wait for the simulation to finish and download the results
task.wait()
cloud_machine.terminate()
task.download_outputs()
task.print_summary()
In this basic example, we're using a cloud machine (c2d-highcpu-4) equipped with 4 virtual CPUs.
For larger or more compute-intensive simulations, consider adjusting the machine_type parameter to select
a machine with more virtual CPUs and increased memory capacity. You can explore the full range of available machines here.
Note: Setting
spot=Trueenables the use of spot machines, which are available at substantial discounts. However, your simulation may be interrupted if the cloud provider reclaims the machine.
To adapt this script for other SPlisHSPlasH simulations, replace input_dir with the
path to your SPlisHSPlasH input files and set the sim_config_filename accordingly.
When the simulation is complete, we terminate the machine, download the results and print a summary of the simulation as shown below.
Task status: Success
Timeline:
Waiting for Input at 21/04, 19:49:20 1.116 s
In Queue at 21/04, 19:49:21 34.469 s
Preparing to Compute at 21/04, 19:49:55 0.996 s
In Progress at 21/04, 19:49:56 9.123 s
โ> 0.982 s cp /SPlisHSPlasH_CPU/bin/SPHSimulator .
โ> 6.877 s ./SPHSimulator DamBreakModel.json --no-gui --output-dir .
โ> 1.064 s rm SPHSimulator
Finalizing at 21/04, 19:50:06 0.502 s
Success at 21/04, 19:50:06
Data:
Size of zipped output: 1.77 MB
Size of unzipped output: 6.98 MB
Number of output files: 5
Total estimated cost (US$): 0.010099 US$
Estimated computation cost (US$): 0.000099 US$
Task orchestration fee (US$): 0.010 US$
Note: A per-run orchestration fee (0.010 US$) applies to tasks run from 01 Dec 2025, in addition to the computation costs.
Learn more about costs at: https://inductiva.ai/guides/basics/how-much-does-it-cost
As you can see in the "In Progress" line, the part of the timeline that represents the actual execution of the simulation, the core computation time of this simulation was approximately 9 seconds.