00001
00002
00003
00004 #include "cddefines.h"
00005 #include "phycon.h"
00006 #include "dense.h"
00007 #include "atoms.h"
00008
00009
00010 double atom_pop3(
00011
00012 double g1, double g2, double g3,
00013
00014
00015 double o12, double o13, double o23,
00016
00017
00018 double a21, double a31, double a32,
00019
00020
00021 double Tex12, double Tex23,
00022
00023
00024 realnum *pop2,
00025
00026
00027 double abund,
00028
00029
00030 double gam2,
00031
00032
00033
00034 double r12,
00035 double r13 )
00036 {
00037 double alf,
00038 b12,
00039 b13,
00040 b23,
00041 bet,
00042 c21,
00043 c23,
00044 c31,
00045 c32,
00046 ex,
00047 fac,
00048 pop3_v;
00049
00050 DEBUG_ENTRY( "atom_pop3()" );
00051
00052
00053
00054 ex = Tex12/phycon.te;
00055 if( (abund <= 0.) || (ex > 20. && r12<SMALLFLOAT ) )
00056 {
00057 pop3_v = 0.;
00058 *pop2 = 0.;
00059 return( pop3_v );
00060 }
00061
00062
00063 ASSERT( g1>0. && g2>0. && g3>0. && o12>=0. && o13>=0. && o23>=0. && a21>=0. && a31>=0. && a32>=0. &&
00064 Tex12>=0. && Tex23>=0. );
00065
00066 b12 = exp(-ex);
00067 b23 = exp(-Tex23/phycon.te);
00068
00069 b13 = b12*b23;
00070 if( b13 == 0. && r12<SMALLFLOAT )
00071 {
00072 pop3_v = 0.;
00073 *pop2 = 0.;
00074 return( pop3_v );
00075 }
00076
00077
00078 atoms.c12 = dense.cdsqte*o12/g1*b12 + r12;
00079 atoms.c13 = dense.cdsqte*o13/g1*b13 + r13;
00080 c23 = dense.cdsqte*o23/g2*b23;
00081 c32 = dense.cdsqte*o23/g3;
00082 c31 = dense.cdsqte*o13/g3;
00083 c21 = dense.cdsqte*o12/g2;
00084
00085 alf = a21 + c21 + c23 + gam2;
00086 bet = a31 + a32 + c31 + c32;
00087 *pop2 = (realnum)((atoms.c13/bet + atoms.c12/(c32 + a32))/(alf/(c32 + a32) - c23/bet));
00088 pop3_v = (atoms.c13 + *pop2*c23)/bet;
00089
00090
00091 fac = abund/(1. + *pop2 + pop3_v);
00092 *pop2 *= (realnum)fac;
00093 pop3_v *= fac;
00094
00095 return( pop3_v );
00096 }