diff --git a/source/age_check.cpp b/source/age_check.cpp index 30930527ab08bc77193c78701d953af1ed78807a..bada1db7136ca15fe2c28d9dc09d68ba9bbe42b4 100644 --- a/source/age_check.cpp +++ b/source/age_check.cpp @@ -39,14 +39,17 @@ void AgeCheck(void) for( i=0; i < limit; i++ ) { - timesc.time_therm_long = - MAX2( timesc.time_therm_long , - struc.DenParticles[i]*BOLTZMANN*1.5*struc.testr[i]/struc.coolstr[i]); - timesc.time_therm_short = - MIN2( timesc.time_therm_short , - struc.DenParticles[i]*BOLTZMANN*1.5*struc.testr[i]/struc.coolstr[i]); - /*>>chng 99 feb 01, had div by heating, changed to cooling so constant - * temperature models are more realistic */ + if( struc.coolstr[i]>SMALLFLOAT ) + { + timesc.time_therm_long = + MAX2( timesc.time_therm_long , + struc.DenParticles[i]*BOLTZMANN*1.5*struc.testr[i]/struc.coolstr[i]); + timesc.time_therm_short = + MIN2( timesc.time_therm_short , + struc.DenParticles[i]*BOLTZMANN*1.5*struc.testr[i]/struc.coolstr[i]); + /*>>chng 99 feb 01, had div by heating, changed to cooling so constant + * temperature models are more realistic */ + } } tlong = MAX2(tlong,timesc.time_therm_long); diff --git a/source/cool_save.cpp b/source/cool_save.cpp index ea4c0db27d43168e66605cb9d7c861b92bdc4e0f..e13bb981db249fb712584911ca818e400cedcce2 100644 --- a/source/cool_save.cpp +++ b/source/cool_save.cpp @@ -67,7 +67,10 @@ void CoolSave(FILE * io, const char chJob[]) if( strncmp( thermal.chClntLab[i], "adve", 4 ) == 0 ) continue; - csav[ip] = (realnum)( safe_div( MAX2(thermal.cooling[i],thermal.heatnt[i]), cool_total, 0. )); + if( cool_total>SMALLFLOAT ) + csav[ip] = (realnum)( safe_div( MAX2(thermal.cooling[i],thermal.heatnt[i]), cool_total, 0. )); + else + csav[ip] = 0.; /* save sign to remember if heating or cooling line */ if( thermal.heatnt[i] == 0. ) { diff --git a/source/dense.cpp b/source/dense.cpp index b8130608314de2cac9f73f9d01afd85f06a59c0f..e27640bcefe356212276eceea35222df2b297362 100644 --- a/source/dense.cpp +++ b/source/dense.cpp @@ -179,6 +179,9 @@ bool lgElemsConserved (void) sum_monatomic + sum_molecules, sum_gas_phase, (sum_monatomic + sum_molecules - sum_gas_phase)/sum_gas_phase ); + fprintf(ioQQQ," Consider increasing value of conv.GasPhaseAbundErrorAllowed with SET DENSITY TOLERANCE as a workaround. " + "Its current value is %.2e\n" , conv.GasPhaseAbundErrorAllowed ); + fprintf(ioQQQ," Temperature %.2e H density %.2e zone %ld \n", phycon.te, dense.gas_phase[ipHYDROGEN], nzone); lgOK=false; } diff --git a/source/prt_comment.cpp b/source/prt_comment.cpp index 048f124a29fb66fabc24e9425293f54f3e7d0862..3bc9698469a1d6a21ca318708df89c77101180a7 100644 --- a/source/prt_comment.cpp +++ b/source/prt_comment.cpp @@ -792,35 +792,35 @@ void PrtComment(void) if( !rfield.lgMMok ) { sprintf( chLine, - " C-Continuum not defined in extreme infrared - Compton scat, grain heating, not treated properly?" ); - caunin(chLine); + " !Continuum not defined in extreme infrared - Compton scat, grain heating, not treated properly?" ); + bangin(chLine); } if( !rfield.lgHPhtOK ) { sprintf( chLine, - " C-Continuum not defined at photon energies which ionize excited states of H, important for H- and ff heating." ); - caunin(chLine); + " !Continuum not defined at photon energies which ionize excited states of H, important for H- and ff heating." ); + bangin(chLine); } if( !rfield.lgXRayOK ) { sprintf( chLine, - " C-Continuum not defined at X-Ray energies - Compton scattering and Auger ionization wrong?" ); - caunin(chLine); + " !Continuum not defined at X-Ray energies - Compton scattering and Auger ionization wrong?" ); + bangin(chLine); } if( !rfield.lgGamrOK ) { sprintf( chLine, - " C-Continuum not defined at gamma-ray energies - pair production and Compton scattering OK?" ); - caunin(chLine); + " !Continuum not defined at gamma-ray energies - pair production and Compton scattering OK?" ); + bangin(chLine); } if( continuum.lgCon0 ) { - sprintf( chLine, " C-Continuum zero at some energies." ); - caunin(chLine); + sprintf( chLine, " !Continuum zero at some energies." ); + bangin(chLine); } if( continuum.lgCoStarInterpolationCaution ) diff --git a/source/timesc.cpp b/source/timesc.cpp index 3454f30743fc9975420d05122c25aef18c35ac9f..3f57c7ce5aa14c493c5cd2e48b3101971e3d5240 100644 --- a/source/timesc.cpp +++ b/source/timesc.cpp @@ -41,12 +41,16 @@ void t_timesc::calc_therm_timesc( long int izone ) { /* >>chng 99 feb 01, had div by heating, changed to cooling so constant * temperature models are more realistic */ - double dt = 1.5 * BOLTZMANN * struc.DenParticles[i] * struc.testr[i] / struc.coolstr[i]; - time_therm_long = MAX2( time_therm_long , dt ); - time_therm_short= MIN2( time_therm_short, dt ); - // printf("dt = %g\t long = %g\t short = %g\n", dt, time_therm_long, time_therm_short); - } + if( struc.coolstr[i] > SMALLFLOAT ) + { + double dt = 1.5 * BOLTZMANN * struc.DenParticles[i] * struc.testr[i] / struc.coolstr[i]; + //double dt = 1.5 * BOLTZMANN * struc.DenParticles[i] * safe_div( (double)struc.testr[i] , struc.coolstr[i] ); + time_therm_long = MAX2( time_therm_long , dt ); + time_therm_short= MIN2( time_therm_short, dt ); + // printf("dt = %g\t long = %g\t short = %g\n", dt, time_therm_long, time_therm_short);} + } // printf( "*** long = %g\t short = %g\n", time_therm_long, time_therm_short ); + } return; }