Ticket #135: rt.diff
| File rt.diff, 5.2 kB (added by gary, 2 years ago) |
|---|
-
atom_level2.cpp
12 12 #include "rfield.h" 13 13 #include "thermal.h" 14 14 #include "cooling.h" 15 #include "conv.h" 16 #include "doppvel.h" 17 #include "rt.h" 15 18 #include "atoms.h" 16 19 17 20 void atom_level2(transition * t) … … 93 96 return; 94 97 } 95 98 99 // update RT quantities to keep them synched with level populations 100 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 101 RT_line_one( t, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 102 96 103 /* net rate down A21*(escape + destruction) */ 97 104 a21 = t->Emis->Aul*(t->Emis->Pesc+ t->Emis->Pdest + t->Emis->Pelec_esc); 98 105 -
atom_level3.cpp
4 4 #include "cddefines.h" 5 5 #include "phycon.h" 6 6 #include "physconst.h" 7 #include "conv.h" 8 #include "doppvel.h" 9 #include "rt.h" 7 10 #include "dense.h" 8 11 #include "transition.h" 9 12 #include "thermal.h" … … 168 171 TotalInsanity(); 169 172 } 170 173 174 long nelem; 171 175 /* abundances from the elements grid 172 176 * one of these must be a true line */ 173 177 if( g010 > 0. ) 174 178 { 175 179 /* put null terminated line label into chLab using line array*/ 176 180 chIonLbl(chLab, t10); 181 nelem = t10->Hi->nelem; 177 182 AbunxIon = dense.xIonDense[ t10->Hi->nelem -1][t10->Hi->IonStg-1]; 178 183 } 179 184 … … 181 186 { 182 187 /* put null terminated line label into chLab using line array*/ 183 188 chIonLbl(chLab, t21); 189 nelem = t21->Hi->nelem; 184 190 AbunxIon = dense.xIonDense[t21->Hi->nelem -1][t21->Hi->IonStg-1]; 185 191 } 186 192 … … 198 204 c = t20->EnergyK*phycon.teinv; 199 205 200 206 if( c == 0. ) 201 {202 207 c = a + b; 203 }204 208 205 209 /* if still neg at end, then success!, so possible to 206 210 * to check why zero returned */ … … 209 213 /* if two of the lines are below the plasma frequency, hand the third in atom_level2 */ 210 214 if( ( t10->EnergyErg/EN1RYD < rfield.plsfrq && t20->EnergyErg/EN1RYD < rfield.plsfrq ) ) 211 215 { 216 // update RT quantities to keep them synched with level populations 217 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 218 RT_line_one( t21, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 212 219 atom_level2( t21 ); 213 220 return; 214 221 } 215 222 else if( ( t10->EnergyErg/EN1RYD < rfield.plsfrq && t21->EnergyErg/EN1RYD < rfield.plsfrq ) ) 216 223 { 224 // update RT quantities to keep them synched with level populations 225 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 226 RT_line_one( t20, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 217 227 atom_level2( t20 ); 218 228 return; 219 229 } 220 230 else if( ( t20->EnergyErg/EN1RYD < rfield.plsfrq && t21->EnergyErg/EN1RYD < rfield.plsfrq ) ) 221 231 { 232 // update RT quantities to keep them synched with level populations 233 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 234 RT_line_one( t10, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 222 235 atom_level2( t10 ); 223 236 return; 224 237 } … … 314 327 ASSERT( (t20->Hi->nelem * t21->Hi->nelem == 0) || (t20->Hi->nelem == t21->Hi->nelem) ); 315 328 316 329 ASSERT( o10 > 0. && o21 > 0. && o20 > 0. ); 317 318 330 /*end sanity checks */ 319 331 320 332 /* net loss of line escape and destruction */ … … 335 347 temp12 = t21->EnergyK; 336 348 temp02 = t20->EnergyK; 337 349 temp01 = temp02 - temp12; 350 351 // update RT quantities to be in sync with level populations 352 RT_line_one( t21, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 353 RT_line_one( t20, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 338 354 } 339 355 340 356 else if( a21 == 0. ) … … 348 364 temp02 = t20->EnergyK; 349 365 temp01 = t10->EnergyK; 350 366 temp12 = temp02 - temp01; 367 // update RT quantities to be in sync with level populations 368 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 369 { 370 RT_line_one( t10, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 371 RT_line_one( t20, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 372 } 351 373 } 352 374 353 375 else if( a20 == 0. ) … … 361 383 temp01 = t10->EnergyK; 362 384 temp12 = t21->EnergyK; 363 385 temp02 = temp01 + temp12; 386 // update RT quantities to be in sync with level populations 387 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 388 { 389 RT_line_one( t21, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 390 RT_line_one( t10, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 391 } 364 392 } 365 393 366 394 else … … 375 403 temp02 = t20->EnergyK; 376 404 temp01 = t10->EnergyK; 377 405 temp12 = t21->EnergyK; 406 // update RT quantities to be in sync with level populations 407 if( conv.nTotalIoniz && !conv.lgLastSweepThisZone ) 408 { 409 RT_line_one( t21, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 410 RT_line_one( t10, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 411 RT_line_one( t20, true,0.f, GetDopplerWidth(dense.AtomicWeight[nelem-1]) ); 412 } 378 413 } 379 414 380 415 /* check all energies positive */ -
cool_dima.cpp
53 53 } 54 54 /* now put the cs into the line array */ 55 55 PutCS(cs,&TauLine2[i] ); 56 RT_line_one( &TauLine2[i], true,0.f, GetDopplerWidth(dense.AtomicWeight[TauLine2[i].Hi->nelem-1]) );57 56 atom_level2(&TauLine2[i] ); 58 57 } 59 58 }
