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 Members List Search Today's Posts Mark Forums Read

Like Tree6Likes
  • 2 Post By student666
  • 2 Post By Tobi
  • 1 Post By smodh
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 9, 2017, 09: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: 4
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, 13:30
Default
  #2
Senior Member
 
M. C.
Join Date: May 2013
Location: Italy
Posts: 286
Blog Entries: 6
Rep Power: 12
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 1e15 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 and smodh like this.
student666 is offline   Reply With Quote

Old   May 10, 2017, 08:32
Default
  #3
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,230
Blog Entries: 6
Rep Power: 38
Tobi 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
makaveli_lcf and Mansur like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 10, 2017, 09:20
Default
  #4
New Member
 
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 4
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 10:28. Reason: Cleaned post | missing image
smodh is offline   Reply With Quote

Old   May 10, 2017, 10:56
Default
  #5
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,230
Blog Entries: 6
Rep Power: 38
Tobi 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, 201 views)
File Type: jpg symmetryVsSymmetryPlane.jpg (53.8 KB, 325 views)
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   May 11, 2017, 04:03
Default
  #6
New Member
 
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 4
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, 04:10
Default
  #7
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,230
Blog Entries: 6
Rep Power: 38
Tobi 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 likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 23, 2018, 03:33
Default
  #8
Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 81
Rep Power: 5
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, 16:21
Default
  #9
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,230
Blog Entries: 6
Rep Power: 38
Tobi 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.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   July 25, 2018, 22:02
Default
  #10
Member
 
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 81
Rep Power: 5
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, 03:51
Default
  #11
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,230
Blog Entries: 6
Rep Power: 38
Tobi 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, 10:17
Default
  #12
New Member
 
Sam
Join Date: Feb 2018
Posts: 6
Rep Power: 3
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, 10:23
Default
  #13
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Augsburg
Posts: 2,230
Blog Entries: 6
Rep Power: 38
Tobi 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
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

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

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
symmetryPlane boundary conditions UHGAR OpenFOAM Running, Solving & CFD 2 June 25, 2019 05:33
Boundary condition Youngmj OpenFOAM Pre-Processing 1 October 19, 2016 01:19
How to set uniform heating boundary condition? Sargam05 OpenFOAM 0 September 11, 2012 10:09
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56
Slip boundary condition what is inside normunds OpenFOAM Running, Solving & CFD 2 June 4, 2007 06:45


All times are GMT -4. The time now is 19:46.