jseidl / virtuaplant

VirtuaPlant is a Industrial Control Systems simulator which adds a “similar to real-world control logic” to the basic “read/write tags” feature of most PLC simulators.
http://wroot.org/projects/virtuaplant
MIT License
212 stars 82 forks source link

Move Oil Refinery into Master #7

Open prjpet opened 6 years ago

prjpet commented 6 years ago

Hi,

First of all, many thanks for sharing this great project! I am using it for some research I do at the University of Amsterdam and I believe it's a great tool to simulate basics of liquid flow and modbus commands.

I've made my own adjustments to the oil-refinery branch, which you can find at https://github.com/prjpet/virtuaplant.

I have implemented the following additions:

HOWEVER - THE MOST IMPORTANT FINDING IS THE FOLLOWING:

I have noticed that the collisions are flaky - "space" seems to keep a "history" of the object's collision space, even after the collision is removed.

SOLUTION:

You have to "redraw" the valves at ever update of the graphical environment. First all valves have to be drawn within the "while running:" loop within the run_world() function, then removed at the end of the loop, using space.remove(outlet) (for instance).

Kind regards,

Peter - peter.prjevara@os3.nl

jseidl commented 6 years ago

Hi! Thanks for your collaboration!

Is this the same project as https://github.com/bealerjm/virtuaplant/tree/master/plants/oil-refinery ? I'll be reviewing the code and putting into the main branch as soon as I can.

Indeed this physics library is completely flaky to say the least, I had to use fewer updates per second otherwise the collisions wouldn't be computed at all. I'm currently looking for alternatives to this library (pymunk).

I really wanted to try out Google's LiquidFun project google.github.io/liquidfun but they don't have python bindings yet. My goal is to have something that can provide more realistic fluids and also pressure and heat exchange capabilities.

If anyone knows a better suitability please let me know.

prjpet commented 6 years ago

Well the oil-refinery, made by bealerjm and ike-clinton is a more mature end product, which in my opinion could easily be moved to the main branch. My branch contains some nice improvements such as:

It requires some tidy up though, so I would not recommend moving it to the main branch as of yet.

I will keep an eye out for a more realistic library to be used!