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

symmetry and symmetryPlane boundary condition difference in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Like Tree29Likes
  • 5 Post By student666
  • 15 Post By Tobi
  • 3 Post By Tobi
  • 1 Post By smodh
  • 2 Post By Tobi
  • 2 Post By Tobi
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2017, 10:05
Default symmetry and symmetryPlane boundary condition difference in OpenFOAM
  #1
New Member
 
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10
smodh is on a distinguished road
Hello,
I am working on a EHD problem. In a this problem I have to use symmetry Boundary condition. So should I use symmetry or symmetryPlane Boundary condition. In a both cases my result are diffferent.
So my question is any body know the difference between symmetry and symmetryPlane boundary condition?

Thank you.
smodh is offline   Reply With Quote

Old   May 9, 2017, 14:30
Default
  #2
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 17
student666 is on a distinguished road
This is an usage answer.
If you set symmetryPlane bc, you MUST have all normals of the symmetry patch perfectly aligned.
Symmetry is a more flexible bc.
For example, I got OF to complain as one normal was 1e—15 not aligned or something similar....
By a calculation point of view, i think that symmetry generates errors as higher as the misalignment of the normals...I would say diffusion...but I would like to be corrected by someone else on this forum and I would like to have more informations too...
Regards
amuzeshi, zxyf1, smodh and 2 others like this.
student666 is offline   Reply With Quote

Old   May 10, 2017, 09:32
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I cannot proof everything but I guess it is correct. However, I expect that symmetryPlane and symmetry should give the same results.

symmetry was introduced in 2.3.0 (I guess) and is exactly the same than symmetryPlane in all previous versions. However, the old symmetryPlane introduced numerical errors to pointFields (think about mesh motion) and that was the reason why they introduced the new symmetryPlane for 100% aligned patches. Even groups of patches are not allowed here anymore. More informations are here: https://openfoam.org/release/2-3-0/numerics/

The last weeks I checked it out in more detail. The symmetryPlane is more strict. As already mentioned, all normals has to be equal. For the meshes I generate with snappyHexMesh, I was never able to use symmetryPlane.

But again, I would expect that both should give the same results if the planes are 100% aligned and the normals are equal.

The only differences in both codes are the function named snGradTransformDiag. However, I did not check out what this function is doing. But again, I would expect both to be equal for really flat symmetry planes.

Could you please define what » different results « mean? Is is complete different or slighty. Some quantitive results would be nice to know
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 10, 2017, 10:20
Default
  #4
New Member
 
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10
smodh is on a distinguished road
Hello Holzmann,
Thanks for your reply and openfoam youtube tutorial. I learn a lot from them.
I am working on a Electrohydrodynamic problem.
In my own solver I solved EHD equation. In a EHD channel problem, from top wall I am using as a symmetry boundary condition. For that I used symmetry and symmetryPlane BC. In a both cases my result were different. Here I am attaching the image of result. N_N is a negative charge density.

Symmetry: http://imgur.com/a/fiqhP
SymmetryPlane: http://imgur.com/a/tcbQG

Last edited by Tobi; May 10, 2017 at 11:28. Reason: Cleaned post | missing image
smodh is offline   Reply With Quote

Old   May 10, 2017, 11:56
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Wow, that are complete different results. Based on the fact that you could using both boundaries, the plane is really planar. Hmmm. It seems that you have a yet coming out, right?

I just made a test case to check it out. The outcome, both are equal:

  • left and right (inletOutlet for U and fixed for p)
  • top is symmetry or symmetryPlane
  • bottom is wall + inlet
  • front and back are empty
  • Incompressible solver and steady state (simpleFoam)
  • Both converged after 367 iterations
See also the attachment.

I have no idea about the magnetic field and the calculation but you have your own solver, right. So please make sure that all fields will have the correct boundary conditions. In addition I know from my colleague that MHD is really not an easy task. However, good luck.
Attached Images
File Type: png quantitativCompare.png (18.0 KB, 623 views)
File Type: jpg symmetryVsSymmetryPlane.jpg (53.8 KB, 1078 views)
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 11, 2017, 05:03
Default
  #6
New Member
 
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10
smodh is on a distinguished road
Bonjour Holzmann,

you were correct....There is a no difference between symmetry and symmetryPlane boundary condition.
I made some stupid mistake in my physical parameter description.
Sorry for your convenience. Thanks for explaining boundary condition.
I also found explaining about snGradTransformDiag. please check following link.
http://xiaopingqiu.github.io/2016/04...-in-OpenFOAM3/
it is Chinese or japanise language but use google translator. it will help for understanding.

Thanks and have a nice day!!!!
shang likes this.
smodh is offline   Reply With Quote

Old   May 11, 2017, 05:10
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

there should be a difference, if the patches are not 100% aligned but then, you cannot use symmetryPlane I never checked the transform() function because I was too lazy. Good to know that there is something available. Maybe I will read it through or (what I prefer), read the code. But I guess your link would help other's too.

By the way, there are no stupid mistakes. I also make mistakes during programming. The important thing is that you can resolve it and thus you gain knowledge and you probably will not run into that mistake again. But everybody is doing mistakes. Yesterday I realzied a mistake in my latest contribution which was merged to OpenFOAM-dev. So at least I am not an expert and perfect. I make enough mistakes.

I would be interested which mistake you made.
However, good to know that you get the same results now.
shang and Islamabdelkarim like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 23, 2018, 04:33
Default
  #8
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
I recently had the same problem. As mentioned by M. C., symmetryPlane is very strict and I don't know how to get rid of the "Symmetry plane is not planar" error.

I had a mesh generated from ICEMcfd and used the fluentMeshToFoam utility to convert it to OF style. The model is basically a quarter of a complete cylindrical geometry (so a plane rotates 90 degrees instead of 360). The two sides are named ZQ1 and ZQ2, and I manually changed their type to symmetryPlane in the constant/polyMesh/boundary file. BCs for variables like p, U are modified accordingly in the 0/ folder. When I run the case it always gives the following error message:

Code:
--> FOAM FATAL ERROR: 
Symmetry plane 'ZQ1' is not planar.
At local face at (593.86 -7.37678e-07 149.954) the normal (-1.20113e-07 -1 -1.59815e-05) differs from the average normal (-1.42045e-11 -1 -1.88995e-09) by 2.55361e-10
Either split the patch into planar parts or use the symmetry patch type

    From function virtual void Foam::symmetryPlanePolyPatch::calcGeometry(Foam::PstreamBuffers&)
    in file meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C at line 64.

FOAM exiting
As you can see, the difference between the normal of the face where this error happens and the average normal of the whole surface is really small, and seems to be just a round-off error by the computer.

FYI, I also tried a wedge shape for my geometry (a plane just rotates 3 or 4 degrees) and defined the two sides as "wedge", I got a similar error message of "wedge is not planar".

My questions are two-fold: 1. Is there a way to modify the mesh in an easy way (so that OF thinks the symmetryPlane is planar) or just tell OF to ignore such errors (as they really look like round-off errors)? 2. If we can use symmetry instead of symmetryPlane without any problems, why symmetryPlane is used in OF? How to deal with the "wedge is not planar" error?

Thank you in advance.
cryabroad is offline   Reply With Quote

Old   July 23, 2018, 17:21
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Use Symmetry and done. However, if you want to make a patch planar (if it is in x-, y- or z-plane) you can use a tool I wrote (bitbucket). The program takes the patch and moves it to the position you want. After that it is planar and you can use symmetryPlane. However, the tool is not well tested and was build during my Ph.D. for my purpose and geometry only. See holzmann.cfd.de -> Software Development -> Flatten Patch.
Islamabdelkarim and jky like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 25, 2018, 23:02
Default
  #10
Senior Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10
cryabroad is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Use Symmetry and done. However, if you want to make a patch planar (if it is in x-, y- or z-plane) you can use a tool I wrote (bitbucket). The program takes the patch and moves it to the position you want. After that it is planar and you can use symmetryPlane. However, the tool is not well tested and was build during my Ph.D. for my purpose and geometry only. See holzmann.cfd.de -> Software Development -> Flatten Patch.
Hi Tobi,

Thank you for your reply, and thank you for all you've done for the forum and the youtube tutorials!

I tried
Code:
symmetry
and it does work, but since
Code:
symmetryPlane
does not apply in my case, I was not able to compare the two results. I'll definitely take a look at the tool you mentioned.

Thanks.
cryabroad is offline   Reply With Quote

Old   July 26, 2018, 04:51
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Hi,

both should give you identical results. Symmetry is the old symmetryPlane and the new symmetryPlane is more strict and therefore conservative for pointFields. See also the information on openfoam.org
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 12, 2018, 11:17
Default
  #12
New Member
 
Sam
Join Date: Feb 2018
Posts: 6
Rep Power: 8
xevious is on a distinguished road
Hello, i've been doing research in constructing a 2d axisymmetric rotating disk in a cylinder. I just want to know the difference between using a wedge patch on the front and back, and using symmetry patch.
xevious is offline   Reply With Quote

Old   August 12, 2018, 11:23
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
wedge is for 2d-axissysmmetric
symmetry is for a normal symmetry plane
Teresa.Z likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   August 12, 2018, 11:33
Default
  #14
New Member
 
Sam
Join Date: Feb 2018
Posts: 6
Rep Power: 8
xevious is on a distinguished road
Thanks for the quick reply!
xevious is offline   Reply With Quote

Old   April 27, 2020, 07:06
Default
  #15
Senior Member
 
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 6
otaolafr is on a distinguished road
Quote:
Originally Posted by Tobi View Post
Use Symmetry and done. However, if you want to make a patch planar (if it is in x-, y- or z-plane) you can use a tool I wrote (bitbucket). The program takes the patch and moves it to the position you want. After that it is planar and you can use symmetryPlane. However, the tool is not well tested and was build during my Ph.D. for my purpose and geometry only. See holzmann.cfd.de -> Software Development -> Flatten Patch.
hello tobi,
thanks for all the information, I was facing the same issue as my original geometry have a plane that was cutted in several "small" planes, so at the end of the snappy, i could not achive the requirements for the symmetryPlane, with symmetry everything works correctly, but my question is if i was using the tool implicitFeatureSnap in snappy, this should not assure that the "small"planes are all paralelle? should I go with a higher snap parameters? (the difference in the normals from the error was
At local face at (0.000407515 7.78763e-22 1.31192e-05) the normal (2.09956e-18 -1 6.35007e-17) differs from the average normal (-7.99268e-17 -0.999625 5.83908e-17) by 1.40463e-07.

thanks for the help
otaolafr is offline   Reply With Quote

Old   October 19, 2020, 09:23
Default
  #16
New Member
 
Arne
Join Date: Dec 2018
Posts: 19
Rep Power: 7
arsimons is on a distinguished road
Dear fellow foamers

I use OpenFOAM 1806 on a windows computer (Ubuntu 18.04 LTS).

I compared the symmetryPlane BC on a symmetric case:
I have a square beam: 30 cm x 5 cm x 5 cm (300 cells x 50 cells x 50 cells) filled with air in which a droplet of water is falling (initial condition is a cube of water of 1 cm x 1 cm x 1 cm, thus 10 cells x 10 cells x 10 cells). I am aware that this is a rather coarse mesh, the attempt was only to investigate the BC.

I used 3 simulations (see figure): left is the full system, middle has 1 symmetryPlane (half system) and right has symmetryPlane twice (quarter system). I observed that the quarter system appeared more robust as it showed less numerical diffusion (or so I believe).

Anyone who can give me some more information about this behaviour?

Thank you in advance.

Best regards
Arne
Attached Images
File Type: png Capture.PNG (17.3 KB, 156 views)
arsimons 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
symmetryPlane boundary conditions UHGAR OpenFOAM Running, Solving & CFD 2 June 25, 2019 06:33
Boundary condition Youngmj OpenFOAM Pre-Processing 1 October 19, 2016 02:19
How to set uniform heating boundary condition? Sargam05 OpenFOAM 0 September 11, 2012 11:09
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
Slip boundary condition what is inside normunds OpenFOAM Running, Solving & CFD 2 June 4, 2007 07:45


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