CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [mesh manipulation] Converting a 2Dmesh to axisymmetric (https://www.cfd-online.com/Forums/openfoam-meshing/61473-converting-2dmesh-axisymmetric.html)

schmidt_d July 1, 2011 09:30

I am afraid that I cannot quite understand what you are asking. Do you mean "What other commands are involved in the process" ?

If you were starting from Gambit, for example, this is a three step process.
1) Convert your 2D Gambit mesh to OpenFOAM format
2) Convert the 2D mesh to a 1-cell deep axial mesh with makeAxialMesh
3) Use collapseEdges to remove the degenerate edges along the axis.

I'll quote from the wiki page about step #3.

"The collapseEdges utility should remove these degenerate edges (and the faces that go with it) and stitch the mesh together. For an application like this, you would want to use collapseEdges with a very small length scale argument and an angle argument near 180 degrees."

Regards,
DPS

louiza July 1, 2011 13:11

Hi gschaider,

Thank you very much for the website, I can access to this one :)

Thank's a lot

Gitesh P September 24, 2011 03:18

Hello Gschaider
 
Hello Gschaider,

I am new at OpenFoam environment. I would like to ask you that...Is it possible to switch axisymmetric BC in OpenFoam ?

BR,
Gitesh

amin144 April 22, 2012 04:14

Runing Test case step by step
 
Hello Dear Foamers:)
Especially Dear Bernhard;)

I want to run testCase and doing below steps:
(I think this thread need a post that describe process step by step like this:()

(My OF version: openFoam 1.5-dev)
1-Download files of utility and after Compile makeAxilMesh using "wmake all"---> well done
2-Download "testCase" files
3-Go to testCase Directory
4-Run "blockMesh"----> well done
5-Run "makeAxialMesh -axis movingWall -wede frontAndBack -overwrite" --->well done
6-Run "paraFoam" and can see wedge shape grid
7-Run "collapseEdges 0.0001 175 -overwrite" shows below message:


Create time

Create polyMesh for time = 0

Merging:
edges with length less than 0.0001 meters
edges split by a point with edges in line to within 175 degrees

Collapsing 21 small edges
Morphing ...
Collapsing 0 small edges
Collapsing 0 in line edges
Max face area:4.36194e-05
Collapse area factor:1e-09
Collapse area:4.36194e-14
Collapsing 0 small high aspect ratio faces
Writing collapsed mesh to time 0
End


8-Run "icoFoam" and it runs without any problem!

-----------------------------------------------------
-----------------------------------------------------
Queations:

1))Is my Steps all True? Isn't anything wrong?

2))What does this Case physically show ? Only a full closed cylinder whitout any flow?

3))Any body can mail me a test case for Flow in a simple axisymmetric pipe?
I will appreciat if anybody upload a pipe case for using everyone for test beside this simple and maybe unused case :(

-------------------------------------------------------
-------------------------------------------------------
shariatkhah@gmail.com

Thanks:)

gschaider April 23, 2012 19:31

Quote:

Originally Posted by amin144 (Post 356157)
Hello Dear Foamers:)
Especially Dear Bernhard;)

I want to run testCase and doing below steps:
(I think this thread need a post that describe process step by step like this:()

(My OF version: openFoam 1.5-dev)
1-Download files of utility and after Compile makeAxilMesh using "wmake all"---> well done
2-Download "testCase" files
3-Go to testCase Directory
4-Run "blockMesh"----> well done
5-Run "makeAxialMesh -axis movingWall -wede frontAndBack -overwrite" --->well done
6-Run "paraFoam" and can see wedge shape grid
7-Run "collapseEdges 0.0001 175 -overwrite" shows below message:


Create time

Create polyMesh for time = 0

Merging:
edges with length less than 0.0001 meters
edges split by a point with edges in line to within 175 degrees

Collapsing 21 small edges
Morphing ...
Collapsing 0 small edges
Collapsing 0 in line edges
Max face area:4.36194e-05
Collapse area factor:1e-09
Collapse area:4.36194e-14
Collapsing 0 small high aspect ratio faces
Writing collapsed mesh to time 0
End


8-Run "icoFoam" and it runs without any problem!

-----------------------------------------------------
-----------------------------------------------------
Queations:

1))Is my Steps all True? Isn't anything wrong?

2))What does this Case physically show ? Only a full closed cylinder whitout any flow?

3))Any body can mail me a test case for Flow in a simple axisymmetric pipe?
I will appreciat if anybody upload a pipe case for using everyone for test beside this simple and maybe unused case :(

-------------------------------------------------------
-------------------------------------------------------
shariatkhah@gmail.com

Thanks:)

If we're talking about the same case (the one in the SVN) then it is basically a driven cavity where the axis does not go through the edge of the geometry. Therefor collapsing is not needed (for that case)

tomloh April 27, 2012 00:37

Hello Foamers,

I am trying to use makeAxialMesh to convert mt 2D pipe into a 3D one. I'm using the steps listed below, I believe they are all correct?

01) Put rotationDict into the system
02) Run $ makeAxialMesh -axis center -wedge frontAndBack (This created a folder 1)
03) Backup constant/polyMesh into constant/polyMesh-2Dorg
04) $ mv 1/polyMesh constant/.
05) $ rm -rf 1
06) $ unset FOAM_SIGFPE
07) run $ collapseEdges 1e-8 180
08) Backup constant/polyMesh into constant/polyMesh-2DAxiorg
09) $ mv 1/polyMesh constant/.
10) $ rm -rf 1
11) checkMesh

When running checkMesh I get the following error and I'm not sure how to fix it.

Checking geometry...
Overall domain bounding box (0 0 0.47819) (25 0.5 0.52181)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 1)
Wedge frontAndBack_pos with angle 2.49748 degrees
***Wedge patch frontAndBack_pos not planar. Point (0.25 0.0717724 0.518679) is not in patch plane by 5.12279e-07 meter.
Boundary openness (1.66027e-20 0 -6.63727e-18) OK.
Max cell openness = 9.3096e-17 OK.
Max aspect ratio = 7.50424 OK.
Minumum face area = 0.00020772. Maximum face area = 0.0172689. Face area magnitudes OK.
Min volume = 5.193e-05. Max volume = 0.000363295. Total volume = 0.272622. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.330802 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

Any help or a push in the right direction would be helpful.

Thanks,
Tom

gschaider April 27, 2012 04:30

Quote:

Originally Posted by tomloh (Post 357338)
Hello Foamers,

I am trying to use makeAxialMesh to convert mt 2D pipe into a 3D one. I'm using the steps listed below, I believe they are all correct?

01) Put rotationDict into the system
02) Run $ makeAxialMesh -axis center -wedge frontAndBack (This created a folder 1)
03) Backup constant/polyMesh into constant/polyMesh-2Dorg
04) $ mv 1/polyMesh constant/.
05) $ rm -rf 1
06) $ unset FOAM_SIGFPE
07) run $ collapseEdges 1e-8 180
08) Backup constant/polyMesh into constant/polyMesh-2DAxiorg
09) $ mv 1/polyMesh constant/.
10) $ rm -rf 1
11) checkMesh

When running checkMesh I get the following error and I'm not sure how to fix it.

Checking geometry...
Overall domain bounding box (0 0 0.47819) (25 0.5 0.52181)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 1)
Wedge frontAndBack_pos with angle 2.49748 degrees
***Wedge patch frontAndBack_pos not planar. Point (0.25 0.0717724 0.518679) is not in patch plane by 5.12279e-07 meter.
Boundary openness (1.66027e-20 0 -6.63727e-18) OK.
Max cell openness = 9.3096e-17 OK.
Max aspect ratio = 7.50424 OK.
Minumum face area = 0.00020772. Maximum face area = 0.0172689. Face area magnitudes OK.
Min volume = 5.193e-05. Max volume = 0.000363295. Total volume = 0.272622. Cell volumes OK.
Mesh non-orthogonality Max: 0 average: 0
Non-orthogonality check OK.
Face pyramids OK.
Max skewness = 0.330802 OK.
Coupled point location match (average 0) OK.

Failed 1 mesh checks.

End

Any help or a push in the right direction would be helpful.

Thanks,
Tom

Have you tried checkMesh after MAM (makeAxialMesh) too? Just to make sure that the problem was not introduced by collapseEdges.

Also try this: if writeFormat in controlDict is set to ascii then try setting writePrecision to higher number (12 or so). Reset after the mesh manipulation

tomloh April 27, 2012 05:01

Hi Bernhard,

Thanks for your quick reply. I just ran checkMesh after MAM and I have the error as shown below. My writeFormat is ascii and I have tried changing the writePrecision from 6 up to 24.

Checking geometry...
Overall domain bounding box (0 0 0.478190306317332003427367) (25 0.5 0.521809693682668052083784)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 1)
Wedge frontAndBack_pos with angle 2.49762356858921519275896 degrees
Wedge frontAndBack_neg with angle 2.49762356858906953149813 degrees
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (4.17361820446499761229836e-21 0 -6.63727839475413910092676e-18) OK.
Max cell openness = 9.63289024144322500065237e-17 OK.
Max aspect ratio = 7.50427090517739259212249 OK.
***Zero or negative face area detected. Minimum area: 0
<<Writing 100 zero area faces to set zeroAreaFaces
Min volume = 0.000140685850519272698721726. Max volume = 0.00080548557824244697029431. Total volume = 0.333707879182710054344341. Cell volumes OK.
Mesh non-orthogonality Max: 87.4369863522491215235277 average: 17.0098551033114944175395
*Number of severely non-orthogonal faces: 87.
Non-orthogonality check OK.
<<Writing 87 non-orthogonal faces to set nonOrthoFaces
***Error in face pyramids: 187 faces are incorrectly oriented.
<<Writing 187 faces with incorrect orientation to set wrongOrientedFaces
***Max skewness = 7.96818897130483527746492, 98 highly skew faces detected which may impair the quality of the results
<<Writing 98 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 3 mesh checks.

End

Increasing the writePrecisioin to 12 reduce the failed mesh checks from 4 to 3, but further increases did not change anything. Could this be a fundamental problem with my 2D mesh?

Tom

gschaider April 27, 2012 05:43

Quote:

Originally Posted by tomloh (Post 357419)
Hi Bernhard,

Thanks for your quick reply. I just ran checkMesh after MAM and I have the error as shown below. My writeFormat is ascii and I have tried changing the writePrecision from 6 up to 24.

Checking geometry...
Overall domain bounding box (0 0 0.478190306317332003427367) (25 0.5 0.521809693682668052083784)
Mesh (non-empty, non-wedge) directions (1 1 0)
Mesh (non-empty) directions (1 1 1)
Wedge frontAndBack_pos with angle 2.49762356858921519275896 degrees
Wedge frontAndBack_neg with angle 2.49762356858906953149813 degrees
All edges aligned with or perpendicular to non-empty directions.
Boundary openness (4.17361820446499761229836e-21 0 -6.63727839475413910092676e-18) OK.
Max cell openness = 9.63289024144322500065237e-17 OK.
Max aspect ratio = 7.50427090517739259212249 OK.
***Zero or negative face area detected. Minimum area: 0
<<Writing 100 zero area faces to set zeroAreaFaces
Min volume = 0.000140685850519272698721726. Max volume = 0.00080548557824244697029431. Total volume = 0.333707879182710054344341. Cell volumes OK.
Mesh non-orthogonality Max: 87.4369863522491215235277 average: 17.0098551033114944175395
*Number of severely non-orthogonal faces: 87.
Non-orthogonality check OK.
<<Writing 87 non-orthogonal faces to set nonOrthoFaces
***Error in face pyramids: 187 faces are incorrectly oriented.
<<Writing 187 faces with incorrect orientation to set wrongOrientedFaces
***Max skewness = 7.96818897130483527746492, 98 highly skew faces detected which may impair the quality of the results
<<Writing 98 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 3 mesh checks.

End

Increasing the writePrecisioin to 12 reduce the failed mesh checks from 4 to 3, but further increases did not change anything. Could this be a fundamental problem with my 2D mesh?

Tom

15 digits is the maximum that makes sense (double-precision doesn't store more). The three "problems" are exactly what collapseEdges takes care of (the axis-patch "degenerated" to a collection of zero-area faces - that is the first error. The others are following from this)

The fourth error you're referring to is the "planar"-error in your original posting, right? And a subsequent collapseEdge should remove the other 3

tomloh April 27, 2012 19:17

Wooooooot!!! Everything works XD

Thanks Bernhard!

Tom

gschaider May 1, 2012 05:06

Quote:

Originally Posted by tomloh (Post 357580)
Wooooooot!!! Everything works XD

Thanks Bernhard!

Tom

Great. Could you add a few words about this (write precision and errors to be ecpected in checkMesh) to the Wiki-page of makeAxialMesh so that the knowledge is preserved for future generations?

lindstroem June 15, 2012 06:03

Hello Tom,

To support Bernhards post, could you please give some words about your adjustments?

Did you get rid of the "Wedge patch frontAndBack_pos not planar"-error by increasing the writePrecision? I get this error too, after MAM with write precision to 15.. But for me, this is the only error..

I get the error (from MAM)
Quote:

--> FOAM Warning : End points of axis ((0 1e-05 0) (0 1.00001 0)) are 2.49999999999977e-05 and 2.49999999999977e-05 away from plane (0 0 1) (0.00357141451220821 0.00188587665408491 2.49999999999977e-05)
Radius to axis: min = 2.49999999999977e-05 max = 0.0100100312187325
Calculated Distance of left to axis is 2.6090484684131e-05
and then checkMesh reports
Quote:

***Wedge patch frontAndBack_pos not planar. Point (5e-05 0 2.74383978821424e-05) is not in patch plane by 9.27864137950134e-07 meter.
Thanks!

gschaider June 15, 2012 08:48

Quote:

Originally Posted by lindstroem (Post 366624)
Hello Tom,

To support Bernhards post, could you please give some words about your adjustments?

Did you get rid of the "Wedge patch frontAndBack_pos not planar"-error by increasing the writePrecision? I get this error too, after MAM with write precision to 15.. But for me, this is the only error..

I get the error (from MAM)
and then checkMesh reports
Thanks!

The problem here is that MAM assumes that the axis is centrally aligned to the original mesh in respect to the "ignored" coordinate (the one where only one cell layer eists). Otherwise you will get an asymetric wedge (faces are collapsed towards the axis) - have a look in paraview and you'll see what I mean. Either move the mesh (in your case preferable) or the axis so that this requirement is satisfied.

lindstroem June 15, 2012 08:56

Hi Bernhard,

thanks for your comment.
i tried that too, but then I am getting a floating Point Exception in checkMesh, although the mesh "looks good" in paraview.. I keep on digging where it comes from, but maybe it wont work for my mesh..

gschaider June 15, 2012 17:12

Quote:

Originally Posted by lindstroem (Post 366660)
Hi Bernhard,

thanks for your comment.
i tried that too, but then I am getting a floating Point Exception in checkMesh, although the mesh "looks good" in paraview.. I keep on digging where it comes from, but maybe it wont work for my mesh..

Have you removed the faces of size 0 with collapseEdges? But even then checkMesh shouldn't crash

lindstroem June 18, 2012 05:29

Hi Berhnhard,

I think the error came due to an inconsistency with the boundary definitions in the poly Mesh..
After some tries with the parameters for collapsEdges it seems that there is no error anymore.. can't believe it yet ;)

Thanks!

vahid.najafi August 3, 2012 03:25

plz help me
 
Hi dear Bernhard Gschaider!

I used 2Daxisymmetric for openFoam,and for this used makeAxialmesh and coolapseEdge to make wedge type for boundary.
I make it,
but my result after run is not correct and differrent with 3Dmodel.

if what i did in modelling 2DAxisymetric is not correct please tell me???
Thanks a lot.

vahid.najafi August 6, 2012 04:36

plz help me???
 
4 Attachment(s)
dear Foamers.
I have used 2Daxisymmetric for openFoam.
for this reason used :
1)makeAxialMesh -axis axis.4 -wedge frontAndBackPlanes
2)collapseEdges 1e-8 180
to make wedge type for boundary.

after do above,added for me 2 files.(seen in pic 1)

I have copied polyMesh from file:2e-08 to polyMesh in constant(seen in pic 2),and then I have deleted files: 1e-08 and 2e-08 .(seen in pic 3)

and after those I have correct B.C in file:0.
Then run paraFoam and (seen pic 4)
Is it my way true???


but my result after run is not correct and differrent with 3Dmodel.
if my work in modelling 2DAxisymetric is not correct please tell me???

Thanks for your attention:)

gschaider August 6, 2012 19:01

Quote:

Originally Posted by vahid.najafi (Post 375545)
dear Foamers.
I have used 2Daxisymmetric for openFoam.
for this reason used :
1)makeAxialMesh -axis axis.4 -wedge frontAndBackPlanes
2)collapseEdges 1e-8 180
to make wedge type for boundary.

after do above,added for me 2 files.(seen in pic 1)

I have copied polyMesh from file:2e-08 to polyMesh in constant(seen in pic 2),and then I have deleted files: 1e-08 and 2e-08 .(seen in pic 3)

and after those I have correct B.C in file:0.
Then run paraFoam and (seen pic 4)
Is it my way true???


but my result after run is not correct and differrent with 3Dmodel.
if my work in modelling 2DAxisymetric is not correct please tell me???

Thanks for your attention:)

The way you do it looks alright and the geometry definitely looks wedgy. By using the -overwrite-option you can avoid the copying business.

In which way do the results differ?

vahid.najafi August 7, 2012 02:44

Thanks.
 
Hi Bernhard Gschaider.
Thanks for your answer Bernhard,My problem was solved.
thanks alot.


All times are GMT -4. The time now is 06:41.