in/out strange behavior

Hello all,

I've been testing in/out behavior for internal flows. I am using an .stl file for the solid domain(pipe) and fillbox to create fluid particles. For inlet and outlet regions, I have two cylinders with mask option enabled. Regarding the "inout particles close to boundary" error, I initially simulated two cases.

1- the distance between the solid boundary (.stl file) and the inlet buffer is dp/2. (Rsolid=Rinlet+dp/2 where r is the radius)

2- the distance between the solid boundary (.stl file) and the inlet buffer is dp. (Rsolid=Rinlet+dp where r is the radius)



First of all, why is the buffer not centered? I am using matrixreset and I am sure both solid and buffer center is located at (0,0,0).

Secondly, I am using the most current DSPH (github). And, I am not able to disable gravity, even if I specify b and set it to auto="false", I get an error that reads " No depth data available". So, I am taking gravity to be 1e-5.

In both cases fluid particles escape, I checked the fillbox limits and they seem to be correct.



Because of the spacing between the inlet buffer and the solid boundary, as simulation progresses the region behind the inlet buffer is filled with particles.

20 timesteps

60 timesteps

And eventually, high velocity region and particle clustering is observed near the outlet buffer and this causes simulation to fail.

When I reduce the spacing between the fluid and solid, the region behind the inlet is not filled with particles so no backflow.

However, similar clustering occurs near outlet and simulation fails.

Has anyone encountered a similar problem?


  • Reynolds number is about 800.

  • hey! i am doing same thing you are and facing same issues! thanks god im not the only one...

    about the gravity, you could try writing down manually in the xml file. but i already tried with and without and no changes...

    what do u mean by DSPH (github)? desingsphysics?

  • are you doing it 3D? after my first attempt with problems i decided to go 2D and make it the simplest i could, but i still cant manage it. my flow is horizontal, tried to change the gravity, the hdp, the fluid visco, the shifting coeficient, but all cases i have fluid particles escaping. my boundary has 3 layers and my fluid particles escape and get trapped between the boundary particles.

  • DSPH(github) is the one I downloaded here

    Mine is 2D, I've been trying the same things for about 4-5 months now, still no success.

  • ah, ok, it´s just stuck same way you are... =/

    i tried importing an stl geometry for the pipe and drawing the pipe itself at the xml file, and no difference again...

  • Have you guys been looking at the "FlowCylinder" in "In/Out" example folder? Don't they do what you want there?

    Kind regards

  • i started from that tutorial, but in that example the boundary plates move along with the flow. using a pipe, or even with the same plates, but without moviment, the fluid particles are escaping into the boundary particles.... dont know why...

  • from my many attempts, using periodicity i have no such problems, but im struggling to do it with inlet/outlet conditions...

  • the difference is that for me, the fluid particles are not going away freely as for @circles , they get stuck in the middle of the boundary particles.

  • @olivliv

    What happens if you let the walls move in the same direction as the inlet, with the same velocity? Remember to activate periodic boundary condition.

    In theory they should not fall out even if walls are standing still. After you have tested this then try to increase the constant for smoothing length, h.

    Kind regards

  • i did play with the smoothing length, and when i increased it, the flow went crazy... about the walls moving, i could do it, just like the tutorial, but it wouldnt be representative of the condition i want to validate... it wasnt supposed to behave like that, and if we think about the tutorial of poiseuille flow, it is a confined flow and no particles escape, but again, it uses periodicity condition. my difficulty is to simulate something like the poiseuille flow with inlet/outlet conditions instead of periodicity.

  • I had a similar problem in the simulation of a liquid ring vacuum pump. I have solved it adjusting h parameter as Asalih3d says. But I reduced it from 1 to 0.7. Maybe default value for 3D simulations of 0.866025 also fits, but I haven't tried yet.

  • @Asalih3d it's not the same thing. In my case, things get messed up when I take geometry to be a cylinder and use an .stl file. By cylinder I mean an actual 3D cylinder not a cross section formed by 2 rectangular blocks like in FlowCylinder example.

    Since particles initially are placed on a lattice, my understanding is that the quality(how close to an actual circle) of the inlet/outlet buffer depends on the resolution.

    @olivliv have you tried changing the viscosity? Both the formulation and the value. As it gets more viscous in my case, solution stays stable.

  • @agavino thanks for sharing. i did try reducing hdp to 1 instead of default value 2. the result wasnt messed up as when i increased it, but my fluid particles still were escaping through boundary particles.

    @circles i did try changing the viscosity model and the value itself, but no success to avoid fluid particles from escaping.

    i tried a "square pipe" too, but my fluid particles keep going away through them.

  • the best i could do for now is the channel with upper and bottom boundaries not moving and inletoutlet working, as image attached. but when i try different boundaries, a pipe (using xml commands or importing from stl) or a "square pipe" (with one or three layers of boundary particles), my fluid particles escape. no way to develop to 3D this way.

  • Sometimes particles are excluded because they exceed density limits stablished at RhopOutMax. Particles that exceed this limit in a timestep are excluded from PartFluid files and from analysis and included in PartFluidOut files.

    Simply adjusting RhopOutMax to higher values (look for them at PartFluidOut files) you can avoid exclusion.

    Usually those density peaks are, like pressure, transient and do not affect average behaviour.

  • Also note that it can help to decrease CFL ie. make time steps smaller. Nice to see that you have achieved something a bit more stable now, but hopefully it can be fully stable at the end.

    Are you using any artifical smoothing or LES?

    Kind regards

  • edited December 2019

    @olivliv what shifting method and coefficient are you using? If I disable both shifting and delta-sph, I don't observe the same behavior.

    @Alex when I try with no gravity (even if I define b), it throws me an exception that says "No depth data available.", but I could not find the part or such an exception in source files. Just saw that it is fixed in the most current release.

  • Hi,

    Although in run.out it reports shifting coefficient and shift TFS as the values I define in .xml, in JSph.cpp where it loads the "case configuration to be executed" (line 494) it is defined as follows

    Also, where it "loads the configuration of the execution" in line 377 it is defined

    Does it mean the value will always be -2 ? Also, same for DeltaSPH(DensityDT), the value is set to 0.1.

  • edited December 2019

    Regardless of the resolution and density diffusion particles escape from the buffer when I enable shifting.

    When shifting is disabled the particles stay inside the domain read through an .stl file.

  • @agavino thanks for the suggestion. i could see some good part of my particles out are excluded because of rhop as you said, but not all of them. i dont know if @circles is showing fluid particles and particles out together, but my case is my fluid particles are getting in the middle of my boundary particles, even without being excluded as a particle out. anyway, im doing as you said and increasing my RhopOutMax to avoid this exception.

    this is an example i made using an .stl for the a pipe (white particles) , and my fluid particles (blue) are getting inside the wall pipe...

    that´s when step back and went again to the channel tutorial. In that case for the channel, following your suggestion, i can get better at not loosing too many particles, but my velocities results get a little bit messed up.

  • @Asalih3d im not using LES or smoothing or artificial smoothing... just playing around with regular parameters dualsphysics provides...

  • @circles for that first print i sent, im using this:

     <parameter key="Shifting" value="3" comment="Shifting mode 0:None, 1:Ignore bound, 2:Ignore fixed, 3:Full (default=0)" />

          <parameter key="ShiftCoef" value="-20" comment="Coefficient for shifting computation (default=-2)" />

          <parameter key="ShiftTFS" value="0" comment="Threshold to detect free surface. Typically 1.5 for 2D and 2.75 for 3D (default=0)" />

    for the last one with fluid in the middle of boundary, im using this:

     <parameter key="Shifting" value="1" comment="Shifting mode 0:None, 1:Ignore bound, 2:Ignore fixed, 3:Full (default=0)" />

          <parameter key="ShiftCoef" value="-2" comment="Coefficient for shifting computation (default=-2)" />

          <parameter key="ShiftTFS" value="1.5" comment="Threshold to detect free surface. Typically 1.5 for 2D and 2.75 for 3D (default=0)" />

    but it was a real good observation, i think my problem might be somewhere around here...

  • Sorry, @olivliv I didn't mean artificial smoothing, but artificial viscosity.

    Kind regards

  • @Asalih3d for that first print im using Laminar+SPS with visco=0.005

  • I am not meaning it's your case, but in some high speed aplicaciones some particles were excluded by high pressure. I have not found such description in the docs, but it happened. I fixed it adjusting higher values of speedsystem, gamma and coefsound nearer teo real physics values. They have to he adjusted with liquid compressibility, density, etc.

  • thanks for the insight @agavino ! i will look further on this matter

  • @olivliv Could you please change the shifting mode to "ignore bound" and let us know if you get rid of the behavior you're observing?

Sign In or Register to comment.