00001
00002
00003
00004 #include "cddefines.h"
00005 #include "dense.h"
00006 #include "thermal.h"
00007 #include "atoms.h"
00008 #include "opacity.h"
00009 #include "trace.h"
00010 #include "conv.h"
00011 #include "gammas.h"
00012 #include "ionbal.h"
00013
00014 void IonNitro(void)
00015 {
00016 const int NDIM = ipNITROGEN+1;
00017
00018 static const double dicoef[2][NDIM] = {
00019 {2.98e-3,7.41e-3,1.13e-2,2.62e-3,7.5e-2,4.61e-2,0.},
00020 {0.,.0764,.164,.243,.35,.309,0.}
00021 };
00022 static const double dite[2][NDIM] = {
00023 {2.2e5,2.01e5,1.72e5,1.02e5,4.75e6,5.44e6,0.},
00024 {0.,7.37e4,2.25e5,1.25e5,8.35e5,1.14e6,0.}
00025 };
00026 static const double ditcrt[NDIM] = {1.8e4,1.8e4,2.4e4,1.5e4,6.8e5,1.0e6,1e20};
00027 static const double aa[NDIM] = {0.0,0.0320,-0.8806,0.4134,0.,0.,0.};
00028 static const double bb[NDIM] = {0.6310,-0.6624,11.2406,-4.6319,0.,0.,0.};
00029 static const double cc[NDIM] = {0.1990,4.3191,30.7066,25.9172,0.,0.,0.};
00030 static const double dd[NDIM] = {-0.0197,0.0003,-1.1721,-2.2290,0.,0.,0.};
00031 static const double ff[NDIM] = {0.4398,0.5946,0.6127,0.2360,0.1,0.,0.};
00032
00033 bool lgDebug;
00034 double save_rec;
00035
00036 DEBUG_ENTRY( "IonNitro()" );
00037
00038
00039 if( !dense.lgElmtOn[ipNITROGEN] )
00040 {
00041 DEBUG_EXIT( "IonNitro()" );
00042 return;
00043 }
00044
00045 ion_zero(ipNITROGEN);
00046
00047 ion_photo(ipNITROGEN,false);
00048
00049
00050 ion_collis(ipNITROGEN);
00051
00052
00053
00054
00055 ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipNITROGEN);
00056
00057
00058
00059
00060
00061
00062
00063 save_rec = ionbal.RateRecomTot[ipNITROGEN][0];
00064
00065
00066
00067
00068 # if 0
00069 if( dense.IonLow[ipNITROGEN]==0 &&
00070 co.hevmol[ipNP] > SMALLFLOAT &&
00071 ionbal.RateIonizTot[ipNITROGEN][0]*co.hevmol[ipATN]> 0. )
00072 {
00073 ionbal.RateRecomTot[ipNITROGEN][0] =
00074 ionbal.RateIonizTot[ipNITROGEN][0]*
00075 co.hevmol[ipATN]/co.hevmol[ipNP];
00076 }
00077 # endif
00078
00079
00080 if( dense.xIonDense[ipNITROGEN][0] > 0. )
00081 {
00082 atoms.d5200r = (float)GammaK(opac.in1[0],opac.in1[1],opac.in1[2],1.);
00083
00084
00085
00086
00087
00088
00089 if( !conv.nTotalIoniz )
00090 atoms.p2nit = 0.;
00091
00092 ionbal.PhotoRate_Shell[ipNITROGEN][0][2][0] = ionbal.PhotoRate_Shell[ipNITROGEN][0][2][0]*
00093 (1. - atoms.p2nit) + atoms.p2nit*atoms.d5200r;
00094 ionbal.PhotoRate_Shell[ipNITROGEN][0][2][1] = ionbal.PhotoRate_Shell[ipNITROGEN][0][2][1]*
00095 (1. - atoms.p2nit) + thermal.HeatNet*atoms.p2nit;
00096 }
00097 else
00098 {
00099 atoms.p2nit = 0.;
00100 atoms.d5200r = 0.;
00101 }
00102
00103
00104 # if 0
00105 broken();
00106 if(nzone == 1 )
00107 lgDebug = true;
00108 else
00109 lgDebug = false;
00110 # endif
00111 lgDebug = false;
00112 ion_solver(ipNITROGEN,lgDebug);
00113
00114
00115 if( save_rec > 0.)
00116 ionbal.RateRecomTot[ipNITROGEN][0] = save_rec;
00117
00118 if( trace.lgTrace && trace.lgHeavyBug )
00119 {
00120 fprintf( ioQQQ, " IonNitro retun; frac=" );
00121 for( int i=0; i < 8; i++ )
00122 {
00123 fprintf( ioQQQ, "%10.3e", dense.xIonDense[ipNITROGEN][i]/
00124 dense.gas_phase[ipNITROGEN] );
00125 }
00126 fprintf( ioQQQ, "\n" );
00127 }
00128
00129 DEBUG_EXIT( "IonNitro()" );
00130 return;
00131 }