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

Question – has anybody tried LB for simulating the total drag for a ship moving through water? #127

Open cjnqt opened 9 months ago

cjnqt commented 9 months ago

A common simulation task in naval design is to estimate the total resistance of a boat hull moving at different speeds through calm water.

This is often done with various CFD software before building small models for physical testing in so called towing tanks.

I would guess Lattice Boltzmann would work well for this task. Has anyone here tried it?

I could not find an example – I think it would be a great addition to FluidX3D.

antoniopucciarelli commented 1 month ago

Dear @ProjectPhysX / FluidX3D community,

I was thinking adapting LBM to hull performance prediction.

It would be interesting knowing your opinion over this problem in terms of modelling and LBM tuning. I think LBM could be suitable in this task.

As @cjnqt was asking, it would be really helpful understanding if anyone has already done it.

klausbu commented 3 weeks ago

I am thinking in the same direction. I am looking for a software capable to predict lift, drag and flow around fluid dynamic bodies like hulls, wings, wingbodys or the Ahmed Body for validation of lift and drag predictions.

A few questions come up:

1: Does FluidX3D support double precision computation (which is needed when using OpenFOAM to get correct results)?

2: Can FluidX3D handle simulations to which the y+ < 1 condition applies?

This requires the first cell layer to be within the viscous sub layer of the boundary layer from there the layer thickness growth slowly by a factor of 1.1-1.25 from layer to layer. Usually 8-30 boundary layers are needed to resolve a boundary layer depending on the problem to get correct drag estimates.

3: Are there and reference cases like an adapted version of: Ahmed Body case study model #6 from the paper: "Optimization of Ahmed Body within ANSYS CFX"?

ProjectPhysX commented 3 weeks ago

Hi @klausbu,

I don't have a ship hull sample on hand but feel free to try it yourself!

To your questions:

  1. FP64 arithmetic is neither required for LBM nor avaliable in FluidX3D. FP32 arithmetic is just as accurate as FP64 for LBM, even with the optional compressed FP16 memory storage for density distribution functions. Only in corner cases where super low velocity in LBM units is required - like certain microfluidics applications - FP16 storage is not sufficient. FP64 arithmetic would also be super slow on almost all GPUs. See here for details/validation regarding floating-point precision.
  2. No. FluidX3D cannot do adaptive grid refinement. For y+ < 1, you would need ~5 orders of magnitude spacial resolution, or ~10000³ cells. Today's high-end hardware can only get you ~4000³ cells.
  3. You can try the Ahmed body yourself in FluidX3D. With the resolution you get on a typical desktop GPU, expect drag force to be too large by about a factor 2, due to lack of grid refinement and no wall model.

Kind regards, Moritz

klausbu commented 3 weeks ago

Hi Moritz,

thank you for your feedback.

For me accuracy comes first, I need correct results for lift and drag for external, low Re flows (low Re means 300.000... 2.000.000), correct flow patterns and pressure distribution are also of value.

Are you working on grid refinement and wall functions?

I would be open to look into some validation cases if you address the challenging (lift and) drag computation.

Talking about hardware limitations, How to setup a symmetric "wind tunnel" i.e. a flow domain for the simulation of an external flow using only one half of the body to be studied to reduce computational cost?

Kind regards,

Klaus

pierro42 commented 2 weeks ago

@antoniopucciarelli Just after the parralell_for, add a condition to exclude the cells you already set ( to type S/X/I), that ends after the end of boundary setup:

parallel_for(lbm.get_N(), [&](ulong n) { uint x = 0u, y = 0u, z = 0u; lbm.coordinates(n, x, y, z);
    // initial water line

    if (lbm.flags[n] != (TYPE_S | TYPE_X | TYPE_I) )
    {
        if (z < H) {

( 2x resolution here ) fluidx

antoniopucciarelli commented 2 weeks ago

Thank you @pierro42 for the help and the fast response.

Appreciate it.