cloudy trunk
Loading...
Searching...
No Matches
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
15void PresTotCurrent(void);
16
18inline 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
178extern t_pressure pressure;
179
180
181#endif /* PRESSURE_H_ */
#define ASSERT(exp)
Definition cddefines.h:578
#define MIN2
Definition cddefines.h:761
float realnum
Definition cddefines.h:103
#define POW4
Definition cddefines.h:943
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
long int & ipFine() const
Definition emission.h:413
double & PopOpc() const
Definition emission.h:603
realnum & opacity() const
Definition emission.h:593
realnum EnergyErg() const
Definition transition.h:78
realnum & EnergyWN() const
Definition transition.h:438
qList::iterator Lo() const
Definition transition.h:392
qList::iterator Hi() const
Definition transition.h:396
EmissionList::reference Emis() const
Definition transition.h:408
const realnum SMALLFLOAT
Definition cpu.h:191
UNUSED const double HPLANCK
Definition physconst.h:103
UNUSED const double EN1RYD
Definition physconst.h:179
UNUSED const double PI8
Definition physconst.h:38
t_pressure pressure
Definition pressure.cpp:5
double PressureRadiationLine(const TransitionProxy &t, realnum DopplerWidth)
Definition pressure.h:18
void PresTotCurrent(void)
t_rfield rfield
Definition rfield.cpp:8
double RT_LineWidth(const TransitionProxy &t, realnum DopplerWidth)
bool lgLineRadPresOn
Definition pressure.h:157
vector< double > external_mass[3]
Definition pressure.h:126
long int ipPradMax_line
Definition pressure.h:143
realnum PresPowerlaw
Definition pressure.h:76
double PresTotlError
Definition pressure.h:87
bool lgPres_radiation_ON
Definition pressure.h:130
double PressureInitialSpecified
Definition pressure.h:98
bool lgStrongDLimbo
Definition pressure.h:175
bool lgSonicPoint
Definition pressure.h:168
char chLineRadPres[101]
Definition pressure.h:149
double PresGasCurr
Definition pressure.h:89
realnum PresHigh
Definition pressure.h:74
realnum PresLow
Definition pressure.h:73
double RhoGravity_self
Definition pressure.h:120
realnum RadBetaMax
Definition pressure.h:136
double RhoGravity_dark
Definition pressure.h:119
bool lgPradDen
Definition pressure.h:154
double IntegRhoGravity
Definition pressure.h:123
double PresRamCurr
Definition pressure.h:79
int gravity_symmetry
Definition pressure.h:124
bool lgSonicPointAbortOK
Definition pressure.h:165
double PresTurbCurr
Definition pressure.h:82
realnum pinzon_PresIntegElecThin
Definition pressure.h:116
double RhoGravity
Definition pressure.h:122
realnum PresInteg
Definition pressure.h:109
bool lgPressureInitialSpecified
Definition pressure.h:96
bool lgPres_ram_ON
Definition pressure.h:132
realnum PresMax
Definition pressure.h:140
realnum pbeta
Definition pressure.h:138
bool lgPradCap
Definition pressure.h:153
double self_mass_factor
Definition pressure.h:125
realnum pinzon
Definition pressure.h:110
double RhoGravity_external
Definition pressure.h:121
realnum PresIntegElecThin
Definition pressure.h:115
bool lgContRadPresOn
Definition pressure.h:105
double pres_radiation_lines_curr
Definition pressure.h:101
double PresTotlInit
Definition pressure.h:92
bool lgRadPresAbortOK
Definition pressure.h:161
long int ipPradMax_nzone
Definition pressure.h:146
double PresTotlCurr
Definition pressure.h:86
bool lgPres_magnetic_ON
Definition pressure.h:131