Changeset 2250


Ignore:
Timestamp:
2008-07-23T21:38:40Z (15 years ago)
Author:
Gary J. Ferland
Message:

line pressure routine was moved to inline header but not removed from main source, so two copies existed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/c08_branch/source/pressure_total.cpp

    r2175 r2250  
    10021002        return;
    10031003}
    1004 
    1005 double PressureRadiationLine( const transition *t, double densityDenorm )
    1006 {
    1007         double PresssureReturned;
    1008         DEBUG_ENTRY( "PressureRadiationLine()" );
    1009 
    1010         /* RT_LineWidth gets line width in terms of RT effects */
    1011         double width = RT_LineWidth(t);
    1012         long nelem = t->Hi->nelem-1;
    1013 
    1014         double PopOpc = t->Emis->PopOpc/t->Lo->g;
    1015         /* return zero line radiation PresssureReturned if line mases or has
    1016          * zero opacity */
    1017         if( densityDenorm*PopOpc*t->Emis->opacity <= SMALLFLOAT )
    1018                 return 0;
    1019 
    1020         PresssureReturned = PI8 * HPLANCK / 3. * (powi(t->EnergyWN,4)) *
    1021                 (t->Hi->Pop/t->Hi->g)/PopOpc * width;
    1022 
    1023         /* this prevents line radiation PresssureReturned from being very large when line
    1024          * is not optically thick but total opacity at that energy is large
    1025          * due to overlapping transitions */
    1026         long int ipLineCenter = t->Emis->ipFine + rfield.ipFineConVelShift;
    1027         if( ipLineCenter>0 && ipLineCenter<rfield.nfine && rfield.lgOpacityFine &&
    1028                 rfield.fine_opac_zone[ipLineCenter]>SMALLFLOAT )
    1029         {
    1030                 double FractionThisLine = densityDenorm * t->Emis->PopOpc * t->Emis->opacity / DoppVel.doppler[nelem]/
    1031                         rfield.fine_opac_zone[ipLineCenter];
    1032                 /* fine opacities are only reevaluated one time per zone due
    1033                  * to the expense - PopOpc is for the current solution - but the two
    1034                  * may be out of step by a few percent, due to the variation in
    1035                  * abundance from zone to zone.  This prevents the change
    1036                  * in solution from increasing the radiation pressure.
    1037                  * This correction is mainly an order of magnitude scaler to prevent
    1038                  * optically thin lines from appearing to be optically thick due to
    1039                  * overlapping lines */
    1040                 FractionThisLine = MIN2(1., FractionThisLine);
    1041                 ASSERT( FractionThisLine >=0 && FractionThisLine<=1.0 );
    1042                 PresssureReturned *= FractionThisLine;
    1043         }
    1044 
    1045         return PresssureReturned;
    1046 }
Note: See TracChangeset for help on using the changeset viewer.