00001
00002
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 #include "transition.h"
00012
00015 void PresTotCurrent(void);
00016
00018 inline double PressureRadiationLine( const transition *t, realnum DopplerWidth )
00019 {
00020 DEBUG_ENTRY( "PressureRadiationLine()" );
00021
00022
00023 if( t->EnergyErg / EN1RYD <= rfield.plsfrq )
00024 return 0.;
00025
00026
00027 double width = RT_LineWidth(t, DopplerWidth);
00028
00029 double PopOpc = t->Emis->PopOpc/t->Lo->g;
00030
00031
00032
00033 if( PopOpc*t->Emis->opacity/ DopplerWidth <= 1.e-22 || width<=0. )
00034 return 0.;
00035
00036 double PressureReturned = PI8 * HPLANCK / 3. * POW4(t->EnergyWN) *
00037 (t->Hi->Pop/t->Hi->g)/PopOpc * width;
00038
00039
00040
00041
00042 long int ipLineCenter = t->Emis->ipFine + rfield.ipFineConVelShift;
00043 if( ipLineCenter > 0 && ipLineCenter < rfield.nfine && rfield.lgOpacityFine &&
00044 rfield.fine_opac_zone[ipLineCenter] > SMALLFLOAT )
00045 {
00046 double FractionThisLine = t->Emis->PopOpc * t->Emis->opacity / DopplerWidth/
00047 rfield.fine_opac_zone[ipLineCenter];
00048 if( FractionThisLine<1e-5 )
00049 FractionThisLine = 0.;
00050
00051
00052
00053
00054
00055
00056
00057
00058 FractionThisLine = MIN2(1., FractionThisLine);
00059 ASSERT( FractionThisLine >= 0. && FractionThisLine <= 1.0 );
00060 PressureReturned *= FractionThisLine;
00061 }
00062
00063 return PressureReturned;
00064 }
00065
00067 EXTERN struct t_pressure {
00068
00073 realnum PresLow,
00074 PresHigh;
00075
00076 realnum PresPowerlaw;
00077
00079 double PresRamCurr;
00080
00082 double PresTurbCurr;
00083
00086 double PresTotlCurr,
00087 PresTotlCorrect,
00089 PresGasCurr;
00090
00092 double PresTotlInit;
00093
00096 bool lgPressureInitialSpecified;
00098 double PressureInitialSpecified;
00099
00101 double pres_radiation_lines_curr;
00102
00105 bool lgContRadPresOn;
00106
00109 realnum PresInteg,
00110 pinzon;
00111
00115 realnum PresIntegElecThin,
00116 pinzon_PresIntegElecThin;
00117
00119 double RhoGravity_dark;
00120 double RhoGravity_self;
00121 double RhoGravity_external;
00122 double RhoGravity;
00123 double IntegRhoGravity;
00124 int gravity_symmetry;
00125 double self_mass_factor;
00126 vector<double> external_mass[3];
00127
00130 bool lgPres_radiation_ON;
00131 bool lgPres_magnetic_ON;
00132 bool lgPres_ram_ON;
00133
00134 realnum
00136 RadBetaMax,
00138 pbeta,
00140 PresMax;
00141
00143 long int ipPradMax_line;
00144
00146 long int ipPradMax_nzone;
00147
00149 char chLineRadPres[101];
00150
00153 bool lgPradCap,
00154 lgPradDen;
00155
00157 bool lgLineRadPresOn;
00158
00161 bool lgRadPresAbortOK;
00162
00165 bool lgSonicPointAbortOK;
00166
00168 bool lgSonicPoint;
00169
00175 bool lgStrongDLimbo;
00176
00177 } pressure;
00178
00179
00180 #endif