cloudy
trunk
|
00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 /*IonBoron ionization balance for boron */ 00004 #include "cddefines.h" 00005 #include "dense.h" 00006 #include "trace.h" 00007 #include "ionbal.h" 00008 00009 void IonBoron(void) 00010 { 00011 const int NDIM = ipBORON+1; 00012 00013 static const double dicoef[2][NDIM] = { 00014 {2.54e-3,6.15e-3,1.62e-3,4.78e-2,0.}, {4.42e-2,5.88e-2,0.343,0.362,0.} 00015 }; 00016 static const double dite[2][NDIM] = { 00017 {1.57e5,1.41e5,8.19e4,3.44e6,0.}, {3.74e5,1.41e5,1.59e5,5.87e5,0.} 00018 }; 00019 static const double ditcrt[NDIM] = {1.2e4,1.2e4,1.1e4,4.4e5,1e20}; 00020 static const double aa[NDIM] = {1.8267,2.3196,0.,0.,0.}; 00021 static const double bb[NDIM] = {4.1012,10.7328,0.,0.,0.}; 00022 static const double cc[NDIM] = {4.8443,6.8830,0.,0.,0.}; 00023 static const double dd[NDIM] = {.2261,-0.1824,0.,0.,0.}; 00024 static const double ff[NDIM] = {0.5960,0.4101,0.1,0.1,0.}; 00025 00026 DEBUG_ENTRY( "IonBoron()" ); 00027 00028 /* boron nelem=5 00029 * data are for carbon 00030 * 00031 * real CollidRate(nelem,2) 00032 * 00033 * rates from Shull and van Steenberg, Ap.J. Sup 48, 95. */ 00034 /* DATA GRDEFF/0.10,0.10,0.10,0.053,0.10/ 00035 * GRDEFF is fraction of recombinations to ground state, used for 00036 * outward diffuse fields 00037 * 00038 * rec from +3, +4 from Arnaud et al Ast Ap Sup 60 425. (1985) 00039 * rec from fully ionized uses Seaton '79 in ionrat */ 00040 /* Pequignot and Aldrovandi Ast Ap 161, 169. */ 00041 00042 if( !dense.lgElmtOn[ipBORON] ) 00043 { 00044 return; 00045 } 00046 00047 /* zero out ionization balance arrays */ 00048 ion_zero(ipBORON); 00049 00050 ion_photo(ipBORON,false); 00051 00052 /* find collisional ionization rates */ 00053 ion_collis(ipBORON); 00054 00055 /* get recombination coefficients */ 00056 ion_recomb(false,(const double*)dicoef,(const double*)dite,ditcrt,aa,bb,cc,dd,ff,ipBORON); 00057 00058 /* solve for ionization balance */ 00059 ion_solver(ipBORON,false); 00060 00061 if( trace.lgTrace && trace.lgHeavyBug ) 00062 { 00063 fprintf( ioQQQ, " Boroni returns; frac=" ); 00064 for( int i=0; i < ipBORON+2; i++ ) 00065 { 00066 fprintf( ioQQQ, "%10.3e", dense.xIonDense[ipBORON][i]/ 00067 dense.gas_phase[ipBORON] ); 00068 } 00069 fprintf( ioQQQ, "\n" ); 00070 } 00071 return; 00072 }