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] 2D Axisymmetric Model in OpenFOAM 4.0 (https://www.cfd-online.com/Forums/openfoam-meshing/186049-2d-axisymmetric-model-openfoam-4-0-a.html)

m_ridzon April 9, 2017 08:21

2D Axisymmetric Model in OpenFOAM 4.0
 
I have two questions about modelling 2D axisymmetric flows in OpenFOAM 4.0 in Linux.

1) I recently learned about the following website which contains a utility to take a mesh and collapse it into a wedge thereby preparing it for an axisymmetric simulation. The header of the website states the valid versions, but stops at v2.0. Does anybody know if this utility works with v4.0?
http://openfoamwiki.net/index.php/Contrib_MakeAxialMesh

2) I understand that the aforementioned utility takes a mesh and collapses one side to form a wedge. But that web page, nor that OpenFOAM User Manual Sec 5.3.3 (https://cfd.direct/openfoam/user-gui...25-1830005.3.3) indicate what the starting size of the block should be before collapsing. In other words, using the lid-driven-cavity tutorial from the User Manual, its Z thickness is 0.1m. Collapsing this will produce a wedge of a certain angle. However, if the Z thickness instead started at some other arbitrary number (e.g., 2.0m), the resulting wedge angle will be different after collapsing. So presumably, the wedge angle will have an effect on the simulation, correct? If so, what should the wedge angle be?

Thanks,
M Ridzon

Tobi April 12, 2017 14:37

Hi Ridzon,

I checked the site you mentioned and I guess it is very out dated. For 2D mesh generation you can extrudeMesh utility that come with OpenFOAM. Tutorials for 2D meshes are given in my website.

The second question is related to - how the mesh is extruded. Normally we extrude from the x, y, or z axis (starting from origin). If the plane you want to extrude is not aligned with these corresponding planes (origin point and vector x, y, z), the resulting mesh is different. So if you want to make a 2D wedge mesh, you should put the patch that should be extruded to one of the origin's planes. However, maybe it is not necessary anymore and we can specify some alternative origin for extruding (just check the extrudeMeshDict).

Good luck and I hope I got your question right (especially the second one).

m_ridzon April 12, 2017 16:46

1 Attachment(s)
Tobi,

Thanks for your response, but I'm not sure you understood my second question. Please see the attached thumbnail with my example. In it, I illustrated two examples where I'm collapsing in the XZ plane. In the first scenario, the Z dimension of the block is 0.4, while in the second scenario, the Z dimension is 0.6. After collapsing, this produces wedges of different angles; alpha = 21.8° in the first and 31.0° in the second. So by merely changing the Z dimension of the original block, the wedge changed shaped. How does the software know how to deal with this? Or is there a requirement that the wedge always collapse to a specified angle (e.g., 5 degrees) thus forcing the user to ensure the initial Z dimension is appropriate to achieve that specified angle upon collapsing? Or does the software not care what angle the wedge has?

Thanks again!
M Ridzon

wouter April 12, 2017 17:12

hello m_ridzon,
As far as I know the third dimension is ignored, so in your case only xy plane is used than a 5 deg wedge is made with this plane. But as Tobi describes the z plane will become the axis of the wedge.

Hope this helps
Wouter

piu58 April 13, 2017 00:35

The resulting angel may be configured in system.rotataionDict->wedgeAngle

The z coordinate will be ignored.

Tobi April 13, 2017 03:05

Hi all,

I just want to complete the not 100% correct things here and want to sum up:
  • The angle should be 5° (as Wouter said for 2D); checkMesh will tell you the angle
  • The angle can be adjusted in the extrudePatchDict (I am talking always about the latest Foundation FOAM version, maybe the extend version is different and Uwe refers to this version)
  • The z-direction will not be neglected in a way one expect while using the word neglected; only the treatment of the faces at the patches is different. FOAM uses FVM, so we need 3D volume elements. The empty or wedge patches are then treat the 3D case in a special manner to enable 2D and 1D analyzes (maybe you can say ignoring but I guess this expression is not the best choice; people might be confused why we even use a 3D mesh for 2D simulations); even in 1D simulations we need a 3D mesh based on the FVM

m_ridzon April 13, 2017 09:17

Thanks folks! Yes, I'm using the Foundation FOAM version 4.0. I haven't messed with the Extend version at all.


This is very interesting and I'm glad I asked. Unless I missed it, I was unable to find this tiny, but vital detail in the User Manual.
Quote:

The angle should be 5° (as Wouter said for 2D); checkMesh will tell you the angle
Suppose you didn't otherwise know and had a 10° wedge, then how would you know that the wedge must instead be 5°? I understand checkMesh will reveal the angle, but does it also alert you to it needing to be precisely 5°? Or does the solver alert you if it's not 5°?

Thanks again!
M Ridzon

piu58 April 17, 2017 02:51

> Or does the solver alert you if it's not 5°?

I am not quite sure about this, but I assume that the wedge boundary condition is elaborated for this angle.

tareqkh April 21, 2017 15:58

Hi,

Typical wedge angle would be according the CFD community <5 degrees. I used before different wedge angle i.e 10, 15, and 25 degrees to see how the angle would effect my solution and found that values below 5 would give better solution (You could try that too if you want a further investigation). Another question that of my interests about the wedge bc is in the following https://www.cfd-online.com/Forums/op...th-behind.html

Tobi April 21, 2017 16:54

The angle of 5 degree is mentioned in the user guide. So I would guess that this is the angle you should use and nothing else.

Sent from my HTC One mini using CFD Online Forum mobile app

tareqkh April 21, 2017 17:11

Quote:

Originally Posted by Tobi (Post 645853)
The angle of 5 degree is mentioned in the user guide. So I would guess that this is the angle you should use and nothing else.

Sent from my HTC One mini using CFD Online Forum mobile app

Well, as I mentioned earlier, I used values of the wedge angle up to 25 degrees and the results didn't vary so much but the stranded is below 5 degree (I can show you the results if you are interested). The question is what sort of trick do we use to the 3D Cartesian NS in order to make it axisymmetric? What is the math behind it?

Regards,

piu58 April 22, 2017 01:22

> What is the math behind it?

As far as I understand it: There is no special math. The geometry is warped into a real wedge. The only difference is the boundary condition, which changes from empty to wedge. I assume, that a slip b.c. would give similar results.

m_ridzon April 22, 2017 08:22

Quote:

The angle of 5 degree is mentioned in the user guide. So I would guess that this is the angle you should use and nothing else.
I couldn't previously find anything explicitly stated in the User Manual. But after digging again today, I see that Figure 5.2 therein indicates 5° wedge angle. But in the bullets below it, in the beginning of Section 5.2.1, they mention 1° as an example. So although it's not entirely clear about using nothing but 5°, I'm going to assume 5° is a standard convention and leave it at that. Thanks for the help! :)

Quote:

Well, as I mentioned earlier, I used values of the wedge angle up to 25 degrees and the results didn't vary so much but the stranded is below 5 degree (I can show you the results if you are interested). The question is what sort of trick do we use to the 3D Cartesian NS in order to make it axisymmetric? What is the math behind it?
I'm probably less experienced than many others here, but I might be able to add some small comment to this statement/question. The 3D Navier-Stokes equations are derived in many college textbooks in Cartesian coordinates. Usually in that same area of the book, they will go further to derive them in cylindrical coordinates. A classic, well known book that I know for sure has them, is Schlichting's "Boundary Layer Theory." I cannot say exactly how OpenFOAM uses them in its source code to complete the computations, since I'm not that well versed on the deeper inner workings of the code. But in terms of understanding the math that defines cylindrical NS equations, check out a fluids book; many have the cylindrical system derived therein. For completeness Tareqkh, I'll duplicate my response here over to your post (https://www.cfd-online.com/Forums/op...th-behind.html) since it's dedicated to your question about the math.

krndv January 11, 2018 05:45

Quote:

Originally Posted by Tobi (Post 644707)
Hi Ridzon,

I checked the site you mentioned and I guess it is very out dated. For 2D mesh generation you can extrudeMesh utility that come with OpenFOAM. Tutorials for 2D meshes are given in my website.

The second question is related to - how the mesh is extruded. Normally we extrude from the x, y, or z axis (starting from origin). If the plane you want to extrude is not aligned with these corresponding planes (origin point and vector x, y, z), the resulting mesh is different. So if you want to make a 2D wedge mesh, you should put the patch that should be extruded to one of the origin's planes. However, maybe it is not necessary anymore and we can specify some alternative origin for extruding (just check the extrudeMeshDict).

Good luck and I hope I got your question right (especially the second one).

hello Tobi,
I have gone through your tut on 2d axi-symmetric cases. The tutorial is well posted and really helpful.

I need clarification in some basic doubts.

1. In background mess, is it required to specify patch names?
2. After snappy how you are changing patch names like 'maxZ, minZ' to 'front or back'?
3. Suppose if I define multiple cellzones in snappyHexMesh and if I convert it to wedge , will the cellzone be still marked?


Thank You

Tobi January 11, 2018 07:20

Hi and thanks for your positive feedback,

1. no it is not required; generally my patch names come from the STL`s (depend on your mesh strategy)
2. Either manual by changing the names in constant/polyMesh/boundary or using the changeDictionary application. However, generally point #1 generates my boundary names (in other words, snappyHexMesh is responsible for it)
3. Good question, never checked it out. Could be but it can happen that it is removed. However, regeneration of the cell zones should not be a big deal. I refer to topoSet and setSet.

krndv January 15, 2018 06:00

Cellzone in wedge
 
Hello,

Cellzone will remain marked even after converting geometry to wedge.
checked cellZone file and observed the changes to make sure that its not the old file (befor extrudeMesh) still existing.

Regards
Karundv

krndv January 16, 2018 23:59

extrudeMesh
 
1 Attachment(s)
Hello,

After extrudeMesh getting 5 error in checkMesh.
How this can be controlled? snappyHexMeshDict?

Tobi January 17, 2018 01:22

You extruded in the wrong direction. (neg. volume)

krndv January 17, 2018 01:41

1 Attachment(s)
hi,

I guess exruded direction is correct because I got the expected shape.
But checkMesh is showing error and simulation stopes with 'core dumped' message.

My snappyHexMesh finishes with this warning 'Finished meshing with 31280 illegal faces', but checkMesh showed Ok.
Again got 5 error in checkMesh after forming wedge.

Tobi January 17, 2018 01:47

In my opinion, I can see wrong oriented faces. To proof my statement, check the surface normal vectors in ParaView.

Code:

My snappyHexMesh finishes with this warning 'Finished meshing with 31280 illegal faces', but checkMesh showed Ok.
Again got 5 error in checkMesh after forming wedge.

Then snappy cannot snap to the according surface and undo the changes. I provided a bunch of tutorials regarding snappyHexMesh on my website. I suggest you to check them out. Good luck.


All times are GMT -4. The time now is 11:05.