Understanding the cyclic boundary condition
I need to solve problems with cyclic BCs 'all around the place'. To be clearer, this is the geometry I am considering:
On this screenshot, the colouring is the velocity (U) magnitude, U being obtained using the simpleFoam solver and a uniform inlet BC on the x = 0 face. What I want to do is simply simulate the flow in the (6,4) cell using periodic boundary conditions:
Firstly, let's have a look at what we want to reproduce. Here are the velocity magnitude and orientation in the (6,4) cell (let's call this the reference problem):
This velocity field seems periodic. If we subtract a periodic field from this one, we should get another periodic field, maybe better as an evidence. So we do that and plot the so-called deviation field, UTilde, obtained by subtracting the volume average of U (which is constant over the cell) from U:
UTilde = U - UAverage
Here is what we get:
This deviation field is periodic 'x-wise' and 'y-wise'.
I tried to simulate the flow in the (6,4) cell using the simpleFoam solver (though if might not be the best, AFAIK; anyway, this is not the worst problem here). I therefore simply applied cyclic patches at the boundaries of the cell. Although this insufficiently constraints the problem, the SIMPLE algorithm converges to a solution which only depends on the initial condition, yielding the following velocity field:
Given that image, we can doubt that this field is periodic. The deviation field gives a clearer proof:
UTilde is not periodic, while it should be.
So here is my question: Is there any reason why the periodic BC wouldn't be satisfied in the cyclic problem? Did I do something wrong?
The associated OpenFOAM cases come attached. Screenshot gallery:
I ran an additional simulation with a correctly constrained problem, replacing the inlet and outlet cyclic patches with regular inlet and outlet patches.
Inlet: zeroGradient pressure, fixedValue uniform velocity
Outlet: fixedValue uniform pressure, zeroGradient velocity
The 'y-wise' periodicity is not satisfied either.
something in cyclic patch in your original case is wrong.
checkMesh shows some error.
Using createPatch fixed this problem.
a modified case with createPatchDict and modified Allrun is here,
Periodic fields is obtained with this case. tested with OF222.
Thank you very much! It seems like patch orientation is much more of a big deal than I expected.
I have an additional question about the cyclic boundary condition: what does it actually do? Does it ensure equality of fields and derivatives at the associated boundaries? Or does it only ensure equality of fields?
|All times are GMT -4. The time now is 03:35.|