|
[Sponsors] |
symmetry and symmetryPlane boundary condition difference in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 9, 2017, 10:05 |
symmetry and symmetryPlane boundary condition difference in OpenFOAM
|
#1 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10 |
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. |
|
May 9, 2017, 14:30 |
|
#2 |
Senior Member
|
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 |
|
May 10, 2017, 09:32 |
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 |
|
May 10, 2017, 10:20 |
|
#4 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10 |
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 |
|
May 10, 2017, 11:56 |
|
#5 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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:
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.
__________________
Keep foaming, Tobias Holzmann |
|
May 11, 2017, 05:03 |
|
#6 |
New Member
Sachin
Join Date: Sep 2016
Location: Poitiers,France
Posts: 17
Rep Power: 10 |
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!!!! |
|
May 11, 2017, 05:10 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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.
__________________
Keep foaming, Tobias Holzmann |
|
July 23, 2018, 04:33 |
|
#8 |
Senior Member
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10 |
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 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. |
|
July 23, 2018, 17:21 |
|
#9 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 |
|
July 25, 2018, 23:02 |
|
#10 | |
Senior Member
Ruiyan Chen
Join Date: Jul 2016
Location: Hangzhou, China
Posts: 162
Rep Power: 10 |
Quote:
Thank you for your reply, and thank you for all you've done for the forum and the youtube tutorials! I tried Code:
symmetry Code:
symmetryPlane Thanks. |
||
July 26, 2018, 04:51 |
|
#11 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
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 |
|
August 12, 2018, 11:17 |
|
#12 |
New Member
Sam
Join Date: Feb 2018
Posts: 6
Rep Power: 8 |
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.
|
|
August 12, 2018, 11:33 |
|
#14 |
New Member
Sam
Join Date: Feb 2018
Posts: 6
Rep Power: 8 |
Thanks for the quick reply!
|
|
April 27, 2020, 07:06 |
|
#15 | |
Senior Member
Franco
Join Date: Nov 2019
Location: Compiègne, France
Posts: 129
Rep Power: 7 |
Quote:
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 |
||
October 19, 2020, 09:23 |
|
#16 |
New Member
Arne
Join Date: Dec 2018
Posts: 19
Rep Power: 8 |
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 |
|
|
|
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 |