2D simulation, complex forcing & boundaries

Hi! I’m only starting SPH simulations, with some experience about very basic cases. In the end, I should be running a sea ice simulation for the Northern Baltic Sea.

I’m interested in any possible guidance for setting up a 2D simulation with a complex fixed boundary and a complex, changing wind forcing. Thank you!

Hi @Jonni_Lehtiranta,

I am not sure that GPUSPH offers the possibility of running 2D simulations. Currently, GPUSPH is a 3D computational engine and only support 3D simulations.


Hi @saikali!

That would be a very logical explanation for the lack of information concerning 2D simulations. I wonder if someone has more information on whether it would be easy to modify GPUSPH accordingly. I imagine it could be easy - or hard!

I do know that DualSPHysics is an alternative that does support 2D simulations, but then it doesn’t have multi-GPU capabilities which I would be interested in.


I dont think its impossible… but not fast. New equations (maybe), new smoothing kernels for 2D (sure), …

It can be possible maybe to test a 2D.5 case (long x and z directions, short y dimension)?? Donno if it is interesting… Just an idea.


Thanks for the idea!

I don’t actually have a very good picture of how it would work. Anyhow, the aim is to simulate the ice cover in the Bay of Bothnia, so the model domain would be ~200 km in X and Z, and at most maybe 20 m in Y. So that’s a factor of roughly 10 000. And I probably can’t afford several particles on top of each other, I was hoping for one particle per 100 meters or so.

So a 3D geometry is ok ? non ?

A 3D geometry is ok if I can restrict all action to a 2D plane.


U can give it a try… I hope it will work for your study.
But, you are obliged to fill with particles along the span-wise direction too (Y=20m). Here, dp will be obviously < 100 m (what you plan to use along X and Z directions).

Good luck and enjoy GPUSPH !

Hello @Jonni_Lehtiranta,

to add to @saikali’s answer (and sorry for the delay), making a 2D version of GPUSPH is possible, but it would require some work.

The first thing to do would be to recompute all the coefficients for the smoothing kernels (the kernels are radial, so the functional form remains exactly the same —it’s just the coeffcients computed in src/cuda/forces.cu, setconstants method that would need to change). This is relatively simple.

For the forces computation and integration, most things could be kept as-is. It would be necessary to choose which of the x, y, z direction to ignore, and then simply “kill” that contribution. This can be enforced for example by not integrating the z component in the euler step (eulerDevice kernel in src/cuda/euler_kernel.def). Some additional work would probably be needed to handle moving bodies and floating objects, as well as to compute the stress and strain tensors, if necessary for the model, based on whether this is a plane strain or plane stress conditions.

Finally, the largest non-trivial change would be in the way the problem is set up. We do have some 2D geometries (rectangles and disks), but they are not usually used directly in 3D, just as auxiliary shapes for other geometries. This would need to change when setting up 2D problems.

As a simpler alternatives, for these 2D problems one might simply stick to imported geometries (loading e.g. one or more XYZ files that put everything on the same plane), which may be doable without larger changes, but would require the use of external programs to produce the files in the first place.

Hello, and thank you for the answers! I’m back from vacation, and back to SPH work :).

I think I understand the 2D problematics quite well now. Then there’s the other part that wasn’t really addressed above (or if it was, I didn’t understand it), the complex wind forcing.

It is basically a 2D grid of surface wind velocity vectors (or I could make it drag vectors). This would be significantly more coarse than my SPH simulation, both spatially and temporally - but it should be possible to include arbitrary spatial and temporal variation, as output from a weather model.

So, I need arbitrary prescribed external forces! Is there something in GPUSPH that would make it easy, or would it be a complex modification to the code?

Hello @Jonni_Lehtiranta

sorry, I think nobody actually answered your question about the wind forcing …

Currently GPUSPH only supports an external force field which is uniform in space, but can change in time (it’s informally called the gravity, but it can be any uniform driving force). Having a non-uniform external force is possible, but it would require some work. The idea would be to use something similar to what we use for the DEM: a texture (with the same dimensionality of the problem, thus 2D for 2D problems, 3D for 3D problems) that defines the value of the force at specific points (equally-spaced, but the resolution can be much coarser than the SPH spacing), with the external force at any other point computed by interpolation between the data points.

1 Like