CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Convert temperature from kelvin to cesius

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Yann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2018, 08:05
Default Convert temperature from kelvin to cesius
  #1
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 9
shaileshbg is on a distinguished road
Hello Foamers,

I am trying to convert the temperature values from Kelvin to celsius, I read that paraview has no concept of units so we have to export temperatures out of OpenFOAM 5.x in Celsius-Format.


I tried postprocessing with foamCalc utility but on openFoam 5 foamCalc has been superseded by the postProcess utility.


One of the posts suggested a workaround
" add a volScalarField Toffset with zeroGradient boundary conditions and an initial value of 273K in the time directories you want to export and then proceed with postProcess"

because
Code:
 postProcess -fields "(T 273.15)" -func subtract
requires two fields and does not accept the scalar "273.15"

Is there an easier way to convert temperature values from Kelvin to celsius. Thank you in advance for all your help.

Regards,
Shailesh
shaileshbg is offline   Reply With Quote

Old   January 8, 2018, 08:35
Default
  #2
Member
 
Join Date: Mar 2016
Posts: 73
Rep Power: 10
sufjanst is on a distinguished road
I don't know if it works with OpenFoam but i had a similiar problem in Fluent. The solution data were vectors. You can load these vectors into Matlab and substract 273 to get Celsius. Afterwards you create a new data file with the new values for temperature. It is not very beautiful but it worked in fluent.
sufjanst is offline   Reply With Quote

Old   January 9, 2018, 01:20
Default Easier way in Fluent
  #3
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 9
shaileshbg is on a distinguished road
Hi, thank you for your reply, but there is an easier way in fluent... go to Define > Units > temperature and change from kelvin to celsius.

In openFoam I am looking for an easier way probably by making use of some of its utilities, could anyone please help me out with this.

Regards,
Shailesh
shaileshbg is offline   Reply With Quote

Old   January 9, 2018, 04:38
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Hi Shailesh,

I'm not sure to understand your problem but why don't you just use the calculator in paraview to create a temperature field in Celsius ?
Yann is offline   Reply With Quote

Old   January 9, 2018, 08:53
Default Need to use Plot over Line
  #5
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 9
shaileshbg is on a distinguished road
Hello Yann,

Thank you very much for your reply, I did try with calculator in paraview to create a temperature field in celsius but I do not know how to use that 'result array' while plotting lines using 'Plot over Line'.

So when I plot a graph using 'Plot over Line' with temperature as y co-ordinate I still get the values in kelvins.

So I thought I should import the values into paraview in celsius itself so that my graphs will be in celsius. Could you please help me with this or let me know how to use the resultant celsius array while plotting using plot over line.

Thank you very much for your time,
Shailesh
shaileshbg is offline   Reply With Quote

Old   January 9, 2018, 10:55
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,238
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Shailesh,

You can convert your temperature field from Kelvin to Celsius using the calculator filter in paraview. Be careful to apply your calculator filter on the whole internalMesh if you want to have the temperature field in the whole domain.

In the calculator, select the "T" field in the list of scalar to perform your conversion (T-273.15). You can specify the result array name. Default is "Result" but you can go for anything you want, like Tcelsius for the sake of clarity.

Then you can use the "plot over line" filter using you Calculator filter as source and you'll be able to select the field created with the calculator ("Result" or "Tcelsius") in your plot.

Have fun!
Yann
Robert Wietecki likes this.
Yann is offline   Reply With Quote

Old   January 10, 2018, 01:38
Default its working
  #7
Member
 
Shailesh BG
Join Date: Aug 2017
Location: Bangalore
Posts: 39
Rep Power: 9
shaileshbg is on a distinguished road
Thank you very much Yann, this is exactly what I was looking for, it is working fine now.

Thank you for your time and have a great day ahead.

Regards,
Shailesh
shaileshbg is offline   Reply With Quote

Reply

Tags
openfoam 5.0, paraview 5.4.0, postprocessing


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Shadow Wall and temperature norger FLUENT 10 September 28, 2019 12:43
Inlet won't apply UDF and has temperature at 0K! tccruise Fluent UDF and Scheme Programming 2 September 14, 2012 07:08
difference of temperature HKH FLUENT 0 January 28, 2010 03:45
monitoring point of total temperature rogbrito FLUENT 0 June 21, 2009 18:31
Temperature in vessel during throttling process Astrid Main CFD Forum 2 January 31, 2001 03:34


All times are GMT -4. The time now is 15:50.