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.77k stars 300 forks source link

Pressure field in LBM #117

Closed mohdafeefbadri closed 11 months ago

mohdafeefbadri commented 11 months ago

I am a newbie to LBM and was wondering if it's possible to see pressure fields from the aerodynamic simulations from FluidX3D. I have experience only using OpenFOAM. I am conducting an academic study for which we are trying to validate and compare our test case in OpenFOAM with FluidX3D. Is it possible to have pressure fields along with velocity here?

ProjectPhysX commented 11 months ago

Hi @mohdafeefbadri,

yes you have access to the pressure field: pressure in LBM is directly proportional to density (simulation is isothermal). The proportionality constant is , with c=1/sqrt(3) being the LBM speed of sound.

In LBM units you have the pressure for any lattice point n: float lbm_p_n = lbm.rho[n]/3.0f;. In SI units, it's float si_p_n = units.si_p(lbm.rho[n]/3.0f); with prior unit conversion via units.set_m_kg_s(...);.

For external data evaluation, you can .vtk-export the volumetric density field in LBM units via lbm.rho.write_device_to_vtk(); and also export the conversion constant from (density in LBM units) --> (pressure in SI units) which is float conversion_constant = units.si_p(1.0f/3.0f);.

All the best with your study!

Kind regards, Moritz