CocoonCruisers
Senior Member
- Joined
- Dec 3, 2015
- Messages
- 130
- Reaction score
- 52
- Location
- Marseille & BuenosAires
Hi Laurence & all,
so it took a couple days more with a few failed test runs, and on the core subject of stall detection i must admit defeat;
SnappyHexMesh isn't so good at wrapping boundary layers around coarsely resolved small radii, and if i increase the resolution on the foil surface, at some point the cells height becomes so low that it can't create thick enough boundary layers within them to reach a high enough y+ for efficient solving. So the approach that was good enough for my softer, tidal-turbine style foils with twice the chord just keeps generating collapsing boundary layers at the leading edge for this tiny&thin section with its rather sharp leading edge. You'll see in the pic below how the boundary layers collapse at the LE, and that the y+ on much of the suction side is below 30, which should still work, but differently than the parts that actually rely on the wall function ... not so reassuring, and not exactly fast to solve either. It's probably good enough for L/D calculations at decent angles, but with the mess at the leading edge, i wouldn't trust it for stall inception.
Of course, that doesn't mean it can't be done (anything can with more manual work, more structured meshing and more calculation time. I don't have a cfMesh+ license anymore but that could certainly have tackled it, and it would even be scriptable - but require some babysitting nevertheless). But my aim here was to see if the free and automated workflow does the job.
Maybe it can still be useful for cross-code-validation at the calmer AoA's.
Here's what i got at the 'neutral' angle Laurence gave me:
All in N, all for a half T-Foil !
At 0.5s (flow still developing):
Total = Foil, Winglet, Bulb, Strut
Drag Sideforce Lift m/s
pressure 17.86 183.8 330.6 10.00
viscous 3.60 L/D kn
sum 21.5 15.4 19.4
Wing = Foil, Winglet
Drag Sideforce Lift m/s
pressure 14.65 2.6 331.1 10.00
viscous 2.14 L/D kn
sum 16.8 19.7 19.4
Foil without winglet
Drag Sideforce Lift m/s
pressure 14.06 7.3 322.9 10.00
viscous 2.06 L/D kn
sum 16.1 20.0 19.4
-----------
and at 1.0s:
(notice there is almost no lift left, which may be correct for the neutral AoA)
Total = Foil, Winglet, Bulb, Strut
Drag Sideforce Lift m/s
pressure 23.48 180.8 91.4 10.00
viscous 2.53 198% L/D kn
sum 26.0 #REF! 3.5 19.4
Wing = Foil, Winglet
Drag Sideforce Lift m/s
pressure 18.24 4.9 97.8 10.00
viscous 1.61 5% L/D kn
sum 19.8 #REF! 4.9 19.4
Foil without winglet
Drag Sideforce Lift m/s
pressure 17.68 7.8 92.7 10.00
viscous 1.53 8% L/D kn
sum 19.2 #REF! 4.8 19.4
Here's how it looks after 0.5s of solving:
"Surface LIC" on the inner slice still looks unrealistically smooth over the whole chord:
And this is after 1.0s:
Surface LIC on the inner slice starts to show a bit of separation at the trailing edge:
The workflow in the .zip below was primarily intended to investigate semi-foiling bigger boats. It uses blockMesh to create a background mesh with near-equilateral cubes around the hull geometry (for snappyHexMesh and mesh motion to work properly), while keeping cell count reasonably low by adapting the shape to the diagonality of the wake and grading the sizes towards the far field. It does a first run on a coarser mesh (about 3M cells here) without boundary layers to get an initial solution quickly, then maps it on a finer mesh with boundary layers (around 7M cells here) in a subdirectory called "BLrun". Build-up of the forces is captured in postProcessing/forcesTotal/0.1/forces.dat (or forcesWinglet etc) for each run. A .pvsm to look at it via paraview is also provided. (It can also handle mesh motion for sink and trim, just edit the constant/dynamicMeshDict for CG and rotation point and set "foamDictionary constant/dynamicMeshDict -entry mover/accelerationRelaxation -set 0.0" to "0.1" in the last run in the Allrun script.)
Basic usage would be:
- install openFoam 13, i use it on Ubuntu 24.04
- unzip the attached archive into a folder in your working directory
- make the "Allrun", "Allclean" "BoundaryLayerRemesh" "Restart" and "tail" scripts executable using chmod +x filename
- edit the "Allrun" script to adapt
"foamDictionary system/decomposeParDict -entry numberOfSubdomains -set 8" to your physical core count (NOT "threads" or hyperthreading count. Hyperthreading is only marketing BS as far as CFD/HPC is concerned). (If you have only similar cores, set it to 1 less than your actual core count, else the system might become unresponsive. If you have power cores and economy cores like Laurence's i9, set it to the number of power cores.)
- prepare your geometry: nice, watertight and smooth high resolution STL (when in doubt and on Rhino, shrink-wrap it to 0.0002m resolution), bow towards positive X, positive Y = side used in the sim, positive Z = up. The geometry shoud stick out at least very slightly towards the negative Y.
- replace the geometry files called dummy*.stl in constant/geometry with your geometry, names ending on:
***Foil.stl
***Strut.stl
***Winglet.stl
***Bulb.stl
- edit speed in "0/U" (it's in m/s): UMean 10.0;
- In a separate terminal, or using the "screen" utility, cd into your case directory and launch the Allrun script : ./Allrun
- Check on the meshing and calculations via another terminal.
- to look what your computer is doing and how much memory is used: top
- to look at the beginning of a log file:nano log.snappyHexMesh
- to look at the end of a log file: tail -n 5000 log.snappyHexMesh
- to look at a log file mid-flight: tail -f log.snappyHexMesh
- once the meshing went well, you can launch the "tail" script to see a less cluttered version of the log.foamRun
...watch out for the Courant numbers - if they go up above like 20 and keep raising,
problems are usually past a little spray and your calculation will blow up shortly.
- once the solving gets past the short initial runs, forces can be read up in postProcessing/forcesTotal/0.1/forces.dat (or forcesWinglet etc)
- when the initial run without boundary layers is complete, switch into the BLrun subdirectory where the higher resolution version will calculate itself.
- to visualise in paraview, open a new terminal, get into your case folder (and then into the BLrun folder if we're already that far). Type "paraview" & Enter in the terminal, paraview should launch. Hit File/LoadState, it's supposed to open directly into your case folder. Click on "thisCase.pvsm", then in the "Load State Options" window, choose "Search Files under Specified Directory", point it to your case folder (or the corresponding BLrun subdirectory if you're already that far), and tick the "Only use files in data directory" option before hitting Ok. Hopefully, the visualisation will open as above.
Water density and kinematic Viscosity can be adjusted in constant/physicalProperties.water
Air density and kinematic Viscosity can be adjusted in constant/physicalProperties.air
Surface roughness can be adjusted in 0/nut , parameter Ks for each of the patches. (As far as i understood, it is a "sand grain height" expressed in meters)
Performance was about 10h to reach 0.5s on the BLrun (second run with boundary layers) on my twin Epyc "Genoa" generation server with all 24 DDR-4 slots populated. Perhaps 16hours or so to solve to 1s (that's alredy several chord lengths in this case, the flow should be well established by then).
Feedback welcome !
Would be nice to include the files with corrections in case.
Cheers!
so it took a couple days more with a few failed test runs, and on the core subject of stall detection i must admit defeat;
SnappyHexMesh isn't so good at wrapping boundary layers around coarsely resolved small radii, and if i increase the resolution on the foil surface, at some point the cells height becomes so low that it can't create thick enough boundary layers within them to reach a high enough y+ for efficient solving. So the approach that was good enough for my softer, tidal-turbine style foils with twice the chord just keeps generating collapsing boundary layers at the leading edge for this tiny&thin section with its rather sharp leading edge. You'll see in the pic below how the boundary layers collapse at the LE, and that the y+ on much of the suction side is below 30, which should still work, but differently than the parts that actually rely on the wall function ... not so reassuring, and not exactly fast to solve either. It's probably good enough for L/D calculations at decent angles, but with the mess at the leading edge, i wouldn't trust it for stall inception.
Of course, that doesn't mean it can't be done (anything can with more manual work, more structured meshing and more calculation time. I don't have a cfMesh+ license anymore but that could certainly have tackled it, and it would even be scriptable - but require some babysitting nevertheless). But my aim here was to see if the free and automated workflow does the job.
Maybe it can still be useful for cross-code-validation at the calmer AoA's.
Here's what i got at the 'neutral' angle Laurence gave me:
All in N, all for a half T-Foil !
At 0.5s (flow still developing):
Total = Foil, Winglet, Bulb, Strut
Drag Sideforce Lift m/s
pressure 17.86 183.8 330.6 10.00
viscous 3.60 L/D kn
sum 21.5 15.4 19.4
Wing = Foil, Winglet
Drag Sideforce Lift m/s
pressure 14.65 2.6 331.1 10.00
viscous 2.14 L/D kn
sum 16.8 19.7 19.4
Foil without winglet
Drag Sideforce Lift m/s
pressure 14.06 7.3 322.9 10.00
viscous 2.06 L/D kn
sum 16.1 20.0 19.4
-----------
and at 1.0s:
(notice there is almost no lift left, which may be correct for the neutral AoA)
Total = Foil, Winglet, Bulb, Strut
Drag Sideforce Lift m/s
pressure 23.48 180.8 91.4 10.00
viscous 2.53 198% L/D kn
sum 26.0 #REF! 3.5 19.4
Wing = Foil, Winglet
Drag Sideforce Lift m/s
pressure 18.24 4.9 97.8 10.00
viscous 1.61 5% L/D kn
sum 19.8 #REF! 4.9 19.4
Foil without winglet
Drag Sideforce Lift m/s
pressure 17.68 7.8 92.7 10.00
viscous 1.53 8% L/D kn
sum 19.2 #REF! 4.8 19.4
Here's how it looks after 0.5s of solving:
"Surface LIC" on the inner slice still looks unrealistically smooth over the whole chord:
And this is after 1.0s:
Surface LIC on the inner slice starts to show a bit of separation at the trailing edge:
The workflow in the .zip below was primarily intended to investigate semi-foiling bigger boats. It uses blockMesh to create a background mesh with near-equilateral cubes around the hull geometry (for snappyHexMesh and mesh motion to work properly), while keeping cell count reasonably low by adapting the shape to the diagonality of the wake and grading the sizes towards the far field. It does a first run on a coarser mesh (about 3M cells here) without boundary layers to get an initial solution quickly, then maps it on a finer mesh with boundary layers (around 7M cells here) in a subdirectory called "BLrun". Build-up of the forces is captured in postProcessing/forcesTotal/0.1/forces.dat (or forcesWinglet etc) for each run. A .pvsm to look at it via paraview is also provided. (It can also handle mesh motion for sink and trim, just edit the constant/dynamicMeshDict for CG and rotation point and set "foamDictionary constant/dynamicMeshDict -entry mover/accelerationRelaxation -set 0.0" to "0.1" in the last run in the Allrun script.)
Basic usage would be:
- install openFoam 13, i use it on Ubuntu 24.04
- unzip the attached archive into a folder in your working directory
- make the "Allrun", "Allclean" "BoundaryLayerRemesh" "Restart" and "tail" scripts executable using chmod +x filename
- edit the "Allrun" script to adapt
"foamDictionary system/decomposeParDict -entry numberOfSubdomains -set 8" to your physical core count (NOT "threads" or hyperthreading count. Hyperthreading is only marketing BS as far as CFD/HPC is concerned). (If you have only similar cores, set it to 1 less than your actual core count, else the system might become unresponsive. If you have power cores and economy cores like Laurence's i9, set it to the number of power cores.)
- prepare your geometry: nice, watertight and smooth high resolution STL (when in doubt and on Rhino, shrink-wrap it to 0.0002m resolution), bow towards positive X, positive Y = side used in the sim, positive Z = up. The geometry shoud stick out at least very slightly towards the negative Y.
- replace the geometry files called dummy*.stl in constant/geometry with your geometry, names ending on:
***Foil.stl
***Strut.stl
***Winglet.stl
***Bulb.stl
- edit speed in "0/U" (it's in m/s): UMean 10.0;
- In a separate terminal, or using the "screen" utility, cd into your case directory and launch the Allrun script : ./Allrun
- Check on the meshing and calculations via another terminal.
- to look what your computer is doing and how much memory is used: top
- to look at the beginning of a log file:nano log.snappyHexMesh
- to look at the end of a log file: tail -n 5000 log.snappyHexMesh
- to look at a log file mid-flight: tail -f log.snappyHexMesh
- once the meshing went well, you can launch the "tail" script to see a less cluttered version of the log.foamRun
...watch out for the Courant numbers - if they go up above like 20 and keep raising,
problems are usually past a little spray and your calculation will blow up shortly.
- once the solving gets past the short initial runs, forces can be read up in postProcessing/forcesTotal/0.1/forces.dat (or forcesWinglet etc)
- when the initial run without boundary layers is complete, switch into the BLrun subdirectory where the higher resolution version will calculate itself.
- to visualise in paraview, open a new terminal, get into your case folder (and then into the BLrun folder if we're already that far). Type "paraview" & Enter in the terminal, paraview should launch. Hit File/LoadState, it's supposed to open directly into your case folder. Click on "thisCase.pvsm", then in the "Load State Options" window, choose "Search Files under Specified Directory", point it to your case folder (or the corresponding BLrun subdirectory if you're already that far), and tick the "Only use files in data directory" option before hitting Ok. Hopefully, the visualisation will open as above.
Water density and kinematic Viscosity can be adjusted in constant/physicalProperties.water
Air density and kinematic Viscosity can be adjusted in constant/physicalProperties.air
Surface roughness can be adjusted in 0/nut , parameter Ks for each of the patches. (As far as i understood, it is a "sand grain height" expressed in meters)
Performance was about 10h to reach 0.5s on the BLrun (second run with boundary layers) on my twin Epyc "Genoa" generation server with all 24 DDR-4 slots populated. Perhaps 16hours or so to solve to 1s (that's alredy several chord lengths in this case, the flow should be well established by then).
Feedback welcome !
Would be nice to include the files with corrections in case.
Cheers!
Attachments
Last edited: