[FLASH-USERS] Bug in Ionize Unit
Klaus Weide
klaus at flash.uchicago.edu
Fri Sep 19 18:08:12 EDT 2014
On Wed, 13 Aug 2014, Jason Galyardt wrote:
> Dear FLASH Users,
>
> Since I can't submit to the flash-bugs list, and there's no public bug
> tracking system, I'm submitting my bug report here. If there's a better
> forum for such communications, by all means let me know.
Hello Jason,
Your message has not been forgotten...
You need to be subscribed to the flash-bugs mailing list in order to post
to it, just as with flash-users, unfortunately something like this is
necessary to protect the lists from lots of spam. Anyway, writing to
flash-users is also okay, messages about bugs will be seen by right
people.
> I've come across a bug in the Ionize unit which prevents an update to the
> internal energy due to evolution of the population fractions. Specifically,
> the file in question is [FLASH4.2.2]:
>
> source/physics/sourceTerms/Ionize/IonizeMain/Ionize.F90 .
>
> The lines in question are lines 128 - 140; an update to the internal energy
> is calculated and stored in the local variable 'ei', but never propagated
> to the 'solnData' array. When the equation of state is invoked later on (in
> MODE_DENS_EI mode, no less), it uses the old internal energy as input. The
> updated internal energy from the Ionize unit is thus thrown away.
>
> To fix this bug, the internal energy should be updated in the solnData
> array, along with the total energy (the following 2 lines replace line 137
> in IonizeMain/Ionize.F90):
>
> solnData(EINT_VAR,i,j,k) = ei
> solnData(ENER_VAR,i,j,k) = ei + ek
>
> I do not have any data on the effects of this bug, but it does seem to have
> existed since at least FLASH 2.5. Please let me know if you need more
> information.
I agree that the added line
solnData(EINT_VAR,i,j,k) = ei
SHOULD be there, and have added it to our code. All physics units
that modify energy SHOULD keep 'eint' and 'ener' consistent with
each other.
However, in the case of Ionize.F90 this is just for clarity, and
potentially for user-modified implementations of the integration routines;
there are reasons why this change does not matter at all for the code as
it is distributed (and I am surprised that you noticed the omission in any
way).
The code in question is subject to a test whether 'sdot' is nonzero;
sdot is meant to be an energy change rate. However, 'sdot' is always
returned as zero by the integration routines distributed with FLASH,
unfortunately. This is a limitation that is documented in the Users
Guide:
| 16.2 Ionization Unit
...
| 16.2.1 Algorithms
...
| Note that in the present version, the contribution of the ionization
| and recombination to the energy equation (the bracketed term in
| (16.23)) is not accounted for.
We do not currently use the Ionize unit in any research at the Flash
Center, and I am not aware of external users of the current code
either. Improvements to the capabilities of the code are welcome, and
have a good chance of getting included in future realeases if
accompanied by some test setups and/or unit tests!
Klaus
More information about the flash-users
mailing list