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

How to increase the output precision for a variable?

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree3Likes
  • 2 Post By Lieven
  • 1 Post By wyldckat

Reply
 
LinkBack Thread Tools Display Modes
Old   April 19, 2013, 14:31
Default How to increase the output precision for a variable?
  #1
Member
 
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
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, 15:52
Default
  #2
Member
 
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
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, 15:55
Default
  #3
Senior Member
 
Lieven
Join Date: Dec 2011
Location: Mol, Belgium
Posts: 295
Rep Power: 13
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 and ripperjack like this.
Lieven is offline   Reply With Quote

Old   April 19, 2013, 15:59
Default
  #4
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,251
Blog Entries: 34
Rep Power: 84
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
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
ripperjack likes this.
wyldckat is offline   Reply With Quote

Old   April 19, 2013, 18:04
Default
  #5
Member
 
Ping
Join Date: Dec 2011
Posts: 63
Rep Power: 5
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

Thread Tools
Display Modes

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 On
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 21:49
Condensation as an additional variable Clark Griswold CFX 2 April 21, 2012 07: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 21:28
How to output one variable which is not stored sun Phoenics 3 June 18, 2002 02:37


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