schuberm / dsmc

monte carlo of heat conduction from nanoparticle
16 stars 5 forks source link

The array CS(1,N) of program DSMC.FOR #2

Closed gialbokhary closed 11 years ago

gialbokhary commented 11 years ago

Hello every one. I'm confused about some matter. Consider for example the array CS(1,N) of program DSMC.FOR line 303 this array used to make a summation and most be initiated by zero but this hasn't done instead it has been initiated by very small number 1.E-6 as CS(1,N,L)=1.E-6. So my question is why?

gialbokhary commented 11 years ago

Sorry, the program name above is written incorrect and the right is: DSMC0.FOR

schuberm commented 11 years ago

I'd have to give a closer look, but my guess would be to avoid summation truncation.

gialbokhary commented 11 years ago

No, I don't think so, I mean the reason is not to avoid truncation for two reasons: 1- If it desired to avoid truncation then the array CS most be of type integer and it is double precision type and, 2- We had assigned the value 0.5 not 1.E-6 at the beginning.

schuberm commented 11 years ago

It seems to be used as a numerical safeguard so we aren't dividing integer by integer [Line 758 VEL(K)=CS(K+1,N,L)/CS(1,N,L)].