Changeset 2276
- Timestamp:
- 07/28/08 01:45:32 (6 months ago)
- Location:
- trunk/source
- Files:
-
- 2 modified
-
atom_hyperfine.cpp (modified) (4 diffs)
-
lines_service.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/atom_hyperfine.cpp
r2271 r2276 10 10 /*H21cm_proton - evaluate proton spin changing H atom collision rate, */ 11 11 #include "cddefines.h" 12 #include "conv.h" 12 13 #include "lines_service.h" 13 14 #include "phycon.h" … … 60 61 ASSERT( a21>0. ); 61 62 62 /* >>chng 04 dec 01, add hyperfine.lgLya_pump_21cm, option to turn off Lya pump 63 * of 21 cm, with no 21cm lya pump */ 63 /* hyperfine.lgLya_pump_21cm is option to turn off Lya pump 64 * of 21 cm, with no 21cm lya pump command - note that this 65 * can be negative if Lya mases - can occur during search phase */ 64 66 occnu_lya = OccupationNumberLine( &Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s] ) * 65 67 hyperfine.lgLya_pump_21cm; 66 67 /* >>chng 05 apr 20, GS, the lya occupation number for the hyperfine levels 0S1/2 and 1S1/2 are different*/ 68 if( occnu_lya<0 ) 69 { 70 static bool lgCommentDone = false; 71 /* Lya is masing - could be due to very bad solution in search phase */ 72 if( !conv.lgSearch && !lgCommentDone ) 73 { 74 fprintf(ioQQQ, 75 "NOTE Lya masing will invert 21 cm, occupation number set zero\n"); 76 lgCommentDone = true; 77 } 78 occnu_lya = 0.; 79 } 80 81 /* Lya occupation number for the hyperfine levels 0S1/2 and 1S1/2 are different*/ 68 82 texc = TexcLine( &Transitions[ipH_LIKE][ipHYDROGEN][ipH2p][ipH1s] ); 69 /* >>chng 05 apr 21, GS, Energy difference between 2p1/2 and 2p3/2 istaken from NSRDS */83 /* Energy difference between 2p1/2 and 2p3/2 taken from NSRDS */ 70 84 if( texc > 0. ) 71 85 { 72 /* convert to boltz factor, which will applied to occupation number of hiher energy transition */ 86 /* convert to Boltzmann factor, which will applied to occupation 87 * number of higher energy transition */ 73 88 texc1 = sexp(0.068/texc); 74 89 texc2 = sexp(((82259.272-82258.907)*T1CM)/texc); … … 134 149 HFLines[0].Hi->Pop = (x/(1.+x))* PopTot; 135 150 HFLines[0].Lo->Pop = (1./(1.+x))* PopTot; 151 ASSERT( HFLines[0].Hi->Pop >0. ); 152 ASSERT( HFLines[0].Lo->Pop >0. ); 136 153 137 154 /* the population with correction for stimulated emission */ … … 140 157 /* number of escaping line photons, used elsewhere for outward beam */ 141 158 HFLines[0].Emis->phots = a21*HFLines[0].Hi->Pop; 142 159 ASSERT( HFLines[0].Emis->phots >= 0. ); 143 160 /* intensity of line */ 144 161 HFLines[0].Emis->xIntensity = HFLines[0].Emis->phots*HFLines[0].EnergyErg; -
trunk/source/lines_service.cpp
r2267 r2276 142 142 ASSERT( t->ipCont > 0 ); 143 143 144 /* routine to evaluate line photon occupation number */ 145 if( t->Lo->Pop > SMALLFLOAT ) 144 /* routine to evaluate line photon occupation number - 145 * return negative number if line is maser */ 146 if( fabs(t->Emis->PopOpc) > SMALLFLOAT ) 146 147 { 147 148 /* the lower population with correction for stimulated emission */ 148 double PopLo_corr = t->Lo->Pop / t->Lo->g - t->Hi->Pop / t->Hi->g;149 OccupationNumberLine_v = ( t->Hi->Pop / t->Hi->g )/SDIV(PopLo_corr )*149 OccupationNumberLine_v = ( t->Hi->Pop / t->Hi->g ) / 150 ( t->Emis->PopOpc / t->Lo->g ) * 150 151 (1. - t->Emis->Pesc); 151 152 } … … 154 155 OccupationNumberLine_v = 0.; 155 156 } 157 /* return value is not guaranteed to be positive - negative if 158 * line mases */ 156 159 return( OccupationNumberLine_v ); 157 160 } … … 407 410 transition * t) 408 411 { 409 410 412 DEBUG_ENTRY( "PutCS()" ); 411 413 412 /* collision strength must not be negative, had been test for being positive, 413 * but called with zero - did not check why 98 jul 5 */ 414 ASSERT( cs >= 0. ); 414 /* collision strength must be negative */ 415 ASSERT( cs > 0. ); 415 416 416 417 t->Coll.col_str = (realnum)cs; 418 417 419 return; 418 420 }
