Simulation of fluid movement

Star-Dust

Expert
Licensed User
Longtime User
A few years ago I found on the internet a degree thesis by two guys who simulated the movement of fluids inside a tank where pressure is subjected to one or more points in the fluid.

Together with the explanation and the physical laws that had been simulated in the App they had distributed the source in Java. This fascinated me a lot and I tried to do it again in b4j. Studying the various formulas and detailed explanations I didn't understand a thing. (I would have had to attend the school year to understand something)

So I started translating the code. A complex undertaking because they used classes and methods which were difficult to translate into b4J. Over the course of 3 years I started the project on several occasions but without being able to complete it.

A few weeks ago I started again trying to rewrite it with b4xpages in multiplatform and I finally got something even if it is still rudimentary

B4J

ezgif.com-optimize.gif


B4A
1.png
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
This is the original version

1694865755794.png
 

Star-Dust

Expert
Licensed User
Longtime User
I changed the chart creation. Instead of using Canvas I use BitmapCreator and on B4J it improves performance. Not so much on B4A. I haven't done any testing on B4i.

I attach the source if anyone wants to bang their heads over it.
The original version is very smooth and realistic


P.S. It is possible to modify the viscosity of the liquid, the force applied and the width of the impact point. As well as other settings like color, light etc.
 

Attachments

  • Fluid.zip
    42.9 KB · Views: 116
Last edited:
Top