ProjectPhysX / FluidX3D

The fastest and most memory efficient lattice Boltzmann CFD software, running on all GPUs via OpenCL. Free for non-commercial use.
https://youtube.com/@ProjectPhysX
Other
3.48k stars 281 forks source link

Turbulence details are not displayed clearly after enabling FORCE_FIELD #155

Closed wjsjtu123 closed 4 months ago

wjsjtu123 commented 4 months ago

image This is the Q cloud obtained by calculating the lift coefficient with FORCE_FIELD enabled, and I'm wondering why it turns black and doesn't show more turbulence detail very well. What should I do to get more turbulence details like in this picture below。 image

wjsjtu123 commented 4 months ago

And open the visualization interface in linux system, this visualization interface sometimes does not work and become very laggy.

ProjectPhysX commented 4 months ago

Hi @wjsjtu123,

FORCE_FIELD in itself only adds an additional force vector lbm.F to each cell, and allows calculation of boundary forces. To actually compute boundary forces for rendering, call lbm.calculate_force_on_boundaries(); in a loop with lbm.run(1u);, like this:

while(true) { // main simulation loop
    lbm.run(1u);
    lbm.calculate_force_on_boundaries();
}

The reason to not include calculate_force_on_boundaries() in the run() function is that it needs extra compute time, and in many setups updating the boundary forces may only be required before exporting forces, or before rendering video frames, not in every single time step. See here: https://github.com/ProjectPhysX/FluidX3D/blob/master/DOCUMENTATION.md#liftdrag-forces

The Q-criterion rendering is toggled with key 4, or in the main_setup() function activated with lbm.graphics.visualization_modes = VIS_Q_CRITERION;. In interactive graphics, you can switch coloring between velocity/density fields with key Z.

What hardware do you have? Interactive visualization may become slow at super high resolution.

Kind regards, Moritz