Calculate Normals based on Initial Particles?


So I am trying to do something which I think might be out of the scope of the current DualSPHysics capabilities. Basically I have a sinus sloped profile as such:

And I want to use the new Modified Dynamic Boundary Condition (MDBC) to simulate. The problem is that when I run the simulation I get the warning:


1. The selected DDT '(Fourtakas et al 2019 (full)' needs several boundary layers when h/dp>1.5

2. There are 7162 of 8071 fixed or moving boundary particles without normal data.

Where I dont understand the first warning, but it always pops up, but the 2nd one is what I am dealing with right now, since I was hoping there might be a way for me to easily upload normal data for my sloped profile? My sloped profile has a "width" of 2 particles:

But maybe I should have more particles also in the width? I hope someone can help me out.

Kind regards


  • Okay I kept working on it and now I have gotten it to work and calculated normals:

    This is done by making a bi4 file, overwriting position values in bi4 to match the sine curve exactly and then use the new "Surface normal generator" tool. The problem is that when I run the simulation using MDBC now I see the unphysical gap..

    This doesn't make sense to me since I can confirm from Paraview (using "3D Glyph"-> "Arrow" -> "Orient" -> "Normals") that my normals behave correctly as shown in first picture. If I use a regular distribution of particles and use MDBC I see:

    Which shows that there is no gap - so that works. I cannot figure out why it would not work with what I did though, since I am using the surface normal tool to generate a .nbi4 file, then adding this .nbi4 to my original simulation and then I confirm that normals are correct ( see first picture again) and points towards fluid..

    Can anyone show me an example of how to use "SurfaceNormals -casefile Wedge3d -surface isosurface.vtk -savevtk normals.vtk" (example from code help) correctly?

    Kind regards

  • "The selected DDT '(Fourtakas et al 2019 (full)' needs several boundary layers when h/dp>1.5" is only a warning when DDT=3 is used. The user must guarantee this requirement or the simulation will not work fine.

    About "There are 7162 of 8071 fixed or moving boundary particles without normal data." you can check the file CfgInit_Normals.vtk. This file is created by DualSPHysics with vectors from boundary particle to boundary limit. So it should be dp/2 for first layer of boundary particles. The boundary particles without normal are simulated as DBC. It is not an error because sometimes it is usefull to use MDBC only in a part of the boundaries.

    You can create this slope in the XML using <setfrdrawmode auto="true" /> and <drawextrude> with "layers" option. Check slices 57-58 of XML_GUIDE_v5.0.pdf. You can also find an example applied to MDBC in examples\mdbc\06WaveTank\CaseWaveTankDef.xml. This solution allows you to create several boundary layers with normal data.

    Sometimes the use of <setfrdrawmode auto="true" /> creates a inital gap between boundaries and fluid, since the fluid particles is always created by GenCase using a cubic grid. This initial gap remains using DBC, but it disappears when MDBC is used and the normal vectors are fine.

    The SurfaceNormals program is in development and I do not recommend using it. It should not be in the release package.

    We continue to work on making MDBC easier to use so we hope to provide improvements in this issue soon.

    Best regards

  • Thanks for your detailed explanation. Looking forward to the improvements.

    Kind regards

Sign In or Register to comment.