CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Add Variables Together (https://www.cfd-online.com/Forums/openfoam-post-processing/218898-add-variables-together.html)

RoWoM July 8, 2019 12:43

Add Variables Together
 
Foam Gods: Can results files be added together and scaled easily?

As they are text files I'm wondering if it's easier to bodge together something in python (after hunting all afternoon on the forums) ... but there has to be a better way?

Looked in postProcess, but "add" and "scale" aren't there. funkySetFields isn't installed so would need compiling...

(Using blueCore openfoam 4.x)

yambanshee July 9, 2019 04:08

Quote:

Originally Posted by RoWoM (Post 738338)
Foam Gods: Can results files be added together and scaled easily?

As they are text files I'm wondering if it's easier to bodge together something in python (after hunting all afternoon on the forums) ... but there has to be a better way?

Looked in postProcess, but "add" and "scale" aren't there. funkySetFields isn't installed so would need compiling...

(Using blueCore openfoam 4.x)

There is a postProcess function named add in OF5 and up.
Code:

postProcess -func "add(FIELD1, FIELD2)"
Alternatively, you can make use of the calculator filter in paraview, however the file format will differ from that used by openFoam.

RoWoM July 9, 2019 08:43

Thanks so much ... will use that when I get to foam 5...
Until then it's python time...


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