CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[cfMesh] I can't create sharp edge mesh by cfMesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By franjo_j

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 1, 2015, 10:13
Default I can't create sharp edge mesh by cfMesh
  #1
New Member
 
Choi Hak Kyu
Join Date: Apr 2015
Posts: 12
Rep Power: 11
prodo is on a distinguished road
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;
    }   
}
Attached Images
File Type: png 스크린샷, 2015-06-01 16:54:58.png (84.8 KB, 415 views)
File Type: jpg 스크린샷, 2015-06-01 16:55:12.jpg (16.8 KB, 310 views)
File Type: jpg 스크린샷, 2015-06-01 21:57:07.jpg (16.5 KB, 285 views)
File Type: jpg 스크린샷, 2015-06-01 21:57:18.jpg (97.4 KB, 344 views)
prodo is offline   Reply With Quote

Old   June 2, 2015, 10:01
Default
  #2
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
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
namsivag likes this.
__________________
Principal Developer of cfMesh and CF-MESH+
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram
franjo_j is offline   Reply With Quote

Old   June 2, 2015, 10:54
Arrow
  #3
New Member
 
Choi Hak Kyu
Join Date: Apr 2015
Posts: 12
Rep Power: 11
prodo is on a distinguished road
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;
    }   

}
Attached Images
File Type: jpg Fig1.jpg (96.8 KB, 347 views)
File Type: png Fig2.png (27.9 KB, 234 views)
File Type: jpg Fig3.jpg (12.6 KB, 271 views)
prodo is offline   Reply With Quote

Old   June 2, 2015, 13:07
Default
  #4
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 124
Rep Power: 17
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
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
__________________
Principal Developer of cfMesh and CF-MESH+
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Facebook, Pinterest, Instagram
franjo_j is offline   Reply With Quote

Old   June 10, 2015, 22:34
Default
  #5
New Member
 
Choi Hak Kyu
Join Date: Apr 2015
Posts: 12
Rep Power: 11
prodo is on a distinguished road
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,
prodo is offline   Reply With Quote

Old   November 11, 2015, 04:42
Default
  #6
New Member
 
Giovanni
Join Date: Aug 2013
Location: La Spezia
Posts: 4
Rep Power: 13
Gio Baila is on a distinguished road
Send a message via Skype™ to Gio Baila
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
Gio Baila is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Skewness , Minimum Edge Length and Mesh Quality in FLuent ViLaks FLUENT 2 March 2, 2017 06:57
3D Airfoil with Sharp Trailing Edge - Mesh Help Toofanian CFD Freelancers 1 August 15, 2016 19:03
[ANSYS Meshing] 3D Airfoil with Sharp Trailing Edge - Mesh Help Toofanian ANSYS Meshing & Geometry 0 August 8, 2016 20:54
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 02:07


All times are GMT -4. The time now is 16:53.