Hi,
I hope all is well with you.
I want to use an arbitrary DEM and run it in 2D but I got “FATAL: non-zero z world size: spurious particles generated in the z direction?” error. Is it possible to use an arbitrary DEM in 2D? Do we need to use another format for DEM rather than the default one?
Regards,
Alireza
Hello @AlirezaZarei,
When support for 2D was introduced in GPUSPH, not all features were tested and DEM was among the ones that were postponed, so I’m not surprised you’re seeing the error you report.
The error comes from the fact that in 2D mode GPUSPH uses only x and y components (with y assumed to be the vertical one unless gravity is intentionally oriented differently). To avoid issues during problem setup, a check is done along the z axis and if any particles have non-zero z it is assumed that something went wrong, since the z axis is orthogonal to the simulation plane.
The DEM topology, on the other hand, is assumed to be (as needed for 3D) a regular array of heights over the ground xy plane. So particles get placed entirely outside of the simulation domain. This is also largely independent from the specific file format used, be it ASCII grid, VTK or XYZ. These assumption about the DEM topology are currently hard-coded both host-side (if you’re curious, the source file that manages this is src/geometries/TopoCube.cc
and its companion .hh
file), and device-side (when the geometric form of the DEM is used with the ENABLE_DEM
flag).
At least for standard particle-filling, a new TopoRect
or similar geometry should be introduced, designed specifically for 2D. This would be the geometry used by addDEM
in the problem API when the system is 2D.
This is a useful feature to add. Could you please open a feature request for this on GitHub?
(In the mean time, a workaround could be to generate Segments for the ground, although this will produce a different filling.)
Thank You, Giuseppe!
I will add a feature request on GitHub.
I have another question about the boundary module when using DEM. I want to use 3 layers of non-fluid particles instead of planes for the boundary, but my problem is how to implement these layers of non-fluid particles in a way that they get the shape of DEM! I think the “addBox” function doesn’t work well for this problem. Do you have any suggestions?
The box is a 3D geometry, so you should not use it in 2D. The geometries you can use safely in 2D are Segment, Rectangle and Disk. For composite borders, in particular, you want the Segment geometry.
There is a somewhat convoluted example in the SlidingWedge
test case. This test case is designed to be used both in 2D and 3D mode, which makes the code more complex than a simple 2D case would be, but it should give you an idea about how a complex boundary can be created with segments.
(SlidingWedge
actually defines and uses an addSurface
function that maps to addRect
in 3D and addSegment
in 2D.)
Actually, I want to use an arbitrary DEM in a 3D model. I want to use Dummy or Dynamic boundary conditions with 3 layers of non-fluid particles instead of planes, but the problem is that using “addDEM” and “addDEMfluidBox” is not enough to create 3 layers of non-fluid particles for the DEM. Moreover, I think “addBox” can only create a rectangular shape and cannot produce the DEM shape.
I think someone else had this problem before when I read the " DEM in combination with other geometries" in the Application part, but I couldn’t figure out whether you solved the problem or not.
(For the future: I recommend using different forum topics for different questions, even if they are releated, it makes things a bit more clear ;-))
I see what you mean now. A fix for (at least some of) the issues reported in that forum thread is available in the candidate-v6
branch of the development repository. If you addDEM
with FT_OUTER_BORDER
filltype it should work correctly.
Ok. I will create a new forum topic for the future.
I used FT_OUTER_BORDER
filltype based on the following lines (without using any planes):
if (tangent_filling)
setFillingMethod(Object::BORDER_TANGENT);
addDEM(dem_file, DEM_FMT_ASCII, use_geometries ? FT_NOFILL : FT_OUTER_BORDER);
addDEMFluidBox(water_height);
Now I have 3 layers of boundary layers but the problem is that there is a leakage in the model and particles don’t respect the boundary.
I’m running some tests now and there are indeed still some issues with multilayer fills for the boundaries. I’m currently working on some fixes.