|
[Sponsors] |
August 12, 2013, 02:43 |
writePrecision has any effect in accuracy?
|
#1 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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, 04:12 |
|
#2 |
Member
Hrushi
Join Date: Jan 2013
Posts: 58
Rep Power: 13 |
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, 04:36 |
|
#3 |
Senior Member
Join Date: Mar 2010
Location: Germany
Posts: 154
Rep Power: 16 |
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, 05:17 |
|
#4 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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, 05:23 |
|
#5 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
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, 05:39 |
|
#6 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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, 05:49 |
|
#7 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
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, 05:57 |
|
#8 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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, 10:45 |
|
#9 |
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 22 |
||
August 13, 2013, 05:08 |
|
#10 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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:
__________________
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, 05:12 |
|
#11 |
Senior Member
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,208
Rep Power: 27 |
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.
__________________
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Accuracy of wall shear and velocity | kjetil | OpenFOAM Running, Solving & CFD | 10 | April 27, 2010 14:35 |
Temporal accuracy | ganesh | Main CFD Forum | 0 | February 29, 2008 06:32 |
effect of order of temporal accuracy | zonexo | Main CFD Forum | 4 | August 14, 2006 01:36 |
Can 'shock waves' occur in viscous fluid flows? | diaw | Main CFD Forum | 104 | February 16, 2006 06:44 |
accuracy of Discontinuous Galerkin | Qu Kun | Main CFD Forum | 0 | September 6, 2004 10:19 |