GPUSPH / gpusph

The world's first CUDA implementation of Weakly-Compressible Smoothed Particle Hydrodynamics
160 stars 67 forks source link

errors when run BuoyancyTest with chrono #45

Open Dongxueyang opened 5 years ago

Dongxueyang commented 5 years ago

Hi I have compiled the gpusph successfully and can run some examples in src/problems. But when I run the example BuoyancyTest and Objects I got such errors with chrono

I think the error is related to the chrono. but I donnot know what: 1.I install the chrono successful but what can I do to make a link between chrono and GPUSPH 2.when I install chrono,at step cmake which mudule should be set "ON" to support basic functions of GPUSPH.I see all the modules should be set "OFF" from the install document of GPUSPH. 3.In my computer, I have install another program which is linked to chrono.So if will there be conflects when i use chrono in GPUSPH. The error is seems to related to another program"Yade-Dual4.3"

all regards

Dongxueyang commented 5 years ago

Sorry I failed to past the picture and I am trying to upload it.

Dongxueyang commented 5 years ago

screenshot from 2018-12-27 14_51_46

agnesLeroy commented 5 years ago

Hi,

Have you managed to run your case?

Best regards, Agnès

Oblomov commented 5 years ago

Hello,

the issue seems to be due to a mismatch between what GPUSPH thinks the binary layout of a Chrono object is, versus what the library thinks. A possible reason for this could be that Chrono and GPUSPH are being compiled with different compilers (or different versions of the same compiler). Can you verify if GPUSPH is being compiled with the same (host) compiler and version as what was used with Chrono?

Dongxueyang commented 5 years ago

Yes I have run the test successfully, your suggestiogn is useful anges. These days I am busy with my test so pologize for my response not in time。

Dongxueyang commented 5 years ago

@Oblomov Can you send your email to me , I have some question about the GPUSPH and want to get your help. In Github the communication is not in time. And my email is dxy159753@sina.com All regards

Dongxueyang commented 5 years ago

@agnesLeroy I have doubt about the accuracy of GPUSPH. I think we can not make a accurate simulation with GPUSPH. There days I make a simulation of a single ball falling into water . The density of ball is 860, and radius is 0.0127m, the origin posion is above still water surface 0.24m, which means the velocity of entering water is 2.17m/s. I make a figure of positonZ--time curve but it can not agree with the experiment. Another question. I try to change the density of floating (lilke a ball with density of 1000), I shoud be suspended in water. But it fall down the below of the box. So I think maybe I am mistake with some parameter. Do you have any idea? all regards Dongxueyang

Dongxueyang commented 5 years ago

@agnesLeroy Hi I have a question on about the simulation results. Now I have complete a example of single ball entering water. The ball is floating bady. And I got the result with vtu format which contants all informations. But I can not get the postion information of the single ball. I think the position information can be got from chrono or from GPUSPH. But I do not know what to do. Could you give me some advice?

agnesLeroy commented 5 years ago

Hi! You get this information in data/rbdata.txt where the objects' gravity centers (CM0) and orientations (Q0) are written. Cheers, Agnès

Dongxueyang commented 5 years ago

@agnesLeroy I have checked the file rbdata just now and got the position information, Thanks for your reply. And I have another question about the accuracy of simulation. I have post the question before my last comment in this issue. Hope get your advice. If my explaination is not clear. please tell me and I will make a clarification in details. regards Dongxueyang

agnesLeroy commented 5 years ago

Hi, What boundary formulation are you using for your simulation? Are you sure the object's center of gravity is correct at the initial time? Are the forces applied on it by the water correct? (you can check them in the file objectforces.txt). Cheers, Agnès

Dongxueyang commented 5 years ago

@agnesLeroy I just modified the test model of Objects. And I delete the floating box and obstacle but use the sphere only. Then I changed the position, the density of sphere and the size of fluid. The boundary formulation is dynamic boundary I think. I will check the force. But can I make some output in chrono in the test case Objects? Thands for your advice Dongxueyang

agnesLeroy commented 5 years ago

I suggest that you look at the BuoyancyTest example of GPUSPH to sort out your problem. Best regards, Agnès

Dongxueyang commented 5 years ago

OK I will try and post my question if I have. Thanks for your patience. Best wishes Dongxueyang

Dongxueyang commented 5 years ago

@agnesLeroy Hi I have another question on the floating number. We use chrono to run DEM simulaiton and achieve fluid-solid coupling. The chrono can simulate a large number of dem particles. But the GPUSPH can only make 16 floatings (you mentioned before). I want to know the reason about the limit. It is due to the code or other reasons about the storage capacity? best regards Dongxueyang

Oblomov commented 5 years ago

Both reasons. The coding restriction is that the fluid and object number are encoded in the same area, using 4 bits for the fluid and 12 bits for the object number, so in theory it would be possible to have up to 2^4 = 16 fluids and 2^12 = 4096 objects. However, since some shared memory allocations are fixed, the number of fluids is limited to 4 and the number of objects is limited to 16. It should be possible to increase these limits up to the maximum allowed by changing the corresponding defines (MAX_FLUID_TYPES and MAX_BODIES in src/particledefine.h)

We could also consider a build time parameter (e.g. make maxfluids=... or make maxbodies=...). Would you mind opening a feature request for this?

Dongxueyang commented 5 years ago

@Oblomov I read your comment. And do you think it is easy to achieve to release the limit? Or can we use a 16bits or 32bits for the object number to generate more objects. I do not mind opening a feature request for this. And I think it neccessary to do it. Thans for your reply Best regards Dongxueyang

Oblomov commented 5 years ago

Hello @Dongxueyang

Releasing the limit altogether, or moving to 32-bit for the object it, would require much more extensive changes to the code. I think allowing custom configurations would be the first step anyway. But yes, please open a separate issue for this, so we can address it on its own.

Dongxueyang commented 5 years ago

@Oblomov @agnesLeroy These days I make a simulation to check the accuracy of the GPHSPH, The model is a sphere,density=860, faling into the water with velocity of 2.17m/s. And the radius is 0.0127m. The model is based on the example of BuoyancyTest. And I adpted deltap=0.001 0.0015 0.002 0.003 and get four curves like this:

b

But the curve is different between each other and the experiment curve and theorical curve. So I think the value of deltap affects the accurancy of results obviousely? So how can I to select a deltap in a simulation?

Dongxueyang commented 5 years ago

@agnesLeroy Could you help me ? I am confused with the problem pasted above.

Oblomov commented 5 years ago

Hello @Dongxueyang

SPH, like any numerical method, approximates the analytical solution, with an approximation that is better (i.e. closer to the correct one) as the resolution grows. The plot seems to confirm this, as finer resolutions (smaller dp) provide solutions that are closer to both the experimental and theoretical line. So in general you should try running your simulations at the highest possible resolution.

At any given resolutions, there are also a few parameters that you can try tuning to get better results. For example, using a higher speed of sound will give a stiffer (less compressible) fluid. Also, if you are using the artificial viscosity model you can try lowering the artificial viscosity coefficient, or switch to a different viscous model (e.g. SPS).