Changeset 1729

Show
Ignore:
Timestamp:
01/04/08 12:55:28 (11 months ago)
Author:
rjrw
Message:

Initial implementation of finite surface saturation of grain
photodesorption.

Location:
branches/newmole/source
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/newmole/source/mole.h

    r1717 r1729  
    107107        int num_total, num_calc, num_compacted; 
    108108         
    109         realnum eden_f, grain_area; 
     109        realnum eden_f, grain_area, grain_density, grain_saturation; 
    110110 
    111111        /** total charge in molecules */ 
  • branches/newmole/source/mole_reactions.cpp

    r1717 r1729  
    961961        /* Compute thermal evaporation terms along with total dust number density */ 
    962962        fixit(); // should there be an area weighting to exponential terms? 
    963         if( conv.nTotalIoniz > 1 || iteration > 1 ) 
    964         { 
    965                 for( nd=0; nd < gv.nBin; nd++ ) 
    966                 { 
    967                         Exp_i += exp(-E_i/gv.bin[nd]->tedust); 
    968                         Exp_j += exp(-E_j/gv.bin[nd]->tedust); 
    969                         dust_density += gv.bin[nd]->IntArea*gv.bin[nd]->cnv_H_pCM3/(4*PI*(1e-10)); 
    970                 } 
     963 
     964        for( nd=0; nd < gv.nBin; nd++ ) 
     965        { 
     966                Exp_i += exp(-E_i/gv.bin[nd]->tedust); 
     967                Exp_j += exp(-E_j/gv.bin[nd]->tedust); 
     968                dust_density += gv.bin[nd]->IntArea*gv.bin[nd]->cnv_H_pCM3/(4*PI*(1e-10)); 
    971969        } 
    972970         
     971        ASSERT(fp_equal(dust_density,mole.grain_area/(PI*1e-10))); 
     972 
    973973        /* rates of migration on surface for each species */ 
    974974        diff_i = (1/total_sites)*vib_freq_i*Exp_i; 
     
    10021002        // 1.232e7f * 1.71f is from DB96 referred to below  
    10031003        // will be multiplied by yield factor (~1e-4) to get overall photodesorption rate 
    1004         return 2e-15 * hmi.UV_Cont_rel2_Draine_DB96_depth *(1.232e7f * 1.71f); 
     1004        return mole.grain_saturation*2e-15 * hmi.UV_Cont_rel2_Draine_DB96_depth *(1.232e7f * 1.71f); 
    10051005} 
    10061006 
  • branches/newmole/source/mole_species.cpp

    r1717 r1729  
    596596        int i; 
    597597        int nd; 
    598         double den_times_area; 
     598        double den_times_area, den_grains, adsorbed_density; 
    599599 
    600600        DEBUG_ENTRY("mole_update_species_cache()"); 
    601601 
    602602        mole.eden_f = (realnum)dense.eden;  /* Need floating point version for compatibility with all other values */ 
     603 
     604        for (i=0;i<mole.num_total;i++)  
     605        { 
     606                if(COmole[i]->location != NULL)  
     607                        COmole[i]->hevmol = *(COmole[i]->location); 
     608        } 
    603609  
    604610        /* For rates that are dependent on grain physics.  This includes grain density,  
     
    613619        if(gv.lgDustOn) 
    614620        { 
    615                 den_times_area = 0.0; 
     621                den_times_area = den_grains = 0.0; 
    616622                for( nd=0; nd < gv.nBin; nd++ ) 
    617623                { 
    618624                        /* >>chng 06 mar 04, update expression for projected grain surface area, PvH */ 
    619625                        den_times_area += gv.bin[nd]->IntArea/4.*gv.bin[nd]->cnv_H_pCM3; 
     626                        den_grains += gv.bin[nd]->cnv_GR_pCM3; 
    620627                } 
    621628                 
     629                adsorbed_density = 0.0; 
     630                for (i=0;i<mole.num_total;i++)  
     631                { 
     632                        if( !COmole[i]->lgGas_Phase )  
     633                                adsorbed_density += COmole[i]->hevmol; 
     634                } 
     635 
    622636                mole.grain_area = den_times_area; 
     637                mole.grain_density = den_grains; 
     638 
     639                double mole_cs = 1e-15; 
     640                if (4*den_times_area >= mole_cs*adsorbed_density) 
     641                        mole.grain_saturation = 1.0; 
     642                else 
     643                        mole.grain_saturation = 4*den_times_area/(mole_cs*adsorbed_density); 
    623644        } 
    624645        else 
    625646        { 
    626647                mole.grain_area = 0.0; 
    627         } 
    628  
    629         for (i=0;i<mole.num_total;i++)  
    630         { 
    631                 if(COmole[i]->location != NULL)  
    632                         COmole[i]->hevmol = *(COmole[i]->location); 
    633         } 
     648                mole.grain_density = 0.0; 
     649                mole.grain_saturation = 1.0; 
     650        } 
     651 
    634652} 
    635653