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

How to increase the output precision for a variable?

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes
  • 3 Post By Lieven
  • 3 Post By wyldckat

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 19, 2013, 15:31
Default How to increase the output precision for a variable?
  #1
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 14
ripperjack is on a distinguished road
Hi all,

I am using OpenFOAM to simulate channel flows. I have a problem, and you guys can help me? Thanks.

I specified a very small temperature difference on top and bottom walls (e.g. 300.005 at top and 299.995 at the bottom wall), it seems that the temperature precision is not enough because when I check the T output in the flow field, the results are just 300.004, 300.003, etc. But what I expect is more accurate T value, like 300.004142, 300.003125. I want to increase the precision of temperature, how can I do it?

Regards
ripperjack is offline   Reply With Quote

Old   April 19, 2013, 16:52
Default
  #2
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 14
ripperjack is on a distinguished road
I have checked my openfoam configuration, the $WM_PRECISION_OPTION=DP. It seems that it is double precision, but the output results just have 6 valid digits, it is weird....
ripperjack is offline   Reply With Quote

Old   April 19, 2013, 16:55
Default
  #3
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Leuven, Belgium
Posts: 299
Rep Power: 22
Lieven will become famous soon enough
U can control the "writePrecision" in the system/controlDict file.

Just a small question, how meaningful is writing the temperature up to 5 digits after the decimal point. Can't you assume the flow to be isothermal?

Cheers,

L
wyldckat, ripperjack and A H Gazi like this.
Lieven is offline   Reply With Quote

Old   April 19, 2013, 16:59
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,982
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings ripperjack,

I was trying to make a witty comment, but I'm too burn out from the long week of work... oh well...

So, here's what's happening: OpenFOAM is doing exactly what you told it to do!

Check your "system/controlDict"; then check the user guide: http://www.openfoam.org/docs/user/controlDict.php
There are two very important details here:
  1. "writePrecision" - 6 is the default and is the number of digits stored in the files.
  2. "writeFormat" - well, you have to read both entries to figure it out, but the idea is that "binary" mode preserves the full data resolution!
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   April 19, 2013, 19:04
Default
  #5
Member
 
Jack
Join Date: Dec 2011
Posts: 94
Rep Power: 14
ripperjack is on a distinguished road
Hi Lieven wyldckat,

Many thanks for your reply! I am simulating heat transfer using DNS method, the velocity is very small, so is the temperature difference. Now my results make sense. Thanks again and have a great weekend!

Regards
ripperjack is offline   Reply With Quote

Reply


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
OpenFoam-1.6-ext Allwmake compilation error - one last barrier Pat84 OpenFOAM Installation 15 July 25, 2012 22:49
Condensation as an additional variable Clark Griswold CFX 2 April 21, 2012 08:20
Additional variable as output of an expression Chander CFX 1 November 22, 2011 13:54
help !!!!variable output in cylindrical coordinate rohit Phoenics 3 September 8, 2004 22:28
How to output one variable which is not stored sun Phoenics 3 June 18, 2002 03:37


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