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
00035 DEBUG_ENTRY( "IonNitro()" );
00036
00037
00038 if( !dense.lgElmtOn[ipNITROGEN] )
00039 {
00040 return;
00041 }
00042
00043 ion_zero(ipNITROGEN);
00044
00045 ion_photo(ipNITROGEN,false);
00046
00047
00048 ion_collis(ipNITROGEN);
00049
00050
00051
00052 ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipNITROGEN);
00053
00054
00055
00056 if( dense.xIonDense[ipNITROGEN][0] > 0. )
00057 {
00058 t_phoHeat photoHeat;
00059
00060 atoms.d5200r = (realnum)GammaK(opac.in1[0],opac.in1[1],opac.in1[2],1.,&photoHeat);
00061
00062 ionbal.PhotoRate_Shell[ipNITROGEN][0][2][0] = ionbal.PhotoRate_Shell[ipNITROGEN][0][2][0]*
00063 (1. - atoms.p2nit) + atoms.p2nit*atoms.d5200r;
00064 ionbal.PhotoRate_Shell[ipNITROGEN][0][2][1] = ionbal.PhotoRate_Shell[ipNITROGEN][0][2][1]*
00065 (1. - atoms.p2nit) + photoHeat.HeatNet*atoms.p2nit;
00066 }
00067 else
00068 {
00069 atoms.p2nit = 0.;
00070 atoms.d5200r = 0.;
00071 }
00072
00073
00074 # if 0
00075 broken();
00076 if(nzone == 1 )
00077 lgDebug = true;
00078 else
00079 lgDebug = false;
00080 # endif
00081 lgDebug = false;
00082 ion_solver(ipNITROGEN,lgDebug);
00083
00084 if( trace.lgTrace && trace.lgHeavyBug )
00085 {
00086 fprintf( ioQQQ, " IonNitro retun; frac=" );
00087 for( int i=0; i < 8; i++ )
00088 {
00089 fprintf( ioQQQ, "%10.3e", dense.xIonDense[ipNITROGEN][i]/
00090 dense.gas_phase[ipNITROGEN] );
00091 }
00092 fprintf( ioQQQ, "\n" );
00093 }
00094 return;
00095 }