Cloudy
Spectral Synthesis Code for Astrophysics
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
opacity.h File Reference
#include "module.h"
#include "vectorize.h"
Include dependency graph for opacity.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  t_opac
 

Functions

void OpacityCreateAll (void)
 
void OpacityAdd1Subshell (long int ipOpac, long int ipLowLim, long int ipUpLim, realnum abundance, char chStat)
 
void OpacityAddTotal (void)
 
void OpacityAdd1Element (long int ipZ)
 
void OpacityZero (void)
 
void OpacityZeroOld (void)
 
void OpacityAdd1SubshellInduc (long int ipOpac, long int low, long int ihi, double a, double b, char chStat)
 

Variables

bool lgOpacAllocated
 
t_opac opac
 

Detailed Description

routines dealing with creation and evaluration of opacities

Function Documentation

void OpacityAdd1Element ( long int  ipZ)

OpacityAdd1Element enter total photo cross section for all subshells of a single element into opacity array

Parameters
ipZis 0 for H, 1 for He, etc

References ASSERT, DEBUG_ENTRY, dense, Heavy, t_opac::ipElement, iso_sp, LIMELM, MAX2, t_rfield::nflux, NISO, t_Heavy::nsShells, t_iso_sp::numLevels_local, opac, OpacityAdd1Subshell(), OpacityAdd1SubshellInduc(), rfield, t_iso_sp::st, and t_dense::xIonDense.

Referenced by OpacityAddTotal(), SanityCheckBegin(), and save_opacity().

Here is the call graph for this function:

void OpacityAdd1Subshell ( long int  ipOpac,
long int  ipLowLim,
long int  ipUpLim,
realnum  abundance,
char  chStat 
)

OpacityAdd1Subshell add opacity due to single species to main opacity array

Parameters
ipOpacipOpac is opacity index within opac opacity offset for this species
ipLowLimlower freq limit to opacity range on energy mesh
ipUpLimupper limit to opacity range on energy mesh
abundanceabundance, we bail if zero
chStateither static 's' or volitile 'v'

References ASSERT, DEBUG_ENTRY, t_opac::lgRedoStatic, MIN2, t_rfield::nflux, opac, t_opac::opacity_abs, t_opac::OpacStack, t_opac::OpacStatic, and rfield.

Referenced by OpacityAdd1Element(), and OpacityAddTotal().

void OpacityAdd1SubshellInduc ( long int  ipOpac,
long int  low,
long int  ihi,
double  a,
double  b,
char  chStat 
)

OpacityAdd1SubshellInduc add opacity of individual species, including stimulated emission

Parameters
ipOpacpointer to opacity offset with stack
lowlow energy limit to opacity bound
ihihigh-energy limit to opacity bound
athe abundance of the species in this level
bthe departure coefficient
chStateither 's' for static opacities, or 'v' for volitile

References ASSERT, t_rfield::ContBoltz, DEBUG_ENTRY, hydro, t_hydro::lgHInducImp, t_rfield::lgInducProcess, t_opac::lgRedoStatic, MAX2, MIN2, t_rfield::nflux, opac, t_opac::opacity_abs, t_opac::OpacStack, t_opac::OpacStatic, and rfield.

Referenced by OpacityAdd1Element(), and save_opacity().

void OpacityAddTotal ( void  )

OpacityAddTotal derive total opacity for this position

Todo:
2 add charged heavy elements
Todo:
1 stupid - why this test on opacity_abs ? - we only get here if we already passed above test on this very thing

References t_opac::albedo, t_mesh::anu(), ASSERT, atmdat, atoms, t_gaunt::brems_opac(), t_gaunt::brems_sum_ions(), ca, cdEXIT, t_rfield::ContBoltz, conv, csphot(), DEBUG_ENTRY, molezone::den, t_brems_den::den_Hep, t_brems_den::den_Hepp, t_brems_den::den_Hm, t_brems_den::den_Hp, t_brems_den::den_ion, dense, diatoms, GrainVar::dstab, GrainVar::dstsc, t_dense::eden, t_rfield::eeBremsDif, eeBremsSpectrum(), t_opac::eeFreeFreeOpacity, t_opac::eeFreeFreeTemp, t_atmdat::EIonPot, EXIT_FAILURE, t_iso_sp::fb, findspecieslocal(), fixit, fp_equal(), fprintf(), frac(), t_opac::FreeFreeOpacity, t_dense::gas_phase, gv, h2, t_hmi::H2_total, t_hmi::h2plus_exc_frac, hmi, t_hmi::hmidep, hydro, t_opac::ica2ex, t_opac::ica2op, t_opac::ih2pnt, t_opac::ih2pnt_ex, t_opac::ih2pof, t_opac::ih2pof_ex, t_opac::in1, Singleton< t_gaunt >::Inst(), ionbal, t_opac::iopcom, t_opac::ioppr, ioQQQ, diatomics::ip_photo_opac_offset, diatomics::ip_photo_opac_thresh, t_opac::ipBrems, ipCARBON, t_ionbal::ipCompRecoil, ipH1s, ipH2p, ipH2s, ipH3d, ipH3p, ipH3s, ipH4d, ipH4f, ipH4p, ipH4s, ipH_LIKE, ipHe1s1S, ipHE_LIKE, ipHELIUM, t_hmi::iphmin, t_opac::iphmop, ipHYDROGEN, ipMAGNESIUM, t_opac::ipmgex, ipNITROGEN, t_opac::ipo1exc, t_opac::ipo3exc, t_opac::ipo3exc3, ipoint(), t_opac::ipOpMgEx, ipOXYGEN, t_opac::ippr, t_opac::ipRayScat, isnan, iso_sp, GrainVar::lgDustOn(), t_dense::lgElmtOn, t_conv::lgSearch, t_mole_global::lgStancil, t_trace::lgTrace, LIMELM, MAX2, MIN2, mole_global, t_ionbal::nCompRecoilElec, t_rfield::nflux, t_rfield::nflux_with_check, NISO, t_conv::nPres2Ioniz, t_iso_sp::numLevels_local, nzone, opac, t_opac::opacity_abs, t_opac::opacity_sct, OpacityAdd1Element(), OpacityAdd1Subshell(), OpacityZero(), OpacityZeroOld(), t_opac::OpacStack, t_opac::OpacStatic, t_rfield::otscon, t_rfield::otslin, oxy, t_atoms::p2nit, phycon, t_oxy::poiexc, t_oxy::poiii2, t_oxy::poiii3, t_ca::popca2ex, t_atoms::popMg2, pow2(), rfield, SMALLFLOAT, t_phycon::sqrte, t_iso_sp::st, t_opac::stimax, t_phycon::te, trace, and t_dense::xIonDense.

Referenced by ConvBase().

Here is the call graph for this function:

void OpacityCreateAll ( void  )
void OpacityZero ( void  )

OpacityZero - called by OpacityAddTotal to zero opacity array after saving it into oldopac

References DEBUG_ENTRY, t_opac::lgRedoStatic, t_rfield::nflux_with_check, t_opac::OldOpacSave, opac, t_opac::opacity_abs, t_opac::opacity_sct, t_opac::OpacStatic, and rfield.

Referenced by OpacityAddTotal(), SanityCheckBegin(), and save_opacity().

void OpacityZeroOld ( void  )

OpacityZeroOld - only set old opac to current value during search phase

References DEBUG_ENTRY, t_rfield::nflux_with_check, t_opac::OldOpacSave, opac, t_opac::opacity_abs, and rfield.

Referenced by OpacityAddTotal().

Variable Documentation

bool lgOpacAllocated

set true when allocated, init to false

Referenced by OpacityCreateAll(), and tauff().

t_opac opac

Referenced by t_gaunt::brems_opac(), cdSPEC2(), ConserveEnergy(), ContCreateMesh(), ContCreatePointers(), ContRate(), ContSetIntensity(), ConvBase(), CoolEvaluate(), csphot(), DumpLine(), emergent_line(), GammaBn(), GammaK(), GammaPrt(), GammaPrtRate(), GammaPrtShells(), t_rfield::getCoarseTransCoef(), GetHlikeCollisionStrength(), GrainRateDr(), highen(), diatomics::init(), InitDefaultsPreparse(), ion_photo(), ipShells(), iso_cascade(), iso_collide(), iso_get_collision_strength(), iso_level(), iso_photo(), iso_rad_rec_cooling_discrete(), iso_radiative_recomb(), iter_end_check(), IterEnd(), IterRestart(), IterStart(), LimitSh(), lines_continuum(), lines_setup(), mole_h_reactions(), OpacityAdd1Element(), OpacityAdd1Subshell(), OpacityAdd1SubshellInduc(), OpacityAddTotal(), OpacityCreate1Element(), OpacityCreateAll(), OpacityCreatePowerLaw(), OpacityCreateReilMan(), OpacityValenceRescale(), OpacityZero(), OpacityZeroOld(), outline_base_bin(), t_gaunt::p_setup_brems(), ParseCaseB(), ParseCommands(), ParseCompile(), ParseDont(), ParseSet(), ParseSphere(), ParseTauMin(), pnegopc(), PresTotCurrent(), PrtAllTau(), PrtComment(), PrtFinal(), PrtZone(), radius_first(), radius_increment(), radius_next(), rfield_opac_alloc(), rfield_opac_zero(), RT_continuum(), RT_DestProb(), RT_diffuse(), RT_iso_integrate_RRC(), RT_line_all_escape(), RT_line_electron_scatter(), RT_line_one_tau_reset(), RT_line_pumping(), RT_LineWidth(), RT_OTS(), RT_OTS_AddCont(), RT_OTS_AddLine(), RT_OTS_PrtRate(), RT_OTS_Update(), RT_recom_effic(), RT_tau_inc(), RT_tau_init(), RT_tau_reset(), RTesc_lya(), RTesc_lya_1side(), SanityCheckBegin(), Save_Line_RT(), save_opacity(), SaveDo(), SaveResults(), SaveSpecial(), tauff(), TauZero(), t_mesh::ValidateEdges(), ZoneEnd(), and ZoneStart().