2D-Fluid-Simulation

所属分类:数值算法/人工智能
开发工具:GDScript
文件大小:0KB
下载次数:0
上传日期:2022-03-15 02:42:18
上 传 者sh-1993
说明:  Godot 3.4.2制造。纳维埃-斯托克斯方程有趣。,
(Made in Godot 3.4.2. Navier-Stokes Equation fun.,)

文件列表:
Assets/ (0, 2022-03-14)
Assets/Brushes/ (0, 2022-03-14)
Assets/Brushes/BristlesBrush.png (2809, 2022-03-14)
Assets/Brushes/HardBrush.png (2252, 2022-03-14)
Assets/Brushes/HarderBrush.png (1224, 2022-03-14)
Assets/Brushes/SoftBrush.png (2106, 2022-03-14)
Assets/Brushes/SofterBrush.png (1937, 2022-03-14)
Assets/Images/ (0, 2022-03-14)
Assets/Images/baseTexture.png (3305, 2022-03-14)
Assets/Images/whiteTexture.png (1371, 2022-03-14)
Assets/Media/ (0, 2022-03-14)
Assets/Media/Icon-630x500.png (117904, 2022-03-14)
Assets/Media/Icon-800x450.png (114015, 2022-03-14)
Assets/Media/Icon-Paint-800x450.png (69402, 2022-03-14)
Assets/Screenshots/ (0, 2022-03-14)
Assets/Screenshots/.gdignore (0, 2022-03-14)
Assets/Screenshots/Screenshot_01.png (100673, 2022-03-14)
Assets/Screenshots/Screenshot_02.png (95264, 2022-03-14)
Assets/Screenshots/Screenshot_03.png (124305, 2022-03-14)
Assets/Screenshots/Screenshot_11.png (46628, 2022-03-14)
Assets/Screenshots/Screenshot_12.png (42809, 2022-03-14)
Assets/Screenshots/Screenshot_13.png (48884, 2022-03-14)
Assets/Screenshots/Screenshot_14.png (47914, 2022-03-14)
Assets/Screenshots/Screenshot_21.png (99954, 2022-03-14)
Assets/Screenshots/Screenshot_22.png (245999, 2022-03-14)
Assets/Screenshots/Screenshot_23.png (117105, 2022-03-14)
Assets/Screenshots/Screenshot_24.png (148227, 2022-03-14)
Assets/Screenshots/Screenshot_25.png (105800, 2022-03-14)
Assets/Screenshots/Screenshot_31.png (254920, 2022-03-14)
Assets/Sourced/ (0, 2022-03-14)
Assets/Sourced/Fonts/ (0, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/ (0, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/LICENSE.txt (11358, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/OpenSans-Bold.ttf (224592, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/OpenSans-BoldItalic.ttf (213292, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/OpenSans-ExtraBold.ttf (222584, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf (213420, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/OpenSans-Italic.ttf (212896, 2022-03-14)
Assets/Sourced/Fonts/OpenSans/OpenSans-Light.ttf (222412, 2022-03-14)
... ...

# 2D Fluid Simulator [Try the Sim](https://maaack.itch.io/2d-fluid-simulator-in-godot) Made in Godot 3.4.3 ![Icon-800x450](./Assets/Media/Icon-800x450.png) ![Icon-Paint-800x450](./Assets/Media/Icon-Paint-800x450.png) ## Description A 2D Fluid Simulator made in Godot 3.4.3, running on the GPU through Godot’s shader language. It attempts to solve the Navier-Stokes equation in real time by taking advantage of the parallelism of GPU’s. ## Issues The main demonstration uses layered viewports to simulate multi-passes that converge on solutions for the viscosity as well as the pressure gradient of every pixel. However, every viewport in a scene adds a delay to the final output image. This problem becomes more pronounced as the number of Jacobi iterations for solving the pressure gradient increases. Tutorials suggest setting it 50-100. I have it at 16. Since the solution to the pressure gradient is perpetually lagging behind the rest of the math (and insufficient anyway), I also don’t use the final vector field as the next frame’s initial vector field. Doing so rapidly caused massive disturbances to the vector field and flashing lights (warning)! I opted instead for using the vector field after viscosity had been added (and before the pressure gradient was subtracted) as the next frame’s initial vector field. I eventually implemented a single-pass solution after facing challenges to the multi-pass solution. It uses a semi-lagrangian scheme to solve for pressure, and saves the result in the vector fields z-component. Ultimately, I found the multi-pass solution still looked the best. Both demo scenes are included for your own experimentation. Please share your feedback and suggestions. I’m especially hopeful there are still improvements to be made to the technical side of the simulation. ## Reference Material * https://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html * https://hal.inria.fr/inria-00596050/document * https://softologyblog.wordpress.com/2019/03/13/vorticity-confinement-for-eulerian-fluid-simulations/ * https://www.ixm-ibrahim.com/explanations/2d-fluid-simulation * https://github.com/PavelDoGreat/WebGL-Fluid-Simulation * https://github.com/haxiomic/GPU-Fluid-Experiments * https://github.com/mharrys/fluids-2d

近期下载者

相关文件


收藏者