[FLASH-USERS] Best practice for referencing Abar, Zbar

Aaron Froese aaron.froese at generalfusion.com
Thu May 5 14:29:24 EDT 2011


Hi all,

A method for calling the local ion mass and charge averaged over all species is listed in the manual.

--------------
#include "Flash.h"
#include "Multispecies.h"
USE Multispecies_interface, ONLY: Multispecies_getSumInv, Multispecies_getSumFrac

call Multispecies_getSumInv(A,abar_inv)
abar = 1.e0 / abar_inv
call Multispecies_getSumFrac(Z,zbar)
zbar = abar * zbar
--------------

However, hy_uhd_getFaceFlux.F90 contains the following code which does not include the Multispecies header file.

--------------
#ifdef YE_MSCALAR
              eosData(EOS_ABAR)=1./U(SUMY_MSCALAR,i-1,j,k)
              eosData(EOS_ZBAR)=U(YE_MSCALAR,i-1,j,k)/U(SUMY_MSCALAR,i-1,j,k)
#endif
--------------

It obviously relies on the ion and electron densities per unit mass SUMY and YE being included as mass scalars in the Config file.

--------------
MASS_SCALAR YE    EOSMAPIN: YE
MASS_SCALAR SUMY  EOSMAPIN: SUMY
--------------

However, when I run a test with one specie of A=1 and Z=1, the latter code gives me Abar=Inf and Zbar=NaN.  Does using mass scalars confer any advantage over using the Multispecies subroutines?  If so, does anyone have an MHD example where the mass scalar approach is working properly?

Thanks,
Aaron


More information about the flash-users mailing list