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/)
-   -   postProcess calculate Tdeg (https://www.cfd-online.com/Forums/openfoam-post-processing/210613-postprocess-calculate-tdeg.html)

jonfah October 31, 2018 04:40

postProcess calculate Tdeg
 
Hi, Im trying to calculate the temperature in Celsius by using the postProcess utility. In previous version (OF22x) it was straight forward with the foamCalc utility to simply subtract 273 K from T to get Tdeg. I have tried different combinations with the postProcess utility e.g.


PHP Code:

postProcess -func "subtract(T,273.15,result=Tdeg)" -region fluid_Humidifier 

I get this error message:



--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 4 the doubleScalar 273.15

file: /usrfem/femsys_local/OpenFOAM/OpenFOAM-6/etc/caseDicts/postProcessing/fields/subtract.fields at line 4.

From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&)
in file primitives/strings/word/wordIO.C at line 74.



Does anyone know how to simply subtract a value from a field via the postProcess utility?
Additional info, I’m using OF6 in a multiregion case.

tomf November 1, 2018 04:47

Hi,

I guess it would be fastest to make a field Tref with internalField and all boundaries at uniform 273.15 and than run as

Code:

postProcess -func "subtract(T,Tref,result=Tdeg)" -region fluid_Humidifier
Regards,
Tom

jonfah November 1, 2018 06:07

Thanks Tom, it works perfect!


All times are GMT -4. The time now is 05:48.