Skip to content

Commit

Permalink
FluidX3D v2.5 update (raytracing overhaul)
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectPhysX committed Apr 11, 2023
1 parent 83d1c68 commit f9aba8b
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 67 deletions.
41 changes: 23 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ The fastest and most memory efficient lattice Boltzmann CFD software, running on
- fixed bug in make.sh where multi-GPU device IDs would not get forwarded to the executable
- minor bug fixes in graphics engine (free cursor not centered during rotation, labels in VR mode)
- fixed bug in LBM::voxelize_stl() size parameter standard initialization
- v2.5 (11.04.2023)
- implemented light absorption in fluid for raytracing graphics (no performance impact)
- improved raytracing framerate when camera is inside fluid
- fixed skybox pole flickering artifacts
- fixed bug where moving objects during re-voxelization would leave an erroneous trail of solid grid cells behind

</details>

Expand Down Expand Up @@ -79,29 +84,29 @@ $$f_j(i\\%2\\ ?\\ \vec{x}+\vec{e}_i\\ :\\ \vec{x},\\ t+\Delta t)=f_i^\textrm{tem

- peak performance on GPUs (datacenter/gaming/professional/laptop), validated with roofline model
- optimized to minimize memory demand:
- traditional D3Q19 LBM with FP64 requires ~344 Bytes/cell
- traditional LBM (D3Q19) with FP64 requires ~344 Bytes/cell
```
|ρ:ρ:ρ:ρ:ρ:ρ:ρ:ρ|u:u:u:u:u:u:u:u|u:u:u:u:u:u:u:u|u:u:u:u:u:u:u:u|
|f:f:f:f:f:f:f:f|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|
|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|
|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|
|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|
|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|A:A:A:A:A:A:A:A|
|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|
|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|
|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|
|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|
|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|B:B:B:B:B:B:B:B|
(illustration: density ρ, velocity u, flags f, 2 copies of DDFs A/B; each symbol = 1 Byte)
🟧🟧🟧🟧🟧🟧🟧🟧🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦
🟨🟨🟨🟨🟨🟨🟨🟨🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥🟥
(density 🟧, velocity 🟦, flags 🟨, 2 copies of DDFs 🟩/🟥; each square = 1 Byte)
```
- allows for 3 Million cells per 1 GB VRAM
- FluidX3D requires only 55 Bytes/cell with [Esoteric-Pull](https://doi.org/10.3390/computation10060092)+[FP16](https://www.researchgate.net/publication/362275548_Accuracy_and_performance_of_the_lattice_Boltzmann_method_with_64-bit_32-bit_and_customized_16-bit_number_formats)
- FluidX3D (D3Q19) requires only 55 Bytes/cell with [Esoteric-Pull](https://doi.org/10.3390/computation10060092)+[FP16](https://www.researchgate.net/publication/362275548_Accuracy_and_performance_of_the_lattice_Boltzmann_method_with_64-bit_32-bit_and_customized_16-bit_number_formats)
```
|ρ:ρ:ρ:ρ|u:u:u:u|u:u:u:u|u:u:u:u|f|A:A|A:A|A:A|A:A|A:A|A:A|A:A|
|A:A|A:A|A:A|A:A|A:A|A:A|A:A|A:A|A:A|A:A|A:A|A:A|
🟧🟧🟧🟧🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟨🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩🟩
(illustration: density ρ, velocity u, flags f, DDFs A; each symbol = 1 Byte)
(density 🟧, velocity 🟦, flags 🟨, DDFs 🟩; each square = 1 Byte)
```
- allows for 19 Million cells per 1 GB VRAM
- in-place streaming with [Esoteric-Pull](https://doi.org/10.3390/computation10060092): eliminates redundant copy `B` of density distribution functions (DDFs) in memory; almost cuts memory demand in half and slightly increases performance due to implicit bounce-back boundaries; offers optimal memory access patterns for single-cell in-place streaming
Expand Down
2 changes: 2 additions & 0 deletions src/defines.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#define GRAPHICS_BOUNDARY_FORCE_SCALE 100.0f // scaling factor for visualization of forces on solid boundaries if VOLUME_FORCE is enabled and lbm.calculate_force_on_boundaries(); is called (default: 100.0f)
#define GRAPHICS_STREAMLINE_SPARSE 4 // set how many streamlines there are every x lattice points
#define GRAPHICS_STREAMLINE_LENGTH 128 // set maximum length of streamlines
#define GRAPHICS_RAYTRACING_TRANSMITTANCE 0.25f // transmitted light fraction in raytracing graphics ("0.25f" = 1/4 of light is transmitted and 3/4 is absorbed along longest box side length, "1.0f" = no absorption)
#define GRAPHICS_RAYTRACING_COLOR 0x005F7F // absorption color of fluid in raytracing graphics



Expand Down
2 changes: 1 addition & 1 deletion src/info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ void Info::print_logo() const {
print("| "); print("\\ \\ / /", c); print(" |\n");
print("| "); print("\\ ' /", c); print(" |\n");
print("| "); print("\\ /", c); print(" |\n");
print("| "); print("\\ /", c); print(" FluidX3D Version 2.4 |\n");
print("| "); print("\\ /", c); print(" FluidX3D Version 2.5 |\n");
print("| "); print("'", c); print(" Copyright (c) Moritz Lehmann |\n");
}
void Info::print_initialize() {
Expand Down
Loading

0 comments on commit f9aba8b

Please sign in to comment.