Changeset 1729
- Timestamp:
- 01/04/08 12:55:28 (11 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 3 modified
-
mole.h (modified) (1 diff)
-
mole_reactions.cpp (modified) (2 diffs)
-
mole_species.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/mole.h
r1717 r1729 107 107 int num_total, num_calc, num_compacted; 108 108 109 realnum eden_f, grain_area ;109 realnum eden_f, grain_area, grain_density, grain_saturation; 110 110 111 111 /** total charge in molecules */ -
branches/newmole/source/mole_reactions.cpp
r1717 r1729 961 961 /* Compute thermal evaporation terms along with total dust number density */ 962 962 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)); 971 969 } 972 970 971 ASSERT(fp_equal(dust_density,mole.grain_area/(PI*1e-10))); 972 973 973 /* rates of migration on surface for each species */ 974 974 diff_i = (1/total_sites)*vib_freq_i*Exp_i; … … 1002 1002 // 1.232e7f * 1.71f is from DB96 referred to below 1003 1003 // 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); 1005 1005 } 1006 1006 -
branches/newmole/source/mole_species.cpp
r1717 r1729 596 596 int i; 597 597 int nd; 598 double den_times_area ;598 double den_times_area, den_grains, adsorbed_density; 599 599 600 600 DEBUG_ENTRY("mole_update_species_cache()"); 601 601 602 602 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 } 603 609 604 610 /* For rates that are dependent on grain physics. This includes grain density, … … 613 619 if(gv.lgDustOn) 614 620 { 615 den_times_area = 0.0;621 den_times_area = den_grains = 0.0; 616 622 for( nd=0; nd < gv.nBin; nd++ ) 617 623 { 618 624 /* >>chng 06 mar 04, update expression for projected grain surface area, PvH */ 619 625 den_times_area += gv.bin[nd]->IntArea/4.*gv.bin[nd]->cnv_H_pCM3; 626 den_grains += gv.bin[nd]->cnv_GR_pCM3; 620 627 } 621 628 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 622 636 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); 623 644 } 624 645 else 625 646 { 626 647 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 634 652 } 635 653
