Claudio,
I am a FLASH user, and maybe I know what's the problem with the ioniz
module. I suggest to give a look to the neitest example in the setups
directory of FLASH.
The setup of the mass fractions should be done as follows:
1) First you need to call the sct_element and get_frac routines
if (firstCall) then
..........
call sct_element(idx) ! select the elements in the ioniz
module
call get_frac(xfrac) ! determine the weight to be used in
the mass fraction definition
..........
firstCall = .FALSE.
endif
2) Then you can setup the mass fractions as follows:
xn(ind_ion(1)) = xfrac(1) ! Hydrogen
xn(ind_ion(2)) = xfrac(2) ! electron
id = 2
do nel = 1,nelem ! other elements
if (idx(nel).eq.1) then
call equil(temp_zone,nel,nion,delem) ! compute the
population fractions
! of each element
assuming equilibrium
! of ionization
nion = nelect(nel)+1
do inn = 1,nion
id = id+1
xn(ind_ion(id)) = delem(inn)*xfrac(id)
enddo
endif
enddo
The get_frac routine is necessary because the NEI module requires that
the sum of the pop. fractions of *each* element is 1.0. On the other
hand, the sum of all the species should be one as well. The get_frac
provides the weight necessary to meet both requirements.
The report "Non-equilibrium Ionization Module" in
http://www.astropa.unipa.it/progetti_ricerca/scan/ireport.html can give
(I hope) some additional suggestions.
In addition, if you need to define your own abundances, this should be
done modifying the routine init_mat.F90 in which the abundances of the
elements as well as those of hydrogen and electrons are defined. In this
case copying init_mat.F90 in your setup directory is strongly suggested.
Hope this solves your problem.
Ciao
Salvatore
Claudio Dalla Vecchia wrote:
>
> Hi everybody,
>
> unfortunally the flash manual is not helping me. I would like to
> know what I am doing wrong - because I am sure something is wrong :)
>
> I am setting up a problem in which I need to include a composition module.
> For now it is enough to have just helium and hydrogen, so I put
>
> REQUIRES materials/composition/ioniz/He
>
> in the Config file. At this point
>
> NUMSPECIES = 5
>
> and the code is keeping trace of this species:
>
> H, e, HeI, HeII and HeIII
>
> Good! Reading the manual (10.3.6) hydrogen and electrons are two species
> - computing NUMSPECIES.
>
> Let me now set up the mass fractions that should be, using cosmological
> abundances, and a temperature of 10^8 K (full ionized medium):
>
> H xn(1) = smallx
> e xn(2) =
> 0.76 * emass/(1.0205 * pmass) + 2.0 * 0.24 * emass/(4.002602 * pmass)
> HeI xn(3) = smallx
> HeII xn(4) = smallx
> HeIII xn(5) = 0.24 - sum(xn(1:4))
>
> where
>
> emass = electron mass
> pmass = proton mass
> etc . . .
>
> All this, supposing H is neutral hydrogen and the fraction of electrons
> takes account of HII. There is no HII in the routines - at least, I have
> not seen it.
>
> But, as Mike Zingale wrote on the mailing list, the sum of all xn should
> be 1.0! So, how can I take account of all the HII (ca. 76% of the mass) I
> have?
>
> Hoping to have been clear,
> thank you for the answer.
>
> Claudio.
>
> --
> ***********************************************************************
> Claudio Dalla Vecchia e-mail: claudio.dalla-vecchia@durham.ac.uk
> Institute for Computational web: http://star-www.dur.ac.uk/~caius/
> Cosmology, South Road tel: +44 (0)191 33 43787 linux user
> Durham DH1 3LE - UK fax: +44 (0)191 33 43645 #275369
> -----------------------------------------------------------------------
> "Everywhere I look you're all I see
> Just a fucking reminder of who I used to be"
> ("Something I Can Never Have" - Nine Inch Nails)
> ***********************************************************************
-- I N A F Istituto Nazionale di Astrofisica Osservatorio Astronomico di Palermo "G.S. Vaiana" Piazza del Parlamento 1, I-90134 Palermo, Italy Tel. +39-91-233 423, Fax. +39-91-233 444 Web http://www.astropa.unipa.it/~orlandoReceived on Thu May 22 07:47:22 2003
This archive was generated by hypermail 2.1.8 : Thu Aug 31 2006 - 21:20:48 CDT