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

Symmetry BC bug ?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 17, 2023, 04:45
Exclamation Symmetry BC bug ?
  #1
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 4
okrochak is on a distinguished road
Dear all,

I am running simpleFoam simulations of a flow meter and a pipe assembly, and I want to take advantage of the symmetry of the problem. So I only mesh the right half of the pipe/meter, and then I apply "symmetry" BC for "p U" fields. However, the resulting simulation doesn't behave as expected. If I view my symmetry plane, there are normal fluxes U_y, going through it. The magnitude of flow in my simulation is from 0.01 at the inlet to around 0.04 maximum in the domain. The velocity through the plane reaches magnitudes of 4.5-9 e-4, which is only 2 order lower than the overall magnitude and thus physically significant.

Please note that this behaviour is encountered with Openfoam v2212. However, I've done extensive tests and this behaviour is reproducible with OpenFOAM v2006, as well as with symmetryPlane and even slip BCs !!!

I've also run a simulation with the full domain, for comparison. Although it's not fully converged (it = 400) with simpleFoam, all other solver settings are consistent. The solution matches exactly besides the symmetry slice.

If you need any further information, I will readily provide it to you. I attach the samples from U and boundary files:

https://imgur.com/a/spkiGBy
Thank you in advance for any help

/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions [0 1 -1 0 0 0 0];

internalField uniform (0 0 0);

boundaryField
{
inlet
{
type fixedValue;
value uniform (0.0116 0 0);
}

outlet
{
type zeroGradient;

}

mirrorPlane
{
type symmetry;
}

walls
{
type noSlip;
}

fins
{
type noSlip;
}

}


// ************************************************** *********************** //


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2212 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
arch "LSB;label=32;scalar=64";
class polyBoundaryMesh;
location "1/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

5
(
outlet
{
type patch;
nFaces 1860;
startFace 3445294;
}
inlet
{
type patch;
nFaces 1860;
startFace 3447154;
}
walls
{
type wall;
inGroups 1(wall);
nFaces 67730;
startFace 3449014;
}
mirrorPlane
{
type symmetry;
inGroups 1(symmetry);
nFaces 0;
startFace 3516744;
}
fins
{
type wall;
inGroups 1(wall);
nFaces 62682;
startFace 3516744;
}
)

// ************************************************** *********************** //
okrochak is offline   Reply With Quote

Old   August 17, 2023, 12:50
Default
  #2
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 745
Rep Power: 14
Tobermory will become famous soon enough
Agreed that this seems odd. Initial thoughts are: how good is your mesh (check output from checkMesh) and your solution convergence (check run log)?
Tobermory is offline   Reply With Quote

Old   August 18, 2023, 03:25
Default
  #3
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 4
okrochak is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
Agreed that this seems odd. Initial thoughts are: how good is your mesh (check output from checkMesh) and your solution convergence (check run log)?
Dear Tobermory,

My mesh is mostly ok, I do have some skew and orthogonal faces because I mesh part of the meter with snappyHexMesh

OK.
Min volume = 1.59692e-12. Max volume = 1.1959e-08. Total volume = 0.000494526. Cell volumes OK.
Mesh non-orthogonality Max: 74.8541 average: 13.6687
*Number of severely non-orthogonal (> 70 degrees) faces: 3.
Non-orthogonality check OK.
<<Writing 3 non-orthogonal faces to set nonOrthoFaces
Face pyramids OK.
***Max skewness = 4.1713, 1 highly skew faces detected which may impair the quality of the results
<<Writing 1 skew faces to set skewFaces
Coupled point location match (average 0) OK.

Failed 1 mesh checks.


As for the residuals, I've added it to the imgur album. They are relatively low and don't see to decrease much further, although sometimes there is an "oscillation". I plan to investigate this setup also with a transient solver pimpleFoam.

https://imgur.com/p3h9Zf8

It's a laminar flow without any turbulence model, so only U p are shown

Nonetheless, I don't think this is the cause of this symmetry bug. I think it has to do more with how OpenFOAM interpretes this BC, but I couldn't find much information on that.
okrochak is offline   Reply With Quote

Old   August 18, 2023, 03:50
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 745
Rep Power: 14
Tobermory will become famous soon enough
So checkmesh failed with some corrupt cells ... and it is really the continuity error that we are interested in here. My advice is to sort out the mesh first - get a proper, good quality mesh and you might find that the solver behaves more rationally. I don't think that you can blame it on the boundary condition at this stage.
Tobermory is offline   Reply With Quote

Old   August 18, 2023, 06:21
Default
  #5
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17
sylvester is on a distinguished road
Hi Alex,


You visualize Uy with a range between -9.9e-3 and +9.1e-3, i.e. not symmetrical around 0. This results in a reddish colour for when Uy = 0 m/s. This can give the false impression that the symmetry b.c. is not working properly.



In the attached imaged I've tried to recreate your colour. The value of the Result variable is uniformly 0, but its colour is not white (or neutral grey), but a bit red.
Attached Images
File Type: png non0.png (7.4 KB, 13 views)
sylvester is offline   Reply With Quote

Old   August 22, 2023, 09:18
Default
  #6
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 4
okrochak is on a distinguished road
Quote:
Originally Posted by Tobermory View Post
So checkmesh failed with some corrupt cells ... and it is really the continuity error that we are interested in here. My advice is to sort out the mesh first - get a proper, good quality mesh and you might find that the solver behaves more rationally. I don't think that you can blame it on the boundary condition at this stage.
Dear Tobermory,

Thank you for your reply. The original mesh was created by using "blockMesh" utility to create most of the mesh in a structured manner. Then I've applied "snappyHexMesh" utility to mesh the more complicated part of the geometry.

To test your hypothesis, I've made another mesh with only the structured part. This mesh returns no problems/warning with checkMesh utility. Nonetheless, when I run the simulation, there are still symmetry plane - normal fluxes. I've added an image to the original album.

https://imgur.com/uZUZvT6

So I don't think it's the issue with the mesh in particular. I think this has to do with how symmetry BC (and likely slip wall BC as well) are implemented in OpenFOAM. In my opinion, a symmetry BC should force patch-normal velocity to zero, just as a wall BC forces velocity magnitude to zero (regardless of the mesh quality).
okrochak is offline   Reply With Quote

Old   August 22, 2023, 09:19
Default
  #7
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 4
okrochak is on a distinguished road
Quote:
Originally Posted by sylvester View Post
Hi Alex,


You visualize Uy with a range between -9.9e-3 and +9.1e-3, i.e. not symmetrical around 0. This results in a reddish colour for when Uy = 0 m/s. This can give the false impression that the symmetry b.c. is not working properly.



In the attached imaged I've tried to recreate your colour. The value of the Result variable is uniformly 0, but its colour is not white (or neutral grey), but a bit red.
Hello sylvester,

I understand what you are trying to say, but this is not the issue. Look at the third image in the album, there you clearly see there are non-zero y-velocities:

https://imgur.com/tHTfzwR
okrochak is offline   Reply With Quote

Old   August 22, 2023, 11:48
Default
  #8
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 93
Rep Power: 17
sylvester is on a distinguished road
I see what you mean.


Might it be a ParaView cell-to-point interpolation issue? In your images, do you visualize the data with cell values, or point values?
sylvester is offline   Reply With Quote

Old   August 24, 2023, 06:00
Default
  #9
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 4
okrochak is on a distinguished road
Quote:
Originally Posted by sylvester View Post
I see what you mean.


Might it be a ParaView cell-to-point interpolation issue? In your images, do you visualize the data with cell values, or point values?

I think in the images I use point values, but I get the same results if I use cell values. Maybe you are right, it's just the way the OpenFOAM interpolates, since there could (and should) be some wall normal flux in the cell centers, since it's not entirely at the symmetry plane. But I'm not convinced this is the right explanation and I feel like OpenFOAM or paraview should be able to correct for that, since a BC is given explicitly on the face
okrochak is offline   Reply With Quote

Old   August 24, 2023, 13:18
Default
  #10
Member
 
Ching Liu
Join Date: Sep 2017
Posts: 52
Rep Power: 9
qingqingliu is on a distinguished road
Hi Alex,

I met a similar issue. I used slip boundary in an axisymmetric geometry. However, the normal velocity is not zero. It seems that the slip boundary cannot fully remove the normal velocity in OpenFOAM? My post is here:

slip and wedge boundary conditions in the axisymmetric geometry
qingqingliu is offline   Reply With Quote

Old   October 3, 2023, 05:05
Default
  #11
New Member
 
Alex Krochak
Join Date: May 2022
Posts: 9
Rep Power: 4
okrochak is on a distinguished road
In the end, I ran some tests with a full domain and with half-domain and symmetry bc and the data was the same everywhere besides the points on symmetry plane. So it might simply be an issue of Paraview/Openfoam not knowing to enforce the zero-flux bc on the symmetry plane, but as it doesn't seem to affect the rest of the domain it is not a major issue.
okrochak is offline   Reply With Quote

Old   May 5, 2024, 07:48
Default
  #12
blr
New Member
 
He Shang
Join Date: Nov 2023
Posts: 6
Rep Power: 3
blr is on a distinguished road
I have met the same issue. I use the symmetry conditon, but the velocity normal to the symmetric face is not zeor. Your results justify my situation. Thanks a lot, okrochak!
blr is offline   Reply With Quote

Old   May 5, 2024, 08:18
Thumbs up
  #13
blr
New Member
 
He Shang
Join Date: Nov 2023
Posts: 6
Rep Power: 3
blr is on a distinguished road
Quote:
Originally Posted by blr View Post
I have met the same issue. I use the symmetry conditon, but the velocity normal to the symmetric face is not zeor. Your results justify my situation. Thanks a lot, okrochak!
Hi, okrochak, and everyone, here is a thread for this issue,https://www.cfd-online.com/Forums/openfoam-post-processing/187798-why-no-slip-b-c-does-not-obtain-zero-velocity-contour.html"]Why no-slip b.c. does not obtain zero-velocity contour?[/URL]. It's the problem of ParaView. We should use paraFoam instead of paraFoam -builtin.
blr is offline   Reply With Quote

Reply

Tags
boundary condition, simplefoam, symmetry bc


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
Simulation of a chimney with heat in open atmosphere Jurado OpenFOAM Running, Solving & CFD 9 December 18, 2020 08:35
rhoSimpleFoam - Newbie Issues AndyR OpenFOAM Running, Solving & CFD 6 March 10, 2020 10:28
High nut values in random place and time krzychu111 OpenFOAM Running, Solving & CFD 0 January 9, 2019 09:42
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 10:28
[ICEM] Blocking and Symmetry BrolY ANSYS Meshing & Geometry 32 August 24, 2012 04:13


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