SPH
|
This example only creates a single asteroid with default material settings and runs a simulation with default settings for 1 second. Not a very interesting simulation, but it shows a minimal code necessary to run it.
Here we show how to create an asteroid with custom shape. Specifically, we create a spherical asteroid with a large spherical crater on a surface (a "Death Star"). This can be easily generalized to create an arbitrary shape, provided it can be described using IDomain interface.
The example shows how to:
We show how to implement a custom equation state in the code. All equations of state derive from IEos interface, it is also necessary to manually create a material intead of having the material created from BodySettings parameters.
Many components of the code is designed in such a way that we can either specify it in BodySettings or RunSettings and let the code create it for us, or we can create a custom component and pass it into the constructor of the parent component. This example demonstrates how to do this for the EoS: we can either set the value of BodySettingsId::EOS, or we can add our custom EoS to the material.
The example shows how to:
We finally create a minimalistic impact experiment. Using InitialConditions object, we create two bodies - the target and the impactor - and fire the impactor towards the target at 5 km/s. The example uses default SPH solver and does not include gravity.
The example shows how to:
While it's ofter sufficient to run a single simulation, there are cases where we need to chain multiple simulations together. Here, we show how to implement a two-phase simulation. First phase is an impact and fragmentation of the asteroid, integrated using the default SPH solver, the second phase is a gravitational reaccumulation of the fragments, which is a solved using N-body solver.
The example shows how to
![]() | ![]() | ![]() |
The code is mostly specialized for SPH simulations, but it can be utilized for other computations as well. As long as explicit timestepping is sufficient and our solver can be implemented using ISolver interface, we can easily plug it to the framework. In the previous example, we showed how to use the code for N-body simulations (using NBodySolver), here we solve a one-dimensional heat diffusion equation using finite difference method.
We model a surface of an asteroid, periodically illuminated by the Sun as asteroid rotates. Only the vertical direction is modeled for simplicity. The output of the simulation is the surface temperature as a function of time. We see how the solution is relaxed to periodical function.
The example shows how to: