Page 1 of 1

Navier Stokes Periodic Boundary still problematic

Posted: 08 Apr 2017, 19:34
by TFLOPs
Hello,
looks like periodic boundaries still have issues with Navier Stokes
I attach here an example, a rectangular pipe filled with air with a body force along its axis (Z axis), a no slip boundary condition on sidewalls, and a periodic boundary condition on inlet/outlet.
After running the solver for a steady state solution with the Smagorinsky turbulence model, I see antiperiodic x and y velocity on inlet and outlet (also pressure is antiperiodic).

Is it a bug?


Image
Image
Image



Don't care about values, It's just a qualitative example

Re: Navier Stokes Periodic Boundary still problematic

Posted: 10 Apr 2017, 23:08
by TFLOPs
I've made other tests, basically, periodic boundaries are simply ignored by the Navier Stokes solver.
Periodic boundaries are handled at mesh/grid level, isn't it? They aren't handled directly by the solver.
I'm gonna look at NavierStokes.F90 and NavierStokesGeneral.F90 code

P.S: There's another issue with the sif file generated by the project xml file, that force me to edit the boundary mapping (only for periodic boundaries). I'll also look into sifgenerator.h but the issue can be in other places

Re: Navier Stokes Periodic Boundary still problematic

Posted: 11 Apr 2017, 22:27
by raback
Hi

I had a quick look. I could not find much wrong with your case. I exchanged the preconditioner and increased nonlinear iterations while set steady state iterations to one. This way only the final solution is saved. Additionally I save the results in VTU format for Paraview.

I don't think there is anything wrong with the periodic settings. I also tested the same with mortar BCs which offer simular but more generic functionality (preferred for nonconforming meshes).

The problem is probably that you're running in parallel. Unfortutanely the projection matrices are created in serial. So when partitioning you should take case that the periodic BCs recide in the same partitioning. If the counterpart is not found the code cannot make the projection. Either run serial or use the -connect flag of ElmerGrid to ensure connectivity of given BCs.

Attached is an updated sif.

-Peter

Re: Navier Stokes Periodic Boundary still problematic

Posted: 11 Apr 2017, 23:29
by TFLOPs
Thank you very much Peter
Before uploading this case I already tried to run in serial mode becasuse I saw something about that in this forum, but I was getting the same not-periodic results.
After your reply I tried with the new sif, running serial again, and the solution with paraview gave me the same not periodic results.
Then I downloaded my own case from the forum in a clean directory and with the new sif running serial and all is perfect.
I guess my project directory was a big mess
Now I will try with the mortar condition and parallel
Also thank you for fixing my sif settings, now is faster in serial than with 20 partitions running parallel lol

And I must say Elmer code is very clean written.

Re: Navier Stokes Periodic Boundary still problematic

Posted: 11 Apr 2017, 23:47
by raback
Hi

Note that there is the same limitation with mortar BCs. It is just better for nonconforming meshes - and much more recently coded.

To use the connect flag you do something like this

Code: Select all

ElmerGrid 2 2 meshdir -partdual -metis #np 3 -connect #bc1 #bc2 #bc3
Where #np is the number of partitions and #bci:s are the BCs that should be connected by construction.

-Peter