Cross-posted from Stack Overflow. (https://stackoverflow.com/questions/70686368/can-i-use-periodic-boundary-conditions-for-u-but-not-for-p)
I am trying to numerically compute the drag force around a cylinder due to pressure-driven flow. Here is a crude diagram:
I am using OpenFOAM v2012 (the openfoam.com version, not the openfoam.org version).
For the top and bottom walls, as well as the obstacle in the middle, I have
noSlip boundary conditions for
zeroGradient boundary conditions for
p. However for the inlet on the left and the outlet on the right, I would like to have a periodic boundary condition for
U, but instead of a periodic boundary condition for
p I would instead like to have a pressure drop across the channel of 100. (This comes from dividing the atmospheric pressure, which is roughly 100 000 pascals, by the density of water, which is 1 000 kg/m^3. This is because the
p file is not really the pressure, it is actually the pressure divided by the density, sometimes called p bar.)
However when I tried to implement this, I received the error
--> FOAM FATAL IO ERROR: (openfoam-2012 patch=210618)
inconsistent patch and patchField types for
patch type cyclic and patchField type fixedValue
file: /home/killian/foam_run/cylinder_2/0/p.boundaryField.inlet at line 25 to 26.
It appears OpenFOAM is not letting me mix my metaphors. Does anyone know a way around this? I have tried other BCs for
p but I am running into issues where the solution is blowing up after some time.
Would appreciate any help.