/*MakeCharTran fill in the HCharExcIon and Rec arrays with Kingdon's fitted CT with H */ #include "cddefines.h" #include "phycon.h" #include "hchargtran.h" #include "converge.h" #include "makechartran.h" #include "charexc.h" void MakeCharTran( void ) { long int ion, nelem; static double TeUsed = -1.; # ifdef DEBUG_FUN fputs( "<+>MakeCharTran()\n", debug_fp ); # endif /* first is to force reevaluation on grids of constant density models */ if( !conv.nTotalIoniz || fabs(phycon.te-TeUsed)/phycon.te > 0.01 ) { /* refresh charge transfer arrays if temperature has changed */ for( nelem=2; nelem < LIMELM; nelem++ ) { for( ion=0; ion < nelem; ion++ ) { CharExc.HCharExcIon[nelem][ion] = (float)HCTIon(ion,nelem); CharExc.HCharExcRec[nelem][ion] = (float)HCTRecom(ion,nelem); } } TeUsed = phycon.te; } /* zero out charge transfer rate array */ /* first cell of vector is current value of ioniz/rec of elements * sec is lagging value, average of current and old * CTHrec is total rate (s^-1) for charge transfer neutralization of hydrogen * CTHion is same for ct ionization of hydrogen * chrener is energy exchange in Ryd */ CharExc.CTHion[0][0] = 0.; CharExc.CTHrec[0][0] = 0.; CharExc.CTHion[1][0] = 0.; CharExc.CTHrec[1][0] = 0.; CharExc.chrener = 0.; # ifdef DEBUG_FUN fputs( " <->MakeCharTran()\n", debug_fp ); # endif return; }