39 inline bool isSameUnit(
const char *unit,
const char *ref)
41 return strcmp(unit,ref) == 0;
49 if(
nMatch(
" MIC",chCard) )
54 else if(
nMatch(
" EV ",chCard) )
59 else if(
nMatch(
" KEV",chCard) )
64 else if(
nMatch(
" MEV",chCard) )
69 else if(
nMatch(
"WAVE",chCard) )
74 else if(
nMatch(
"CENT",chCard) ||
nMatch(
" CM ",chCard) )
79 else if(
nMatch(
" MM ",chCard) )
84 else if(
nMatch(
" NM ",chCard) )
89 else if(
nMatch(
"ANGS",chCard) )
94 else if(
nMatch(
" HZ ",chCard) )
99 else if(
nMatch(
" KHZ",chCard) )
104 else if(
nMatch(
" MHZ",chCard) )
109 else if(
nMatch(
" GHZ",chCard) )
114 else if(
nMatch(
"KELV",chCard) ||
nMatch(
" K ",chCard) )
119 else if(
nMatch(
" RYD",chCard) )
125 else if(
nMatch(
" ERG ",chCard) )
132 fprintf(
ioQQQ,
" No energy / wavelength unit was recognized on this line:\n %s\n\n", chCard );
209 fprintf(
ioQQQ,
" insane units in Energy::get: \"%s\"\n", unit );
229 set(1e6*value/EVRYD);
233 set(1e3*value/EVRYD);
249 set(RYDLAM/(1.
e1*value));
253 set(RYDLAM/(1.e4*value));
257 set(RYDLAM/(1.e7*value));
261 set(RYDLAM/(1.e8*value));
269 set(1e3*value/FR1RYD);
273 set(1e6*value/FR1RYD);
277 set(1e9*value/FR1RYD);
285 fprintf(
ioQQQ,
" insane units in Energy::set: \"%s\"\n", unit );
297 fprintf(
ioQQQ,
" The energy %g Ryd is not within the default Cloudy range\n", energy );
326 outsum(&outtot,&outin,&outout);
328 sum_recom_lines =
totlin(
'r');
329 if( sum_recom_lines == 0. )
331 sprintf( chLine,
" !Total recombination line energy is 0." );
336 sum_coolants =
totlin(
'c');
337 if( sum_coolants == 0. )
339 sprintf( chLine,
" !Total cooling is zero." );
361 fprintf(
ioQQQ,
"PROBLEM DISASTER lgConserveEnergy failed %li\t%li\t%e\t%e\t%e\n",
378 " W-Radiated luminosity (cool+rec+wind=%.2e+%.2e+%.2e) is greater than that in incident radiation (TotalLumin=%8.2e). Power radiated was %8.2e",
382 fprintf(
ioQQQ,
"\n\n DISASTER This calculation DID NOT CONSERVE ENERGY!\n\n\n" );
385 fprintf(
ioQQQ,
"Rerun with *set check energy every zone* command to do energy check for each zone.\n\n");
391 fprintf(
ioQQQ,
"\n The CASE B command was entered - this can have unphysical effects, including non-conservation of energy.\n Why was it needed?\n\n" );
396 sprintf( chLine,
" W-Something is really wrong: the ratio of radiated to incident luminosity is %.2e.",
403 fprintf(
ioQQQ,
" This may have been caused by the FORCE TE command.\n" );
416 double flxref = 0., flxatt = 0., conem = 0.;
448 static const double RATIO = 0.02;
456 fprintf(
ioQQQ,
" badprt: all entries with greater than%6.2f%% of incident continuum follow.\n",
458 fprintf(
ioQQQ,
" badprt: Intensities are relative to total energy in incident continuum.\n" );
464 " Sum of energy in recombination lines is %.2e relative to total incident radiation is %.2e\n",
466 sum_recom_lines/
MAX2(1e-30,total) );
468 fprintf(
ioQQQ,
" all strong information lines \n line wl ener/total\n");
480 fprintf(
ioQQQ,
" all strong cooling lines \n line wl ener/total\n");
483 fprintf(
ioQQQ,
" Sum of coolants (abs) = %.2e (rel)= %.2e\n",
484 sum_coolants, sum_coolants/
MAX2(1e-30,total) );
495 fprintf(
ioQQQ,
" all strong heating lines \n line wl ener/total\n");
497 fprintf(
ioQQQ,
" Sum of heat (abs) = %.2e (rel)= %.2e\n",
void bangin(const char *chLine)
STATIC double sum_radiation(void)
static const char * ENERGY_MHZ
static const char * ENERGY_WN
bool isSameUnit(const char *unit, const char *ref)
static const char * ENERGY_HZ
bool lgCheckEnergyEveryZone
bool lgTimeDependentStatic
long nMatch(const char *chKey, const char *chCard)
static const char * ENERGY_K
static const char * ENERGY_MEV
bool lgTemperatureConstant
static const char * ENERGY_KEV
double anu(size_t i) const
STATIC void badprt(double total)
void warnin(const char *chLine)
const realnum * getCoarseTransCoef()
bool lgBallistic(void) const
long ipoint(double energy_ryd)
double energy(const genericState &gs)
static const char * ENERGY_RYD
static const char * ENERGY_A
static const char * ENERGY_MM
const int INPUT_LINE_LENGTH
static const char * ENERGY_EV
static const char * ENERGY_ERG
double totlin(int chInfo)
static const char * ENERGY_GHZ
static const char * ENERGY_KHZ
const char * StandardEnergyUnit(const char *chCard)
#define DEBUG_ENTRY(funcname)
static const char * ENERGY_MICRON
int fprintf(const Output &stream, const char *format,...)
void outsum(double *outtot, double *outin, double *outout)
static const char * ENERGY_CM
bool lgStatic(void) const
t_secondaries secondaries
double get(const char *unit) const
static const char * ENERGY_NM