First simulation

Setup

Simulations in OpenSPH are set up using a node-based editor. To get familiar with the system, open up the the Presets category on the right-hand side of the editor and select a simulation by double-clicking it.

Each node requires a set of inputs, it is necessary to connect the inputs in order to evalute it. For example, the SPH run node requires the particle data as its initial conditions and, if boundary conditions are enabled, also the shape definiting the computation domain. There are currently four types of nodes:

Running the simulation

To start the simulation, you can:

If the simulation setup is not valid, OpenSPH will show you an error message, otherwise the nodes will be evaluated, starting from the left-most ones (nodes with no inputs) and moving right in the node hierarchy. The currently evaluated node as well as the progress are shown in the status bar on the bottom of the simulation page.

There are two types of simulation - SPH and N-body. Both can be used for simulations of self-gravitating objects, they differ in particle interactions. SPH solves hydrodynamical equations to get physically correct behavior of fluids or solid bodies. N-body considers particles to be solid spheres and handles their collisions using either billiard-ball physics or by merging them into a larger particle.

For SPH simulations, it is useful to set Particle radius to about 0.3 in the simulation page. This only affects the visualization of particles. It reduces the particle overlap and makes the rendering window more responsive. However, keep the radius at 1 for N-body simulation to correctly show the physical radius of particles. It is sometimes useful to set certain Cutoff distance. This will only render particles close to the z=0 plane, showing the interiors of the simulated objects.

Time step

The time step in the simulation is determined automatically, using the user-defined criteria. The current time step is displayed in the Run statistics panel, together with the criterion that limits the time step. There are several criteria, all of which are enabled by default. They can be set in the Time step criteria property of the simulation node. Generally, the Courant and Divergence criterion ensure the stability and should therefore always be enabled (although feel free to test what happens if you turn them off). Criteria Derivatives and Acceleration control the accuracy of the simulation. It is useful to disable them for quick tests, as they may considerably slow down the simulation, although they should remain enabled for 'serious' work. The time step is further limited by the Maximal timestep property, which might need to be increased for simulations of very large objects.