Show
Ignore:
Timestamp:
03/15/08 13:48:18 (10 months ago)
Author:
rjrw
Message:

In most places, findrate is better than findrk as it has consistent
units and automatically includes factors of reactant density.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/mole_drive.cpp

    r1848 r1849  
    740740                        create_h3p = mole_findrate("H,H3+=>H2,H2+"); 
    741741                        create_h3pe = mole_findrate("e-,H3+=>H2,H");  
    742                         create_grains = mole_findrk("H,H,grnh=>H2*")+mole_findrk("H,H,grnh=>H2"); 
     742                        create_grains = mole_findrate("H,H,grnh=>H2*")+mole_findrate("H,H,grnh=>H2"); 
    743743                        create_hminus = (mole_findrate("H,H-=>H2,e-")+mole_findrate("H,H-=>H2*,e-")); 
    744744 
     
    760760                        /* >>chng 04 jan 28, had wrong Boltzmann factor, 
    761761                         * caught by gargi Shaw */ 
    762                         destroy_hm = (mole_findrk("H2,e-=>H,H-")+mole_findrk("H2*,e-=>H,H-"))*findspecies("e-")->den; 
     762                        destroy_hm = (mole_findrate("H2,e-=>H,H-")+mole_findrate("H2*,e-=>H,H-")); 
    763763                        /*destroy_hm2 = eh2hhm;*/ 
    764                         destroy_solomon = hmi.H2_Solomon_dissoc_rate_used_H2g; 
    765                         destroy_2h = (mole_findrk("H2,e-=>H,H,e-")+mole_findrk("H2*,e-=>H,H,e-")); 
    766                         destroy_hp = mole_findrk("H2,H+=>H3+")*findspecies("H+")->den; 
    767                         destroy_h = mole_findrk("H,H2=>H,H,H")*findspecies("H")->den; 
    768                         destroy_hp2 = mole_findrk("H2,H+=>H2+,H")*findspecies("H+")->den; 
    769                         destroy_h3p = mole_findrk("H2,H3+=>H2,H2+,H") * findspecies("H3+")->den; 
     764                        destroy_solomon = hmi.H2_Solomon_dissoc_rate_used_H2g * findspecies("H2")->den; 
     765                        destroy_2h = (mole_findrate("H2,e-=>H,H,e-")+mole_findrate("H2*,e-=>H,H,e-")); 
     766                        destroy_hp = mole_findrate("H2,H+=>H3+"); 
     767                        destroy_h = mole_findrate("H,H2=>H,H,H"); 
     768                        destroy_hp2 = mole_findrate("H2,H+=>H2+,H"); 
     769                        destroy_h3p = mole_findrate("H2,H3+=>H2,H2+,H"); 
    770770                        destroysum = destroy_hm + /*destroy_hm2 +*/ destroy_solomon + destroy_2h +  
    771771                                destroy_hp+ destroy_h+ destroy_hp2+ destroy_h3p; 
     
    796796                                destsum , createsum; 
    797797 
    798                         double sum_first_ions = 0.; 
    799                         long int nelem; 
    800  
    801                         for( nelem=ipHYDROGEN; nelem < LIMELM; nelem++ ) 
     798                        create_from_Ho = mole_findrate("H,e-=>H-,PHOTON"); 
     799                        create_3body_Ho = mole_findrate("H,e-,e-=>H-,e-"); 
     800                        /* total formation is sum of g and s attachment */ 
     801                        create_batach = (mole_findrate("H2,e-=>H,H-") + mole_findrate("H2*,e-=>H,H-")); 
     802                        destroy_photo = mole_findrate("H-,PHOTON=>H,e-"); 
     803                        destroy_coll_heavies = 0.; 
     804                        for( i=ipLITHIUM; i < LIMELM; i++ ) 
    802805                        { 
    803                                 if (nelem != ipHYDROGEN && nelem != ipHELIUM) 
    804                                         sum_first_ions += mole.list[element_list[nelem]->ipMl[1]]->den; 
    805                         } 
    806  
    807                         create_from_Ho = mole_findrk("H,e-=>H-,PHOTON")*findspecies("e-")->den; 
    808                         create_3body_Ho = mole_findrk("H,e-,e-=>H-,e-")*findspecies("e-")->den*findspecies("e-")->den; 
    809                         /* total formation is sum of g and s attachment */ 
    810                         create_batach = (mole_findrk("H2,e-=>H,H-") + mole_findrk("H2*,e-=>H,H-"))*findspecies("e-")->den; 
    811                         destroy_photo = hmi.HMinus_photo_rate; 
    812                         destroy_coll_heavies = mole_findrk("H-,Li+=>H,Li")*sum_first_ions; 
    813                         destroy_coll_electrons = mole_findrk("H-,e-=>H-,e-,e-")*findspecies("e-")->den; 
    814                         destroy_Hattach = mole.list[element_list[ipHYDROGEN]->ipMl[0]]->den*(mole_findrk("H,H-=>H2,e-")+mole_findrk("H,H-=>H2*,e-")); 
    815                         destroy_fhneut = mole_findrk("H-,H+=>H,H")*mole.list[element_list[ipHYDROGEN]->ipMl[1]]->den; 
     806                                char react[32]; 
     807                                if (dense.lgElmtOn[i])  
     808                                { 
     809                                        sprintf(react,"H-,%s=>H,%s",mole.list[element_list[i]->ipMl[1]]->label,element_list[i]->label); 
     810                                        destroy_coll_heavies += mole_findrate(react); 
     811                                } 
     812                        } 
     813                        destroy_coll_electrons = mole_findrate("H-,e-=>H-,e-,e-"); 
     814                        destroy_Hattach = (mole_findrate("H,H-=>H2,e-")+mole_findrate("H,H-=>H2*,e-")); 
     815                        destroy_fhneut = mole_findrate("H-,H+=>H,H"); 
    816816 
    817817                        destsum = destroy_photo + destroy_coll_heavies + destroy_coll_electrons +  
     
    912912        { 
    913913 
    914                 double sum_first_ions = 0.; 
    915                 long int nelem; 
    916  
    917                 for( nelem=ipHYDROGEN; nelem < LIMELM; nelem++ ) 
    918                 { 
    919                         if (nelem != ipHYDROGEN && nelem != ipHELIUM)                            
    920                                 sum_first_ions += mole.list[element_list[nelem]->ipMl[1]]->den; 
    921                 } 
    922  
     914                double destroy_coll_heavies = 0.; 
     915 
     916                for( i=ipLITHIUM; i < LIMELM; i++ ) 
     917                { 
     918                        char react[32]; 
     919                        if (dense.lgElmtOn[i])  
     920                        { 
     921                                sprintf(react,"H-,%s=>H,%s",mole.list[element_list[i]->ipMl[1]]->label,element_list[i]->label); 
     922                                destroy_coll_heavies += mole_findrate(react); 
     923                        } 
     924                } 
    923925                fprintf( ioQQQ, " MOLE, Dep Coef, H-:%10.2e H2:%10.2e H2+:%10.2e\n",  
    924926                  hmi.hmidep, hmi.h2dep, hmi.h2pdep ); 
    925927                fprintf( ioQQQ, "     H- creat: Rad atch%10.3e Induc%10.3e bHneut%10.2e 3bod%10.2e b=>H2%10.2e N(H-);%10.2e b(H-);%10.2e\n",  
    926                                                  mole_findrate("H,e-=>H-,PHOTON"), hmi.HMinus_induc_rec_rate, mole_findrate("H,H=>H-,H+"),  
     928                                                 mole_findrate("H,e-=>H-,PHOTON"), hmi.HMinus_induc_rec_rate*findspecies("H-")->den, mole_findrate("H,H=>H-,H+"),  
    927929                                                 mole_findrate("H,e-,e-=>H-,e-"),  
    928930                                                 mole_findrate("H2,e-=>H,H-"), findspecies("H-")->den, hmi.hmidep ); 
    929931 
    930932                fprintf( ioQQQ, "     H- destr: Photo;%10.3e mut neut%10.2e e- coll ion%10.2e =>H2%10.2e x-ray%10.2e p+H-%10.2e\n",  
    931                                                  hmi.HMinus_photo_rate, mole_findrk("H-,Li+=>H,Li")*sum_first_ions,  
    932                                                  mole_findrk("H-,e-=>H-,e-,e-")*findspecies("e-")->den,  
    933                                                  mole.list[element_list[ipHYDROGEN]->ipMl[0]]->den*(mole_findrk("H,H-=>H2,e-")+mole_findrk("H,H-=>H2*,e-")), iso.gamnc[ipH_LIKE][ipHYDROGEN][ipH1s],  
    934                                                  mole.list[element_list[ipHYDROGEN]->ipMl[1]]->den*mole_findrk("H-,H+=>H,H") ); 
     933                                                 mole_findrate("H-,PHOTON=>H,e-"), destroy_coll_heavies,  
     934                                                 mole_findrate("H-,e-=>H-,e-,e-"),  
     935                                                 (mole_findrate("H,H-=>H2,e-")+mole_findrate("H,H-=>H2*,e-")), iso.gamnc[ipH_LIKE][ipHYDROGEN][ipH1s]*findspecies("H-")->den,  
     936                                                 mole_findrate("H-,H+=>H,H") ); 
    935937                fprintf( ioQQQ, "     H- heating:%10.3e Ind cooling%10.2e Spon cooling%10.2e\n",  
    936938                                                 hmi.hmihet, hmi.HMinus_induc_rec_cooling, hmi.hmicol ); 
     
    993995                        fprintf(ioQQQ," debuggggrn grn\t%.2f\t%.3e\t%.3e\tfrac\t%.3e\tH-\t%.3e\t%.3e\tfrac\t%.3e\t%.3e\t%.3e\t%.3e\n", 
    994996                                fnzone , 
    995                                 mole_findrk("H,H,grnh=>H2*")+mole_findrk("H,H,grnh=>H2") ,  
     997                                mole_findrate("H,H,grnh=>H2*")+mole_findrate("H,H,grnh=>H2") ,  
    996998                                hmi.H2_forms_grains+hmi.H2star_forms_grains , 
    997                                                         mole_findrk("H,H,grnh=>H2*")/SDIV(mole_findrk("H,H,grnh=>H2*")+mole_findrk("H,H,grnh=>H2")), 
     999                                                        mole_findrate("H,H,grnh=>H2*")/SDIV(mole_findrate("H,H,grnh=>H2*")+mole_findrate("H,H,grnh=>H2")), 
    9981000                                                        (mole_findrate("H,H-=>H2,e-")+mole_findrate("H,H-=>H2*,e-")), 
    9991001                                hmi.H2star_forms_hminus+hmi.H2_forms_hminus, 
    10001002                                                        frac_H2star_hminus(), 
    1001                                                         (mole_findrk("H,H-=>H2,e-")+mole_findrk("H,H-=>H2*,e-")),findspecies("H")->den,findspecies("H-")->den 
     1003                                                        (mole_findrate("H,H-=>H2,e-")+mole_findrate("H,H-=>H2*,e-")),findspecies("H")->den,findspecies("H-")->den 
    10021004                                ); 
    10031005                } 
     
    10201022                                                        phycon.te,  
    10211023                                                        dense.eden, 
    1022                                                         (mole_findrk("H,H-=>H2,e-")+mole_findrk("H,H-=>H2*,e-")), 
    1023                                                         mole_findrk("H2,e-=>H,H-")*findspecies("e-")->den,  
    1024                                                         mole_findrk("H2*,e-=>H,H-")*findspecies("e-")->den,  
    1025                                                         mole_findrk("H,e-=>H-,PHOTON")*findspecies("e-")->den, 
    1026                                                         hmi.HMinus_induc_rec_rate, 
     1024                                                        (mole_findrate("H,H-=>H2,e-")+mole_findrate("H,H-=>H2*,e-")), 
     1025                                                        mole_findrate("H2,e-=>H,H-"),  
     1026                                                        mole_findrate("H2*,e-=>H,H-"),  
     1027                                                        mole_findrate("H,e-=>H-,PHOTON"), 
     1028                                                        hmi.HMinus_induc_rec_rate*findspecies("H-")->den, 
    10271029                                                        mole.list[element_list[ipHYDROGEN]->ipMl[0]]->den, 
    10281030                                                        mole.list[element_list[ipHYDROGEN]->ipMl[1]]->den, 
     
    10441046                                                         hmi.H2_rate_destroy,  
    10451047                                                         hmi.H2_Solomon_dissoc_rate_used_H2g / hmi.H2_rate_destroy,  
    1046                                                          mole_findrk("H2,e-=>H,H-")*findspecies("e-")->den / hmi.H2_rate_destroy,  
    1047                                                          mole_findrk("H,H2=>H,H,H") / hmi.H2_rate_destroy,  
     1048                                                         mole_findrate("H2,e-=>H,H-") / (hmi.H2_total*hmi.H2_rate_destroy),  
     1049                                                         mole_findrate("H,H2=>H,H,H") / (hmi.H2_total*hmi.H2_rate_destroy),  
    10481050                                                         hmi.H2_photoionize_rate / hmi.H2_rate_destroy,  
    1049                                                          mole_findrk("H2,H+=>H2+,H") / hmi.H2_rate_destroy,  
    1050                                                          (mole_findrk("H2,e-=>H,H,e-")+mole_findrk("H2*,e-=>H,H,e-")) /hmi.H2_rate_destroy,  
    1051                                                          mole_findrk("H2,H+=>H3+") / hmi.H2_rate_destroy , 
     1051                                                         mole_findrate("H2,H+=>H2+,H") / (hmi.H2_total* hmi.H2_rate_destroy),  
     1052                                                         (mole_findrate("H2,e-=>H,H,e-")+mole_findrate("H2*,e-=>H,H,e-")) / (hmi.H2_total* hmi.H2_rate_destroy),  
     1053                                                         mole_findrate("H2,H+=>H3+") / (hmi.H2_total* hmi.H2_rate_destroy) , 
    10521054                                                         secondaries.csupra[ipHYDROGEN][0]*2.02 / hmi.H2_rate_destroy 
    10531055                          );