--
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.
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.
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.
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
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.gtvfpysph.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
Dr. Ramachandran,
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
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
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
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
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?
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
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 errorRuntimeError: 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
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
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. |
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).
I checked the same with the dam_break_2d.py (https://github.com/pypr/pysph/blob/master/pysph/examples/dam_break_2d.py#L29)
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 pushedfluid.x += self.dx / 4
# away from the wall, so displacing it by a tiny amount helps.
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#L232and 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
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
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
--
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
To unsubscribe from this group and stop receiving emails from it, send an email to pysph...@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.
Dr. Ramachandran,