pyEQL 1.4.0rc9__cp312-cp312-macosx_10_13_x86_64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. pyEQL/__init__.py +50 -0
  2. pyEQL/_phreeqc.cpython-312-darwin.so +0 -0
  3. pyEQL/activity_correction.py +879 -0
  4. pyEQL/database/geothermal.dat +5693 -0
  5. pyEQL/database/llnl.dat +19305 -0
  6. pyEQL/database/phreeqc_license.txt +54 -0
  7. pyEQL/database/pyeql_db.json +35607 -0
  8. pyEQL/engines.py +1153 -0
  9. pyEQL/equilibrium.py +227 -0
  10. pyEQL/functions.py +281 -0
  11. pyEQL/phreeqc/__init__.py +5 -0
  12. pyEQL/phreeqc/bindings.cpp +84 -0
  13. pyEQL/phreeqc/core.py +239 -0
  14. pyEQL/phreeqc/database/Amm.dat +1968 -0
  15. pyEQL/phreeqc/database/CMakeLists.txt +32 -0
  16. pyEQL/phreeqc/database/ColdChem.dat +267 -0
  17. pyEQL/phreeqc/database/Concrete_PHR.dat +158 -0
  18. pyEQL/phreeqc/database/Concrete_PZ.dat +195 -0
  19. pyEQL/phreeqc/database/Kinec.v2.dat +12039 -0
  20. pyEQL/phreeqc/database/Kinec_v3.dat +12159 -0
  21. pyEQL/phreeqc/database/Makefile.am +28 -0
  22. pyEQL/phreeqc/database/Makefile.in +530 -0
  23. pyEQL/phreeqc/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
  24. pyEQL/phreeqc/database/Tipping_Hurley.dat +4137 -0
  25. pyEQL/phreeqc/database/__init__.py +0 -0
  26. pyEQL/phreeqc/database/core10.dat +6824 -0
  27. pyEQL/phreeqc/database/frezchem.dat +634 -0
  28. pyEQL/phreeqc/database/iso.dat +7235 -0
  29. pyEQL/phreeqc/database/llnl.dat +19310 -0
  30. pyEQL/phreeqc/database/minteq.dat +5654 -0
  31. pyEQL/phreeqc/database/minteq.v4.dat +13212 -0
  32. pyEQL/phreeqc/database/phreeqc.dat +1972 -0
  33. pyEQL/phreeqc/database/phreeqc_rates.dat +3158 -0
  34. pyEQL/phreeqc/database/pitzer.dat +1044 -0
  35. pyEQL/phreeqc/database/sit.dat +14348 -0
  36. pyEQL/phreeqc/database/wateq4f.dat +4036 -0
  37. pyEQL/phreeqc/ext/README.md +10 -0
  38. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/CMakeLists.txt +476 -0
  39. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/INSTALL +302 -0
  40. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqc.rc +61 -0
  41. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqcConfig.cmake.in +4 -0
  42. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.am +8 -0
  43. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.in +816 -0
  44. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/aclocal.m4 +1217 -0
  45. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/CTestScript.cmake +167 -0
  46. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/CSelectedOutput.cpp.o +0 -0
  47. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc.cpp.o +0 -0
  48. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqcLib.cpp.o +0 -0
  49. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc_interface_F.cpp.o +0 -0
  50. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/Var.c.o +0 -0
  51. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Dictionary.cpp.o +0 -0
  52. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ExchComp.cxx.o +0 -0
  53. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Exchange.cxx.o +0 -0
  54. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/GasComp.cxx.o +0 -0
  55. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/GasPhase.cxx.o +0 -0
  56. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ISolution.cxx.o +0 -0
  57. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ISolutionComp.cxx.o +0 -0
  58. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/KineticsComp.cxx.o +0 -0
  59. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/NameDouble.cxx.o +0 -0
  60. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/NumKeyword.cxx.o +0 -0
  61. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PBasic.cpp.o +0 -0
  62. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PHRQ_io_output.cpp.o +0 -0
  63. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PPassemblage.cxx.o +0 -0
  64. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PPassemblageComp.cxx.o +0 -0
  65. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Phreeqc.cpp.o +0 -0
  66. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp.o +0 -0
  67. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Pressure.cxx.o +0 -0
  68. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Reaction.cxx.o +0 -0
  69. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ReadClass.cxx.o +0 -0
  70. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SS.cxx.o +0 -0
  71. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SSassemblage.cxx.o +0 -0
  72. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SScomp.cxx.o +0 -0
  73. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SelectedOutput.cpp.o +0 -0
  74. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Serializer.cxx.o +0 -0
  75. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Solution.cxx.o +0 -0
  76. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SolutionIsotope.cxx.o +0 -0
  77. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/StorageBin.cxx.o +0 -0
  78. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/StorageBinList.cpp.o +0 -0
  79. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Surface.cxx.o +0 -0
  80. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SurfaceCharge.cxx.o +0 -0
  81. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SurfaceComp.cxx.o +0 -0
  82. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/System.cxx.o +0 -0
  83. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Temperature.cxx.o +0 -0
  84. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Use.cpp.o +0 -0
  85. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/UserPunch.cpp.o +0 -0
  86. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/advection.cpp.o +0 -0
  87. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/basicsubs.cpp.o +0 -0
  88. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cl1.cpp.o +0 -0
  89. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/PHRQ_base.cxx.o +0 -0
  90. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/PHRQ_io.cpp.o +0 -0
  91. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/Parser.cxx.o +0 -0
  92. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/Utils.cxx.o +0 -0
  93. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cvdense.cpp.o +0 -0
  94. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cvode.cpp.o +0 -0
  95. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cxxKinetics.cxx.o +0 -0
  96. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cxxMix.cxx.o +0 -0
  97. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/dense.cpp.o +0 -0
  98. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/dumper.cpp.o +0 -0
  99. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/gases.cpp.o +0 -0
  100. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/input.cpp.o +0 -0
  101. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/integrate.cpp.o +0 -0
  102. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/inverse.cpp.o +0 -0
  103. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/isotopes.cpp.o +0 -0
  104. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/kinetics.cpp.o +0 -0
  105. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/mainsubs.cpp.o +0 -0
  106. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/model.cpp.o +0 -0
  107. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/nvector.cpp.o +0 -0
  108. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/nvector_serial.cpp.o +0 -0
  109. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/parse.cpp.o +0 -0
  110. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/phqalloc.cpp.o +0 -0
  111. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/pitzer.cpp.o +0 -0
  112. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/pitzer_structures.cpp.o +0 -0
  113. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/prep.cpp.o +0 -0
  114. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/print.cpp.o +0 -0
  115. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/read.cpp.o +0 -0
  116. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/readtr.cpp.o +0 -0
  117. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/runner.cpp.o +0 -0
  118. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/sit.cpp.o +0 -0
  119. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/smalldense.cpp.o +0 -0
  120. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/spread.cpp.o +0 -0
  121. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/step.cpp.o +0 -0
  122. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/structures.cpp.o +0 -0
  123. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/sundialsmath.cpp.o +0 -0
  124. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/tally.cpp.o +0 -0
  125. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/tidy.cpp.o +0 -0
  126. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/transport.cpp.o +0 -0
  127. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/utilities.cpp.o +0 -0
  128. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CTestTestfile.cmake +6 -0
  129. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/DartConfiguration.tcl +109 -0
  130. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/cmake_install.cmake +45 -0
  131. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/libIPhreeqc.a +0 -0
  132. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ar-lib +270 -0
  133. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/compile +347 -0
  134. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.guess +1441 -0
  135. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.sub +1813 -0
  136. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/depcomp +791 -0
  137. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/install-sh +508 -0
  138. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ltmain.sh +11156 -0
  139. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/missing +215 -0
  140. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/test-driver +148 -0
  141. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure +23867 -0
  142. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure.ac +136 -0
  143. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Amm.dat +1968 -0
  144. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/CMakeLists.txt +32 -0
  145. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/ColdChem.dat +267 -0
  146. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PHR.dat +158 -0
  147. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PZ.dat +195 -0
  148. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec.v2.dat +12039 -0
  149. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec_v3.dat +12159 -0
  150. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.am +28 -0
  151. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.in +530 -0
  152. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
  153. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Tipping_Hurley.dat +4137 -0
  154. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/core10.dat +6824 -0
  155. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/frezchem.dat +634 -0
  156. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/iso.dat +7235 -0
  157. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/llnl.dat +19310 -0
  158. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.dat +5654 -0
  159. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.v4.dat +13212 -0
  160. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc.dat +1972 -0
  161. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc_rates.dat +3158 -0
  162. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/pitzer.dat +1044 -0
  163. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/sit.dat +14348 -0
  164. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/wateq4f.dat +4036 -0
  165. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/CMakeLists.txt +35 -0
  166. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/IPhreeqc.pdf +0 -0
  167. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.am +24 -0
  168. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.in +545 -0
  169. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/NOTICE +51 -0
  170. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_2_1999_manual.pdf +0 -0
  171. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_3_2013_manual.pdf +0 -0
  172. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/README +428 -0
  173. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/RELEASE +7294 -0
  174. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h.html +5096 -0
  175. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h_source.html +389 -0
  176. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp.html +83 -0
  177. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp_source.html +478 -0
  178. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h.html +318 -0
  179. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h_source.html +200 -0
  180. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bc_s.png +0 -0
  181. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bdwn.png +0 -0
  182. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.html +2274 -0
  183. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.png +0 -0
  184. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.html +69 -0
  185. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.png +0 -0
  186. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/closed.png +0 -0
  187. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +68 -0
  188. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.css +1440 -0
  189. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.png +0 -0
  190. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dynsections.js +97 -0
  191. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2blank.png +0 -0
  192. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2doc.png +0 -0
  193. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderclosed.png +0 -0
  194. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderopen.png +0 -0
  195. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2lastnode.png +0 -0
  196. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2link.png +0 -0
  197. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mlastnode.png +0 -0
  198. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mnode.png +0 -0
  199. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2node.png +0 -0
  200. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2plastnode.png +0 -0
  201. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2pnode.png +0 -0
  202. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2splitbar.png +0 -0
  203. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2vertline.png +0 -0
  204. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/index.html +58 -0
  205. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/jquery.js +31 -0
  206. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_f.png +0 -0
  207. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_g.png +0 -0
  208. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_h.png +0 -0
  209. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/open.png +0 -0
  210. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/structVAR.html +143 -0
  211. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_off.png +0 -0
  212. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_on.png +0 -0
  213. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_a.png +0 -0
  214. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_b.png +0 -0
  215. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_h.png +0 -0
  216. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_s.png +0 -0
  217. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tabs.css +60 -0
  218. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/phreeqc3.chm +0 -0
  219. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/CMakeLists.txt +11 -0
  220. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.am +88 -0
  221. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.in +696 -0
  222. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/CMakeLists.txt +1 -0
  223. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt +35 -0
  224. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt.in +21 -0
  225. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/README.txt +44 -0
  226. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/advect.c +101 -0
  227. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/ic +17 -0
  228. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/phreeqc.dat +1579 -0
  229. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/CMakeLists.txt +10 -0
  230. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/README.txt +3 -0
  231. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/CMakeLists.txt +9 -0
  232. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/phreeqc.dat +1582 -0
  233. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/runphreeqc.xls +0 -0
  234. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/withcallback.xls +0 -0
  235. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/CMakeLists.txt +11 -0
  236. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/Gypsum.py +52 -0
  237. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/parallel_advect.py +465 -0
  238. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/phreeqc.dat +1582 -0
  239. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/pitzer.dat +790 -0
  240. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/wateq4f.dat +3846 -0
  241. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/CMakeLists.txt +1 -0
  242. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt +35 -0
  243. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt.in +20 -0
  244. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/README.txt +45 -0
  245. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/advect.cpp +110 -0
  246. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/ic +17 -0
  247. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/phreeqc.dat +1579 -0
  248. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/CMakeLists.txt +1 -0
  249. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt +44 -0
  250. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt.in +24 -0
  251. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/README.txt +45 -0
  252. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/advect.F90 +102 -0
  253. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/ic +17 -0
  254. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/phreeqc.dat +1579 -0
  255. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt +26 -0
  256. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt.in +20 -0
  257. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/README.txt +37 -0
  258. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/ex2 +26 -0
  259. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/main.cpp +20 -0
  260. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/phreeqc.dat +1837 -0
  261. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/post-install.cmake.in +7 -0
  262. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/CMakeLists.txt +185 -0
  263. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.cpp +171 -0
  264. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.h +34 -0
  265. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.am +18 -0
  266. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.in +466 -0
  267. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestCVar.cpp +9 -0
  268. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqc.cpp +4901 -0
  269. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqcLib.cpp +4644 -0
  270. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestSelectedOutput.cpp +669 -0
  271. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestVar.cpp +10 -0
  272. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/conv_fail.in +11 -0
  273. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/dump +42 -0
  274. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/iso.dat +7231 -0
  275. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/kinn20140218 +349 -0
  276. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/missing_e.dat +1556 -0
  277. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch +105 -0
  278. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch_no_set +102 -0
  279. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.90a6449 +1935 -0
  280. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.old +1556 -0
  281. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/libtool.m4 +8388 -0
  282. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltoptions.m4 +437 -0
  283. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltsugar.m4 +124 -0
  284. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltversion.m4 +23 -0
  285. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/lt~obsolete.m4 +99 -0
  286. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/resource.h +14 -0
  287. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.cpp +401 -0
  288. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.hxx +77 -0
  289. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CVar.hxx +162 -0
  290. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Debug.h +12 -0
  291. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/ErrorReporter.hxx +70 -0
  292. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.cpp +1889 -0
  293. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f.inc +91 -0
  294. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f90.inc +603 -0
  295. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.h +2182 -0
  296. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.hpp +1027 -0
  297. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcCallbacks.h +19 -0
  298. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcF.f +653 -0
  299. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcLib.cpp +1098 -0
  300. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface.F90 +1283 -0
  301. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.cpp +535 -0
  302. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.h +162 -0
  303. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.am +210 -0
  304. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.in +1294 -0
  305. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/README.Fortran +17 -0
  306. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.c +84 -0
  307. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.h +152 -0
  308. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Version.h +36 -0
  309. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fimpl.h +282 -0
  310. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.cpp +646 -0
  311. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.h +163 -0
  312. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap1.cpp +24 -0
  313. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap2.cpp +24 -0
  314. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap3.cpp +24 -0
  315. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap4.cpp +24 -0
  316. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap5.cpp +24 -0
  317. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap6.cpp +25 -0
  318. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap7.cpp +25 -0
  319. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap8.cpp +24 -0
  320. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.cpp +225 -0
  321. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.h +59 -0
  322. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.cpp +1382 -0
  323. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.h +444 -0
  324. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.cpp +42 -0
  325. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.h +79 -0
  326. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.cpp +41 -0
  327. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.h +28 -0
  328. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.cxx +398 -0
  329. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.h +117 -0
  330. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.cxx +466 -0
  331. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.h +74 -0
  332. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.h +1184 -0
  333. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.resX +36 -0
  334. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.cxx +265 -0
  335. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.h +59 -0
  336. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.cxx +659 -0
  337. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.h +103 -0
  338. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.cxx +40 -0
  339. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.h +53 -0
  340. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.cxx +202 -0
  341. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.h +138 -0
  342. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.cxx +318 -0
  343. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.h +81 -0
  344. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NA.h +1 -0
  345. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.cxx +537 -0
  346. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.h +66 -0
  347. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.cxx +190 -0
  348. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.h +67 -0
  349. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.cpp +8350 -0
  350. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.h +572 -0
  351. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PHRQ_io_output.cpp +411 -0
  352. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.cxx +375 -0
  353. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.h +70 -0
  354. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.cxx +441 -0
  355. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.h +83 -0
  356. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.cpp +2087 -0
  357. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.h +2164 -0
  358. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp +242 -0
  359. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.h +104 -0
  360. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.cxx +417 -0
  361. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.h +43 -0
  362. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.cxx +284 -0
  363. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.h +57 -0
  364. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ReadClass.cxx +1150 -0
  365. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.cxx +609 -0
  366. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.h +128 -0
  367. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.cxx +317 -0
  368. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.h +59 -0
  369. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.cxx +297 -0
  370. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.h +66 -0
  371. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.cpp +115 -0
  372. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.h +209 -0
  373. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.cxx +213 -0
  374. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.h +42 -0
  375. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.cxx +1795 -0
  376. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.h +154 -0
  377. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.cxx +333 -0
  378. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.h +85 -0
  379. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.cxx +1507 -0
  380. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.h +141 -0
  381. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.cpp +358 -0
  382. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.h +81 -0
  383. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.cxx +837 -0
  384. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.h +108 -0
  385. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.cxx +617 -0
  386. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.h +137 -0
  387. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.cxx +509 -0
  388. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.h +70 -0
  389. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.cxx +103 -0
  390. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.h +89 -0
  391. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.cxx +423 -0
  392. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.h +42 -0
  393. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.cpp +78 -0
  394. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.h +159 -0
  395. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.cpp +32 -0
  396. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.h +39 -0
  397. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ZedGraph.dll +0 -0
  398. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/advection.cpp +140 -0
  399. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/basicsubs.cpp +4333 -0
  400. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cl1.cpp +881 -0
  401. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.cxx +117 -0
  402. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.h +48 -0
  403. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_exports.h +20 -0
  404. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.cpp +914 -0
  405. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.h +207 -0
  406. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.cxx +1331 -0
  407. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.h +310 -0
  408. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.cxx +263 -0
  409. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.h +29 -0
  410. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/phrqtype.h +18 -0
  411. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.cpp +566 -0
  412. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.h +267 -0
  413. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.cpp +3939 -0
  414. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.h +940 -0
  415. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.cxx +617 -0
  416. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.h +78 -0
  417. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.cxx +154 -0
  418. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.h +58 -0
  419. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.cpp +175 -0
  420. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.h +341 -0
  421. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.cpp +277 -0
  422. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.h +60 -0
  423. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/gases.cpp +748 -0
  424. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/global_structures.h +1672 -0
  425. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/input.cpp +133 -0
  426. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/integrate.cpp +1219 -0
  427. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/inverse.cpp +5135 -0
  428. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/isotopes.cpp +1813 -0
  429. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/kinetics.cpp +3180 -0
  430. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/mainsubs.cpp +2320 -0
  431. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/model.cpp +5843 -0
  432. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.cpp +272 -0
  433. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.h +485 -0
  434. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.cpp +1032 -0
  435. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.h +369 -0
  436. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/parse.cpp +1044 -0
  437. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.cpp +316 -0
  438. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.h +47 -0
  439. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer.cpp +2709 -0
  440. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer_structures.cpp +225 -0
  441. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/prep.cpp +6267 -0
  442. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/print.cpp +3673 -0
  443. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/read.cpp +10245 -0
  444. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/readtr.cpp +1495 -0
  445. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.cpp +158 -0
  446. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.h +33 -0
  447. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sit.cpp +1684 -0
  448. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.cpp +324 -0
  449. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.h +261 -0
  450. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/spread.cpp +1309 -0
  451. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/step.cpp +1566 -0
  452. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/structures.cpp +3381 -0
  453. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.cpp +133 -0
  454. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.h +162 -0
  455. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialstypes.h +183 -0
  456. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tally.cpp +1288 -0
  457. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tidy.cpp +5600 -0
  458. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/transport.cpp +6403 -0
  459. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/utilities.cpp +1339 -0
  460. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/thread.h +64 -0
  461. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/CMakeLists.txt +133 -0
  462. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.am +45 -0
  463. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.in +1128 -0
  464. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/ex2.in +26 -0
  465. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main.f90 +31 -0
  466. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main77.f +6 -0
  467. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main_fortran.cxx +8 -0
  468. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/phreeqc.dat.in +1556 -0
  469. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_c.c +148 -0
  470. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_cxx.cxx +152 -0
  471. pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_f90.F90 +328 -0
  472. pyEQL/phreeqc/iphreeqc_wrapper.cpp +75 -0
  473. pyEQL/phreeqc/solution.py +74 -0
  474. pyEQL/phreeqc/var.py +50 -0
  475. pyEQL/presets/Ringers lactate.yaml +20 -0
  476. pyEQL/presets/__init__.py +17 -0
  477. pyEQL/presets/normal saline.yaml +17 -0
  478. pyEQL/presets/rainwater.yaml +17 -0
  479. pyEQL/presets/seawater.yaml +29 -0
  480. pyEQL/presets/urine.yaml +26 -0
  481. pyEQL/presets/wastewater.yaml +21 -0
  482. pyEQL/py.typed +0 -0
  483. pyEQL/salt_ion_match.py +112 -0
  484. pyEQL/solute.py +163 -0
  485. pyEQL/solution.py +2714 -0
  486. pyEQL/utils.py +237 -0
  487. pyeql-1.4.0rc9.dist-info/METADATA +130 -0
  488. pyeql-1.4.0rc9.dist-info/RECORD +491 -0
  489. pyeql-1.4.0rc9.dist-info/WHEEL +6 -0
  490. pyeql-1.4.0rc9.dist-info/licenses/AUTHORS.md +21 -0
  491. pyeql-1.4.0rc9.dist-info/licenses/LICENSE.txt +20 -0
@@ -0,0 +1,1566 @@
1
+ #include "Phreeqc.h"
2
+ #include "phqalloc.h"
3
+
4
+ #include "Utils.h"
5
+ #include "StorageBin.h"
6
+ #include "Solution.h"
7
+ #include "PPassemblage.h"
8
+ #include "SSassemblage.h"
9
+ #include "SS.h"
10
+ #include "NameDouble.h"
11
+ #include "Temperature.h"
12
+ #include "cxxMix.h"
13
+ #include "Exchange.h"
14
+ #include "GasPhase.h"
15
+ #include "Reaction.h"
16
+ #include "PPassemblage.h"
17
+ #include "SSassemblage.h"
18
+ #include "cxxKinetics.h"
19
+
20
+ #if defined(PHREEQCI_GUI)
21
+ #ifdef _DEBUG
22
+ #define new DEBUG_NEW
23
+ #undef THIS_FILE
24
+ static char THIS_FILE[] = __FILE__;
25
+ #endif
26
+ #endif
27
+
28
+ /* ---------------------------------------------------------------------- */
29
+ int Phreeqc::
30
+ step(LDBLE step_fraction)
31
+ /* ---------------------------------------------------------------------- */
32
+ {
33
+ /*
34
+ * zero global solution, add solution or mixture, add exchange,
35
+ * add surface, add gas phase, add solid solutions,
36
+ * set temperature, and add reaction.
37
+ * Ensure all elements
38
+ * included in any of these are present in small amounts.
39
+ * Save result as n_user -1.
40
+ */
41
+ LDBLE difftemp;
42
+ int step_number;
43
+ cxxPPassemblage *pp_assemblage_save = NULL;
44
+ cxxSSassemblage *ss_assemblage_save = NULL;
45
+ /*
46
+ * Zero out global solution data
47
+ */
48
+
49
+ xsolution_zero();
50
+ /*
51
+ * Set reaction to zero
52
+ */
53
+ step_x = 0.0;
54
+ step_number = reaction_step;
55
+ /*
56
+ * Mixing or solution
57
+ */
58
+ if (use.Get_mix_ptr() != NULL)
59
+ {
60
+ add_mix(use.Get_mix_ptr());
61
+ int n = use.Get_n_mix_user_orig();
62
+ if (n == 0 || n == count_cells + 1)
63
+ {
64
+ cxxSolution *solution_ptr = Utilities::Rxn_find(Rxn_solution_map, n);
65
+ if (solution_ptr != NULL && !solution_ptr->Get_new_def())
66
+ potV_x = solution_ptr->Get_potV();
67
+ }
68
+ }
69
+ else if (use.Get_solution_ptr() != NULL)
70
+ {
71
+ add_solution(use.Get_solution_ptr(), 1.0, 1.0);
72
+ potV_x = use.Get_solution_ptr()->Get_potV();
73
+ cell_no = use.Get_n_solution_user();
74
+ }
75
+ else
76
+ {
77
+ input_error++;
78
+ error_msg("Neither mixing nor an initial solution have "
79
+ "been defined in reaction step.", STOP);
80
+ }
81
+ /*
82
+ * Reaction
83
+ */
84
+ if (use.Get_reaction_ptr() != NULL)
85
+ {
86
+ add_reaction( use.Get_reaction_ptr(), step_number, step_fraction);
87
+ }
88
+ /*
89
+ * Kinetics
90
+ */
91
+ if (use.Get_kinetics_ptr() != NULL)
92
+ {
93
+ add_kinetics(use.Get_kinetics_ptr());
94
+ }
95
+ /*
96
+ * Exchange
97
+ */
98
+ if (use.Get_exchange_ptr() != NULL)
99
+ {
100
+ add_exchange(use.Get_exchange_ptr());
101
+ }
102
+ /*
103
+ * Surface
104
+ */
105
+ if (use.Get_surface_ptr() != NULL)
106
+ {
107
+ add_surface(use.Get_surface_ptr());
108
+ }
109
+ /*
110
+ * Gases
111
+ */
112
+ if (use.Get_gas_phase_ptr() != NULL)
113
+ {
114
+ cxxGasPhase * gas_phase_ptr = use.Get_gas_phase_ptr();
115
+ add_gas_phase(gas_phase_ptr);
116
+ }
117
+ /*
118
+ * Temperature
119
+ */
120
+ if (use.Get_temperature_ptr() != NULL)
121
+ {
122
+ cxxTemperature *t_ptr = use.Get_temperature_ptr();
123
+ tc_x = t_ptr->Temperature_for_step(step_number);
124
+ }
125
+ if ((state == TRANSPORT) && (transport_step != 0) &&
126
+ (cell > 0) && (cell != count_cells + 1)) // ** needs potV correction
127
+ {
128
+ difftemp = tc_x - cell_data[cell].temp;
129
+ cell_data[cell].temp += difftemp / tempr;
130
+ tc_x = cell_data[cell].temp;
131
+ }
132
+ /*
133
+ * Pressure
134
+ */
135
+ if (use.Get_pressure_ptr() != NULL)
136
+ {
137
+ cxxPressure *p_ptr = use.Get_pressure_ptr();
138
+ patm_x = p_ptr->Pressure_for_step(step_number);
139
+ }
140
+ /*
141
+ * Pure phases and solid solutions are added to avoid
142
+ * zero or negative concentrations
143
+ */
144
+ /*
145
+ * Pure phases
146
+ */
147
+ if (use.Get_pp_assemblage_ptr() != NULL)
148
+ {
149
+ cxxPPassemblage * pp_assemblage_ptr = use.Get_pp_assemblage_ptr();
150
+ pp_assemblage_save = new cxxPPassemblage(*pp_assemblage_ptr);
151
+ add_pp_assemblage(pp_assemblage_ptr);
152
+ }
153
+ /*
154
+ * Solid solutions
155
+ */
156
+ if (use.Get_ss_assemblage_ptr() != NULL)
157
+ {
158
+ ss_assemblage_save = new cxxSSassemblage(*use.Get_ss_assemblage_ptr());
159
+ add_ss_assemblage(use.Get_ss_assemblage_ptr());
160
+ }
161
+ /*
162
+ * Check that elements are available for gas components,
163
+ * pure phases, and solid solutions
164
+ */
165
+ if (use.Get_gas_phase_ptr() != NULL)
166
+ {
167
+ cxxGasPhase * gas_phase_ptr = use.Get_gas_phase_ptr();
168
+ gas_phase_check(gas_phase_ptr);
169
+ }
170
+ if (use.Get_pp_assemblage_ptr() != NULL)
171
+ {
172
+ cxxPPassemblage * pp_assemblage_ptr = use.Get_pp_assemblage_ptr();
173
+ pp_assemblage_check(pp_assemblage_ptr);
174
+ }
175
+ if (use.Get_ss_assemblage_ptr() != NULL)
176
+ {
177
+ ss_assemblage_check(use.Get_ss_assemblage_ptr());
178
+ }
179
+ /*
180
+ * Check that element moles are >= zero
181
+ */
182
+ if (solution_check() == MASS_BALANCE)
183
+ {
184
+ /* reset moles and deltas */
185
+ if (use.Get_pp_assemblage_ptr() != NULL)
186
+ {
187
+ Rxn_pp_assemblage_map[pp_assemblage_save->Get_n_user()] = *pp_assemblage_save;
188
+ use.Set_pp_assemblage_ptr(Utilities::Rxn_find(Rxn_pp_assemblage_map, pp_assemblage_save->Get_n_user()));
189
+ }
190
+ if (use.Get_ss_assemblage_ptr() != NULL)
191
+ {
192
+ Rxn_ss_assemblage_map[ss_assemblage_save->Get_n_user()] = *ss_assemblage_save;
193
+ use.Set_ss_assemblage_ptr(Utilities::Rxn_find(Rxn_ss_assemblage_map, ss_assemblage_save->Get_n_user()));
194
+ }
195
+ if (pp_assemblage_save != NULL)
196
+ {
197
+ delete pp_assemblage_save;
198
+ pp_assemblage_save = NULL;
199
+ }
200
+ if (ss_assemblage_save != NULL)
201
+ {
202
+ delete ss_assemblage_save;
203
+ ss_assemblage_save = NULL;
204
+ }
205
+ return (MASS_BALANCE);
206
+ }
207
+ /*
208
+ * Copy global into solution n_user = -1
209
+ */
210
+ xsolution_save(-1);
211
+ step_save_surf(-1);
212
+ step_save_exch(-1);
213
+ /*
214
+ * Clean up temporary space
215
+ */
216
+ if (pp_assemblage_save != NULL)
217
+ {
218
+ delete pp_assemblage_save;
219
+ pp_assemblage_save = NULL;
220
+ }
221
+ if (ss_assemblage_save != NULL)
222
+ {
223
+ delete ss_assemblage_save;
224
+ ss_assemblage_save = NULL;
225
+ }
226
+ //
227
+ // Solution -1 has sum of solution/mix, exchange, surface, gas_phase
228
+ // reaction, kinetics
229
+ //
230
+ // Determine system totals, calculate maximum mineral precipitation
231
+ if (use.Get_pp_assemblage_in() || use.Get_ss_assemblage_in())
232
+ {
233
+ cxxStorageBin sys_bin(phrq_io);
234
+ cxxSolution *sol = Utilities::Rxn_find(Rxn_solution_map, -1);
235
+ cxxSolution soln(*sol);
236
+ sys_bin.Set_Solution(-1, soln);
237
+ if (use.Get_pp_assemblage_in())
238
+ {
239
+ sys_bin.Set_PPassemblage(-1, use.Get_pp_assemblage_ptr());
240
+ }
241
+ if (use.Get_ss_assemblage_in())
242
+ {
243
+ sys_bin.Set_SSassemblage(-1, *use.Get_ss_assemblage_ptr());
244
+ }
245
+ sys_bin.Set_System(-1);
246
+ sys_bin.Get_System().totalize(this);
247
+ cxxNameDouble sys_tots = sys_bin.Get_System().Get_Totals();
248
+ if (use.Get_pp_assemblage_in())
249
+ {
250
+ cxxPPassemblage *pp_assemblage_ptr = sys_bin.Get_PPassemblage(-1);
251
+ std::map<std::string, cxxPPassemblageComp>::iterator it;
252
+ it = pp_assemblage_ptr->Get_pp_assemblage_comps().begin();
253
+ for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
254
+ {
255
+ int n;
256
+ class phase *p_ptr = phase_bsearch((it->first).c_str(), &n, FALSE);
257
+ const class elt_list *e_ptr;
258
+ LDBLE min = 1e10;
259
+ for (e_ptr = &p_ptr->next_elt[0]; e_ptr->elt != NULL; e_ptr++)
260
+ {
261
+ std::string e(e_ptr->elt->primary->elt->name);
262
+ cxxNameDouble::iterator st = sys_tots.find(e.c_str());
263
+ if (st != sys_tots.end())
264
+ {
265
+ LDBLE m1 = st->second / e_ptr->coef;
266
+ if (m1 < min) min = m1;
267
+ }
268
+ }
269
+ p_ptr->delta_max = min;
270
+ }
271
+ }
272
+ if (use.Get_ss_assemblage_in())
273
+ {
274
+ cxxSSassemblage *ss_assemblage_ptr = sys_bin.Get_SSassemblage(-1);
275
+ std::vector<cxxSS *> ss_ptrs = ss_assemblage_ptr->Vectorize();
276
+ for (size_t j = 0; j < ss_ptrs.size(); j++)
277
+ {
278
+ cxxSS * ss_ptr = ss_ptrs[j];
279
+ for (size_t k = 0; k < ss_ptr->Get_ss_comps().size(); k++)
280
+ {
281
+ cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
282
+ int n;
283
+ class phase *p_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &n, FALSE);
284
+
285
+ const class elt_list *e_ptr;
286
+ LDBLE min = 1e10;
287
+ for (e_ptr = &p_ptr->next_elt[0]; e_ptr->elt != NULL; e_ptr++)
288
+ {
289
+ std::string e(e_ptr->elt->primary->elt->name);
290
+ cxxNameDouble::iterator st = sys_tots.find(e.c_str());
291
+ if (st != sys_tots.end())
292
+ {
293
+ LDBLE m1 = st->second / e_ptr->coef;
294
+ if (m1 < min)
295
+ {
296
+ min = m1;
297
+ }
298
+ }
299
+ }
300
+ p_ptr->delta_max = min;
301
+ }
302
+ }
303
+ }
304
+ }
305
+
306
+ return (OK);
307
+ }
308
+
309
+ /* ---------------------------------------------------------------------- */
310
+ int Phreeqc::
311
+ xsolution_zero(void)
312
+ /* ---------------------------------------------------------------------- */
313
+ {
314
+ /*
315
+ * Zero out _x variables, master->totals, and species->la
316
+ */
317
+ int i;
318
+ /*
319
+ * Zero totals in master structures
320
+ */
321
+ new_x = FALSE;
322
+
323
+ tc_x = 0.0;
324
+ patm_x = 0;
325
+ potV_x = 0;
326
+ ph_x = 0.0;
327
+ solution_pe_x = 0.0;
328
+ mu_x = 0.0;
329
+ ah2o_x = 0.0;
330
+ viscos = 0.0;
331
+ viscos_0 = 0.0;
332
+ density_x = 0.0;
333
+ total_h_x = 0.0;
334
+ total_o_x = 0.0;
335
+ cb_x = 0.0;
336
+ mass_water_aq_x = 0.0;
337
+ units_x = moles_per_kilogram_string;
338
+
339
+ for (i = 0; i < (int)master.size(); i++)
340
+ {
341
+ master[i]->total = 0.0;
342
+ master[i]->total_primary = 0.0;
343
+ master[i]->s->la = 0.0;
344
+ }
345
+ if (pitzer_model == TRUE || sit_model == TRUE)
346
+ {
347
+ for (i = 0; i < (int)s.size(); i++)
348
+ {
349
+ s[i]->lg = 0.0;
350
+ }
351
+ }
352
+ /*
353
+ * Copy pe data (not sure this will be used
354
+ */
355
+ /*
356
+ pe_data_free (pe_x);
357
+ pe_x = pe_data_alloc();
358
+ */
359
+ return (OK);
360
+ }
361
+ /* ---------------------------------------------------------------------- */
362
+ int Phreeqc::
363
+ add_solution(cxxSolution *solution_ptr, LDBLE extensive, LDBLE intensive)
364
+ /* ---------------------------------------------------------------------- */
365
+ {
366
+ /*
367
+ * Accumulate solution data in master->totals and _x variables.
368
+ *
369
+ * extensive is multiplication factor for solution
370
+ * intensive is fraction of all multiplication factors for all solutions
371
+ */
372
+ class master *master_ptr;
373
+ class species *species_ptr;
374
+ /*
375
+ * Add solution to global variables
376
+ */
377
+ tc_x += solution_ptr->Get_tc() * intensive;
378
+ ph_x += solution_ptr->Get_ph() * intensive;
379
+ patm_x += solution_ptr->Get_patm() * intensive;
380
+ //potV_x += solution_ptr->Get_potV() * intensive;
381
+ solution_pe_x += solution_ptr->Get_pe() * intensive;
382
+ mu_x += solution_ptr->Get_mu() * intensive;
383
+ ah2o_x += solution_ptr->Get_ah2o() * intensive;
384
+ viscos += solution_ptr->Get_viscosity() * intensive;
385
+ viscos_0 += solution_ptr->Get_viscos_0() * intensive;
386
+ density_x += solution_ptr->Get_density() * intensive;
387
+
388
+ total_h_x += solution_ptr->Get_total_h() * extensive;
389
+ total_o_x += solution_ptr->Get_total_o() * extensive;
390
+ cb_x += solution_ptr->Get_cb() * extensive;
391
+ mass_water_aq_x += solution_ptr->Get_mass_water() * extensive;
392
+ /*
393
+ * Copy totals data into primary master species
394
+ */
395
+ cxxNameDouble::iterator jit = solution_ptr->Get_totals().begin();
396
+ for ( ; jit != solution_ptr->Get_totals().end(); jit++)
397
+ {
398
+ master_ptr = master_bsearch_primary(jit->first.c_str());
399
+ if (master_ptr != NULL)
400
+ {
401
+ master_ptr->total += jit->second * extensive;
402
+ }
403
+ else
404
+ {
405
+ input_error++;
406
+ error_msg(sformatf("Undefined element in solution, %s\n", jit->first.c_str()), CONTINUE);
407
+ }
408
+ }
409
+ /*
410
+ * Accumulate initial guesses for activities
411
+ */
412
+ jit = solution_ptr->Get_master_activity().begin();
413
+ for ( ; jit != solution_ptr->Get_master_activity().end(); jit++)
414
+ {
415
+ {
416
+ master_ptr = master_bsearch(jit->first.c_str());
417
+ if (master_ptr != NULL)
418
+ {
419
+ master_ptr->s->la += jit->second * intensive;
420
+ }
421
+ }
422
+ }
423
+ /*
424
+ * Accumulate initial guesses for log gamma
425
+ */
426
+ if (pitzer_model == TRUE || sit_model == TRUE)
427
+ {
428
+ jit = solution_ptr->Get_species_gamma().begin();
429
+ for ( ; jit != solution_ptr->Get_species_gamma().end(); jit++)
430
+ {
431
+ species_ptr = s_search(jit->first.c_str());
432
+ if (species_ptr != NULL)
433
+ {
434
+ species_ptr->lg += jit->second * intensive;
435
+ }
436
+ }
437
+ }
438
+ return (OK);
439
+ }
440
+ /* ---------------------------------------------------------------------- */
441
+ int Phreeqc::
442
+ add_exchange(cxxExchange *exchange_ptr)
443
+ /* ---------------------------------------------------------------------- */
444
+ {
445
+ /*
446
+ * Accumulate exchange data in master->totals and _x variables.
447
+ */
448
+ class master *master_ptr;
449
+
450
+ if (exchange_ptr == NULL)
451
+ return (OK);
452
+ /*
453
+ * Add element concentrations on exchanger to master species totals
454
+ */
455
+ for (size_t i = 0; i < exchange_ptr->Get_exchange_comps().size(); i++)
456
+ {
457
+ cxxExchComp comp_ref = exchange_ptr->Get_exchange_comps()[i];
458
+ cxxNameDouble nd(comp_ref.Get_totals());
459
+ cxxNameDouble::iterator it = nd.begin();
460
+ for ( ; it != nd.end(); it++)
461
+ {
462
+ class element *elt_ptr = element_store(it->first.c_str());
463
+ LDBLE coef = it->second;
464
+ assert(elt_ptr != NULL && elt_ptr->primary != NULL);
465
+ master_ptr = elt_ptr->primary;
466
+ if (master_ptr->s == s_hplus)
467
+ {
468
+ total_h_x += coef;
469
+ }
470
+ else if (master_ptr->s == s_h2o)
471
+ {
472
+ total_o_x += coef;
473
+ }
474
+ else
475
+ {
476
+ master_ptr->total += coef;
477
+ }
478
+ }
479
+ }
480
+ if (exchange_ptr->Get_new_def())
481
+ {
482
+ for (int i = 0; i < (int)master.size(); i++)
483
+ {
484
+ if (master[i]->type == EX && master[i]->total > 0)
485
+ {
486
+ master[i]->s->la = log10(0.1 * master[i]->total);
487
+ }
488
+ }
489
+ }
490
+ else
491
+ {
492
+ for (size_t i = 0; i < exchange_ptr->Get_exchange_comps().size(); i++)
493
+ {
494
+ cxxExchComp &comp_ref = exchange_ptr->Get_exchange_comps()[i];
495
+ cxxNameDouble nd(comp_ref.Get_totals());
496
+ cxxNameDouble::iterator it = nd.begin();
497
+ for ( ; it != nd.end(); it++)
498
+ {
499
+ class element *elt_ptr = element_store(it->first.c_str());
500
+ assert(elt_ptr->master);
501
+ if (elt_ptr->master->type == EX)
502
+ {
503
+ elt_ptr->master->s->la = comp_ref.Get_la();
504
+ }
505
+ }
506
+ cb_x += comp_ref.Get_charge_balance();
507
+ }
508
+ }
509
+ return (OK);
510
+ }
511
+ /* ---------------------------------------------------------------------- */
512
+ int Phreeqc::
513
+ add_surface(cxxSurface *surface_ptr)
514
+ /* ---------------------------------------------------------------------- */
515
+ {
516
+ /*
517
+ * Accumulate surface data in master->totals and _x variables.
518
+ */
519
+ if (surface_ptr == NULL)
520
+ return (OK);
521
+ /*
522
+ * Add element concentrations on surface to master species totals
523
+ */
524
+ dl_type_x = surface_ptr->Get_dl_type();
525
+ for (size_t i = 0; i < surface_ptr->Get_surface_comps().size(); i++)
526
+ {
527
+ cxxSurfaceComp *comp_ptr = &(surface_ptr->Get_surface_comps()[i]);
528
+ class element *elt_ptr = element_store(comp_ptr->Get_master_element().c_str());
529
+ if (elt_ptr->master == NULL)
530
+ {
531
+ error_msg(sformatf("Data not defined for master in SURFACE, %s\n", comp_ptr->Get_formula().c_str()), STOP);
532
+ }
533
+ class master *master_i_ptr = elt_ptr->master;
534
+
535
+ if (surface_ptr->Get_type() == cxxSurface::NO_EDL)
536
+ {
537
+ cb_x += comp_ptr->Get_charge_balance();
538
+ }
539
+ if (!surface_ptr->Get_new_def())
540
+ {
541
+ master_i_ptr->s->la = comp_ptr->Get_la();
542
+ }
543
+ /*
544
+ * Add surface and specifically sorbed elements
545
+ */
546
+ cxxNameDouble::iterator jit;
547
+ for (jit = comp_ptr->Get_totals().begin(); jit != comp_ptr->Get_totals().end(); jit++)
548
+ {
549
+ LDBLE coef = jit->second;
550
+ class element *elt_j_ptr = element_store(jit->first.c_str());
551
+ class master *master_j_ptr = elt_j_ptr->primary;
552
+ if (master_j_ptr == NULL)
553
+ {
554
+ input_error++;
555
+ error_string = sformatf( "Element not defined in database, %s.",
556
+ elt_j_ptr->name);
557
+ error_msg(error_string, STOP);
558
+ }
559
+ if (master_j_ptr->s == s_hplus)
560
+ {
561
+ total_h_x += coef;
562
+ }
563
+ else if (master_j_ptr->s == s_h2o)
564
+ {
565
+ total_o_x += coef;
566
+ }
567
+ else
568
+ {
569
+ master_j_ptr->total += coef;
570
+ }
571
+ }
572
+ }
573
+ if (surface_ptr->Get_type() != cxxSurface::DDL && surface_ptr->Get_type() != cxxSurface::CCM && surface_ptr->Get_type() != cxxSurface::CD_MUSIC)
574
+ return (OK);
575
+ for (size_t i = 0; i < surface_ptr->Get_surface_charges().size(); i++)
576
+ {
577
+ cxxSurfaceCharge *charge_ptr = &(surface_ptr->Get_surface_charges()[i]);
578
+ if (surface_ptr->Get_type() == cxxSurface::DDL || surface_ptr->Get_type() == cxxSurface::CCM || surface_ptr->Get_type() == cxxSurface::CD_MUSIC)
579
+ {
580
+ cb_x += charge_ptr->Get_charge_balance();
581
+ }
582
+ if (!surface_ptr->Get_new_def())
583
+ {
584
+ class master *master_ptr = surface_get_psi_master(charge_ptr->Get_name().c_str(), SURF_PSI);
585
+ master_ptr->s->la = charge_ptr->Get_la_psi();
586
+ }
587
+ /*
588
+ * Add diffuse layer elements (including water in Debye layer)
589
+ */
590
+ if (surface_ptr->Get_dl_type() != cxxSurface::NO_DL && !surface_ptr->Get_new_def())
591
+ {
592
+ cxxNameDouble::const_iterator jit;
593
+ for (jit = charge_ptr->Get_diffuse_layer_totals().begin(); jit != charge_ptr->Get_diffuse_layer_totals().end(); jit++)
594
+ {
595
+ LDBLE coef = jit->second;
596
+ class element *elt_j_ptr = element_store(jit->first.c_str());
597
+ class master * master_j_ptr = elt_j_ptr->master;
598
+ if (master_j_ptr->s == s_hplus)
599
+ {
600
+ total_h_x += coef;
601
+ }
602
+ else if (master_j_ptr->s == s_h2o)
603
+ {
604
+ total_o_x += coef;
605
+ }
606
+ else
607
+ {
608
+ master_j_ptr->total += coef;
609
+ }
610
+ }
611
+ }
612
+ }
613
+ return (OK);
614
+ }
615
+ /* ---------------------------------------------------------------------- */
616
+ int Phreeqc::
617
+ add_mix(cxxMix *mix_ptr)
618
+ /* ---------------------------------------------------------------------- */
619
+ {
620
+ /*
621
+ * calls add_solution to accumulate all data in master->totals
622
+ * and other variables.
623
+ */
624
+ LDBLE sum_fractions, intensive, extensive;
625
+ LDBLE sum_fractions_water=0, sum_positive_water=0, intensive_water=0, extensive_water=0;
626
+ cxxSolution *solution_ptr;
627
+ int count_positive;
628
+ LDBLE sum_positive;
629
+
630
+ if (mix_ptr == NULL)
631
+ return (OK);
632
+ if (mix_ptr->Get_mixComps().size() == 0)
633
+ return (OK);
634
+ sum_fractions = 0.0;
635
+ sum_positive = 0.0;
636
+ count_positive = 0;
637
+ std::map<int, LDBLE>::const_iterator it;
638
+ for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++)
639
+ {
640
+ solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
641
+ if (solution_ptr == NULL)
642
+ {
643
+ error_string = sformatf("Mix solution not found, %d.",
644
+ it->first);
645
+ error_msg(error_string, CONTINUE);
646
+ input_error++;
647
+ continue;
648
+ }
649
+ sum_fractions += it->second;
650
+ sum_fractions_water += it->second * solution_ptr->Get_mass_water();
651
+ if (it->second > 0)
652
+ {
653
+ sum_positive += it->second;
654
+ sum_positive_water += it->second * solution_ptr->Get_mass_water();
655
+ count_positive++;
656
+ }
657
+ }
658
+ for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++)
659
+ {
660
+ solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
661
+ if (solution_ptr == NULL)
662
+ {
663
+ error_string = sformatf( "Mix solution not found, %d.",
664
+ it->first);
665
+ error_msg(error_string, CONTINUE);
666
+ input_error++;
667
+ continue;
668
+ }
669
+ extensive = it->second;
670
+ extensive_water = it->second * solution_ptr->Get_mass_water();
671
+ intensive = extensive / sum_fractions;
672
+ intensive_water = extensive_water / sum_fractions_water;
673
+
674
+ if (count_positive < (int) mix_ptr->Get_mixComps().size())
675
+ {
676
+ if (it->second > 0)
677
+ {
678
+ intensive = extensive / sum_positive;
679
+ intensive_water = extensive_water / sum_positive_water;
680
+ }
681
+ else
682
+ {
683
+ intensive = 0;
684
+ }
685
+ }
686
+ add_solution(solution_ptr, extensive, intensive_water);
687
+ }
688
+ return (OK);
689
+ }
690
+ #ifdef SKIP_ERROR
691
+ /* ---------------------------------------------------------------------- */
692
+ int Phreeqc::
693
+ add_mix(cxxMix* mix_ptr)
694
+ /* ---------------------------------------------------------------------- */
695
+ {
696
+ /*
697
+ * calls add_solution to accumulate all data in master->totals
698
+ * and other variables.
699
+ */
700
+ LDBLE sum_fractions, intensive, extensive;
701
+ cxxSolution* solution_ptr;
702
+ int count_positive;
703
+ LDBLE sum_positive;
704
+
705
+ if (mix_ptr == NULL)
706
+ return (OK);
707
+ if (mix_ptr->Get_mixComps().size() == 0)
708
+ return (OK);
709
+ sum_fractions = 0.0;
710
+ sum_positive = 0.0;
711
+ count_positive = 0;
712
+ std::map<int, LDBLE>::const_iterator it;
713
+ for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++)
714
+ {
715
+ sum_fractions += it->second;
716
+ if (it->second > 0)
717
+ {
718
+ sum_positive += it->second;
719
+ count_positive++;
720
+ }
721
+ }
722
+ for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++)
723
+ {
724
+ solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
725
+ if (solution_ptr == NULL)
726
+ {
727
+ error_string = sformatf("Mix solution not found, %d.",
728
+ it->first);
729
+ error_msg(error_string, CONTINUE);
730
+ input_error++;
731
+ continue;
732
+ }
733
+ extensive = it->second;
734
+ intensive = extensive / sum_fractions;
735
+ if (count_positive < (int)mix_ptr->Get_mixComps().size())
736
+ {
737
+ if (it->second > 0)
738
+ {
739
+ intensive = extensive / sum_positive;
740
+ }
741
+ else
742
+ {
743
+ intensive = 0;
744
+ }
745
+ }
746
+ add_solution(solution_ptr, extensive, intensive);
747
+ }
748
+ return (OK);
749
+ }
750
+ #endif
751
+ /* ---------------------------------------------------------------------- */
752
+ int Phreeqc::
753
+ add_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
754
+ /* ---------------------------------------------------------------------- */
755
+ {
756
+ /*
757
+ * Add a small amount of each phase if necessary to insure
758
+ * all elements exist in solution.
759
+ */
760
+ int i;
761
+ LDBLE amount_to_add, total;
762
+ char token[MAX_LENGTH];
763
+ const char* cptr;
764
+ class master *master_ptr;
765
+
766
+ if (check_pp_assemblage(pp_assemblage_ptr) == OK)
767
+ return (OK);
768
+ /*
769
+ * Go through list and generate list of elements and
770
+ * coefficient of elements in reaction
771
+ */
772
+ count_elts = 0;
773
+ paren_count = 0;
774
+ /*
775
+ * Check that all elements are in solution for phases with greater than zero mass
776
+ */
777
+ std::map<std::string, cxxPPassemblageComp>::iterator it;
778
+ it = pp_assemblage_ptr->Get_pp_assemblage_comps().begin();
779
+ for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
780
+ {
781
+ cxxPPassemblageComp * comp_ptr = &(it->second);
782
+ if (comp_ptr->Get_precipitate_only()) continue;
783
+ int l;
784
+ class phase * phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
785
+ count_elts = 0;
786
+ paren_count = 0;
787
+ amount_to_add = 0.0;
788
+ comp_ptr->Set_delta(0.0);
789
+ if (comp_ptr->Get_add_formula().size() > 0)
790
+ {
791
+ Utilities::strcpy_safe(token, MAX_LENGTH, comp_ptr->Get_add_formula().c_str());
792
+ cptr = &(token[0]);
793
+ get_elts_in_species(&cptr, 1.0);
794
+ }
795
+ else
796
+ {
797
+ Utilities::strcpy_safe(token, MAX_LENGTH, phase_ptr->formula);
798
+ add_elt_list(phase_ptr->next_elt, 1.0);
799
+ }
800
+ if (comp_ptr->Get_moles() > 0.0)
801
+ {
802
+ for (i = 0; i < count_elts; i++)
803
+ {
804
+ master_ptr = elt_list[i].elt->primary;
805
+ if (master_ptr->s == s_hplus)
806
+ {
807
+ continue;
808
+ }
809
+ else if (master_ptr->s == s_h2o)
810
+ {
811
+ continue;
812
+ }
813
+ else if (master_ptr->total > MIN_TOTAL)
814
+ {
815
+ continue;
816
+ }
817
+ else
818
+ {
819
+ total = (-master_ptr->total + 1e-10) / elt_list[i].coef;
820
+ if (amount_to_add < total)
821
+ {
822
+ amount_to_add = total;
823
+ }
824
+ }
825
+ }
826
+ if (comp_ptr->Get_moles() < amount_to_add)
827
+ {
828
+ amount_to_add =comp_ptr->Get_moles();
829
+ }
830
+ }
831
+ if (amount_to_add > 0.0)
832
+ {
833
+ comp_ptr->Set_moles(comp_ptr->Get_moles() - amount_to_add);
834
+ comp_ptr->Set_delta(amount_to_add);
835
+ /*
836
+ * Add reaction to totals
837
+ */
838
+ for (i = 0; i < count_elts; i++)
839
+ {
840
+ master_ptr = elt_list[i].elt->primary;
841
+ if (master_ptr->s == s_hplus)
842
+ {
843
+ total_h_x += elt_list[i].coef * amount_to_add;
844
+ }
845
+ else if (master_ptr->s == s_h2o)
846
+ {
847
+ total_o_x += elt_list[i].coef * amount_to_add;
848
+ }
849
+ else
850
+ {
851
+ master_ptr->total += elt_list[i].coef * amount_to_add;
852
+ }
853
+ }
854
+ }
855
+ }
856
+ return (OK);
857
+ }
858
+ /* ---------------------------------------------------------------------- */
859
+ int Phreeqc::
860
+ check_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
861
+ /* ---------------------------------------------------------------------- */
862
+ {
863
+ /*
864
+ * Check list of all elements in pure_phase assemblage to see
865
+ * if all are in model. Return true if all are present,
866
+ * Return false if one or more is missing.
867
+ */
868
+ class master *master_ptr;
869
+
870
+ cxxNameDouble nd = pp_assemblage_ptr->Get_eltList();
871
+ cxxNameDouble::iterator it;
872
+ for (it = nd.begin(); it != nd.end(); it++)
873
+ {
874
+ class element *elt_ptr = element_store(it->first.c_str());
875
+ if (elt_ptr == NULL || elt_ptr->primary == NULL)
876
+ {
877
+ return FALSE;
878
+ }
879
+
880
+ master_ptr = elt_ptr->primary;
881
+ if (master_ptr->s == s_h2o || master_ptr->s == s_hplus)
882
+ continue;
883
+ if (master_ptr->total > MIN_TOTAL)
884
+ continue;
885
+ return (FALSE);
886
+ }
887
+ return (TRUE);
888
+ }
889
+ /* ---------------------------------------------------------------------- */
890
+ int Phreeqc::
891
+ add_reaction(cxxReaction *reaction_ptr, int step_number, LDBLE step_fraction)
892
+ /* ---------------------------------------------------------------------- */
893
+ {
894
+ /*
895
+ * Add irreversible reaction
896
+ */
897
+ char c;
898
+ class master *master_ptr;
899
+ /*
900
+ * Calculate and save reaction
901
+ */
902
+ /* !!!!! with kinetics reaction, coeff's may change
903
+ * and reaction_calc must be called ....
904
+ */
905
+ if (reaction_ptr == NULL)
906
+ return OK;
907
+
908
+ reaction_calc(reaction_ptr);
909
+
910
+ /*
911
+ * Step size
912
+ */
913
+ if (incremental_reactions == FALSE)
914
+ {
915
+ if (!reaction_ptr->Get_equalIncrements() && reaction_ptr->Get_steps().size()> 0 )
916
+ {
917
+ if (step_number > (int) reaction_ptr->Get_steps().size())
918
+ {
919
+ step_x = reaction_ptr->Get_steps()[reaction_ptr->Get_steps().size() - 1];
920
+ }
921
+ else
922
+ {
923
+ step_x = reaction_ptr->Get_steps()[(size_t)step_number - 1];
924
+ }
925
+ }
926
+ else if (reaction_ptr->Get_equalIncrements() && reaction_ptr->Get_steps().size()> 0)
927
+ {
928
+ if (step_number > (int) reaction_ptr->Get_reaction_steps())
929
+ {
930
+ step_x = reaction_ptr->Get_steps()[0];
931
+ }
932
+ else
933
+ {
934
+ step_x = reaction_ptr->Get_steps()[0] *
935
+ ((LDBLE) step_number) /
936
+ ((LDBLE) (reaction_ptr->Get_reaction_steps()));
937
+ }
938
+ }
939
+ else
940
+ {
941
+ step_x = 0.0;
942
+ }
943
+ }
944
+ else
945
+ {
946
+ /* Incremental reactions */
947
+ if (!reaction_ptr->Get_equalIncrements() && reaction_ptr->Get_steps().size()> 0)
948
+ {
949
+ if (step_number > (int) reaction_ptr->Get_reaction_steps())
950
+ {
951
+ step_x = reaction_ptr->Get_steps()[(size_t)reaction_ptr->Get_reaction_steps() - 1];
952
+ }
953
+ else
954
+ {
955
+ step_x = reaction_ptr->Get_steps()[(size_t)step_number - 1];
956
+ }
957
+ }
958
+ else if (reaction_ptr->Get_equalIncrements() && reaction_ptr->Get_steps().size()> 0)
959
+ {
960
+ if (step_number > (int) reaction_ptr->Get_reaction_steps())
961
+ {
962
+ step_x = 0;
963
+ }
964
+ else
965
+ {
966
+ step_x = reaction_ptr->Get_steps()[0] / ((LDBLE) (reaction_ptr->Get_reaction_steps()));
967
+ }
968
+ }
969
+ else
970
+ {
971
+ step_x = 0.0;
972
+ }
973
+ }
974
+ /*
975
+ * Convert units
976
+ */
977
+ c = reaction_ptr->Get_units().c_str()[0];
978
+ if (c == 'm')
979
+ {
980
+ step_x *= 1e-3;
981
+ }
982
+ else if (c == 'u')
983
+ {
984
+ step_x *= 1e-6;
985
+ }
986
+ else if (c == 'n')
987
+ {
988
+ step_x *= 1e-9;
989
+ }
990
+ /*
991
+ * Add reaction to totals
992
+ */
993
+ cxxNameDouble::const_iterator it = reaction_ptr->Get_elementList().begin();
994
+ for ( ; it != reaction_ptr->Get_elementList().end(); it++)
995
+ {
996
+ class element * elt_ptr = element_store(it->first.c_str());
997
+ LDBLE coef = it->second;
998
+ if (elt_ptr == NULL)
999
+ {
1000
+ assert (false);
1001
+ }
1002
+ else
1003
+ {
1004
+ master_ptr = elt_ptr->primary;
1005
+ if (master_ptr == NULL)
1006
+ {
1007
+ // error msg has been called in reaction_calc
1008
+ continue;
1009
+ }
1010
+ if (master_ptr->s == s_hplus)
1011
+ {
1012
+ total_h_x += coef * step_x * step_fraction;
1013
+ }
1014
+ else if (master_ptr->s == s_h2o)
1015
+ {
1016
+ total_o_x += coef * step_x * step_fraction;
1017
+ }
1018
+ else
1019
+ {
1020
+ master_ptr->total += coef * step_x * step_fraction;
1021
+ }
1022
+ }
1023
+ }
1024
+ return (OK);
1025
+ }
1026
+ /* ---------------------------------------------------------------------- */
1027
+ int Phreeqc::
1028
+ reaction_calc(cxxReaction *reaction_ptr)
1029
+ /* ---------------------------------------------------------------------- */
1030
+ {
1031
+ /*
1032
+ * Go through irreversible reaction initially to
1033
+ * determine a list of elements and amounts in
1034
+ * the reaction.
1035
+ */
1036
+ int return_value;
1037
+ LDBLE coef;
1038
+ const char* cptr;
1039
+ class phase *phase_ptr;
1040
+ /*
1041
+ * Go through list and generate list of elements and
1042
+ * coefficient of elements in reaction
1043
+ */
1044
+ return_value = OK;
1045
+ count_elts = 0;
1046
+ paren_count = 0;
1047
+
1048
+ cxxNameDouble nd(reaction_ptr->Get_reactantList());
1049
+ cxxNameDouble::iterator it;
1050
+ for (it = nd.begin(); it != nd.end(); it++)
1051
+ {
1052
+ coef = it->second;
1053
+ int j;
1054
+ phase_ptr = phase_bsearch(it->first.c_str(), &j, FALSE);
1055
+ /*
1056
+ * Reactant is a pure phase, copy formula into token
1057
+ */
1058
+ if (phase_ptr != NULL)
1059
+ {
1060
+ add_elt_list(phase_ptr->next_elt, coef);
1061
+ }
1062
+ else
1063
+ {
1064
+ cptr = it->first.c_str();
1065
+ get_elts_in_species(&cptr, coef);
1066
+ }
1067
+ }
1068
+ /*
1069
+ * Check that all elements are in database
1070
+ */
1071
+ for (int i = 0; i < count_elts; i++)
1072
+ {
1073
+ if (elt_list[i].elt->master == NULL)
1074
+ {
1075
+ error_string = sformatf(
1076
+ "Element or phase not defined in database, %s.",
1077
+ elt_list[i].elt->name);
1078
+ error_msg(error_string, CONTINUE);
1079
+ input_error++;
1080
+ return_value = ERROR;
1081
+ }
1082
+ }
1083
+ reaction_ptr->Set_elementList(elt_list_NameDouble());
1084
+
1085
+ return (return_value);
1086
+ }
1087
+ /* ---------------------------------------------------------------------- */
1088
+ int Phreeqc::
1089
+ add_gas_phase(cxxGasPhase *gas_phase_ptr)
1090
+ /* ---------------------------------------------------------------------- */
1091
+ {
1092
+ /*
1093
+ * Accumulate gas data in master->totals and _x variables.
1094
+ */
1095
+ int i;
1096
+ class master *master_ptr;
1097
+
1098
+ if (gas_phase_ptr == NULL)
1099
+ return (OK);
1100
+ /*
1101
+ * calculate reaction
1102
+ */
1103
+ count_elts = 0;
1104
+ paren_count = 0;
1105
+ for (size_t i = 0; i < gas_phase_ptr->Get_gas_comps().size(); i++)
1106
+ {
1107
+ cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
1108
+ int k;
1109
+ class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
1110
+ if (phase_ptr == NULL)
1111
+ {
1112
+ input_error++;
1113
+ error_msg(sformatf("PHASE not found in database, %s\n", gc_ptr->Get_phase_name().c_str()), CONTINUE);
1114
+ }
1115
+ //assert(phase_ptr);
1116
+ else
1117
+ {
1118
+ add_elt_list(phase_ptr->next_elt, gc_ptr->Get_moles());
1119
+ }
1120
+ }
1121
+ /*
1122
+ * Sort elements in reaction and combine
1123
+ */
1124
+ elt_list_combine();
1125
+ /*
1126
+ * Add gas elements to totals
1127
+ */
1128
+ for (i = 0; i < count_elts; i++)
1129
+ {
1130
+ master_ptr = elt_list[i].elt->primary;
1131
+ if (master_ptr->s == s_hplus)
1132
+ {
1133
+ total_h_x += elt_list[i].coef;
1134
+ }
1135
+ else if (master_ptr->s == s_h2o)
1136
+ {
1137
+ total_o_x += elt_list[i].coef;
1138
+ }
1139
+ else
1140
+ {
1141
+ master_ptr->total += elt_list[i].coef;
1142
+ }
1143
+ }
1144
+ if (gas_phase_ptr->Get_type() == cxxGasPhase::GP_PRESSURE && fabs(gas_phase_ptr->Get_total_p() - patm_x) > 0.01)
1145
+ {
1146
+ patm_x = gas_phase_ptr->Get_total_p();
1147
+ k_temp(tc_x, patm_x);
1148
+ }
1149
+ return (OK);
1150
+ }
1151
+ /* ---------------------------------------------------------------------- */
1152
+ int Phreeqc::
1153
+ add_ss_assemblage(cxxSSassemblage *ss_assemblage_ptr)
1154
+ /* ---------------------------------------------------------------------- */
1155
+ {
1156
+ /*
1157
+ * Accumulate solid_solution data in master->totals and _x variables.
1158
+ */
1159
+ int i, j, k;
1160
+ LDBLE amount_to_add, total;
1161
+ class master *master_ptr;
1162
+ const char* cptr;
1163
+
1164
+ if (ss_assemblage_ptr == NULL)
1165
+ return (OK);
1166
+ count_elts = 0;
1167
+ paren_count = 0;
1168
+ /*
1169
+ * Check that all elements are in solution for phases with greater than zero mass
1170
+ */
1171
+ std::vector<cxxSS *> ss_ptrs = ss_assemblage_ptr->Vectorize();
1172
+ for (i = 0; i < (int) ss_ptrs.size(); i++)
1173
+ {
1174
+ cxxSS * ss_ptr = ss_ptrs[i];
1175
+ count_elts = 0;
1176
+ paren_count = 0;
1177
+ for (j = 0; j < (int) ss_ptr->Get_ss_comps().size(); j++)
1178
+ {
1179
+ cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[j]);
1180
+ int l;
1181
+ class phase * phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
1182
+
1183
+ amount_to_add = 0.0;
1184
+ comp_ptr->Set_delta(0.0);
1185
+ if (comp_ptr->Get_moles() > 0.0)
1186
+ {
1187
+ cptr = phase_ptr->formula;
1188
+ count_elts = 0; // appt
1189
+ get_elts_in_species(&cptr, 1.0);
1190
+ for (k = 0; k < count_elts; k++)
1191
+ {
1192
+ master_ptr = elt_list[k].elt->primary;
1193
+ if (master_ptr->s == s_hplus)
1194
+ {
1195
+ continue;
1196
+ }
1197
+ else if (master_ptr->s == s_h2o)
1198
+ {
1199
+ continue;
1200
+ }
1201
+ else if (master_ptr->total > MIN_TOTAL_SS)
1202
+ {
1203
+ continue;
1204
+ }
1205
+ else
1206
+ {
1207
+ total =
1208
+ (-master_ptr->total + 1e-10) / elt_list[k].coef;
1209
+ if (amount_to_add < total)
1210
+ {
1211
+ amount_to_add = total;
1212
+ }
1213
+ }
1214
+ }
1215
+ }
1216
+ if (comp_ptr->Get_moles() < amount_to_add)
1217
+ {
1218
+ amount_to_add = comp_ptr->Get_moles();
1219
+ }
1220
+ if (amount_to_add > 0.0)
1221
+ {
1222
+ comp_ptr->Set_moles(comp_ptr->Get_moles() - amount_to_add);
1223
+ comp_ptr->Set_delta(amount_to_add);
1224
+ /*
1225
+ * Add reaction to totals
1226
+ */
1227
+ for (k = 0; k < count_elts; k++)
1228
+ {
1229
+ master_ptr = elt_list[k].elt->primary;
1230
+ if (master_ptr->s == s_hplus)
1231
+ {
1232
+ total_h_x += elt_list[k].coef * amount_to_add;
1233
+ }
1234
+ else if (master_ptr->s == s_h2o)
1235
+ {
1236
+ total_o_x += elt_list[k].coef * amount_to_add;
1237
+ }
1238
+ else
1239
+ {
1240
+ master_ptr->total += elt_list[k].coef * amount_to_add;
1241
+ }
1242
+ }
1243
+ }
1244
+ }
1245
+ }
1246
+ return (OK);
1247
+ }
1248
+ /* ---------------------------------------------------------------------- */
1249
+ int Phreeqc::
1250
+ add_kinetics(cxxKinetics *kinetics_ptr)
1251
+ /* ---------------------------------------------------------------------- */
1252
+ {
1253
+ /*
1254
+ * Add kinetic reaction
1255
+ */
1256
+ class master *master_ptr = NULL;
1257
+ /*
1258
+ * Add reaction to totals
1259
+ */
1260
+ if (kinetics_ptr->Get_totals().size() == 0)
1261
+ return (OK);
1262
+ cxxNameDouble::iterator it = kinetics_ptr->Get_totals().begin();
1263
+ for (; it != kinetics_ptr->Get_totals().end(); it++)
1264
+ {
1265
+ LDBLE coef = it->second;
1266
+ class element *elt_ptr = element_store(it->first.c_str());
1267
+ if (elt_ptr == NULL || (master_ptr = elt_ptr->primary) == NULL)
1268
+ {
1269
+ input_error++;
1270
+ error_string = sformatf(
1271
+ "Element %s in kinetic reaction not found in database.",
1272
+ it->first.c_str());
1273
+ error_msg(error_string, STOP);
1274
+ }
1275
+ else
1276
+ {
1277
+ if (master_ptr->s == s_hplus)
1278
+ {
1279
+ total_h_x += coef;
1280
+ }
1281
+ else if (master_ptr->s == s_h2o)
1282
+ {
1283
+ total_o_x += coef;
1284
+ }
1285
+ else
1286
+ {
1287
+ master_ptr->total += coef;
1288
+ }
1289
+ }
1290
+ }
1291
+ return (OK);
1292
+ }
1293
+ /* ---------------------------------------------------------------------- */
1294
+ int Phreeqc::
1295
+ gas_phase_check(cxxGasPhase *gas_phase_ptr)
1296
+ /* ---------------------------------------------------------------------- */
1297
+ {
1298
+ /*
1299
+ * Check for missing elements
1300
+ */
1301
+ class master *master_ptr;
1302
+
1303
+ if (gas_phase_ptr == NULL)
1304
+ return (OK);
1305
+ // set gas pressure to reaction_pressure...
1306
+ if (use.Get_pressure_ptr() != NULL && gas_phase_ptr->Get_type() == cxxGasPhase::GP_PRESSURE)
1307
+ {
1308
+ gas_phase_ptr->Set_total_p(patm_x);
1309
+ k_temp(tc_x, patm_x);
1310
+ }
1311
+
1312
+ /*
1313
+ * Check that all elements are in solution for phases with zero mass
1314
+ */
1315
+ for (size_t i = 0; i < gas_phase_ptr->Get_gas_comps().size(); i++)
1316
+ {
1317
+ cxxGasComp *gc_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
1318
+ int k;
1319
+ class phase *phase_ptr = phase_bsearch(gc_ptr->Get_phase_name().c_str() , &k, FALSE);
1320
+ count_elts = 0;
1321
+ paren_count = 0;
1322
+ if (gc_ptr->Get_moles() <= 0.0)
1323
+ {
1324
+ add_elt_list(phase_ptr->next_elt, 1.0);
1325
+ for (int j = 0; j < count_elts; j++)
1326
+ {
1327
+ master_ptr = elt_list[j].elt->primary;
1328
+ if (master_ptr->s == s_hplus)
1329
+ {
1330
+ continue;
1331
+ }
1332
+ else if (master_ptr->s == s_h2o)
1333
+ {
1334
+ continue;
1335
+ }
1336
+ else if (master_ptr->total > MIN_TOTAL)
1337
+ {
1338
+ continue;
1339
+ }
1340
+ else
1341
+ {
1342
+ if (state != ADVECTION && state != TRANSPORT
1343
+ && state != PHAST)
1344
+ {
1345
+ error_string = sformatf(
1346
+ "Element %s is contained in gas %s (which has 0.0 mass),\nbut is not in solution or other phases.",
1347
+ elt_list[j].elt->name,
1348
+ phase_ptr->name);
1349
+ warning_msg(error_string);
1350
+ }
1351
+ }
1352
+ }
1353
+ }
1354
+ }
1355
+ return (OK);
1356
+ }
1357
+ /* ---------------------------------------------------------------------- */
1358
+ int Phreeqc::
1359
+ pp_assemblage_check(cxxPPassemblage *pp_assemblage_ptr)
1360
+ /* ---------------------------------------------------------------------- */
1361
+ {
1362
+ /*
1363
+ * Check for missing elements
1364
+ */
1365
+ std::string token;
1366
+ const char* cptr;
1367
+ class master *master_ptr;
1368
+
1369
+ if (check_pp_assemblage(pp_assemblage_ptr) == OK)
1370
+ return (OK);
1371
+ /*
1372
+ * Check that all elements are in solution for phases with zero mass
1373
+ */
1374
+ std::map<std::string, cxxPPassemblageComp>::iterator it;
1375
+ it = pp_assemblage_ptr->Get_pp_assemblage_comps().begin();
1376
+ for ( ; it != pp_assemblage_ptr->Get_pp_assemblage_comps().end(); it++)
1377
+ {
1378
+ cxxPPassemblageComp * comp_ptr = &(it->second);
1379
+ int l;
1380
+ class phase * phase_ptr = phase_bsearch(it->first.c_str(), &l, FALSE);
1381
+ count_elts = 0;
1382
+ paren_count = 0;
1383
+ if (comp_ptr->Get_moles() <= 0.0)
1384
+ {
1385
+ comp_ptr->Set_delta(0.0);
1386
+ if (comp_ptr->Get_add_formula().size() > 0)
1387
+ {
1388
+ token = comp_ptr->Get_add_formula();
1389
+ cptr = &(token[0]);
1390
+ get_elts_in_species(&cptr, 1.0);
1391
+ }
1392
+ else
1393
+ {
1394
+ token = phase_ptr->formula;
1395
+ add_elt_list(phase_ptr->next_elt, 1.0);
1396
+ }
1397
+ for (int i = 0; i < count_elts; i++)
1398
+ {
1399
+ master_ptr = elt_list[i].elt->primary;
1400
+ if (master_ptr->s == s_hplus)
1401
+ {
1402
+ continue;
1403
+ }
1404
+ else if (master_ptr->s == s_h2o)
1405
+ {
1406
+ continue;
1407
+ }
1408
+ else if (master_ptr->total > MIN_TOTAL)
1409
+ {
1410
+ continue;
1411
+ }
1412
+ else
1413
+ {
1414
+ if (state != ADVECTION && state != TRANSPORT
1415
+ && state != PHAST)
1416
+ {
1417
+ error_string = sformatf(
1418
+ "Element %s is contained in %s (which has 0.0 mass),"
1419
+ "\t\nbut is not in solution or other phases.",
1420
+ elt_list[i].elt->name,
1421
+ phase_ptr->name);
1422
+ warning_msg(error_string);
1423
+ }
1424
+ /*
1425
+ * Make la's of all master species for the element small, so SI will be small
1426
+ * and no mass transfer will be calculated
1427
+ */
1428
+ for (int k = 0; k < (int)master.size(); k++)
1429
+ {
1430
+ if (master[k]->elt->primary == master_ptr)
1431
+ {
1432
+ master[k]->s->la = -9999.999;
1433
+ }
1434
+ }
1435
+ }
1436
+ }
1437
+ }
1438
+ }
1439
+ return (OK);
1440
+ }
1441
+ /* ---------------------------------------------------------------------- */
1442
+ int Phreeqc::
1443
+ ss_assemblage_check(cxxSSassemblage *ss_assemblage_ptr)
1444
+ /* ---------------------------------------------------------------------- */
1445
+ {
1446
+ /*
1447
+ * Check for missing elements
1448
+ */
1449
+ int j, k;
1450
+ class master *master_ptr;
1451
+
1452
+ if (ss_assemblage_ptr == NULL)
1453
+ return (OK);
1454
+ /*
1455
+ * Check that all elements are in solution for phases with zero mass
1456
+ */
1457
+ std::vector<cxxSS *> ss_ptrs = ss_assemblage_ptr->Vectorize();
1458
+ for (j = 0; j < (int) ss_ptrs.size(); j++)
1459
+ {
1460
+ cxxSS * ss_ptr = ss_ptrs[j];
1461
+ for (k = 0; k < (int) ss_ptr->Get_ss_comps().size(); k++)
1462
+ {
1463
+ cxxSScomp *comp_ptr = &(ss_ptr->Get_ss_comps()[k]);
1464
+ int l;
1465
+ class phase *phase_ptr = phase_bsearch(comp_ptr->Get_name().c_str(), &l, FALSE);
1466
+ count_elts = 0;
1467
+ paren_count = 0;
1468
+ if (comp_ptr->Get_moles() <= 0.0)
1469
+ {
1470
+ add_elt_list(phase_ptr->next_elt, 1.0);
1471
+ for (l = 0; l < count_elts; l++)
1472
+ {
1473
+ master_ptr = elt_list[l].elt->primary;
1474
+ if (master_ptr->s == s_hplus)
1475
+ {
1476
+ continue;
1477
+ }
1478
+ else if (master_ptr->s == s_h2o)
1479
+ {
1480
+ continue;
1481
+ }
1482
+ else if (master_ptr->total > MIN_TOTAL_SS)
1483
+ {
1484
+ continue;
1485
+ }
1486
+ else
1487
+ {
1488
+ if (state != ADVECTION && state != TRANSPORT
1489
+ && state != PHAST)
1490
+ {
1491
+ error_string = sformatf(
1492
+ "Element %s is contained in solid solution %s (which has 0.0 mass),\nbut is not in solution or other phases.",
1493
+ elt_list[l].elt->name,
1494
+ phase_ptr->name);
1495
+ warning_msg(error_string);
1496
+ }
1497
+ }
1498
+ /*
1499
+ * Make la's of all master species for the element small,
1500
+ * so SI will be small
1501
+ * and no mass transfer will be calculated
1502
+ */
1503
+ for (k = 0; k < (int)master.size(); k++)
1504
+ {
1505
+ if (master[k]->elt->primary == master_ptr)
1506
+ {
1507
+ master[k]->s->la = -9999.999;
1508
+ }
1509
+ }
1510
+ }
1511
+ }
1512
+ }
1513
+ }
1514
+ return (OK);
1515
+ }
1516
+ /* ---------------------------------------------------------------------- */
1517
+ int Phreeqc::
1518
+ solution_check(void)
1519
+ /* ---------------------------------------------------------------------- */
1520
+ {
1521
+ /*
1522
+ * Check for missing elements
1523
+ */
1524
+ int i;
1525
+ class master *master_ptr;
1526
+
1527
+ /*
1528
+ * Check that all elements are in solution for phases with zero mass
1529
+ */
1530
+ for (i = 0; i < (int)master.size(); i++)
1531
+ {
1532
+ master_ptr = master[i];
1533
+ if (master_ptr->total <= MIN_TOTAL && master_ptr->total >= -MIN_TOTAL)
1534
+ {
1535
+ master_ptr->total = 0;
1536
+ continue;
1537
+ }
1538
+ if (master_ptr->total >= 0.0)
1539
+ continue;
1540
+ //if (master_ptr->total > -MIN_TOTAL)
1541
+ //{
1542
+ // master_ptr->total = 0;
1543
+ // continue;
1544
+ //}
1545
+ if (master_ptr->s == s_eminus || master_ptr->s == s_h2o
1546
+ || master_ptr->s == s_hplus || master_ptr->s == s_h3oplus)
1547
+ {
1548
+ master_ptr->total = 0;
1549
+ continue;
1550
+ }
1551
+ /*
1552
+ sprintf (error_string,
1553
+ "Element %s has negative moles in solution, %e. \n\tErroneous mole balance occurs as moles are added to produce zero moles.\n\tUsually caused by KINETICS, REACTION, or diffuse layer calculation.\n\tMay be due to large time steps in early part of KINETICS simulation or negative concentrations in the diffuse layer.",
1554
+ master_ptr->elt->name, (LDBLE) master_ptr->total);
1555
+ */
1556
+ if (state != TRANSPORT)
1557
+ {
1558
+ error_string = sformatf(
1559
+ "Negative moles in solution %d for %s, %e. Recovering...",
1560
+ cell_no, master_ptr->elt->name, (double)master_ptr->total);
1561
+ warning_msg(error_string);
1562
+ }
1563
+ return (MASS_BALANCE);
1564
+ }
1565
+ return (OK);
1566
+ }