Changeset 1680 for branches/newmole/source
- Timestamp:
- 12/16/07 03:39:51 (11 months ago)
- Location:
- branches/newmole/source
- Files:
-
- 5 modified
-
dense.cpp (modified) (1 diff)
-
mole_eval_balance.cpp (modified) (1 diff)
-
mole_newton_step.cpp (modified) (1 diff)
-
pressure_total.cpp (modified) (3 diffs)
-
rt_line_one_tauinc.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/newmole/source/dense.cpp
r1653 r1680 7 7 long int nelem, ion; 8 8 bool lgOK=true; 9 10 if (dynamics.lgAdvection)11 {12 // Switch off invariant checks for dynamics -- better to13 // work out broader invariant which applies here...14 fixit();15 return true;16 }17 9 18 10 /* this checks that all molecules and ions add up to gas phase abundance -
branches/newmole/source/mole_eval_balance.cpp
r1652 r1680 90 90 if(i!=j) 91 91 { 92 rate_deriv[i] *= rate->reactants[j]->hevmol;93 } 94 } 95 } 96 97 rate_tot = rate_deriv[0]* rate->reactants[0]->hevmol;92 rate_deriv[i] *= fabs(rate->reactants[j]->hevmol); 93 } 94 } 95 } 96 97 rate_tot = rate_deriv[0]*fabs(rate->reactants[0]->hevmol); 98 98 99 99 for(i=0;i<rate->nreactants;i++) -
branches/newmole/source/mole_newton_step.cpp
r1676 r1680 194 194 195 195 /* add positive ions and neutral atoms: ratios are set by ion_solver, 196 * we determine sum of twohere */196 * we determine abundance of the group as a whole here */ 197 197 198 198 if (loop == 0) { -
branches/newmole/source/pressure_total.cpp
r1610 r1680 70 70 pmx; 71 71 realnum den_hmole , 72 DenseAtomsIons, 73 DensElements; 72 DenseAtomsIons; 74 73 75 74 DEBUG_ENTRY( "PresTotCurrent()" ); … … 132 131 TempChange(phycon.te , false); 133 132 134 /* find total number of atoms and ions */ 135 DenseAtomsIons = 0.; 136 DensElements = 0.; 137 realnum factor = 1.1f; 138 if( conv.lgSearch ) 139 factor = 2.f; 140 for( nelem=ipHYDROGEN; nelem<LIMELM; ++nelem ) 141 { 142 /* only check element solution if it is on, and ionization 143 * has not been set with TABLE ELEMENT command */ 144 if( dense.lgElmtOn[nelem] ) 145 { 146 /* gas_phase is density of all atoms and ions, but not molecules */ 147 DensElements += dense.gas_phase[nelem]; 148 realnum DenseOne = 0; 149 for( ion=0; ion<=nelem+1; ++ion ) 150 DenseOne += dense.xIonDense[nelem][ion]; 151 152 /* during search phase sums may not add up correctly, and during 153 * early parts of search phase may be badly off. This test 154 * was introduced as result off fpe due to another 155 * reason - Te had changed too much during initial search 156 * for sim in which chemistry was important - fix was to not 157 * let Te change. During resulting insanity caused by large 158 * change, linearization did not work, CO and ionization solvers 159 * could diverge leading to molecule or ionization population 160 * larger than 1e38 limit to a realnum, fpe followed. this is to 161 * catch that in its early stages */ 162 ASSERT( conv.nTotalIoniz<5 || dense.lgSetIoniz[nelem] || 163 DenseOne <= dense.gas_phase[nelem]*factor ); 164 DenseAtomsIons += DenseOne; 165 } 166 } 167 /* DensElements is sum of all gas-phase densities of all elements, 168 * DenseAtomsIons is sum of density of atoms and ions, does not 169 * include molecules */ 170 ASSERT( conv.nTotalIoniz<5 || DenseAtomsIons <= DensElements*factor ); 171 ASSERT( DenseAtomsIons > 0. ); 133 ASSERT(lgElemsConserved()); 172 134 173 135 /* evaluate the total ionization energy on a scale where neutral atoms … … 203 165 * never set and only appears in print statements */ 204 166 phycon.EnergyBinding = 0.; 167 168 /* find total number of atoms and ions */ 169 DenseAtomsIons = 0.; 170 for( nelem=ipHYDROGEN; nelem<LIMELM; ++nelem ) 171 { 172 /* only check element solution if it is on, and ionization 173 * has not been set with TABLE ELEMENT command */ 174 if( dense.lgElmtOn[nelem] ) 175 { 176 /* gas_phase is density of all atoms and ions, but not molecules */ 177 for( ion=0; ion<=nelem+1; ++ion ) 178 DenseAtomsIons += dense.xIonDense[nelem][ion]; 179 } 180 } 181 /* DensElements is sum of all gas-phase densities of all elements, 182 * DenseAtomsIons is sum of density of atoms and ions, does not 183 * include molecules */ 184 ASSERT( DenseAtomsIons > 0. ); 205 185 206 186 /* find number of molecules of the heavy elements in the gas phase. -
branches/newmole/source/rt_line_one_tauinc.cpp
r1610 r1680 48 48 49 49 /* sanity check - total fine opacity should be greater than single ine opacity */ 50 ASSERT( fabs(dTau_line) < 0.01 || 50 ASSERT( fabs(dTau_line) < 0.01 || wind.windv != 0 || 51 51 rfield.fine_opac_zone[t->Emis->ipFine]*1.1 >= opacity*t->Emis->PopOpc ); 52 52 }
