CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   [codedFixedValue] - reversing patch (https://www.cfd-online.com/Forums/openfoam-solving/254318-codedfixedvalue-reversing-patch.html)

DashaSh February 2, 2024 04:13

[codedFixedValue] - reversing patch
 
Hello! I'm using 'codedFixedValue' for the inlet, which depends on the outlet patch.

I have a problem: the values on the inlet patch are 'mirrored' from the outlet patch. How can I fix this? Is there any possibility to reverse the face of the patch?


Code:

forAll(TField, faceI)
            {
                TField[faceI] = fieldOAP[faceI] + 5;
            }

I have also added a schematic image for clarity.
https://imgur.com/D9jN5kV

https://imgur.com/D9jN5kV

NiklasW February 2, 2024 09:05

Hi :)
as an easy fix, you could maybe rewrite it to:
Code:

forAll(TField, faceI)
            {
                TField[TField.size() - 1 - faceI] = fieldOAP[faceI] + 5;
            }

so that one of the patches counts the face ids backwards.

DashaSh February 2, 2024 09:40

Thanks a lot!


All times are GMT -4. The time now is 00:24.