CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] 2D Cylinder mesh problems with Snappy

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 27, 2011, 12:16
Default
  #21
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 15
onyir is on a distinguished road
Right now I'm not at work so I can't post it, but I can tell it fails with an error of different areas in faces of cells on the boundary of the processors. Something like
"face # area does not match neighbour # by %"
onyir is offline   Reply With Quote

Old   April 27, 2011, 12:23
Default
  #22
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Sounds like a boundary mismatch. Anyway, post it when you have a chance.
ziad is offline   Reply With Quote

Old   April 27, 2011, 13:52
Default
  #23
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 15
onyir is on a distinguished road
I don't get what you mean by "boundary mismatch".
If I run the case without decomposing it, it runs without any errors.
If I run it decomposing it first, it gives the error you can see in the log attached.
Thanks.
Attached Files
File Type: gz case.gz (15.4 KB, 27 views)
onyir is offline   Reply With Quote

Old   April 27, 2011, 16:06
Default
  #24
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
I ran it serial and it went okay except for some weird faces in your borde_ataqe and borde_salida regions. The ones in the jpg are for the trailing edge on the Front plane. There area few others. I think they are not connecting properly with their equivalent faces between the Front and Back planes. Their general location corresponds to the error reported in your log file.

There are some warnings in your log file regarding possible wedges between the Front and Back planes as well. Might be related...
Code:
--> FOAM Warning : 
    From function twoDPointCorrector::twoDPointCorrector(const polyMesh& mesh, const vector& n)
    in file twoDPointCorrector/twoDPointCorrector.C at line 168
    The number of points in the mesh is not equal to twice the number of edges normal to the plane - this may be OK only for wedge geometries.
    Please check the geometry or adjust the orthogonality tolerance.
Anyway, not sure why it's happening and I haven't used snappy for 4-5 months now but it wouldn't hurt to keep things simple and use one refinement box for the entire airfoil. Make sure it extends well beyond the airfoil, like a couple chord lengths or more. It's only 2D after all and a few thousand cells more won't matter if you can keep your mesh clean.

Oh yeah, the trailing edge is warped too in the z direction but this won't matter once you extrude as per the procedure I suggested above. It's the snappy bug for CAD edges but apparently they fixed it in the next release.
Attached Images
File Type: jpg faces-tail.jpg (88.9 KB, 114 views)
ziad is offline   Reply With Quote

Old   April 28, 2011, 11:31
Default
  #25
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Ran it in parallel and snappyHexMesh finishes similarly to the serial run. The mesh also fails two checkMesh tests in both serial and parallel.

Code:
***Number of edges not aligned with or perpendicular to non-empty directions: 38872
***Max skewness = 5.30239, 32 highly skew faces detected which may impair the quality of the results
ziad is offline   Reply With Quote

Old   April 28, 2011, 11:39
Default
  #26
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 15
onyir is on a distinguished road
How did you run it in parallel?
I always get the same error. I've tried a few combinations, even without the boxes and always fails.
onyir is offline   Reply With Quote

Old   April 28, 2011, 11:47
Default
  #27
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
  1. decomposePar
  2. mpirun -np 2 snappyHexMesh
  3. checkMesh
ziad is offline   Reply With Quote

Old   April 28, 2011, 11:53
Default
  #28
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 15
onyir is on a distinguished road
I think you have to do
mpirun -np snappyHexMesh -parallel
so it really runs it in parallel.
Am I wrong?
onyir is offline   Reply With Quote

Old   April 28, 2011, 12:07
Default
  #29
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
That's how I run all my OF executables in parallel for OpenMPI. Use it and you'll see that it works. I just tried the -parallel option and it failed like it did for you. They provide this option in the user guide for 1.7.x but I am not sure when it was introduced. Personally I never used it. You might want to search the forum on this topic.

Anyway, both parallel and serial checkMesh fail so the problem is in the specific settings at the leading/trailing edges. I am not sure but I think I've seen something like this a few months ago with snappy when preparing the 2D procedure. A simpler refinement box around the entire airfoil and extending to the exit plane could work better.
ziad is offline   Reply With Quote

Old   April 28, 2011, 12:26
Default
  #30
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
By the way you don't have to reconstruct your parallel case anymore. Just process it as you would a serial run. That part of the user guide is outdated.

Definitely skip the -parallel option. It might actually be the (very) old way of doing things.
ziad is offline   Reply With Quote

Old   April 28, 2011, 12:48
Default
  #31
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 15
onyir is on a distinguished road
That way you don't to decompose your case either. I don't think that's the right way of doing it.
http://www.cfd-online.com/Forums/ope...-parallel.html
onyir is offline   Reply With Quote

Old   April 28, 2011, 12:54
Default
  #32
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
It's up to you. All I can tell you is that -parallel is not needed and it's been a while that you don't have to reconstruct your case anymore. Used to be like that with the older parallel implementation but not anymore.

Wouldn't hurt to try it
ziad is offline   Reply With Quote

Old   April 28, 2011, 13:11
Default
  #33
New Member
 
RDG
Join Date: Feb 2011
Posts: 29
Rep Power: 15
onyir is on a distinguished road
Ok, I just tried and it does not work the way you say.
It takes the same time to perform, and twice the ram. It is say doing both processors perform the same case.
It even works without decomposing.
onyir is offline   Reply With Quote

Old   April 28, 2011, 14:32
Default
  #34
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Oops my bad! Just checked our execution scripts and it is implemented with the -parallel option.

Last edited by ziad; April 29, 2011 at 15:51.
ziad is offline   Reply With Quote

Old   July 19, 2011, 02:17
Default
  #35
Member
 
Ben Vernieres
Join Date: Jul 2011
Location: Valencia, Spain
Posts: 42
Rep Power: 14
bouclette is on a distinguished road
Send a message via Skype™ to bouclette
Hi all,

I've been reading through this topic and practicing a bit on the method discribed by Ziad but I struggle to understand one thing:

In order to create the 2D mesh starting from a sHM mesh, we need to make a 3D mesh with the face of interest that has sufficiently enough cells to be usefull to us.

So for example, in my case, I need to mesh a foil section with about 4M cells to obtain a mere 140k cells once 2d'ed.

Am I missing something there or is is there a way to avoid spending a fair bit of time making a big mesh to get a dumb coarse 2D mesh?

Thanks,
bouclette is offline   Reply With Quote

Old   January 4, 2012, 09:57
Default extrudeMesh
  #36
New Member
 
Nick
Join Date: Dec 2011
Posts: 11
Rep Power: 14
Verfblikje is on a distinguished road
The method for me does not seem to work. I have tried to find a solution. To no avail. The problem is as follows:
I am trying to model a multi element wing cross section. First I create the blockMesh and run sHM in parallel. Subsequently I use reconstructParMesh to view it in paraview. In paraview it looks good. Then I copy the polyMesh directory from time3 to constant and I run extrudeMesh. However it does not create new patches. Needless to say, autoPatch does not work either.
My model is in the y-z plane. However I don't quite understand how to edit the extrudeMeshDict so that it works. (I am assuming this is the same file as the extrudeProperties file posted by ziad?) I did try several combinations of the wedge properties, but this did not help. Any thoughts?

Thanks in advance,

Nick
Verfblikje is offline   Reply With Quote

Old   January 4, 2012, 17:03
Default OpenFOAM version
  #37
New Member
 
Nick
Join Date: Dec 2011
Posts: 11
Rep Power: 14
Verfblikje is on a distinguished road
Apologies I forgot to mention OF and ubuntu version. I am running OF 2.01 (I think, the latest version in the ubuntu software center) and Ubuntu 11.04.
Verfblikje is offline   Reply With Quote

Old   June 4, 2012, 15:49
Default
  #38
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Quote:
Originally Posted by ziad View Post
Hi Daniel,

I finally got to spend some time on this and figured out how to do it using only OpenFoam tools. The procedure outline is the following but does not require splitMesh:

  1. run blockMesh: to get the mesh bounding box.
  2. run snappyHexMesh -overwrite: to get the full mesh in the constant/polyMesh directory.
  3. run extrudeMesh: on boundary front by a positive distance, the sign of the outward normal to this boundary. I used delta_z = 1.0 from the original z = 0.1 plane. The extrudeProperties dictionary is provided and should reside in the constant directory. It will create 3 patches, originalPatch (the original front patch in plane z = 0.1), otherSide (extruded front patch now in plane z=1.1), and sides. The last one, sides, consists of the extrusions of the bounding curves of the original front. Therefore it includes the extrusions of inlet, exit, top, bottom and airfoil. These will be separated next.
  4. run autoPatch 90: where 90 is the feature angle to search for and the actual angle between the parts of sides and the other two patches. You will get 7 additional patches named auto0 to auto6. The original three patches from the extrusion process now have 0 faces in them in the constant/polyMesh/boundary file and the total boundary number is 10 right after the file header. Edit the constant/polyMesh/boundary file, remove the sections pertaining to the original 3 extrusion boundaries, and adjust the total number of boundaries to 7. You might want to rename the boundaries from auto* to more meaningful names such as inlet, exit, airfoil, etc. I've provided my final boundary file from that step as well for reference.
The following 3 steps are optional. Use them if you want to divide the airfoil in parts (slats, flaps, whatever...):
    1. run faceSet: now we want to extract the faces from the airfoil patch and put them in a new face set, f0, in order to separate the flap in the next step. Here we use options "action new" and patchToFace. These are commented in the provided faceSetDict file which should reside in the system folder.
    2. run faceSet: now we want to extract the flap part from the existing face set f0, so we use options "action subset" and boxToFace where the specified box should enclose the face centres of the flap part of the airfoil. I picked the last delta-x = 0.4 therefore my box extends from x = 0.6 to x = 1 (yeah I know, that's a ridiculously huge flap ). faceSet will now use the existing set f0 after creating a backup to f0_old. After the command finishes f0 will only have flap faces in it.
    3. run createPatch: this is the last step where we create the flap patch from face set f0. You'll need the createPatchDict file (provided) which should reside in the system folder. We need to use options "constructFrom set" and "set f0" in the patchInfo section. Note that createPatch will also adjust the entire mesh and remove any boundaries that might end up with 0 faces in them. The final mesh will be in folder 1/polyMesh. You can have it written directly in constant/polyMesh by using the -overwrite flag.
That's it! It looks lengthy because of all the explanations but it's really not that bad.
It got soooo much easier with 2.1.x. Just tried the new version of extrudeMesh and if you specify "constructFrom patch;" then the utility sorts out all the boundary patches for you. Here is an example extrudeMeshDict below...

Code:
// What to extrude:
//      patch   : from patch of another case ('sourceCase')
//      mesh    : as above but with original case included
//      surface : from externally read surface

//constructFrom mesh; USE THIS TO EXTEND A 3D MESH BY EXTRUSION. MESHES ARE AUTOMATICALLY STITCHED TOGETHER!!!
constructFrom patch;

// If construct from patch/mesh:
sourceCase "./";
sourcePatches (floor);
// If construct from patch: patch to use for back (can be same as sourcePatch)
exposedPatchName floor;

// Flip surface normals before usage.
flipNormals false;

//- Linear extrusion in point-normal direction
extrudeModel        linearNormal;

nLayers             30;

expansionRatio      1.0;    //0.9;

linearNormalCoeffs
{
    thickness       0.3;
}

// Do front and back need to be merged? Usually only makes sense for 360
// degree wedges.
mergeFaces false;   //true;

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Edit: posted the wrong extrudeMeshDict file that actually applies to extending a 3D mesh by patch extrusion.

Last edited by ziad; June 5, 2012 at 02:00.
ziad is offline   Reply With Quote

Reply

Tags
2d mesh, airfoil, cylinder, extrudemesh, snappyhexmesh


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
[snappyHexMesh] Help with Snappy: no layers growing GianF OpenFOAM Meshing & Mesh Conversion 2 September 23, 2020 08:26
[snappyHexMesh] Snappy Hex Mesh - issue with smoothness of the model edges olek.warc OpenFOAM Meshing & Mesh Conversion 1 August 31, 2018 11:31
[snappyHexMesh] Snappy Hex Mesh Generation: error preventing the .eMesh file generation. Mariana Garcia OpenFOAM Meshing & Mesh Conversion 1 January 7, 2016 04:24
[snappyHexMesh] Layers:problem with curvature giulio.topazio OpenFOAM Meshing & Mesh Conversion 10 August 22, 2012 09:03
Ugly mesh around cylinder rks171 STAR-CCM+ 4 May 9, 2012 14:35


All times are GMT -4. The time now is 08:02.