Sloshing Tank Simulation: How to externally assign an time varying acceleration to fluid / solid ?

248 views
Skip to first unread message

Chaitanya Kesanapalli

unread,
Feb 24, 2020, 3:02:42 PM2/24/20
to pysph-users
Hi Guys,

I am new to PySPH. I am trying to migrate from DualSPHysics to PySPH as it has various schemes.



I am trying to simulate sloshing tank by given sinusoidal acceleration to the fluid (or to the sloshing tank) ( a=Aw^2 sin(wt) ).

The tank dimensions are 1m x 1m and mean water level is 0.125m. Here Amplitude is 0.03 and Time period = 1.6 sec

Can anyone tell me how to externally assign a sinusoidal acceleration to the fluid (or to the sloshing tank) for every timestep

Thank you

Prabhu Ramachandran

unread,
Feb 26, 2020, 5:53:16 AM2/26/20
to Chaitanya Kesanapalli, pysph-users
Hi Chaitanya,

There are a few ways to do what you want.  One way is to set the velocity or acceleration of the tank directly in an equation.  One example to see is this:


It sets up an acceleration for the moving square but does not use any default "Scheme", integrating your equation into an existing scheme will require a bit of tinkering, one way is to use the scheme's get_equation method and print that out and then inject your equation instances where you need to.   One pretty complex example of this is the method here:


HTH.
cheers,
Prabhu
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/843e187e-e1e8-49f2-b460-0b68a0187a1a%40googlegroups.com.


Chaitanya Kesanapalli

unread,
Feb 26, 2020, 2:23:24 PM2/26/20
to pysph-users
Hi Dr. Ramachandran,

I tried to run the moving_square.py But I got the following error.

""
File "moving_square.py", line 24, in <module>
from pysph.sph.wc.gtvf import GTVFScheme
ModuleNotFoundError: No module named 'pysph.sph.wc.gtvf'
"""


On Wednesday, February 26, 2020 at 4:53:16 AM UTC-6, Prabhu Ramachandran wrote:
Hi Chaitanya,

There are a few ways to do what you want.  One way is to set the velocity or acceleration of the tank directly in an equation.  One example to see is this:


It sets up an acceleration for the moving square but does not use any default "Scheme", integrating your equation into an existing scheme will require a bit of tinkering, one way is to use the scheme's get_equation method and print that out and then inject your equation instances where you need to.   One pretty complex example of this is the method here:


HTH.
cheers,
Prabhu

On 25/02/20 1:32 AM, Chaitanya Kesanapalli wrote:
Hi Guys,

I am new to PySPH. I am trying to migrate from DualSPHysics to PySPH as it has various schemes.



I am trying to simulate sloshing tank by given sinusoidal acceleration to the fluid (or to the sloshing tank) ( a=Aw^2 sin(wt) ).

The tank dimensions are 1m x 1m and mean water level is 0.125m. Here Amplitude is 0.03 and Time period = 1.6 sec

Can anyone tell me how to externally assign a sinusoidal acceleration to the fluid (or to the sloshing tank) for every timestep

Thank you
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.

Chaitanya Kesanapalli

unread,
Feb 26, 2020, 2:26:28 PM2/26/20
to pysph-users
Hi Dr. Ramachandran,

I tried to run the dam_break_2d.py But I got the same following error.

""
File "dam_break_2d.py", line 24, in <module>
from pysph.sph.wc.gtvf import GTVFScheme
ModuleNotFoundError: No module named 'pysph.sph.wc.gtvf'
"""



On Wednesday, February 26, 2020 at 4:53:16 AM UTC-6, Prabhu Ramachandran wrote:
Hi Chaitanya,

There are a few ways to do what you want.  One way is to set the velocity or acceleration of the tank directly in an equation.  One example to see is this:


It sets up an acceleration for the moving square but does not use any default "Scheme", integrating your equation into an existing scheme will require a bit of tinkering, one way is to use the scheme's get_equation method and print that out and then inject your equation instances where you need to.   One pretty complex example of this is the method here:


HTH.
cheers,
Prabhu

On 25/02/20 1:32 AM, Chaitanya Kesanapalli wrote:
Hi Guys,

I am new to PySPH. I am trying to migrate from DualSPHysics to PySPH as it has various schemes.



I am trying to simulate sloshing tank by given sinusoidal acceleration to the fluid (or to the sloshing tank) ( a=Aw^2 sin(wt) ).

The tank dimensions are 1m x 1m and mean water level is 0.125m. Here Amplitude is 0.03 and Time period = 1.6 sec

Can anyone tell me how to externally assign a sinusoidal acceleration to the fluid (or to the sloshing tank) for every timestep

Thank you
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.

Prabhu Ramachandran

unread,
Feb 26, 2020, 10:29:45 PM2/26/20
to Chaitanya Kesanapalli, pysph-users
On 27/02/20 12:53 AM, Chaitanya Kesanapalli wrote:
Hi Dr. Ramachandran,

I tried to run the moving_square.py But I got the following error.

""
File "moving_square.py", line 24, in <module>
from pysph.sph.wc.gtvf import GTVFScheme
ModuleNotFoundError: No module named 'pysph.sph.wc.gtvf'
"""

Do you have pysph installed properly? Do other examples run?  How did you install it?  It does work on master, and apologies if this is broken in the last released version.

Also you don't need to run that example to understand how to write the equations. I just wanted to show you an actual example of one way to do this.

Regards,

Prabhu



Chaitanya Kesanapalli

unread,
Feb 27, 2020, 10:32:47 AM2/27/20
to pysph-users
Dr. Ramachandran,

I was trying to see the results of the "moving square.py" file.

Regarding the PySPH installation, I installed it in a Ubuntu environment in Windows 10. And the installation method that I used is from this section https://pysph.readthedocs.io/en/latest/installation.html#id15.

Regarding the PySPH Library here I am attaching a file with the modules of the PySPH and it doesn't have
pysph.sph.wc.gtvf
pysph.sph.isph
PySPH_modules.md

Prabhu Ramachandran

unread,
Feb 28, 2020, 3:11:12 AM2/28/20
to Chaitanya Kesanapalli, pysph-users
On 27/02/20 9:02 PM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

I was trying to see the results of the "moving square.py" file.

Regarding the PySPH installation, I installed it in a Ubuntu environment in Windows 10. And the installation method that I used is from this section https://pysph.readthedocs.io/en/latest/installation.html#id15.

Regarding the PySPH Library here I am attaching a file with the modules of the PySPH and it doesn't have
pysph.sph.wc.gtvf
pysph.sph.isph

Apologies, I suspect that those were not in the last released pysph version.  You can try with pysph master which is far improved but still needs a bit of work before a release.

Regards,

Prabhu

Chaitanya Kesanapalli

unread,
Mar 2, 2020, 3:26:43 PM3/2/20
to pysph-users
Dr. Ramachandran,

I have installed the latest pysph version (1.0b1.dev0), but I am getting the following error, for the library "pysph.base.utils"

---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-1-c5d91da8698d> in <module>
12
13 from pysph.base.kernels import WendlandQuintic, QuinticSpline
---> 14 from pysph.base.utils import get_particle_array
15 from pysph.solver.application import Application
16 from pysph.sph.scheme import WCSPHScheme, SchemeChooser, AdamiHuAdamsScheme

C:\tools\Anaconda3\lib\site-packages\pysph\base\utils.py in <module>
5
6 import numpy
----> 7 from .particle_array import ParticleArray, \
8 get_local_tag, get_remote_tag, get_ghost_tag
9

C:\tools\Anaconda3\lib\site-packages\pysph\base\particle_array.pyx in init pysph.base.particle_array()

C:\tools\Anaconda3\lib\site-packages\pysph\base\device_helper.py in <module>
10 from compyle.api import declare, annotate
11 from compyle.types import dtype_to_ctype
---> 12 from compyle.template import Template
13 import compyle.array as array
14 import pysph.base.particle_array

ModuleNotFoundError: No module named 'compyle.template'

Prabhu Ramachandran

unread,
Mar 2, 2020, 11:42:46 PM3/2/20
to Chaitanya Kesanapalli, pysph-users
With master you need the latest compyle as well. :(

Regards,
Prabhu

On 03/03/20 1:56 AM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

Chaitanya Kesanapalli

unread,
Mar 3, 2020, 12:22:29 AM3/3/20
to pysph-users
Dr. Ramachandran,

Can you tell me how to resolve this issue (or to install the latest compyle).

Thank you
Chaitanya Kesanapalli

Prabhu Ramachandran

unread,
Mar 3, 2020, 12:35:04 AM3/3/20
to Chaitanya Kesanapalli, pysph-users
On 03/03/20 10:52 AM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

Can you tell me how to resolve this issue (or to install the latest compyle).

pip install -U https://github.com/pypr/compyle/zipball/master

Should work.  It is also a good idea to learn how to create a dummy environment depending on your platform.  For example with conda (which you seem to use) you can create new environments, and play with them, experiment and also delete them

https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

HTH,

cheers,

Prabhu



Chaitanya Kesanapalli

unread,
Mar 5, 2020, 1:08:55 PM3/5/20
to pysph-users
Thanks a lot. Now it is working.

Chaitanya Kesanapalli

unread,
Mar 9, 2020, 12:40:58 AM3/9/20
to pysph-users
Dr. Ramachandran,

I followed your suggestions in giving motion to the tank by inject an external motion class. But I am getting leakage of particles.

Here I am attaching a simple modification of the filehttps://github.com/pypr/pysph/blob/master/pysph/examples/dam_break_2d.py#L173 t
to add the external motion class "SloshingAcceleration".

Can you tell me how to resolve this issue.

Thank you
Chaitanya Kesanapalli
dam_break_modified.py

Chaitanya Kesanapalli

unread,
Mar 9, 2020, 12:42:42 AM3/9/20
to pysph-users
Dr. Ramachandran,

Here is the leakage image
leakage.png

Chaitanya Kesanapalli

unread,
Mar 9, 2020, 4:11:46 PM3/9/20
to pysph-users
Dr. Ramachandran,

I have also tried the led_cube that was attached in other post. It is working for a cubic domain but when the domain is reduced i.e., original tank dimensions - 1 x 1 x 1 and I changed to 1 x 0.3 x 1 m and dx = 0.03. For the new dimension the water particles are leaking from the bottom.

May I know how to resolve this issue.
 
Thank you
led_cube_3d_v2_stable.py

Chaitanya Kesanapalli

unread,
Mar 16, 2020, 1:19:14 PM3/16/20
to pysph-users
Hi Dr. Ramachandran, Can you give any suggestion on how to resolve this issue

Prabhu Ramachandran

unread,
Mar 17, 2020, 3:00:49 PM3/17/20
to pysph...@googlegroups.com
On 3/16/20 10:49 PM, Chaitanya Kesanapalli wrote:
Hi Dr. Ramachandran, Can you give any suggestion on how to resolve this issue

I would suggest first trying to write an example that does not move anything and get that working.  A static example.  In your current case,  the biggest issue is that your particles are not uniformly spaced.  The spacing between particles in the y-axis are very different from the rest.

So if you make the spacing the same it should work -- it does when you set the shape to be a cube.  Basically dx should be the same as dy and dz.

Regards,

Prabhu

Chaitanya Kesanapalli

unread,
Mar 23, 2020, 1:49:51 AM3/23/20
to pysph-users
Dr. Ramachandran,

I did tried the dam break 2D case without motion and it was working

But when I assign the motion the particles started to leak as mentioned in the attached picture.

Chaitanya Kesanapalli

unread,
Mar 23, 2020, 1:54:34 AM3/23/20
to pysph-users
Can you tell me what are the changes that I have to make in the dam_break_modified.py file.
dam_break.py
dam_break_modified.py

Chaitanya Kesanapalli

unread,
Mar 23, 2020, 2:35:35 AM3/23/20
to pysph-users
Dr. Ramachandran,
I have also modified the led cube example to 2D, but I am getting error saying

WARNING: Domain size has increased by a large amount.
Particles are probably diverging, please check your code!
led_cube_2d.py

Prabhu Ramachandran

unread,
Mar 23, 2020, 3:00:15 AM3/23/20
to pysph...@googlegroups.com
On 3/23/20 11:19 AM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

I did tried the dam break 2D case without motion and it was working

The standard dam break example is complex supporting many different schemes and a variety of options.  So modifying that is not a good idea unless you are very clear about how to work with a complex example.  I would suggest that you write your own simple example from scratch before changing things. Do you have some exposure to SPH in general as most of the time the issues are with getting the method to work with the right setup of initial conditions and boundary conditions or setting the timestep or spacing of particles.  This is outside the scope of pysph per se so it usually helps to work your way up to more complex examples after becoming comfortable with simpler examples in terms of the problem setup.  Running an existing problem doesn't expose you to the typical problems you might face when writing a new example. 

The led cube example is simpler and worth working with as you have done so I would suggest to persist a little with that.

Regards,

Prabhu


Prabhu Ramachandran

unread,
Mar 23, 2020, 5:31:08 AM3/23/20
to Chaitanya Kesanapalli, pysph-users

On 3/23/20 12:05 PM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,
I have also modified the led cube example to 2D, but I am getting error saying

WARNING: Domain size has increased by a large amount.
Particles are probably diverging, please check your code!

This may help: https://pysph.readthedocs.io/en/latest/tutorial/circular_patch_simple.html#debugging-when-things-go-wrong

I will try and go over the code but I am not sure how much time I will have to look at this, in the meanwhile try the things mentioned there, try to visualize the accelerations and other terms to see what exactly is blowing up.

Prabhu

Chaitanya Kesanapalli

unread,
Mar 25, 2020, 4:34:30 PM3/25/20
to pysph-users
Dr. Ramachandran,

I am getting results for the 3D sloshing tank (of dimension 1 x 0.1 x 1 m) but not for the 2D sloshing tank (1 x 1 m).

Here are the code for the 3D (working) and 2D sloshing tank
led_cube_2D.py
led_cube_3D.py

Chaitanya Kesanapalli

unread,
Mar 27, 2020, 5:33:59 PM3/27/20
to pysph-users
Dr. Ramachandran,

I resolved the issue. I think the gravity value was given in z axis where as the 2D tank domain is in x-y plane. This file has the working example.

BUT, when I changed the scheme from WCSPH to SISPH or IISPH I am encountering errors saying

for SISPH scheme :
TypeError: 'MultiStageEquations' object is not subscriptable

for IISPH scheme:
RuntimeError: ERROR: Missing array properties for equation: NumberDensity
Array 'solid' missing properties {'V'}.

Can you tell me how to resolve these issues.

Again Thanks a lot for the help.
led_cube_2D_wcsph.py
led_cube_2D_isph.py

Chaitanya Kesanapalli

unread,
Mar 27, 2020, 7:06:54 PM3/27/20
to pysph-users
Dr. Ramachandran,

Can you tell how to get the pressure values(y-axis) with respect to time (x-axis) at a specific locations on the moving tank?

Thank you

Prabhu Ramachandran

unread,
Apr 6, 2020, 6:44:32 AM4/6/20
to pysph...@googlegroups.com
On 3/28/20 4:36 AM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

Can you tell how to get the pressure values(y-axis) with respect to time (x-axis) at a specific locations on the moving tank?

Prabhu Ramachandran

unread,
Apr 6, 2020, 6:48:53 AM4/6/20
to Chaitanya Kesanapalli, pysph-users
On 3/28/20 3:03 AM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

I resolved the issue. I think the gravity value was given in z axis where as the 2D tank domain is in x-y plane. This file has the working example.

Glad you were able to resolve this.



BUT, when I changed the scheme from WCSPH to SISPH or IISPH I am encountering errors saying

for SISPH scheme :
TypeError: 'MultiStageEquations' object is not subscriptable

Remember that you are grabbing the scheme's equations and injecting your code, print what equations the scheme gives you and it should be easier to debug.  SISPH uses multi-stage equations as each stage requires a different set of equations.

I suggest that you do not use pysph master's sisph as it is not up-to-date with our paper and that will happen in the next few weeks, I hope.


for IISPH scheme:
RuntimeError: ERROR: Missing array properties for equation: NumberDensity
Array 'solid' missing properties {'V'}.

Add the necessary properties.  This may help: https://pysph.readthedocs.io/en/latest/tutorial/circular_patch_simple.html#functions-for-loading-generating-the-particles

As will many of the pysph examples.

cheers,

Prabhu

Chaitanya Kesanapalli

unread,
Apr 6, 2020, 12:58:57 PM4/6/20
to pysph-users
Dr. Ramachandran,

Regarding the SISPH, I have resolved the above error and written a simple code for a hydrostatic case. But it is returning a particle diverges error
RuntimeError: ERROR: LinkedListNNPS requires too many cells (276555111).

Here I am attaching the code, can you briefly check where might the error.

Thanks a lot
led_cube_2D_4.py

Chaitanya Kesanapalli

unread,
Apr 6, 2020, 1:21:23 PM4/6/20
to pysph-users
And also Is it possible to give a time varying acceleration to fluid (like time varying gravity) in pysph ?

Prabhu Ramachandran

unread,
Apr 7, 2020, 12:37:23 AM4/7/20
to pysph...@googlegroups.com
On 4/6/20 10:28 PM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

Regarding the SISPH, I have resolved the above error and written a simple code for a hydrostatic case. But it is returning a particle diverges error
RuntimeError: ERROR: LinkedListNNPS requires too many cells (276555111).
Again, that means the particles blew up and the debugging of these requires what you are already aware of. As I said, do not use the SISPH scheme as the one in pysph is not current.


Here I am attaching the code, can you briefly check where might the error.

I am sorry, but I simply do not have the time for debugging your code.  I have too much to do and too little time to go over this.  Going over something like this takes a lot of time, and I have my own work to do.  At best, I can provide general help and guidelines.

Regards,

Prabhu


Prabhu Ramachandran

unread,
Apr 7, 2020, 12:39:03 AM4/7/20
to Chaitanya Kesanapalli, pysph-users

On 4/6/20 10:51 PM, Chaitanya Kesanapalli wrote:
And also Is it possible to give a time varying acceleration to fluid (like time varying gravity) in pysph ?

I do not understand the question, I thought you already did this when you moved your solid body in a time varying fashion -- gravity would be no different.  The existing equations assume the g is a constant but you can always set those to zero and add your time varying equations.

Regards,

Prabhu


Chaitanya Kesanapalli

unread,
Apr 7, 2020, 1:52:26 PM4/7/20
to pysph-users
Dr. Ramachandran,

Is there any ISPH scheme that is currently up to date that I can use?
when I used IISPH, the particles are leaking from the bottom.

Regarding acceleration, when I apply acceleration to solid (d_au[d_idx] = sin(t)), it is working fine (using WCSPH)
But when I apply same acceleration to fluid (d_au[d_idx] += - sin(t)), fluid is not effected by the external (sin(t)) acceleration.

Thanks a lot for the help again

Chaitanya Kesanapalli

unread,
Apr 7, 2020, 1:55:23 PM4/7/20
to pysph-users
Here I am attaching the files of respective issues:

IISPH: particle leakage : led_cube_2D_ISPH.py
Acceleration to fluid: led_cube_2D_2_1_fluid.py
led_cube_2D_isph.py
led_cube_2D_2_1_fluid.py

Chaitanya Kesanapalli

unread,
Apr 9, 2020, 3:56:55 PM4/9/20
to pysph-users
Dr. Ramchandran,

I resolved all the issues by removing the governing equations with gravity from the schemes and modifying them to add oscillating acceleration. And also I developed the post processes for the pressure.

But I am encounter unstable particle displacement in IISPH (for all particle resolution) and SISPH (only for large number of particles).


by changing only the fluid_column_width from 1.0 to 4.0 (same as tank) with proper adjustment such that fluid particles are not too close to the boundary.

For IISPH, I have applied the condition that is mentioned in https://github.com/pypr/pysph/blob/master/pysph/examples/dam_break_2d.py#L232

if self.options.scheme == 'iisph':
   # the default position tends to cause the particles to be pushed
   # away from the wall, so displacing it by a tiny amount helps.
    fluid.x += self.dx / 4

But this resulted in

IISPH: Unstable particle movement at the boundary (Here are the changes in the file that I made https://github.com/ckesanapalli/pysph/pull/1/files)

SISPH: Works fine for dam_break_2d.py. Particle leakage for sloshing simulation. I decrease time-step but the problem still persists.

Can you tell me how to resolve these issues.

Thanks a lot for help.

Here I am attaching the code highlighting the modifications in the https://github.com/pypr/pysph/blob/master/pysph/examples/dam_break_2d.py#L232
and here you can see the modifications https://github.com/ckesanapalli/pysph/pull/1/files.

Chaitanya Kesanapalli

unread,
Apr 9, 2020, 3:57:32 PM4/9/20
to pysph-users
dam_break_2d_iisph_error.py
IISPH_dam_break_unstable.jpg
SISPH_for_Sloshing_tank_leakage.jpg

Prabhu Ramachandran

unread,
Apr 13, 2020, 5:48:34 AM4/13/20
to pysph...@googlegroups.com
Hi Chaitanya,

Sorry for the very tardy responses.  My answers are inline below.

On 4/10/20 1:26 AM, Chaitanya Kesanapalli wrote:
Dr. Ramchandran,

I resolved all the issues by removing the governing equations with gravity from the schemes and modifying them to add oscillating acceleration. And also I developed the post processes for the pressure.

Great!


But I am encounter unstable particle displacement in IISPH (for all particle resolution) and SISPH (only for large number of particles).


by changing only the fluid_column_width from 1.0 to 4.0 (same as tank) with proper adjustment such that fluid particles are not too close to the boundary.

For IISPH, I have applied the condition that is mentioned in https://github.com/pypr/pysph/blob/master/pysph/examples/dam_break_2d.py#L232

if self.options.scheme == 'iisph':
   # the default position tends to cause the particles to be pushed
   # away from the wall, so displacing it by a tiny amount helps.
    fluid.x += self.dx / 4

But this resulted in

IISPH: Unstable particle movement at the boundary (Here are the changes in the file that I made https://github.com/ckesanapalli/pysph/pull/1/files)

The IISPH implementation in pysph is not very well tested for some of these problems.  I wrote the implementation after I read the original paper which was unfortunately rather scant on some crucial details.  It does work for many basic problems though.  I have noticed that it is not robust with changes to the kernel and also with changes to the timestep.  The implementation is basic but requires some tuning for specific problems I imagine.  It may also be my incorrect implementation of the scheme.

Unfortunately, without more people making available their codes, it is difficult to reproduce results in numerical methods.  We are trying to put up our own code but we are just a small group working our way through the many schemes in the literature.


SISPH: Works fine for dam_break_2d.py. Particle leakage for sloshing simulation. I decrease time-step but the problem still persists.

Can you tell me how to resolve these issues.

Thanks a lot for help.

Here I am attaching the code highlighting the modifications in the https://github.com/pypr/pysph/blob/master/pysph/examples/dam_break_2d.py#L232
and here you can see the modifications https://github.com/ckesanapalli/pysph/pull/1/files.

The SISPH in the pysph repo is old and not accurate.  Instead you should use the repository mentioned in our SISPH paper (https://doi.org/10.1016/j.cpc.2020.107283), at https://gitlab.com/pypr/sisph

We will integrate the sisph code into pysph in a few weeks (I hope) but given the lockdown here things are proceeding rather slowly.  Regardless, you should be able to use the sisph code from the original repository for the paper. 

Prabhu


Prabhu Ramachandran

unread,
Apr 13, 2020, 9:20:50 AM4/13/20
to pysph...@googlegroups.com
Hi Chaitanya,

On 4/13/20 3:18 PM, Prabhu Ramachandran wrote:
The IISPH implementation in pysph is not very well tested for some of these problems.  I wrote the implementation after I read the original paper which was unfortunately rather scant on some crucial details.  It does work for many basic problems though.  I have noticed that it is not robust with changes to the kernel and also with changes to the timestep.  The implementation is basic but requires some tuning for specific problems I imagine.  It may also be my incorrect implementation of the scheme.

Unfortunately, without more people making available their codes, it is difficult to reproduce results in numerical methods.  We are trying to put up our own code but we are just a small group working our way through the many schemes in the literature.

One possibility that may improve the behavior of the IISPH is to not solve the pressure for any boundary particles by looking at the summation density values.  We will see if this can be improved and push any changes to the pysph repository.

cheers,

Prabhu

Chaitanya Kesanapalli

unread,
Apr 13, 2020, 3:45:51 PM4/13/20
to pysph-users
Dr. Ramachandran,

I have one small question?

I am doing a simulation of 4.5 sec and and I want output following timesteps
> 0 - 4.2 sec with time step of 0.1 sec
> 4.2 - 4.5 sec with time step of 0.0005 sec

I used following configure_solver but currently I am only getting output of
> 0 - 4.5 sec with time step of 0.1 sec

self.scheme.configure_solver(
dt=dt, tf=total_time, adaptive_timestep=False,
pfreq=1,
output_at_times=list(np.concatenate((np.arange(0,4.2,0.1),
np.arange(4.2001,4.5,0.0005))))
)

Can you tell me how can I get this custom time-step output ?

Thanks a lot

Chaitanya Kesanapalli

Prabhu Ramachandran

unread,
Apr 14, 2020, 12:51:47 AM4/14/20
to pysph...@googlegroups.com
On 4/14/20 1:15 AM, Chaitanya Kesanapalli wrote:
I have one small question?

I am doing a simulation of 4.5 sec and and I want output following timesteps
> 0 - 4.2 sec with time step of 0.1 sec
> 4.2 - 4.5 sec with time step of 0.0005 sec

I used following configure_solver but currently I am only getting output of
> 0 - 4.5 sec with time step of 0.1 sec

self.scheme.configure_solver(
dt=dt, tf=total_time, adaptive_timestep=False,
pfreq=1,
output_at_times=list(np.concatenate((np.arange(0,4.2,0.1),
np.arange(4.2001,4.5,0.0005))))
)

What is your actual timestep?  Also why do you have pfreq=1, that will make your simulation very slow and in that case the output_at_times is not really useful.  In principle the above should have worked.  I will take a look once I understand your issue more.

Prabhu

Chaitanya Kesanapalli

unread,
Apr 17, 2020, 1:46:57 PM4/17/20
to pysph-users
Dr. Ramachandran,

timestep in the above code is dt = 0.125*dx/vref = 0.00001

and total time tf=total_time=4.5

Thank you

Prabhu Ramachandran

unread,
Apr 22, 2020, 10:07:29 AM4/22/20
to pysph...@googlegroups.com
Hi Chaitanya,

I think I may have fixed this issue in master, there was a subtle issue with the output at times.  Please try again.

Prabhu
--
You received this message because you are subscribed to the Google Groups "pysph-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pysph-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pysph-users/c1e081d0-eca0-46ae-acc1-657dc368ae54%40googlegroups.com.


-- 
Prabhu Ramachandran                 http://www.aero.iitb.ac.in/~prabhu

Chaitanya Kesanapalli

unread,
Apr 27, 2020, 5:36:55 PM4/27/20
to pysph-users
Dr. Ramachandran,

I have resolve the time step and thanks a lot for the help.

i have a theoretical question related to the results of the SISPH.


As you can see in the attached video url, the results of SISPH of PySPH simulation of the sloshing tank, at the 15th sec of the animation, the impact pressure is propagating the fluid.
 
Usually pressure propagation happens in Weakly compressible SPH. This because the fluid is compressible and impact is propagated as a pressure/density wave with a speed of sound (artificial speed of sound is this case).

But in Incompressible fluid, the pressure propagation should happen instantly after the impact (speed of sound is infinite).

But as you can see in the video the pressure wave is propagating in time (which I think shouldn't happen in incompressible).

Can you clarify this for me?

Thanks a lot

Chaitanya
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@googlegroups.com.

Prabhu Ramachandran

unread,
Apr 28, 2020, 12:51:31 AM4/28/20
to pysph...@googlegroups.com
Hi Chaitanya,

Interesting question!  I think we can discuss this off-list since this is specific to a particular method and paper rather than PySPH in general.  Perhaps we can summarize the results here after the discussion is done.

Prabhu

On 4/28/20 3:06 AM, Chaitanya Kesanapalli wrote:
Dr. Ramachandran,

Reply all
Reply to author
Forward
0 new messages