# writePrecision has any effect in accuracy?

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 August 12, 2013, 01:43 writePrecision has any effect in accuracy? #1 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 19 Sponsored Links does writePrecision has any effect on results or its only for representation of numbers to the user? which value is better? Code: writePrecision 10; __________________ Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked.

 August 12, 2013, 03:12 #2 Member   Hrushi Join Date: Jan 2013 Posts: 58 Rep Power: 6 I think it does. Since the NS equ is non-linear, it will amplify the errors if they are introduced due to precision, particularly if you are solving a problem with turbulence.

 August 12, 2013, 03:36 #3 Senior Member   Join Date: Mar 2010 Location: Germany Posts: 154 Rep Power: 9 In my understanding it has no effect on the internal accuracy during the solution process. The effects described in the previous post should only occur when starting from a state that has been written to disk with a lower precision.

 August 12, 2013, 04:17 #4 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 19 thanks both Hrushi and Cutter then if I improve writePrecision from 10 to 12 for example does the results become more accurate(because of more significant figures)? or it produce some amplifying errors in return? my case is unsteady turbulent and compressible,which value you suggest? __________________ Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked.

 August 12, 2013, 04:23 #5 Super Moderator     Niklas Nordin Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 693 Rep Power: 22 you should always use binary format and then the writePrecision is just for presentation and has no effect. If you have ascii format and perform a parallel calculation you should be aware that the processore to processor communication is streamed via the Pstream library and thus the precision can be influential, but Im not sure.

 August 12, 2013, 04:39 #6 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 19 Hi Niklas thanks,I need to make some changes in variables(around each 500000 iterations)in groovyBC during run so it seems I can't use binary files unless there is a way to convert binary files need to change to ascii ones so that performing modifications can be done. how can see which value is specified for Pstream? what value is better in your opinion? what may be its other effects? it causes to take more space on disc and more run time too? __________________ Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked.

 August 12, 2013, 04:49 #7 Super Moderator     Niklas Nordin Join Date: Mar 2009 Location: Stockholm, Sweden Posts: 693 Rep Power: 22 i suggest you perform a simple parallel run test on one of the tutorials and test with 2 different values on writePrecision for instance 3 and 12 if the results differ...then you know

 August 12, 2013, 04:57 #8 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,210 Rep Power: 19 OK does it account for all the digits or digits after points? for example if a number is 12345.111 and writePrecision be 5 it will included in calculations with 12345? isn't there away so that we can specify number of digits after "."? __________________ Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked.

August 12, 2013, 09:45
#9
Senior Member

Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 14
Quote:
 Originally Posted by immortality unless there is a way to convert binary files need to change to ascii ones
Consider foamFormatConvert

August 13, 2013, 04:08
#10
Senior Member

Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,210
Rep Power: 19
Hi
It seems a bit tricky.in variables like pressure and temperature that a multi-diagonal matrix is solved for them it seems that writePrecision has not much effect BUT in rho that is calculated from other fields by perfect gas equation it is important.
I tested rhoCentralFoam/forwardStep for two different writePrecisions 2 and 12.
these are writePrecisions 2; results:
Attached Images
 p_writePrecision=2.jpg (11.7 KB, 35 views) T_writePrecision=2.jpg (11.5 KB, 25 views) U_writePrecision=2.jpg (13.4 KB, 32 views) rho_writePrecision=2.jpg (11.6 KB, 29 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

August 13, 2013, 04:12
#11
Senior Member

Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,210
Rep Power: 19
due to limitation of numbers of attachments(5) I put writePrecision=5 results here.
correct if my conclusion isn't true.
I appreciate for other comments and experiments.
Attached Images
 p_writePrecision=12.jpg (12.6 KB, 30 views) T_writePrecision=12.jpg (12.1 KB, 20 views) U_writePrecision=12.jpg (13.1 KB, 22 views) rho_writePrecision=12.jpg (12.0 KB, 24 views)
__________________
Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King.
To Be or Not To Be,Thats the Question!
The Only Stupid Question Is the One that Goes Unasked.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post kjetil OpenFOAM Running, Solving & CFD 10 April 27, 2010 13:35 ganesh Main CFD Forum 0 February 29, 2008 06:32 zonexo Main CFD Forum 4 August 14, 2006 00:36 diaw Main CFD Forum 104 February 16, 2006 06:44 Qu Kun Main CFD Forum 0 September 6, 2004 09:19