VIIC 1:45 modell

Show off your FreeCAD projects here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
hds
Posts: 117
Joined: Tue Feb 14, 2017 8:23 am

Re: VIIC 1:45 modell

Post by hds »

thanks to @freecad-heini-1 for pointing out the slicing of lofts and parts the meshing is done ...
On to openfoam next.
viic_meshed.jpg
viic_meshed.jpg (137.43 KiB) Viewed 3405 times
freecad-heini-1
Veteran
Posts: 7788
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: VIIC 1:45 modell

Post by freecad-heini-1 »

hds wrote: Tue Jun 05, 2018 12:51 pm 1) Don't use "Ruled Surfaces". Use "Loft" instead. Reason: They are exported differently for example into a ".step" file. The former will not be recognized as a volume by meshing tools. The latter will.<br/>
Thank you for this recommendation. I figured out the same to create complex parting plane for injection mold. Loft could replace ruled faces, so skip ruled faces for the future.
hds
Posts: 117
Joined: Tue Feb 14, 2017 8:23 am

Re: VIIC 1:45 modell

Post by hds »

Some short notes of the transfer from FC to OpenFoam:

1) If you are creating complex hulls you may want to make sure that your "tiles" consist of two splines and two straight lines. It is probably not a must every time, but you will have less rounding issues during the mesh process. This is how i did it in FC. Straight lines top and bottom, splines from aft to bow.
FreeCADSpantenDir.jpg
FreeCADSpantenDir.jpg (246.15 KiB) Viewed 3340 times

2) Double check that your parts do not interlock. Otherwise your meshing will probably fail with "intersection" errors.


3) Settings of gmsh i used. I did not use the FEM WB because i wanted to have a bit more control over the files created for the data interchange. You may want to set the import geometry tolerance from 1e-8 to 1e-2 depending on your hull. The interpolation between the various splines will leave "holes" otherwise. You can check that for example with an export to *stl file and do a test with Meshlab.
gmshGeometry1.jpg
gmshGeometry1.jpg (37.13 KiB) Viewed 3340 times


4) My Mesh settings
gmshMesh1.jpg
gmshMesh1.jpg (44.7 KiB) Viewed 3340 times


5) In gmsh add your various parts as volumes and do a 3D mesh.



6) Save mesh and move it to an OpenFoam project tree. Change "writeFormat" from "ASCII" to "binary" in your controlDict, otherwise the import will fail. Run "gmshToFoam your.msh".
controlDictEdit.jpg
controlDictEdit.jpg (36.98 KiB) Viewed 3340 times


7) Create an empty file in the OpenFoam project tree with just a name "foobar.openFoam" for example. It is only needed for paraview. Start paraview, open File -> Files of type (scroll to ALL files) -> click on your "*.openFoam". If everything went right you should see your 3D Foam Mesh.
ParaviewCut.jpg
ParaviewCut.jpg (242.01 KiB) Viewed 3340 times


8) Create the flow channel ... This is something for the next days. The idea for now is using blockmesh for the flowchannel and then snappyHexMesh for combining.
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: VIIC 1:45 modell

Post by thschrader »

Hi hds,
can you give some additional info?

What hardware do you use for cfd? (processor, number of cpus, RAM)
In you "ParaviewCut" pic from above I can see that your mesh (the meshed sub-body, right?)
contains more than 1,2 Mio FEM-cells. When I extrapolate this mesh refinement to the complete flow
domain, you will get approx 10 Mio cells :shock: .

What calculation you will run? I mean, is the sub submerged or do you want to simulate a
free surface (sub not submerged).

Is the sub your "original" hobby-model or is it scaled up to the real world?

I am wondering why you do not use the FreeCAD cfd-workbench.
You have 3 different meshers (gmsh, snappyhexmesh+blockmesh, cfmesh)
with the options of mesh-refinement and turbulence (boundary-layers).
regards Thomas
again: stunning project!
hds
Posts: 117
Joined: Tue Feb 14, 2017 8:23 am

Re: VIIC 1:45 modell

Post by hds »

I'am in the lucky position to have acces to various machines ranging from 12CPUs/8GB to 40CPUS/256GB RAM (Intel).

The mesh you see in paraview is not the final stage. This is just to show a reproducible way of generating the mesh. As you might have realized i'am by no means a CFD engineer.

I need the hydrodynamic coeffiencts of the submerged boat. In various articels about the navigation control of AUVs it is pointed out that especially the pitch control is very much non linear. You may realize it when watching model subs on an exhibition. They tend to be stable in a certain range of speed. Below and above there is some tendency for instability. Yes, i know that there are pitch controller out there. But as said above i like the challenge. Lets see where i end up. I don't mind if my effort does not pay off. In the end i learned how to create a ship hull in FC and dump that into OpenFoam. Fair enough.

The sub i build is a model 1:45. But there is no reason for not doing a real world CFD. Only need to scale up the model.

The cfd WB in FC cannot be installed (at least in the latest FCdaily i use). The cfdOF has the same limitation in usage as the "loft" tool. When it comes down to select the part you want to mesh, you are forced to select from this darn drop down list of lines, splines and such. I've been through this process of manually creating dozends of lofts on the pyhton console. Not again.

I couldn't get gmsh to create the mesh between the flow channel and the body of the sub. Probably something dumb, but i cannot figure it out of how to do it. Thats the deeper reason why i want to give blockMesh and snappyHexMesh a try.
hds
Posts: 117
Joined: Tue Feb 14, 2017 8:23 am

Re: VIIC 1:45 modell

Post by hds »

Reality strikes back ...

Something went wrong in the plastification process. Probably something with the chemicals. So i have to redo the 132 frames because they are more or less a bit warped ....

Code: Select all

for (jacka=0,jacka<=42;jacka++) {
     mv head -> locker(hard);
}
hds
Posts: 117
Joined: Tue Feb 14, 2017 8:23 am

Re: VIIC 1:45 modell

Post by hds »

at least the openFoam approach seems to be promising ... blockMesh for the flow channel and snappyHexMesh for the VIIC surface file.


VIIC_openfoam.jpg
VIIC_openfoam.jpg (503.6 KiB) Viewed 3148 times
User avatar
Chris_G
Veteran
Posts: 2579
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: VIIC 1:45 modell

Post by Chris_G »

hds wrote: Tue Jun 12, 2018 10:26 am Something went wrong in the plastification process. Probably something with the chemicals. So i have to redo the 132 frames because they are more or less a bit warped ....
That's sad. Good luck, this is an amazing project.
hds wrote: Tue Jun 12, 2018 10:26 am

Code: Select all

for (jacka=0,jacka<=42;jacka++) {
     mv head -> locker(hard);
}
:lol: :lol:
thschrader
Veteran
Posts: 3129
Joined: Sat May 20, 2017 12:06 pm
Location: Germany

Re: VIIC 1:45 modell

Post by thschrader »

hds wrote: Tue Jun 12, 2018 1:37 pm at least the openFoam approach seems to be promising ... blockMesh for the flow channel and snappyHexMesh for the VIIC surface file.
How do you connect both meshes?
As far as I know the blockmesh works only as a "background-mesh" for snappyhexmesh to start.
Which means the blockmesh must be bigger than the complete flow channel.
The meshing-pics below of my "submarine" are done with the freecad cfd-wb (snappyhexmesh with refinement).
As you can see, there is no mesh inside the submarine (cylinder) body. When you mesh the submarine-body
too, the water-flow goes through the sub, not around it.

Can you provide a step-file of your submarine body? (watertight solid body without rudders)
Would be intersting to see, how FC can handle this problem. (I believe it can...)

Programming the openfoam dictionaries "by hand" is very time consuming. Thats why the
cfd-of workbench was invented :)
regards Thomas
cylinder3.JPG
cylinder3.JPG (34.05 KiB) Viewed 3075 times
cylinder2.JPG
cylinder2.JPG (109.67 KiB) Viewed 3075 times
cylinder1.JPG
cylinder1.JPG (91.61 KiB) Viewed 3075 times
hds
Posts: 117
Joined: Tue Feb 14, 2017 8:23 am

Re: VIIC 1:45 modell

Post by hds »

The meshes are connected by snappyHexMesh. This picture is just a vizualisation of the surface of the hull and bottom and back of the flow channel.

You may download the step file here
It would be nice if you could post any findings here as well so that the knowledge is not lost.

Have fun.

Attached pls find some pics of the water flow in Y-direction (up/down) with a -0.5m/s water flow in Z-direction.
viic_pic.tgz
(313.32 KiB) Downloaded 100 times
viic_20.jpg
viic_20.jpg (23.1 KiB) Viewed 3018 times
Post Reply