cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pressure.h
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 
4 #ifndef PRESSURE_H_
5 #define PRESSURE_H_
6 
7 #include "rt.h"
8 #include "rfield.h"
9 #include "doppvel.h"
10 #include "physconst.h"
11 #include "transition.h"
12 
15 void PresTotCurrent(void);
16 
18 inline double PressureRadiationLine( const TransitionProxy &t, realnum DopplerWidth )
19 {
20  DEBUG_ENTRY( "PressureRadiationLine()" );
21 
22  /* return zero if below plasma frequency */
23  if( t.EnergyErg() / EN1RYD <= rfield.plsfrq )
24  return 0.;
25 
26  /* RT_LineWidth gets line width in terms of RT effects */
27  double width = RT_LineWidth(t, DopplerWidth);
28 
29  double PopOpc = t.Emis().PopOpc()/(*t.Lo()).g();
30  /* return zero line radiation PressureReturned if line mases or has
31  * zero opacity */
32  /* \todo 2 1e-22 is arbtrary but roughly 1/kpc. Replace with a cloud width if available? */
33  if( PopOpc*t.Emis().opacity()/ DopplerWidth <= 1.e-22 || width<=0. )
34  return 0.;
35 
36  double PressureReturned = PI8 * HPLANCK / 3. * POW4(t.EnergyWN()) *
37  ((*t.Hi()).Pop()/(*t.Hi()).g())/PopOpc * width;
38 
39  /* this prevents line radiation PressureReturned from being very large when line
40  * is not optically thick but total opacity at that energy is large
41  * due to overlapping transitions */
42  long int ipLineCenter = t.Emis().ipFine() + rfield.ipFineConVelShift;
43  if( ipLineCenter > 0 && ipLineCenter < rfield.nfine && rfield.lgOpacityFine &&
44  rfield.fine_opac_zone[ipLineCenter] > SMALLFLOAT )
45  {
46  double FractionThisLine = t.Emis().PopOpc() * t.Emis().opacity() / DopplerWidth/
47  rfield.fine_opac_zone[ipLineCenter];
48  if( FractionThisLine<1e-5 )
49  FractionThisLine = 0.;
50  /* fine opacities are only reevaluated one time per zone due
51  * to the expense - PopOpc is for the current solution - but the two
52  * may be out of step by a few percent, due to the variation in
53  * abundance from zone to zone. This prevents the change
54  * in solution from increasing the radiation pressure.
55  * This correction is mainly an order of magnitude scaler to prevent
56  * optically thin lines from appearing to be optically thick due to
57  * overlapping lines */
58  FractionThisLine = MIN2(1., FractionThisLine);
59  ASSERT( FractionThisLine >= 0. && FractionThisLine <= 1.0 );
60  PressureReturned *= FractionThisLine;
61  }
62 
63  return PressureReturned;
64 }
65 
67 struct t_pressure {
68 
74  PresHigh;
75 
77 
79  double PresRamCurr;
80 
82  double PresTurbCurr;
83 
86  double PresTotlCurr,
90 
92  double PresTotlInit;
93 
99 
102 
106 
110  pinzon;
111 
117 
122  double RhoGravity;
126  vector<double> external_mass[3];
127 
133 
134  realnum
138  pbeta,
140  PresMax;
141 
143  long int ipPradMax_line;
144 
146  long int ipPradMax_nzone;
147 
149  char chLineRadPres[101];
150 
153  bool lgPradCap,
154  lgPradDen;
155 
158 
162 
166 
169 
176 
177  };
178 extern t_pressure pressure;
179 
180 
181 #endif /* PRESSURE_H_ */
#define MIN2
Definition: cddefines.h:765
double PresTotlInit
Definition: pressure.h:92
long int & ipFine() const
Definition: emission.h:413
bool lgContRadPresOn
Definition: pressure.h:105
realnum & opacity() const
Definition: emission.h:593
realnum EnergyErg() const
Definition: transition.h:78
realnum PresInteg
Definition: pressure.h:109
bool lgSonicPointAbortOK
Definition: pressure.h:165
double PressureInitialSpecified
Definition: pressure.h:98
const realnum SMALLFLOAT
Definition: cpu.h:178
double RhoGravity_dark
Definition: pressure.h:119
long int ipPradMax_nzone
Definition: pressure.h:146
realnum PresIntegElecThin
Definition: pressure.h:115
double PresRamCurr
Definition: pressure.h:79
double IntegRhoGravity
Definition: pressure.h:123
realnum PresMax
Definition: pressure.h:136
bool lgOpacityFine
Definition: rfield.h:421
char chLineRadPres[101]
Definition: pressure.h:149
static double * g
Definition: species2.cpp:28
bool lgPradDen
Definition: pressure.h:153
double PresTotlCurr
Definition: pressure.h:86
double pres_radiation_lines_curr
Definition: pressure.h:101
long int ipPradMax_line
Definition: pressure.h:143
void PresTotCurrent(void)
realnum pinzon
Definition: pressure.h:109
double RT_LineWidth(const TransitionProxy &t, realnum DopplerWidth)
Definition: rt_escprob.cpp:918
realnum & EnergyWN() const
Definition: transition.h:438
double RhoGravity
Definition: pressure.h:122
bool lgStrongDLimbo
Definition: pressure.h:175
EmissionList::reference Emis() const
Definition: transition.h:408
t_pressure pressure
Definition: pressure.cpp:5
t_rfield rfield
Definition: rfield.cpp:8
float realnum
Definition: cddefines.h:107
bool lgPres_magnetic_ON
Definition: pressure.h:131
long int ipFineConVelShift
Definition: rfield.h:418
qList::iterator Hi() const
Definition: transition.h:396
realnum RadBetaMax
Definition: pressure.h:136
double PressureRadiationLine(const TransitionProxy &t, realnum DopplerWidth)
Definition: pressure.h:18
int gravity_symmetry
Definition: pressure.h:124
bool lgPradCap
Definition: pressure.h:153
double PresGasCurr
Definition: pressure.h:86
double PresTotlError
Definition: pressure.h:86
const double EN1RYD
Definition: physconst.h:179
realnum PresHigh
Definition: pressure.h:73
bool lgRadPresAbortOK
Definition: pressure.h:161
realnum pbeta
Definition: pressure.h:136
realnum * fine_opac_zone
Definition: rfield.h:408
realnum PresPowerlaw
Definition: pressure.h:76
#define ASSERT(exp)
Definition: cddefines.h:582
qList::iterator Lo() const
Definition: transition.h:392
bool lgPressureInitialSpecified
Definition: pressure.h:96
long nfine
Definition: rfield.h:402
bool lgLineRadPresOn
Definition: pressure.h:157
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:688
double & PopOpc() const
Definition: emission.h:603
realnum PresLow
Definition: pressure.h:73
bool lgSonicPoint
Definition: pressure.h:168
double RhoGravity_external
Definition: pressure.h:121
bool lgPres_ram_ON
Definition: pressure.h:132
vector< double > external_mass[3]
Definition: pressure.h:126
double self_mass_factor
Definition: pressure.h:125
double RhoGravity_self
Definition: pressure.h:120
realnum pinzon_PresIntegElecThin
Definition: pressure.h:115
double PresTurbCurr
Definition: pressure.h:82
realnum plsfrq
Definition: rfield.h:447
#define POW4
Definition: cddefines.h:947
bool lgPres_radiation_ON
Definition: pressure.h:130
const double HPLANCK
Definition: physconst.h:103
const double PI8
Definition: physconst.h:38