mass blance

Exchange about the physics background, diffuse interface theory, etc..
Post Reply
zhubq
Posts: 84
Joined: Mon Jun 22, 2009 7:33 pm

mass blance

Post by zhubq » Fri May 20, 2011 9:38 pm

Hi, Bernd
when I run a diffusional transformation simulation, I find that MICRESS could keep the mass balance accurately during the whole simulation.
But in my own codes, I found that the mass balance cannot be kept exactly, there is always accumulated error (maybe quite small every iteration) and the error is significant after thousands of calculation steps. The solution i've found is to use double precision which could keep the error in a acceptable range. What's your comment on this? Thank you.

Ben

Bernd
Posts: 1144
Joined: Mon Jun 23, 2008 9:29 pm

Re: mass blance

Post by Bernd » Mon May 23, 2011 8:10 pm

Hi zhubq,

for exactly this reason, we are using double precision (R8) in MICRESS for the diffusion solver, even if the memory usage is higher!
We found the strongest problems when using the 1d extension of the concentration field with long-range diffusion profiles.
Of course, one can try to reduce problems by "intelligent" programming, like to avoid calculating differences beween variables with values of different orders of magnitude, or not calculating twice the same fluxes between neighbour cells but store them instead. But you never can be sure, so I would advice you to use R8!

Bernd

zhubq
Posts: 84
Joined: Mon Jun 22, 2009 7:33 pm

Re: mass blance

Post by zhubq » Tue May 24, 2011 11:36 pm

Bernd wrote:Hi zhubq,

for exactly this reason, we are using double precision (R8) in MICRESS for the diffusion solver, even if the memory usage is higher!
We found the strongest problems when using the 1d extension of the concentration field with long-range diffusion profiles.
Of course, one can try to reduce problems by "intelligent" programming, like to avoid calculating differences beween variables with values of different orders of magnitude, or not calculating twice the same fluxes between neighbour cells but store them instead. But you never can be sure, so I would advice you to use R8!

Bernd
Thanks, Bernd!
It seems using R8 is the best way.

Post Reply