CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Community Contributions (https://www.cfd-online.com/Forums/openfoam-community-contributions/)
-   -   [cfMesh] I can't create sharp edge mesh by cfMesh (https://www.cfd-online.com/Forums/openfoam-community-contributions/153684-i-cant-create-sharp-edge-mesh-cfmesh.html)

prodo June 1, 2015 09:13

I can't create sharp edge mesh by cfMesh
 
4 Attachment(s)
Hello,

I am a beginner in cfMesh.

Using Geometry file, I want to create a mesh with a sharp edge.

However, I can't make.

no matter how, setting smaller the size of the mesh.

I made .stl file by Gridgen.

What should I do?

Please refer to the attached figure.

Thank you for your help

This is my very simple meshDIct

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | cfMesh: A library for mesh generation          |
|  \\    /  O peration    |                                                |
|  \\  /    A nd          | Author: Franjo Juretic                        |
|    \\/    M anipulation  | E-mail: franjo.juretic@c-fields.com            |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version  2.0;
    format    ascii;
    class    dictionary;
    location  "system";
    object    meshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

surfaceFile "7_KCS_Hull_Cylinder.ftr";

maxCellSize 0.7;

surfaceMeshRefinement
{

    insideSlider
    {
        additionalRefinementLevels  3;
        surfaceFile "5_KCS_Cylinder.ftr";
        refinementThickness 0.05;
    //cellSize 0.3;
    }

    Bow
    {
        additionalRefinementLevels 6;
        surfaceFile "3_KCS_Bow.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    }

    Stern
    {
        additionalRefinementLevels  6;   
        surfaceFile "1_KCS_Stern.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    }

    Rudder
    {
        additionalRefinementLevels  6;
        surfaceFile "4_KCS_Rudder.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    } 

    Center
    {
        additionalRefinementLevels  5;
        surfaceFile "2_KCS_Center.ftr";
        refinementThickness 0.05;
    //cellSize 0.1;
    } 
}


franjo_j June 2, 2015 09:01

Hello,

The are two ways of handling features in cfMesh, and these are:
1. Boundaries between two patches in the surface mesh.
2. By marking edges in the surface mesh as feature edges in the fms file.

You can generate it by using surfaceFeatureEdges utility. Please check the manual and the ship5415Octree example.

surfaceFeatureEdges <inputSurf> <outputSurf>.stl -angle 40 generates a new stl file with patches bounded by selected feature edges.

surfaceFeatureEdges <inputSurf> <outputSurf>.ftr -angle 30 generates a ftr file with patches bounded by selected feature edges.

surfaceFeatureEdges <inputSurf> <outputSurf>.fms generates a fms file with selected feature edges and leaves the patches intact.

-angle is optional.

You can export fms to vtk by using FMSToVTK or FMSToSurface, when you want to visualise it in ParaView.

Regards,

Franjo

prodo June 2, 2015 09:54

3 Attachment(s)
Thank you for your answer, Franjo.

I already solve this problem by using surfaceFeatureEdges utility

I was seperate Hull surface and Plane surface by small feature angle.

and then I can obatin much better mesh around the boundary like Fig.1 and 2

But, there is another problem from small feature angle

1. Due to small feature angle, It create many useless small surface. like Fig3

2. Also, I can't create boundary layer around Hull, It works only around outer circle and this is significant problem for me.

3. It is not working boundary layer for seperated surface?

Can you give me some tips for this problem?

Thank you

This is my meshDict
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | cfMesh: A library for mesh generation          |
|  \\    /  O peration    |                                                |
|  \\  /    A nd          | Author: Franjo Juretic                        |
|    \\/    M anipulation  | E-mail: franjo.juretic@c-fields.com            |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version  2.0;
    format    ascii;
    class    dictionary;
    location  "system";
    object    meshDict;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

surfaceFile "7_KCS_Hull_Cylinder.ftr";

maxCellSize 0.7;

//enforceGeometryConstraints 1;

/*
boundaryCellSize  1;
boundaryCellSizeRefinementThickness 50;

objectRefinements
{
    box
    {
    cellSize 0.005;
    type box;
    centre (3.12481351 0 -0.13085746);
    lengthX 0.5;
    lengthY 0.5;
    lengthZ 0.5;
    }
}
*/

boundaryLayers
{
//    nLayers 4;
//    thicknessRatio 1;
//    maxFirstLayerThickness 0.1;

    patchBoundaryLayers
    {
        "ascii_file_exported_from_Gridgen_82"        //outer
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }

        "ascii_file_exported_from_Gridgen_76"        //inner
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }

        "ascii_file_exported_from_Gridgen_83"        //slider
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }

        "ascii_file_exported_from_Gridgen_81"        //top
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }

        "ascii_file_exported_from_Gridgen_78"        //Rudder side
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }

        "ascii_file_exported_from_Gridgen_79"        //Rudder side
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }

        "ascii_file_exported_from_Gridgen_80"        //Rudder side
        {
            nLayers 3;
            thicknessRatio 1;
        maxFirstLayerThickness 0.1;
            allowDiscontinuity 1;
        }
    }
}
surfaceMeshRefinement
{

    insideSlider
    {
        additionalRefinementLevels  3;
        surfaceFile "5_KCS_Cylinder.ftr";
        refinementThickness 0.05;
    //cellSize 0.3;
    }
    Bow
    {
        additionalRefinementLevels 6;
        surfaceFile "3_KCS_Bow.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    }
   
    Center
    {
        additionalRefinementLevels  5;
        surfaceFile "2_KCS_Center.ftr";
        refinementThickness 0.05;
    //cellSize 0.1;
    } 
   
    Stern
    {
        additionalRefinementLevels  6;   
        surfaceFile "1_KCS_Stern.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    }

    Rudder
    {
        additionalRefinementLevels  8;
        surfaceFile "4_KCS_Rudder.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    } 

    Cap
    {
        additionalRefinementLevels  8;
        surfaceFile "9_KCS_Cap.ftr";
        refinementThickness 0.05;
    //cellSize 0.001;
    } 

}


franjo_j June 2, 2015 12:07

Hi,

Edge extraction may not be perfect when the surface mesh is not of good quality. You can play with the angle tolerance and find out what works best for your problem. Alternatively, you could try exporting the geometry as separate stl solids and merge them together into a single file.

I guess that you have a symmetry plane in your geometry. That is risky, and may merge the layer at the hull with the layer the symmetry plane.

There are rules how layers behave, and you can find read about them here: http://www.cfd-online.com/Forums/ope...rs-cfmesh.html

Regards,

Franjo

prodo June 10, 2015 21:34

Thank you for your answer, Franjo

As you say, i was seperate the geometry by small parts
and then, use surfaceFeatureEdges utility,
so, I can get the proper geomerty and .ftr files.
Finally, merged all surface by using surfaceAdd utility.

regards,

Gio Baila November 11, 2015 03:42

Hi guys,
thank you Franjo,
I guess I'm having the same kind of problem and I would like to summarize the correct procedure for ship hull meshing. Considering that the starting point is a boolean difference between the ship and the symmetric domain, you suggest to:
1- Separate by hand the complete .stl in order to have different files, each one with a patch;
2- Apply surfaceFeatureEdges to each single file and save the content as .ftr (why not fms?)
3- Merge the .ftr with surfaceAdd (in which format?? still ftr??)
4- Create the mesh

Is it correct?
Why even if you use directly the surfaceFeatureEdge on the complete .stl file and you have the different patches as you want, the normals on the symmetryPlane gets screwed up after the meshing process??

Ciao,
Giovanni


All times are GMT -4. The time now is 17:09.