CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Bugs (
-   -   OF 1.6-ext setFields does not keep patch values (

Arnoldinho June 24, 2011 10:42

OF 1.6-ext setFields does not keep patch values
I'm nut sure if this is a bug or a normal procedure: Using setFields with OF 1.6-ext doesn't keep the original defined values at the boundary patches. This is not the case in 1.7.x, which I have used before.

An example: In I set fixedValue uniform (0 0 0) for patch walls. The internal fields of part of the mesh are then set to (0.15 0 0) using setFields (regions, boxToCell). In the updated U file, values for patch walls are then also set to (0.15 0 0), which is wrong, as it serves as a boundary condition for the whole simulation.

Is there something like keetPatches in funkySetFields?


jdiorio May 2, 2012 13:06

Same issue - any resolution on this?

Arnoldinho May 8, 2012 07:28

Sorry no, at least not from my side.
I'm avoiding this by first setting the specific patch values to zeroGradient, and after setFields, giving back fixedValues. But this is just an ugly workaround.

cosimobianchini May 9, 2012 03:58

1 Attachment(s)
Here is another "ugly" workaround: simply avoid the loop on the faces.
I wrote an utility called setFieldsPreservePatch baset on setFields from 1.6-ext where I just removed lines from 86 to 91.
You find it in the attachement, please let me know if you encounter any problem.

All times are GMT -4. The time now is 11:56.