Notes

This pages is inteded to store various notes, findings and misconceptions I stumbled over while working with OpenFOAM. It is mainly intended as a reminder to myself and used to live in my private wiki. I moved it out of there, because this might be of help for someone else than me. Please contact me if you consider something wrong, incomplete or missing.

inletOutlet vs. outletInlet

Both boundary conditions sound almost identical, but they are not. In fact they are acting absolutely contrary to each other. inletOutlet is basically a fixedValue boundary condition when a flux into the domain is present and a zeroGradient when the flux is pointing outwards. Though boundary conditions are applied to boundary patches, this decision is done on a face-to-face basis. This means that two adjoining boundary faces on a boundary patch might have fluxes with different signs and are hence handled differently.

The outletInlet boundary condition does this decision in the same manner, but if there is an inward flux, it is a zeroGradient and otherwise a fixedValue boundary condition.

This can be found in the sources as well. Doing a vimdiff of the source files of both boundary conditions and just looking for the real differences and ignoring the naming differences reveals a significant difference in the updateCoeffs method of both classes. This shows that both boundary conditions are the inverse of the other:

// inletOutlet
this->valueFraction() = 1.0 - pos(phip);

// outletInlet
this->valueFraction() = pos(phip);

If you would like to see that in the actual source, go to $FOAM_SRC/finiteVolume/fields/fvPatchFields/derived and execute the following command:

vimdiff inletOutlet/inletOutletFvPatchField.C outletInlet/outletInletFvPatchField.C