cloudy trunk
Loading...
Searching...
No Matches
Macros | Functions
ion_solver.cpp File Reference
#include "cddefines.h"
#include "yield.h"
#include "prt.h"
#include "continuum.h"
#include "iso.h"
#include "dynamics.h"
#include "grainvar.h"
#include "hmi.h"
#include "mole.h"
#include "thermal.h"
#include "newton_step.h"
#include "thirdparty.h"
#include "conv.h"
#include "secondaries.h"
#include "phycon.h"
#include "atmdat.h"
#include "heavy.h"
#include "elementnames.h"
#include "dense.h"
#include "radius.h"
#include "ionbal.h"
#include "taulines.h"
#include "trace.h"
Include dependency graph for ion_solver.cpp:

Go to the source code of this file.

Macros

#define SOLVE_TWO   0
 
#define MAT(M_, I_, J_)   ((M_)[(I_)*(ion_range)+(J_)])
 
#define MAT1(M_, I_, J_)   ((M_)[(I_)*(ion_range1)+(J_)])
 
#define MAT2(M_, I_, J_)   ((M_)[(I_)*(ion_range2)+(J_)])
 
#define THRESHOLD   0.25
 

Functions

STATIC bool lgTrivialSolution (long nelem, double abund_total)
 
STATIC void find_solution (long nelem, long ion_range, valarray< double > &xmat, valarray< double > &source)
 
STATIC void fill_array (long int nelem, long ion_range, valarray< double > &xmat, valarray< double > &source, valarray< double > &auger, double *abund_total)
 
STATIC double get_total_abundance_ions (long int nelem)
 
STATIC void HomogeneousSource (long nelem, long ion_low, long ion_range, valarray< double > &xmat, valarray< double > &source, double abund_total)
 
STATIC void store_new_densities (long nelem, long ion_range, long ion_low, double *source, double abund_total, bool *lgNegPop)
 
STATIC void PrintRates (long nelem, bool lgNegPop, double abund_total, valarray< double > &auger, bool lgPrintIt)
 
void solveions (double *ion, double *rec, double *snk, double *src, long int nlev, long int nmax)
 
void ion_solver (long int nelem, bool lgPrintIt)
 
bool lgOH_ChargeTransferDominant (void)
 
void ion_wrapper (long nelem)
 

Macro Definition Documentation

◆ MAT

#define MAT (   M_,
  I_,
  J_ 
)    ((M_)[(I_)*(ion_range)+(J_)])

Definition at line 54 of file ion_solver.cpp.

◆ MAT1

#define MAT1 (   M_,
  I_,
  J_ 
)    ((M_)[(I_)*(ion_range1)+(J_)])

Definition at line 57 of file ion_solver.cpp.

◆ MAT2

#define MAT2 (   M_,
  I_,
  J_ 
)    ((M_)[(I_)*(ion_range2)+(J_)])

Definition at line 60 of file ion_solver.cpp.

◆ SOLVE_TWO

#define SOLVE_TWO   0

Definition at line 28 of file ion_solver.cpp.

◆ THRESHOLD

#define THRESHOLD   0.25

Function Documentation

◆ fill_array()

STATIC void fill_array ( long int  nelem,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source,
valarray< double > &  auger,
double *  abund_total 
)

◆ find_solution()

STATIC void find_solution ( long  nelem,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source 
)

◆ get_total_abundance_ions()

STATIC double get_total_abundance_ions ( long int  nelem)

◆ HomogeneousSource()

STATIC void HomogeneousSource ( long  nelem,
long  ion_low,
long  ion_range,
valarray< double > &  xmat,
valarray< double > &  source,
double  abund_total 
)

◆ ion_solver()

void ion_solver ( long int  nelem,
bool  lgPrintIt 
)

ion_solver solve the bi-diagonal matrix for ionization balance

Parameters
nelem- element number on C scale, He is 1
lgPrintIt- option to print details of matrix elements

Definition at line 62 of file ion_solver.cpp.

References ASSERT, conv, DEBUG_ENTRY, dense, fill_array(), find_solution(), get_total_abundance_ions(), HomogeneousSource(), t_conv::incrementCounter(), ION_SOLVES, t_dense::IonHigh, t_dense::IonLow, ipH_LIKE, iso_charge_transfer_update(), iso_departure_coefficients(), ISO_LOOPS, iso_satellite_update(), iso_set_ion_rates(), iso_solve(), t_prt::lgPrtArry, lgTrivialSolution(), LIMELM, MIN2, NISO, PrintRates(), prt, source, and store_new_densities().

Referenced by IonHelium(), IonHydro(), and IonNelem().

Here is the call graph for this function:

◆ ion_wrapper()

void ion_wrapper ( long  nelem)

ion_wrapper a wrapper that redirects to IonHelium, IonCarbo, etc..

Definition at line 1498 of file ion_solver.cpp.

References ASSERT, t_elementnames::chElementSym, DEBUG_ENTRY, dense, elementnames, t_dense::gas_phase, IonHelium(), IonHydro(), IonNelem(), ioQQQ, ipHELIUM, ipHYDROGEN, lgElemsConserved(), t_dense::lgElmtOn, t_trace::lgHeavyBug, t_trace::lgTrace, LIMELM, trace, and t_dense::xIonDense.

Referenced by ConvBase().

Here is the call graph for this function:

◆ lgOH_ChargeTransferDominant()

bool lgOH_ChargeTransferDominant ( void  )

◆ lgTrivialSolution()

STATIC bool lgTrivialSolution ( long  nelem,
double  abund_total 
)

Definition at line 239 of file ion_solver.cpp.

References dense, t_dense::IonHigh, t_dense::IonLow, ipH_LIKE, iso_renorm(), t_dense::lgSetIoniz, NISO, t_dense::SetIoniz, and t_dense::xIonDense.

Referenced by ion_solver().

Here is the call graph for this function:

◆ PrintRates()

STATIC void PrintRates ( long  nelem,
bool  lgNegPop,
double  abund_total,
valarray< double > &  auger,
bool  lgPrintIt 
)

◆ solveions()

void solveions ( double *  ion,
double *  rec,
double *  snk,
double *  src,
long int  nlev,
long int  nmax 
)

Definition at line 1448 of file ion_solver.cpp.

References cdEXIT, DEBUG_ENTRY, EXIT_FAILURE, and ioQQQ.

◆ store_new_densities()

STATIC void store_new_densities ( long  nelem,
long  ion_range,
long  ion_low,
double *  source,
double  abund_total,
bool lgNegPop 
)
Todo:
2 renorm should == 1 when the molecules and ionization are in equilibrium. Should monitor this figure of merit in calling routine.

Definition at line 429 of file ion_solver.cpp.

References ASSERT, t_elementnames::chElementSym, conv, DEBUG_ENTRY, dense, elementnames, fixit(), t_thermal::heating, ionbal, t_dense::IonHigh, t_dense::IonLow, ioQQQ, ipH_LIKE, iso_renorm(), iso_sp, iteration, t_conv::lgSearch, LIMELM, MAT, MAX_DENSITY, NISO, t_iso_sp::numLevels_max, nzone, t_ionbal::RateIonizTot(), t_ionbal::RateRecomTot, source, thermal, TorF(), and t_dense::xIonDense.

Referenced by ion_solver().

Here is the call graph for this function: