00001 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 00004 #ifndef _PRESSURE_H_ 00005 #define _PRESSURE_H_ 00006 00007 #include "rt.h" 00008 #include "rfield.h" 00009 #include "doppvel.h" 00010 #include "physconst.h" 00011 00014 void PresTotCurrent(void); 00015 00017 inline double PressureRadiationLine( const transition *t, double densityDenorm ) 00018 { 00019 DEBUG_ENTRY( "PressureRadiationLine()" ); 00020 00021 /* RT_LineWidth gets line width in terms of RT effects */ 00022 double width = RT_LineWidth(t); 00023 00024 double PopOpc = t->Emis->PopOpc/t->Lo->g; 00025 long nelem = t->Hi->nelem-1; 00026 /* return zero line radiation PressureReturned if line mases or has 00027 * zero opacity */ 00028 if( densityDenorm*PopOpc*t->Emis->opacity/ DoppVel.doppler[nelem] <= SMALLFLOAT*1e5 || 00029 width<=0. ) 00030 return 0.; 00031 00032 double PressureReturned = PI8 * HPLANCK / 3. * POW4(t->EnergyWN) * 00033 (t->Hi->Pop/t->Hi->g)/PopOpc * width; 00034 00035 /* this prevents line radiation PressureReturned from being very large when line 00036 * is not optically thick but total opacity at that energy is large 00037 * due to overlapping transitions */ 00038 long int ipLineCenter = t->Emis->ipFine + rfield.ipFineConVelShift; 00039 if( ipLineCenter > 0 && ipLineCenter < rfield.nfine && rfield.lgOpacityFine && 00040 rfield.fine_opac_zone[ipLineCenter] > SMALLFLOAT ) 00041 { 00042 double FractionThisLine = densityDenorm * t->Emis->PopOpc * t->Emis->opacity / DoppVel.doppler[nelem]/ 00043 rfield.fine_opac_zone[ipLineCenter]; 00044 if( FractionThisLine<1e-5 ) 00045 FractionThisLine = 0.; 00046 /* fine opacities are only reevaluated one time per zone due 00047 * to the expense - PopOpc is for the current solution - but the two 00048 * may be out of step by a few percent, due to the variation in 00049 * abundance from zone to zone. This prevents the change 00050 * in solution from increasing the radiation pressure. 00051 * This correction is mainly an order of magnitude scaler to prevent 00052 * optically thin lines from appearing to be optically thick due to 00053 * overlapping lines */ 00054 FractionThisLine = MIN2(1., FractionThisLine); 00055 ASSERT( FractionThisLine >= 0. && FractionThisLine <= 1.0 ); 00056 PressureReturned *= FractionThisLine; 00057 } 00058 00059 return PressureReturned; 00060 } 00061 00063 EXTERN struct t_pressure { 00064 00069 realnum PresLow, 00070 PresHigh; 00071 00072 realnum PresPowerlaw; 00073 00075 double PresRamCurr; 00076 00078 double PresTurbCurr; 00079 00082 double PresTotlCurr, 00083 PresTotlCorrect, 00085 PresGasCurr; 00086 00088 double PresTotlInit; 00089 00092 bool lgPressureInitialSpecified; 00094 double PressureInitialSpecified; 00095 00097 double pres_radiation_lines_curr; 00098 00101 bool lgContRadPresOn; 00102 00105 realnum PresInteg, 00106 pinzon; 00107 00110 bool lgPres_radiation_ON; 00111 bool lgPres_magnetic_ON; 00112 bool lgPres_ram_ON; 00113 00114 realnum 00116 RadBetaMax, 00118 pbeta, 00120 PresMax; 00121 00123 long int ipPradMax_line; 00124 00126 long int ipPradMax_nzone; 00127 00129 char chLineRadPres[101]; 00130 00133 bool lgPradCap, 00134 lgPradDen; 00135 00137 bool lgLineRadPresOn; 00138 00141 bool lgRadPresAbortOK; 00142 00145 bool lgSonicPointAbortOK; 00146 00148 bool lgSonicPoint; 00149 00155 bool lgStrongDLimbo; 00156 00157 } pressure; 00158 00159 00160 #endif /* _PRESSURE_H_ */