Skip to content

Commit d6485e7

Browse files
committed
FluidX3D v2.7 update
1 parent 8e796b6 commit d6485e7

File tree

8 files changed

+214
-72
lines changed

8 files changed

+214
-72
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
1111

1212
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1313

14-
German [Act on Copyright and Related Rights](https://www.gesetze-im-internet.de/englisch_urhg/englisch_urhg.html) (Urheberrechtsgesetz - UrhG) - Copyright Act of 9 September 1965 (Federal Law Gazette I, p. 1273), as last amended by Article 25 of the Act of 23 June 2021 (Federal Law Gazette I, p. 1858) - applies, in particular also [§ 97 (2) UrhG](https://www.gesetze-im-internet.de/englisch_urhg/englisch_urhg.html#p0881).
14+
German [Act on Copyright and Related Rights](https://www.gesetze-im-internet.de/englisch_urhg/englisch_urhg.html) (Urheberrechtsgesetz - UrhG) - Copyright Act of 9 September 1965 (Federal Law Gazette I, p. 1273), as last amended by Article 25 of the Act of 23 June 2021 (Federal Law Gazette I, p. 1858) - applies, in particular also [§ 97 (2) UrhG](https://www.gesetze-im-internet.de/englisch_urhg/englisch_urhg.html#p0881). The name "FluidX3D" is protected by German Werktitelschutz, [§ 5 (3) MarkenG](https://www.gesetze-im-internet.de/markeng/__5.html).

README.md

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ The fastest and most memory efficient lattice Boltzmann CFD software, running on
44

55
<a href="https://youtu.be/-MkRBeQkLk8"><img src="https://img.youtube.com/vi/o3TPN142HxM/maxresdefault.jpg" width="50%"></img></a><a href="https://youtu.be/oC6U1M0Fsug"><img src="https://img.youtube.com/vi/oC6U1M0Fsug/maxresdefault.jpg" width="50%"></img></a><br>
66
<a href="https://youtu.be/XOfXHgP4jnQ"><img src="https://img.youtube.com/vi/XOfXHgP4jnQ/maxresdefault.jpg" width="50%"></img></a><a href="https://youtu.be/3JNVBQyetMA"><img src="https://img.youtube.com/vi/3JNVBQyetMA/maxresdefault.jpg" width="50%"></img></a>
7+
(click on images to show videos on YouTube)
78

89

910
<details><summary>Update History</summary>
@@ -57,6 +58,17 @@ The fastest and most memory efficient lattice Boltzmann CFD software, running on
5758
- fixed bug where moving objects during re-voxelization would leave an erroneous trail of solid grid cells behind
5859
- v2.6 (16.04.2023)
5960
- patched OpenCL issues of Intel Arc GPUs: now VRAM allocations >4GB are possible and correct VRAM capacity is reported
61+
- v2.7 (29.05.2023)
62+
- added slice visualization (key <kbd>2</kbd> / key <kbd>3</kbd> modes, then switch through slice modes with key <kbd>T</kbd>, move slice with keys <kbd>Q</kbd>/<kbd>E</kbd>)
63+
- made flag wireframe / solid surface visualization kernels toggleable with key <kbd>1</kbd>
64+
- added surface pressure visualization (key <kbd>1</kbd> when `FORCE_FIELD` is enabled and `lbm.calculate_force_on_boundaries();` is called)
65+
- added binary `.vtk` export function for meshes with `lbm.write_mesh_to_vtk(Mesh* mesh);`
66+
- added `time_step_multiplicator` for `integrate_particles()` function in PARTICLES extension
67+
- made correction of wrong memory reporting on Intel Arc more robust
68+
- fixed bug in `write_file()` template functions
69+
- reverted back to separate `cl::Context` for each OpenCL device, as the shared Context otherwise would allocate extra VRAM on all other unused Nvidia GPUs
70+
- removed Debug and x86 configurations from Visual Studio solution file (one less complication for compiling)
71+
- fixed bug that particles could get too close to walls and get stuck, or leave the fluid phase (added boundary force)
6072

6173
</details>
6274

@@ -247,9 +259,9 @@ $$f_j(i\\%2\\ ?\\ \vec{x}+\vec{e}_i\\ :\\ \vec{x},\\ t+\Delta t)=f_i^\textrm{tem
247259
- rendering is fully multi-GPU-parallelized via seamless domain decomposition rasterization
248260
- with interactive graphics mode disabled, image resolution can be as large as VRAM allows for (4K/8K/16K and above)
249261
- (interacitive) visualization modes:
250-
- flags (and force vectors on solid boundary cells if the extension is used)
251-
- velocity field
252-
- streamlines
262+
- flag wireframe / solid surface (and force vectors on solid cells or surface pressure if the extension is used)
263+
- velocity field (with slice mode)
264+
- streamlines (with slice mode)
253265
- velocity-colored Q-criterion isosurface
254266
- rasterized free surface with [marching-cubes](http://paulbourke.net/geometry/polygonise/)
255267
- [raytraced free surface](https://www.researchgate.net/publication/360501260_Combined_scientific_CFD_simulation_and_interactive_raytracing_with_OpenCL) with fast ray-grid traversal and marching-cubes, either 1-4 rays/pixel or 1-10 rays/pixel
@@ -283,17 +295,19 @@ $$f_j(i\\%2\\ ?\\ \vec{x}+\vec{e}_i\\ :\\ \vec{x},\\ t+\Delta t)=f_i^\textrm{tem
283295
- Set the initial condition in a loop that iterates over the entire lattice by writing to `lbm.rho[n]`/`lbm.u.x[n]`/`lbm.u.y[n]`/`lbm.u.z[n]`/`lbm.flags[n]`.
284296
- Call `lbm.run();` to initialize and execute the setup (infinite time steps) or `lbm.run(time_steps);` to execute only a specific number of time steps.
285297
- As long as the `lbm` object is in scope, you can access the memory. As soon as it goes out of scope, all memory associated to the current simulation is freed again.
286-
3. On Windows in Visual Studio Community and click compile+run, or on Linux run `chmod +x make.sh` and `./make.sh`; this will automatically select the fastest installed GPU(s). Alternatively, you can add the device ID(s) as command-line arguments, for example `./make.sh 2` to compile+run on device 2, or `bin/FluidX3D 1 3` to run the executable on devices 1 and 3. Compile time for the entire code is about 10 seconds. If you use `INTERACTIVE_GRAPHICS` on Linux, change to the "compile on Linux with X11" command in `make.sh`.
298+
3. On Windows in Visual Studio Community click compile+run, or on Linux run `chmod +x make.sh` and `./make.sh`; this will automatically select the fastest installed GPU(s). Alternatively, you can add the device ID(s) as command-line arguments, for example `./make.sh 2` to compile+run on device 2, or `bin/FluidX3D 1 3` to run the executable on devices 1 and 3. Compile time for the entire code is about 10 seconds. If you use `INTERACTIVE_GRAPHICS` on Linux, change to the "compile on Linux with X11" command in `make.sh`.
287299
4. Keyboard/mouse controls with `INTERACTIVE_GRAPHICS`/`INTERACTIVE_GRAPHICS_ASCII` enabled:
288300
- <kbd>P</kbd>: start/pause the simulation
289301
- <kbd>H</kbd>: show/hide help
290-
- <kbd>1</kbd>: flags (and force vectors on solid boundary cells if the extension is used)
302+
- <kbd>1</kbd>: flag wireframe / solid surface (and force vectors on solid cells or surface pressure if the extension is used)
291303
- <kbd>2</kbd>: velocity field
292304
- <kbd>3</kbd>: streamlines
293305
- <kbd>4</kbd>: vorticity / velocity-colored Q-criterion isosurface
294306
- <kbd>5</kbd>: rasterized free surface
295307
- <kbd>6</kbd>: raytraced free surface
296308
- <kbd>7</kbd>: particles
309+
- <kbd>T</kbd>: toggle slice visualization mode
310+
- <kbd>Q</kbd>/<kbd>E</kbd>: move slice in slice visualization mode
297311
- <kbd>Mouse</kbd> or <kbd>I</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd>: rotate camera
298312
- <kbd>Scrollwheel</kbd> or <kbd>+</kbd>/<kbd>-</kbd>: zoom (centered camera mode) or camera movement speed (free camera mode)
299313
- <kbd>Mouseclick</kbd> or <kbd>U</kbd>: toggle rotation with <kbd>Mouse</kbd> and angle snap rotation with <kbd>I</kbd>/<kbd>J</kbd>/<kbd>K</kbd>/<kbd>L</kbd>
@@ -398,6 +412,7 @@ Colors: 🔴 AMD, 🔵 Intel, 🟢 Nvidia, 🟣 Apple, 🟡 Samsung
398412
| 🟢&nbsp;GeForce&nbsp;GT&nbsp;630&nbsp;(OEM) | 0.46 | 2 | 29 | 151 (81%) | 185 (50%) | 78 (21%) |
399413
| 🟢&nbsp;Quadro&nbsp;NVS&nbsp;290 | 0.03 | 0.256 | 6 | 1 ( 2%) | 1 ( 1%) | 1 ( 1%) |
400414
| | | | | | | |
415+
| 🟣&nbsp;M2&nbsp;Max&nbsp;GPU&nbsp;38C&nbsp;32GB | 9.73 | 22 | 400 | 2405 (92%) | 4641 (89%) | 2444 (47%) |
401416
| 🟣&nbsp;M1&nbsp;Max&nbsp;GPU&nbsp;24C&nbsp;32GB | 6.14 | 22 | 400 | 2369 (91%) | 4496 (87%) | 2777 (53%) |
402417
| 🟣&nbsp;M1&nbsp;Pro&nbsp;GPU&nbsp;16C&nbsp;16GB | 4.10 | 11 | 200 | 1204 (92%) | 2329 (90%) | 1855 (71%) |
403418
| 🔴&nbsp;Radeon&nbsp;Vega&nbsp;8&nbsp;(4750G) | 2.15 | 27 | 57 | 263 (71%) | 511 (70%) | 501 (68%) |

src/defines.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
#define GRAPHICS_BACKGROUND_COLOR 0x000000 // set background color; black background (default) = 0x000000, white background = 0xFFFFFF
3434
#define GRAPHICS_U_MAX 0.2f // maximum velocity for velocity coloring in units of LBM lattice speed of sound (c=1/sqrt(3)) (default: 0.2f)
3535
#define GRAPHICS_Q_CRITERION 0.0001f // Q-criterion value for Q-criterion isosurface visualization (default: 0.0001f)
36-
#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)
36+
#define GRAPHICS_F_MAX 0.002f // maximum force in LBM units for visualization of forces on solid boundaries if VOLUME_FORCE is enabled and lbm.calculate_force_on_boundaries(); is called (default: 0.002f)
3737
#define GRAPHICS_STREAMLINE_SPARSE 4 // set how many streamlines there are every x lattice points
3838
#define GRAPHICS_STREAMLINE_LENGTH 128 // set maximum length of streamlines
3939
#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)

src/info.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ void Info::print_logo() const {
6767
print("| "); print("\\ \\ / /", c); print(" |\n");
6868
print("| "); print("\\ ' /", c); print(" |\n");
6969
print("| "); print("\\ /", c); print(" |\n");
70-
print("| "); print("\\ /", c); print(" FluidX3D Version 2.6 |\n");
71-
print("| "); print("'", c); print(" Copyright (c) Moritz Lehmann |\n");
70+
print("| "); print("\\ /", c); print(" FluidX3D Version 2.7 |\n");
71+
print("| "); print("'", c); print(" Copyright (c) Dr. Moritz Lehmann |\n");
7272
}
7373
void Info::print_initialize() {
7474
const float Re = lbm->get_Re_max();

0 commit comments

Comments
 (0)