1

I am trying to numerically compute the drag force around a cylinder due to pressure-driven flow. Here is a crude diagram:

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 U and 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 U and p but I am running into issues where the solution is blowing up after some time.

Would appreciate any help.

K.defaoite
  • 103
  • 1
  • 8
  • Consider also posting on https://scicomp.stackexchange.com/, I am not sure how many users here are skilled with OpenFOAM. I tried it once my self for fun, but never digged in it too much. – Bob Jan 16 '22 at 10:36

0 Answers0