00001 /* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and 00002 * others. For conditions of distribution and use see copyright notice in license.txt */ 00003 00004 #include "cddefines.h" 00005 #include "collision.h" 00006 00007 #include "dense.h" 00008 #include "h2.h" 00009 #include "hmi.h" 00010 00011 ColliderList::ColliderList() 00012 { 00013 DEBUG_ENTRY(" ColliderList::ColliderList()"); 00014 00015 list.resize( ipNCOLLIDER ); 00016 list[ipELECTRON].charge = -1; 00017 list[ipELECTRON].mass_amu = ELECTRON_MASS/ATOMIC_MASS_UNIT; 00018 00019 list[ipPROTON].charge = 1; 00020 list[ipPROTON].mass_amu = dense.AtomicWeight[0]; 00021 00022 list[ipHE_PLUS].charge = 1; 00023 list[ipHE_PLUS].mass_amu = dense.AtomicWeight[1]; 00024 00025 list[ipALPHA].charge = 2; 00026 list[ipALPHA].mass_amu = dense.AtomicWeight[1]; 00027 00028 list[ipATOM_H].charge = 0; 00029 list[ipATOM_H].mass_amu = dense.AtomicWeight[0]; 00030 00031 list[ipATOM_HE].charge = 0; 00032 list[ipATOM_HE].mass_amu = dense.AtomicWeight[1]; 00033 00034 list[ipH2_ORTHO].charge = 0; 00035 list[ipH2_ORTHO].mass_amu = 2.f; 00036 00037 list[ipH2_PARA].charge = 0; 00038 list[ipH2_PARA].mass_amu = 2.f; 00039 00040 list[ipH2].charge = 0; 00041 list[ipH2].mass_amu = 2.f; 00042 } 00043 00044 void ColliderList::init() 00045 { 00046 DEBUG_ENTRY(" ColliderList::init()"); 00047 colliders.list[ipELECTRON].density = &(dense.EdenHCorr); 00048 colliders.list[ipPROTON].density = &(dense.xIonDense[ipHYDROGEN][1]); 00049 colliders.list[ipHE_PLUS].density = &(dense.xIonDense[ipHELIUM][1]); 00050 colliders.list[ipALPHA].density = &(dense.xIonDense[ipHELIUM][2]); 00051 colliders.list[ipATOM_H].density = &(dense.xIonDense[ipHYDROGEN][0]); 00052 colliders.list[ipATOM_HE].density = &(dense.xIonDense[ipHELIUM][0]); 00053 colliders.list[ipH2_ORTHO].density = &(h2.ortho_density); 00054 colliders.list[ipH2_PARA].density = &(h2.para_density); 00055 colliders.list[ipH2].density = &(hmi.H2_total); 00056 } 00057 ColliderList colliders; 00058 00059 /*CollisionJunk set all elements of transition struc to dangerous values */ 00060 void CollisionJunk( const CollisionProxy & t ) 00061 { 00062 00063 DEBUG_ENTRY( "CollisionJunk()" ); 00064 00065 /* Coll->cooling and Coll->heating due to collisional excitation */ 00066 t.cool() = -FLT_MAX; 00067 t.heat() = -FLT_MAX; 00068 00069 /* collision strengths for transition */ 00070 t.col_str() = -FLT_MAX; 00071 00072 for( long i=0; i<ipNCOLLIDER; i++ ) 00073 t.rate_coef_ul_set()[i] = 0.f; 00074 00075 t.rate_lu_nontherm_set() = 0.f; 00076 00077 return; 00078 } 00079 00080 /*CollisionZero zeros out the structure */ 00081 void CollisionZero( const CollisionProxy & t ) 00082 { 00083 00084 DEBUG_ENTRY( "CollisionZero()" ); 00085 00086 /* Coll->cooling and Coll->heating due to collisional excitation */ 00087 t.cool() = 0.; 00088 t.heat() = 0.; 00089 00090 return; 00091 } 00092