FreeSurface with poly layers

Hi there,

I am just staring to work FC_0.21.1 with this workbench cfdOF_1.24.8, and I got confused and wondering around for few days… :mrgreen:

I have a Sphere in a 2Phase liquid. So I want to refine the mesh of gmsh(polyhedral) with 10 layers around the object that is ‘Cut’ in the 2Pahse environment of Sea and Air. I would like to have 10 layers on the free surface also (b/w water and air).

  • I have try every possible Cut with gmsh(Polyhedral) and Extrusion is not changing it’s direction always to the outside of mesh-grid (I have try to change it from refine ‘Data’ window etc. / try to change normals of body / reverse of body / mesh and so on … ) noting worked out.
  • Than a look at the forum and there was a post for using ‘Edit’ after Meshing with cfMesh and change to pMesh in “AllMesh” file.
    It worked the half way: with the layers for the body, but not for the layers of free surface… and the mesh is strangely tight :slight_smile:

Yes I can refine it with volume around the free surface, but this is not what I’m looking fo’ :nerd:

Here I will upload one of my simple Tasks with which I am struggling with… any advice or link will be helpful…
Thank you in advance.

Is there away to manipulate or refine cfdOF (yellow) mesh cube in FEM Workbench and bring it back:
-So far I see you can transform cfdOF yellow mesh to green mesh .stl file but that’s all.This way you can merge the green meshes so to create the domain I need but will they work together, can you adjust the inner volume of that mesh and how to input it back to cfdOF mesh generator for check (not to regenerate again, but to use it directly) is a mystery for me :mrgreen: if it possible at all so far…

Can you create FEM mesh (yellow) in FreeCAD after the creation of cfdOF and input it back ?

There is an mesh option called “DynamicMeshInterfaceRefinement”, please see here (the catamaran):
https://devtalk.freecad.org/t/mesh-refinements-with-different-mesher-apps/70634/7

Thank you very much :slight_smile:

I have try and explore it, but for sure it is not giving any indications when FreeCAD generate the visual mesh*

After some research it seems that OpenFOAM create this “sharp interface” (free surface), explained in “Dam Break” tutorial.
~https://www.openfoam.com/documentation/tutorial-guide/4-multiphase-flow/4.1-breaking-of-a-dam~

  • So this option “DynamicMeshInterfaceRefinement” is adding 10 layers in that ‘sharp interface’ for accurate resolution b/w the two phases of fluid (air 0/1 water). and something important: it only uses the hexRef8 class (hexahedral cells) as cells that can be refined. The cells of this type being cut in 3 directions. Here is the old post: https://cfd-training.com/2018/01/06/how-to-use-dynamicrefinefvmesh-library/
    So can not be used for polyhedral cells!
    *If it is true, may be is good to be removed as option when using gmesh(polyhedral) or give some indication in hints bars :bulb:

  • Also Mesh layers are added just to “walls” and now I have new issue, to wonder:
    why when the object is cut in half those 10 layers are applied to “wall of symmetry” also, not only on the half cut object ? :mrgreen:

This is what I get when meshing my boat hull with surface refinement:
gmsh-tet-mesh is fine, checkMesh=ok.
gmsh-poly-mesh allways produces mesh errors.
gmsh_tet_vs_poly_cells.png

Nice boat :slight_smile: cool stuff

As far for 10layers to the free surface as my previous post state:

  • I have found out that 10layrs on free surface is possible only if we use Lagrangian grid of “Interface tracking method” for “Free Surface”… (no VOF)
  • when using VOF we use Eulerian grid of “Interface capturing method”, so here we have this “sharp interface” of a line with values b/w 0 and 1 (for multiphase flow) for the “Free Surface”.
  • so fare this part is Solved!

But the other part of my my task is to create 10 layers around the boat with polyhedral mesh (for accuracy)… so far it is not possible or I can get the right way if using gmesh (polyhedral) there are no option to create 10 layers on the surface of the boat…

  • what I can see from the picture there is just surface refinement…
  • as for ‘check mesh’ so far I haven’t achieved o.k. mesh also, there are always few bad faces out there :blush:
    *mesh is o.k. only if I use the “hacky way” of entering in ‘Allmesh’ file after using cfMesh generator and later in Edit changing script code cartesianMesh to pMesh (line 38) and then the web is strangely arranged in order for a polyhedral mesh type