Changeset 1714 for branches/newmole/source
- Timestamp:
- 12/22/07 09:53:10 (11 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 6 modified
-
ion_solver.cpp (modified) (1 diff)
-
mole.h (modified) (1 diff)
-
mole_newton_step.cpp (modified) (4 diffs)
-
mole_reactions.cpp (modified) (1 diff)
-
mole_species.cpp (modified) (3 diffs)
-
punch_do.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/ion_solver.cpp
r1706 r1714 68 68 if (abund_total < -10.0*FLT_EPSILON*dense.gas_phase[nelem]) 69 69 { 70 double sum; 70 71 fprintf(stdout," DISASTER ion_solver: Bad density %li %g %g %g\n",nelem,dense.gas_phase[nelem],dense.xMolecules[nelem], 71 72 dense.gas_phase[nelem]-dense.xMolecules[nelem]); 73 sum = 0; 74 fprintf(stdout," Levels:"); 75 for (ion=dense.IonLow[nelem]; ion<=dense.IonHigh[nelem]; ++ion ) 76 { 77 fprintf(stdout," %ld %g;",ion,dense.xIonDense[nelem][ion]); 78 sum += dense.xIonDense[nelem][ion]; 79 } 80 fprintf(stdout," tot=%g\n",sum); 72 81 puts( "[Stop in ion_solver]" ); 73 82 cdEXIT(EXIT_FAILURE); -
branches/newmole/source/mole.h
r1688 r1714 107 107 int num_total, num_calc, num_compacted; 108 108 109 realnum eden_f, grain_area ;109 realnum eden_f, grain_area, grain_avg_area; 110 110 111 111 /** total charge in molecules */ -
branches/newmole/source/mole_newton_step.cpp
r1712 r1714 26 26 27 27 #define ABSLIM 1e-12 28 #define ERRLIM 1e-12 28 29 #define SMALLABUND 1e-24 29 30 # ifdef MAT … … 291 292 { 292 293 /* Smooth the error mode tailoff */ 293 etmp = b[groupspecies[i]->index] ;294 //((ABSLIM+b0vec[i])*(-c[groupspecies[i]->index][groupspecies[i]->index]));294 etmp = b[groupspecies[i]->index]/ 295 ((ERRLIM+fabs(b0vec[i]))*(ERRLIM+fabs(c[groupspecies[i]->index][groupspecies[i]->index]))); 295 296 etmp *= etmp; 296 297 if (etmp > emax) … … 477 478 iworst = i; 478 479 } 479 if (b0vec[i] > SMALLABUND ) //|| b2vec[i] < -SMALLABUND)480 if (b0vec[i] > SMALLABUND || b2vec[i] < -SMALLABUND) 480 481 ++*nBad; 481 482 } … … 488 489 updateMolecules( b2vec, fion ); 489 490 } 491 //fprintf(ioQQQ,"Final fstep %g\n",fstep); 490 492 491 493 *error = (realnum) MIN2(error0,1e30); -
branches/newmole/source/mole_reactions.cpp
r1708 r1714 990 990 * The following treatment uses their equation 3 */ 991 991 992 double grain_area;993 int nd;994 995 992 DEBUG_ENTRY("grn_photo()"); 996 993 997 grain_area = 0.; 998 for( nd=0; nd < gv.nBin; nd++ ) 999 { 1000 grain_area += gv.bin[nd]->AvArea; 1001 } 1002 1003 /* This is the number of molecules removed from the grain per incident photon 1004 * use same value of 1e-4 as used in Bergin */ 1005 1006 return grain_area* hmi.UV_Cont_rel2_Draine_DB96_depth; 994 /* This is the number of molecules removed from the grain per 995 * incident photon use same value of 1e-4 as used in Bergin, include 996 * conversion to radiation field units to get the dimensions right 997 * (cf the d'Hendercourt reference in Bergin et al) */ 998 999 fixit(); // Should this be 4* (i.e. the total not the cs area)? Depends on definition of radiation field. 1000 return mole.grain_avg_area * hmi.UV_Cont_rel2_Draine_DB96_depth *(1.232e7f * 1.71f); 1007 1001 } 1008 1002 -
branches/newmole/source/mole_species.cpp
r1712 r1714 212 212 sp = newspecies("H2Ogrn",MOLECULE,MOLE_ACTIVE,NULL,1.00e-15, -238.9f); 213 213 sp = newspecies("OHgrn ",MOLECULE,MOLE_ACTIVE,NULL,1.00e-15, 38.4f); 214 if ( 0)214 if (1) 215 215 { 216 216 sp = newspecies("Cgrn ",MOLECULE,MOLE_ACTIVE,NULL,1.00e-15, 711.2f); … … 596 596 int i; 597 597 int nd; 598 double den_times_area ;598 double den_times_area, dengrains; 599 599 600 600 DEBUG_ENTRY("mole_update_species_cache()"); … … 611 611 /* >>chng 06 feb 28, turn off this rate when no grain molecules */ 612 612 /* >>chng 06 dec 05 rjrw: do this in newreact rather than rate */ 613 den_times_area = 0.0; 614 for( nd=0; nd < gv.nBin; nd++ ) 615 { 616 /* >>chng 06 mar 04, update expression for projected grain surface area, PvH */ 617 den_times_area += gv.bin[nd]->IntArea/4.*gv.bin[nd]->cnv_H_pCM3; 618 } 619 620 mole.grain_area = den_times_area; 613 if(gv.lgDustOn) 614 { 615 den_times_area = dengrains = 0.0; 616 for( nd=0; nd < gv.nBin; nd++ ) 617 { 618 /* >>chng 06 mar 04, update expression for projected grain surface area, PvH */ 619 den_times_area += gv.bin[nd]->IntArea/4.*gv.bin[nd]->cnv_H_pCM3; 620 dengrains += gv.bin[nd]->cnv_GR_pCM3; 621 } 622 623 mole.grain_area = den_times_area; 624 mole.grain_avg_area = den_times_area/dengrains; 625 } 626 else 627 { 628 mole.grain_area = mole.grain_avg_area = 0.0; 629 } 621 630 622 631 for (i=0;i<mole.num_total;i++) -
branches/newmole/source/punch_do.cpp
r1701 r1714 2530 2530 for(i=0; i<mole.num_calc; ++i ) 2531 2531 { 2532 fprintf( punch.ipPnunit[ipPun], "\t%- 4.4s", COmole[i]->label );2532 fprintf( punch.ipPnunit[ipPun], "\t%-7.7s", COmole[i]->label ); 2533 2533 } 2534 2534 fprintf ( punch.ipPnunit[ipPun], "\n");
