CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Open Source Meshers: Gmsh, Netgen, CGNS, ...

Problem CfMesh 2D Mesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Clmkite

Reply
 
LinkBack Thread Tools Display Modes
Old   September 23, 2015, 16:35
Default Problem CfMesh 2D Mesh
  #1
New Member
 
Clement Mtrl
Join Date: Apr 2014
Posts: 13
Rep Power: 4
Clmkite is on a distinguished road
Hi,

I'm trying to mesh a car with cfMesh in 2D but I experience some problems.
Here is the geometry :

https://drive.google.com/file/d/0B0-...ew?usp=sharing
https://drive.google.com/file/d/0B0-...ew?usp=sharing

Here is my meshDict :

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                |
| \\      /  F ield         | OpenFOAM GUI Project: creativeFields           |
|  \\    /   O peration     | Version:  0.8.9.0                                  |
|   \\  /    A nd           | Web: www.c-fields.com                                       |
|    \\/     M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

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

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

surfaceFile    "caronly3.ftr";

maxCellSize    100;
minCellSize     80;
//boundaryCellSize 200;

surfaceFile    "caronly3.ftr";


localRefinement
{
car
{
cellSize 50;
}
}

objectRefinements
{
box
{
type box;
cellsize 100;
centre (15000 3000 5);
lengthX 20000;
lengthY 5500;
lengthZ 10;
}
}


boundaryLayers
{
 patchboundaryLayers
 {
  car
   {   
    nLayers         10;
    thicknessRatio  1.2;
    maxFirstlayrThickness 0.01;
   }
 }
}
In fact I have 2 problems,
When the ratio between maxCellSize and minCellSize is too large I have the following error :

Code:
--> FOAM FATAL ERROR: 
This cannot be a 2D mesh

    From function void polyMeshGen2DEngine::findZMinOffsetPoints()
    in file utilities/meshes/polyMeshGen2DEngine/polyMeshGen2DEngine.C at line 174.

FOAM exiting
When the ration between maxCellSize and boundaryCellSize is too big I have this one :
Code:
Octree nodes 37794
Resizing points!
Segmentation fault (core dumped)
And it seems quite important to have a big ratio to reduce the number of cells far from the car.

My second problem is that my localRefinement / objectRefinements / boundaryLayers are completely ignored by the program (cartesian2DMesh).

At this point I didn,t find my answers anywhere...

Thanks a lot
Clmkite is offline   Reply With Quote

Old   September 27, 2015, 10:29
Default
  #2
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 106
Rep Power: 8
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hello,

The case did not produce the expected results because of some incorrect settings (mainly typos), and the crash was due to some bugs in the 1.1 version. Please upgrade to the 1.1.1 version available at SourceForge. We have resolved some problems reported by the people using the 2D mesher.
Please check the attached case and please let me know if it generates the required result.
There are a few suggestions that I would like to point out:
1. When you generate the features via surfaceFeatureEdges and export the results into an stl or an ftr file, it changes the names of the patches in the surface mesh. You need to use the new names for meshing or simply use the regular expressions. A non-existent patch name in meshDict results in the region being ignored.
2. Please pay attention to use the correct keywords. The settings are case-sensitive so you cannot use cellsize, it has to be cellSize. The same problem is with patchboundaryLayers, it shall be patchBoundaryLayers. This has caused the problem that box refinement region was ignored, and there was only one boundary layer.

I hope that this helps you.

Regards,

Franjo
Attached Files
File Type: zip case.zip (14.1 KB, 12 views)
__________________
Principal Developer of cfMesh
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Old   September 28, 2015, 11:17
Default
  #3
New Member
 
Clement Mtrl
Join Date: Apr 2014
Posts: 13
Rep Power: 4
Clmkite is on a distinguished road
Hi Franjo,

Thanks for your answer.
I did upgrade myversion and since I didn't encounter my first error.
And you were right about my typo because now it works much better
It's not so long that I work in linux environnement and not used to take care so much of the typo !!!

Howevers I get a mesh loonking like I want (cf pictures).
My checkMesh is not really good and I don't really know how to play with parameters in order to get good quality mesh (I tried optimiseLayer but I didn't find may informations about it).

My MeshDict

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                |
| \\      /  F ield         | OpenFOAM GUI Project: creativeFields           |
|  \\    /   O peration     | Version:  0.8.9.0                                  |
|   \\  /    A nd           | Web: www.c-fields.com                                       |
|    \\/     M anipulation  |                                                |
\*---------------------------------------------------------------------------*/

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

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

surfaceFile	"caronly1.stl";


maxCellSize	600;
minCellSize     6;
boundaryCellSize 350;
boundaryCellSizeRefinementThickness 400;

localRefinement
{
car {cellSize 30;refinementThickness 200;}
}

objectRefinements
{
becquet {type sphere;cellSize 0.5;centre (10013 1732 5);radius 6;}
box1 {type box;cellSize 80;centre (11000 1300 5);lengthX 12500;lengthY 2600;lengthZ 20;}
box2 {type box;cellSize 200;centre (15000 2200 5);lengthX 25000;lengthY 4400;lengthZ 20;}
box3 {type box;cellSize 400;centre (25000 2500 5);lengthX 45000;lengthY 5000;lengthZ 20;}
}

boundaryLayers
{
 patchBoundaryLayers
 {
  car {nLayers 30;thicknessRatio 1.2;maxFirstLayerThickness 0.01;}
 }

optimiseLayer 1; // activates layer optimisation

// optional parameters
optimisationParameters
{
// number of iterations in the procedure for reducing normal-variation
nSmoothNormals 30;

// max number of total iterations
maxNumIterations 50;

// feature size factor. Reasonable range <0.2, 0.5>
// lower values force thinner layers
featureSizeFactor 0.3;

// shall the normal vectors be recalculated
reCalculateNormals 1;

// relative thickess variation between two hair nSmoothNormals
// lower value produce thinner and more uniform layers
relThicknessTol 0.01;
}
}
chekcMesh results

Code:
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.4.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : 2.4.0-f0842aea0e77
Exec   : checkMesh
Date   : Sep 28 2015
Time   : 11:04:32
Host   : "clement-desktop"
PID    : 2742
Case   : /home/clement/OpenFOAM/clement-2.4.0/run/etude/caronly
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           244808
    internal points:  0
    faces:            479164
    internal faces:   237537
    cells:            118920
    faces per cell:   6.02675
    boundary patches: 7
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     116196
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     2724
    Breakdown of polyhedra by number of faces:
        faces   number of cells
            7   2269
            8   453
            9   2

Checking topology...
    Boundary definition OK.
 ***Total number of faces on empty patches is not divisible by the number of cells in the mesh. Hence this mesh is not 1D or 2D.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
                   Patch    Faces   Points                  Surface topology
                     car     2983     5966  ok (non-closed singly connected)
                   inlet       40       82  ok (non-closed singly connected)
                  ground      556     1114  ok (non-closed singly connected)
                     top      168      338  ok (non-closed singly connected)
                  outlet       40       82  ok (non-closed singly connected)
        bottomEmptyFaces   118920   122404  ok (non-closed singly connected)
           topEmptyFaces   118920   122404  ok (non-closed singly connected)

Checking geometry...
    Overall domain bounding box (0 0 0) (50000 12000 10)
    Mesh (non-empty, non-wedge) directions (0 0 0)
    Mesh (non-empty) directions (0 0 0)
 ***Number of edges not aligned with or perpendicular to non-empty directions: 291712
  <<Writing 212922 points on non-aligned edges to set nonAlignedEdges
    Boundary openness (3.33116e-20 4.09695e-20 4.28121e-14) OK.
 ***Open cells found, max cell openness: 1, number of open cells 1761
  <<Writing 1761 non closed cells to set nonClosedCells
 ***Zero or negative face area detected.  Minimum area: 0
  <<Writing 14895 zero area faces to set zeroAreaFaces
 ***Zero or negative cell volume detected.  Minimum negative volume: -0.0445, Number of negative volume cells: 4766
  <<Writing 4766 zero volume cells to set zeroVolumeCells
    Mesh non-orthogonality Max: 179.145 average: 34.9415
   *Number of severely non-orthogonal (> 70 degrees) faces: 26886.
 ***Number of non-orthogonality errors: 10474.
  <<Writing 37360 non-orthogonal faces to set nonOrthoFaces
 ***Error in face pyramids: 5229 faces are incorrectly oriented.
  <<Writing 4902 faces with incorrect orientation to set wrongOrientedFaces
 ***Max skewness = 8.75e+150, 6824 highly skew faces detected which may impair the quality of the results
  <<Writing 6824 skew faces to set skewFaces
    Coupled point location match (average 0) OK.

Failed 7 mesh checks.

End
Thanks again because I try cfMesh and sHM and I was about giving up on cfMesh whereas now I found it powerful and very efficient (if I can fix quality).
Attached Images
File Type: png 1.png (19.1 KB, 37 views)
File Type: png 2.png (37.3 KB, 34 views)

Last edited by Clmkite; September 28, 2015 at 14:09.
Clmkite is offline   Reply With Quote

Old   September 28, 2015, 14:30
Default
  #4
New Member
 
Clement Mtrl
Join Date: Apr 2014
Posts: 13
Rep Power: 4
Clmkite is on a distinguished road
I found the utility improveMeshQuality
in the userguide but is it possible to constrain it with qulity criteria instead of numbers of iterations ?

Is it normal to get the kind of results I attached after using improveMeshQuality ?

Thx a lot
Attached Images
File Type: jpg 3.jpg (153.7 KB, 30 views)
Clmkite is offline   Reply With Quote

Old   September 28, 2015, 17:14
Default
  #5
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 106
Rep Power: 8
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Hi,

Can you please post the content of your controlDict? Do you save the mesh in the binary format? Can you please post the log of cartesian2DMesh?
It seems to me that the thickness of the first layer is smaller than the floating-point tolerance. Please increase the number of digits saved in a file or set the writeFormat to binary.

Quote:
Originally Posted by Clmkite View Post
I found the utility improveMeshQuality
in the userguide but is it possible to constrain it with qulity criteria instead of numbers of iterations ?
Not yet, we are working on that. It will be available in the next couple of days.

Quote:
Originally Posted by Clmkite View Post
Is it normal to get the kind of results I attached after using improveMeshQuality ?
Thx a lot
Your boundary layers are extremely thin and the algorithm is not designed to handle that.
__________________
Principal Developer of cfMesh
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Old   September 29, 2015, 09:48
Default
  #6
New Member
 
Clement Mtrl
Join Date: Apr 2014
Posts: 13
Rep Power: 4
Clmkite is on a distinguished road
Hi Franjo,

Thanks for everything,
In fact I changed my wall function so I increase my first layer thickness and everything went well !
For next time I sill remember what you've said but how can I choose the writeFormat (just change ascii to binary in the header ?)

It's really great to have the support of the developer while discovering this great tool
franjo_j likes this.
Clmkite is offline   Reply With Quote

Old   September 29, 2015, 12:44
Smile
  #7
Senior Member
 
Franjo Juretic
Join Date: Aug 2011
Location: Velika Gorica, Croatia
Posts: 106
Rep Power: 8
franjo_j is on a distinguished road
Send a message via Skype™ to franjo_j
Quote:
Originally Posted by Clmkite View Post
Hi Franjo,

Thanks for everything,
In fact I changed my wall function so I increase my first layer thickness and everything went well !
For next time I sill remember what you've said but how can I choose the writeFormat (just change ascii to binary in the header ?)
Yes, all you need is:
writeFormat binary;

My suggestion is to use the binary format because it does not lose information, that is extremely important for very thin layers. In addition, it also saves disk space.

Quote:
Originally Posted by Clmkite View Post
It's really great to have the support of the developer while discovering this great tool
Thank you! Happy meshing !
__________________
Principal Developer of cfMesh
www.cfmesh.com
Social media: LinkedIn, Twitter, YouTube, Google+, Facebook, Pinterest
franjo_j is offline   Reply With Quote

Reply

Tags
boundarylayers, cfmesh, refinement

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Overset MESH problem DFBI 6DOF Ale85 STAR-CCM+ 0 October 1, 2013 12:25
[ICEM] ICEM Structured Mesh Problem OMJT ANSYS Meshing & Geometry 3 March 22, 2013 11:06
[GAMBIT] SOFC crossflow mesh possible problem??? epc1 ANSYS Meshing & Geometry 1 February 4, 2013 02:57
snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Native Meshers: snappyHexMesh and Others 2 March 27, 2011 21:11
Dynamic Mesh Problem. Tom Clark FLUENT 9 July 7, 2010 07:56


All times are GMT -4. The time now is 12:22.