/**************************************************************************** * * * hydrogenic.h - * * this file contains the variables for the model hydrogen ions, * * and prototypes for the series of routines that drive the atom * * the EXTERN structure hydro is defined here - all H variables should migrate here* * * ****************************************************************************/ /* the routine that calls the hydrogenic routines */ void Hydrogenic(void); /*HydroCool compute net heating/cooling due to hydrogenc atom species */ void HydroCool( /* ipZ is charge -1, so 0 for H itself */ long int ipZ); /*HydroLevel solve for ionization balance level populations of model hydrogen atom */ void HydroLevel(long int ipZ); /*HydroLevelDep solve for departure coefs in hydrogen ionization balance */ void HydroLevelDep(long int ipZ , double **SaveZ/*[nhlevel+2][nhlevel+2]*/, double *bvec/*[nhlevel+2]*/, double *error/*[nhlevel+2]*/, double *work/*[nhlevel+2]*/, double **z/*[nhlevel+2][nhlevel+2]*/ , long int *ipiv , /* malloc out to [nhlevel+1] */ double *totcap/* malloc out to [nhlevel+1]*/); /*HydroLevelPop solve for departure coefs in hydrogen ionization balance */ void HydroLevelPop(long int ipZ , double **SaveZ/*[nhlevel+2][nhlevel+2]*/, double *bvec/*[nhlevel+2]*/, double *error/*[nhlevel+2]*/, double *work/*[nhlevel+2]*/, double **z/*[nhlevel+2][nhlevel+2]*/ , long int *ipiv , /* malloc out to [nhlevel+1] */ double *totcap/* malloc out to [nhlevel+1]*/); /*HydroCreate create data for hydrogen and helium, 1 one time per coreload */ void HydroCreate(void); /*HydroPesc evaluate escape and deEXTERN struction probabilities for hydrogen lines, * second parameter is flag saying whether to also do escape prob (TRUE) or * just the deEXTERN struction probabilites (FALSE) */ void HydroPesc(long int ipZ, int lgDoEsc); /*HydroCollid evaluate collision rate for model hydrogen atom */ void HydroCollid(long int ipZ); /*HydroOTS evaluate model hydrogen atom line and continuum ots rates */ void HydroOTS(void); /*HydroT2Low called to do hydrogenic level populations when temp too low for matrix */ void HydroT2Low(long int ipZ, double rfac); /*HydroRecCool hydrogen recombination cooling */ double HydroRecCool(long int n, long int ipZ); /*HydroBranch compute branching ratios for Jason's model hydrogen atom */ double HydroBranch(long int ihigh, long int ilow, long int iz); /*HydroSumTrans photoionization, recombination, radiative rates for model hydrogen atom */ void HydroSumTrans(long int ipZ); /*HydroPhoto photoionization, recombination, radiative rates for model hydrogen atom */ void HydroPhoto(long int ipZ); /*HydroRecom photoionization, recombination, radiative rates for model hydrogen atom */ void HydroRecom(long int ipZ); /*HydColIon calculate hydrogenic ionization rates for all n, and Z*/ double HydColIon( long int n, /* principal quantum number, > 1 * since only used for excited states */ long int iz);/* charge, >=1 since only used for ions * iz = 1 is helium the least possible charge */ /*Hydcs123 Hydrogenic de-excitation collision rates n=1,2,3 */ double Hydcs123(long int ilow, long int ihigh, long int iz, long int chType); /*H1cs123 hydrogen collision data levels involving 1s,2s,2p,3. */ double H1cs123(long int i, long int j, long int chType); /*He2cs123 line collision strengths for lower levels of helium ion, n=1,2,3, by K Korista */ double He2cs123(long int i, long int j); /*Ne10cs123 line collision rates for lower levels of hydrogenic neon, n=1,2,3 */ double Ne10cs123(long int i, long int j); /*Fe26cs123 line collision rates for lower levels of hydrogenic iron, n=1,2,3 */ double Fe26cs123(long int i, long int j); /*HydColDwn rate coefficient for collisional de-excitation for any levels of hydrogenic Z*/ double HydColDwn(long int ipHi, long int ipLo, long int iz); /* * nhlevel is the number of levels in hydrogenic atoms, * 0 is 1s, 1 is 2s, 2 is 2p, etc, going up to n = nhlevel * nhlevel is set on the fly with hydrogen levels command, and * all loops should be from IP1S to <= nhlevel * it is initialized in zero.c */ extern long int nhlevel ; /* all of these are initialized in zero */ EXTERN struct t_hydro { /* normally unity, set to zero when hydrogen collisional * ionization turned off with hydrogenic collisional ionization command */ float HColIonOn , /* normally unity, set to zero when hydrogen collisional * excitation turned off with hydrogenic collisional excitation command */ HColExcOn ; /* are collisions between 2s and 2p enabled?*/ int lgC2psOn; /* >>chng 99 nov 29 from float to double */ /* cooling due to various hydrogenic species, evaluated in HydroCool */ /* cooling due to Lya */ double coola[LIMELM], /* collisional ionization */ chion[LIMELM], /* hydrogen radiative recombination cooling */ HRadRecCool[LIMELM], hrest[LIMELM], barest[LIMELM], restly[LIMELM] , HLineTotCool[LIMELM], dHLTot[LIMELM]; /* flag to say (true) to produce emissivity for hydrogenic species, * rather than intensity (the default). Set with * hydrogen emissivity commmand. default is false */ int lgHydEmiss; /* FreFreHeat is free-free heating, evaluated in freeht*/ double FreeFreeHeat, /* total free free heating integrated over model */ FreeFreeTotHeat, /* FreeFreeCool is cooling, evaluated in coolr*/ FreeFreeCool , /* HFFNet is net cooling, negative if heating*/ /* heating stored in heating[11,0]*/ HFFNet; /* lgHiPop2 flag set if H n=2 population gets large relative to ground * pop2mx is maximum population of n=2 relative to ground */ int lgHiPop2; float pop2mx; /* hlbolt(low,up) line boltzmann factors for hydrogen atom*/ double ***hlbolt /*hlbolt[LIMELM][LMHLVL+1][LMHLVL+1]*/; /* hcbolt(n) excit to continuum */ double **hcbolt /*hcbolt[LIMELM][LMHLVL+1]*/; /* electron scattering escape probability * currently zeroed out in hydrotrans */ float ***esesc /*esesc[LIMELM][LMHLVL+1][LMHLVL+1]*/; /* net rates down for hydrogenic species */ float ***HRadNet /*HRadNet[LIMELM][LMHLVL+1][LMHLVL+1]*/; /* arrays for stark broadening in Puetter formalism */ float **strkar/*strkar[LMHLVL+1][LMHLVL+1]*/; float **pestrk/*pestrk[LMHLVL+1][LMHLVL+1]*/; /* hbn(level,nelem) departure coefficient, hbnOld is averaged value */ double **hbn/*hbn[LIMELM][LMHLVL+1]*/; /* collisional ionization */ float **hcolnc/*hcolnc[LIMELM][LMHLVL+1]*/; /* hn(level,nelem) population relative to ion, hnOld is averaged value */ float **hn/*hn[LIMELM][LMHLVL+1]*/; /* radiative recombination */ float ***hrec /*hrec[LIMELM][LMHLVL+1][3]*/; /* collisions between levels */ float ***hcol/*hcol[LIMELM][LMHLVL+1][LMHLVL+1]*/; /* dstfe2lya is destruction probability for Lya onto FeII, * net deexcitation of Lya but not ots destruction */ float dstfe2lya; /* ionizatoin potention of hydrogenic level n, set in hydrocreate * 0 is ground, 1 is 2s, 2 is 2p */ float HLevNIonRyd[LIMELM][NHYDRO_MAX_LEVEL]; } hydro; /* following three are defined in cddefines */ /* pointers within recombination coefficient array */ /* ipRecEsc is state specific escape probability*/ extern const int ipRecEsc /*= 2*/; /* the net, including deEXTERN struction by background and optical deepth*/ extern const int ipRecNetEsc /*= 1*/; /* ipRecRad is state specific radiative recombination rate*/ extern const int ipRecRad /*= 0*/;