Institute-for-Future-Intelligence / multiphysics

Interactive Multiphysics Simulation for Everyone
https://intofuture.org/energy2d.html
GNU Lesser General Public License v3.0
58 stars 29 forks source link

add visualization for velocity fields #17

Closed hoehnp closed 1 year ago

hoehnp commented 1 year ago

first of all thank you @charxie for this amazing tool. For the visualization of fluid mechanics heat maps of flow velocities seem more intuitive to me. Therefore, I implemented heat maps for the components of the velocity and its magnitude. Since the velocities in the lid driven cavity flow are much smaller than 1, I also added a scaling factor in ScalarDistributionRenderer to avoid all values being rounded to 0. Would there be a better solution for this?

charxie commented 1 year ago

Thank you, Patrick! I just saw this and merged your code.

charxie commented 1 year ago

Your changes cause a heatmap bug that I don't quite know where it is. So I had to revert your pull request.

hoehnp commented 1 year ago

Could you please share details of the bug with me, so that I can fix it later on?

charxie commented 1 year ago

It seems the heatmap scale is incorrect. If you run the Natural Convection example in the Examples menu, you should see the screen is filled with white color pretty quickly. It should be like this:

1