pyEQL 1.4.0rc9__cp313-cp313-macosx_11_0_arm64.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-313-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,1684 @@
1
+ #include "Phreeqc.h"
2
+ #include "phqalloc.h"
3
+ #include "Exchange.h"
4
+ #include "Solution.h"
5
+
6
+ #if defined(PHREEQCI_GUI)
7
+ #ifdef _DEBUG
8
+ #define new DEBUG_NEW
9
+ #undef THIS_FILE
10
+ static char THIS_FILE[] = __FILE__;
11
+ #endif
12
+ #endif
13
+
14
+ /* ---------------------------------------------------------------------- */
15
+ int Phreeqc::
16
+ sit_init(void)
17
+ /* ---------------------------------------------------------------------- */
18
+ {
19
+ /*
20
+ * Initialization for SIT
21
+ */
22
+ sit_model = FALSE;
23
+ sit_params.clear();
24
+ OTEMP = -100.;
25
+ OPRESS = -100.;
26
+ return OK;
27
+ }
28
+
29
+ /* ---------------------------------------------------------------------- */
30
+ int Phreeqc::
31
+ sit_tidy(void)
32
+ /* ---------------------------------------------------------------------- */
33
+ {
34
+ /*
35
+ * Make lists of species for cations, anions, neutral
36
+ */
37
+ int i, j;
38
+ /*
39
+ * Ensure new parameters are calculated
40
+ */
41
+ OTEMP = -100.;
42
+ OPRESS = -100.;
43
+ /*
44
+ * allocate pointers to species structures
45
+ */
46
+ spec.clear();
47
+ spec.resize(3 * s.size(), NULL);
48
+
49
+ cations = &spec[0];
50
+ neutrals = &(spec[s.size()]);
51
+ anions = &(spec[2 * s.size()]);
52
+ sit_MAXCATIONS = (int)s.size();
53
+ sit_FIRSTANION = 2 * (int)s.size();
54
+ sit_MAXNEUTRAL = (int)s.size();
55
+ sit_count_cations = 0;
56
+ sit_count_anions = 0;
57
+ sit_count_neutrals = 0;
58
+ if (itmax < 200) itmax = 200;
59
+ /*
60
+ * allocate other arrays for SIT
61
+ */
62
+ sit_IPRSNT.resize(3 * s.size());
63
+ sit_M.resize(3 * s.size());
64
+ sit_LGAMMA.resize(3 * s.size());
65
+
66
+ for (i = 0; i < (int)s.size(); i++)
67
+ {
68
+ if (s[i] == s_eminus)
69
+ continue;
70
+ if (s[i] == s_h2o)
71
+ continue;
72
+ if (s[i]->type == EX || s[i]->type == SURF)
73
+ continue;
74
+ if (s[i]->z < -.001)
75
+ {
76
+ anions[sit_count_anions++] = s[i];
77
+ }
78
+ else if (s[i]->z > .001)
79
+ {
80
+ cations[sit_count_cations++] = s[i];
81
+ }
82
+ else
83
+ {
84
+ neutrals[sit_count_neutrals++] = s[i];
85
+ }
86
+ }
87
+ /*
88
+ * no ethetas
89
+ */
90
+ /*
91
+ * put species numbers in sit_params
92
+ */
93
+ for (i = 0; i < (int)sit_params.size(); i++)
94
+ {
95
+ for (j = 0; j < 3; j++)
96
+ {
97
+ if (sit_params[i]->species[j] == NULL)
98
+ continue;
99
+ sit_params[i]->ispec[j] = sit_ISPEC(sit_params[i]->species[j]);
100
+ if ((j < 2 && sit_params[i]->ispec[j] == -1) ||
101
+ (j == 3
102
+ && (sit_params[i]->type == TYPE_PSI
103
+ || sit_params[i]->type == TYPE_ZETA)
104
+ && sit_params[i]->ispec[j] == -1))
105
+ {
106
+ input_error++;
107
+ error_string = sformatf(
108
+ "Species for Pitzer parameter not defined in SOLUTION_SPECIES, %s",
109
+ sit_params[i]->species[j]);
110
+ error_msg(error_string, CONTINUE);
111
+ }
112
+ }
113
+ } /* remake map */
114
+ {
115
+ sit_param_map.clear();
116
+ for (int j = 0; j < (int)sit_params.size(); j++)
117
+ {
118
+ std::set< std::string > header;
119
+ for (int i = 0; i < 3; i++)
120
+ {
121
+ if (sit_params[j]->species[i] != NULL) header.insert(sit_params[j]->species[i]);
122
+ }
123
+ std::ostringstream key_str;
124
+ key_str << sit_params[j]->type << " ";
125
+ std::set< std::string >::iterator it = header.begin();
126
+ for(; it != header.end(); ++it)
127
+ {
128
+ key_str << *it << " ";
129
+ }
130
+ std::string key = key_str.str().c_str();
131
+ sit_param_map[key] = j;
132
+ }
133
+ assert ((int) sit_param_map.size() == (int)sit_params.size());
134
+ }
135
+ if (get_input_errors() > 0) return (ERROR);
136
+ return OK;
137
+ }
138
+
139
+ /* ---------------------------------------------------------------------- */
140
+ int Phreeqc::
141
+ sit_ISPEC(const char *name)
142
+ /* ---------------------------------------------------------------------- */
143
+ /*
144
+ * Find species number in spec for character string species name
145
+ */
146
+ {
147
+ int i;
148
+ for (i = 0; i < 3 * (int)s.size(); i++)
149
+ {
150
+ if (spec[i] == NULL)
151
+ continue;
152
+ if (name == spec[i]->name)
153
+ {
154
+ return (i);
155
+ }
156
+ }
157
+ return (-1);
158
+ }
159
+
160
+ /* ---------------------------------------------------------------------- */
161
+ int Phreeqc::
162
+ read_sit(void)
163
+ /* ---------------------------------------------------------------------- */
164
+ {
165
+ /*
166
+ * Reads advection information
167
+ *
168
+ * Arguments:
169
+ * none
170
+ *
171
+ * Returns:
172
+ * KEYWORD if keyword encountered, input_error may be incremented if
173
+ * a keyword is encountered in an unexpected position
174
+ * EOF if eof encountered while reading mass balance concentrations
175
+ * ERROR if error occurred reading data
176
+ *
177
+ */
178
+ /*
179
+ * Read advection parameters:
180
+ * number of cells;
181
+ * number of shifts;
182
+ */
183
+ int n;
184
+ class pitz_param *pzp_ptr;
185
+ pitz_param_type pzp_type;
186
+
187
+ int return_value, opt, opt_save;
188
+ const char* next_char;
189
+ const char *opt_list[] = {
190
+ "epsilon", /* 0 */
191
+ "epsilon1" /* 1 */
192
+ };
193
+ int count_opt_list = 2;
194
+ /*
195
+ * Read lines
196
+ */
197
+ opt_save = OPTION_ERROR;
198
+ return_value = UNKNOWN;
199
+ n = -1;
200
+ pzp_type = TYPE_Other;
201
+ pitzer_pe = TRUE;
202
+ for (;;)
203
+ {
204
+ opt = get_option(opt_list, count_opt_list, &next_char);
205
+ if (opt == OPTION_DEFAULT)
206
+ {
207
+ opt = opt_save;
208
+ }
209
+ switch (opt)
210
+ {
211
+ case OPTION_EOF: /* end of file */
212
+ return_value = EOF;
213
+ break;
214
+ case OPTION_KEYWORD: /* keyword */
215
+ return_value = KEYWORD;
216
+ break;
217
+ case OPTION_DEFAULT:
218
+ pzp_ptr = pitz_param_read(line, n);
219
+ if (pzp_ptr != NULL)
220
+ {
221
+ pzp_ptr->type = pzp_type;
222
+ sit_param_store(pzp_ptr);
223
+ }
224
+ break;
225
+ case OPTION_ERROR:
226
+ input_error++;
227
+ error_msg("Unknown input in SIT keyword.", CONTINUE);
228
+ error_msg(line_save, CONTINUE);
229
+ break;
230
+ case 0: /* epsilon */
231
+ pzp_type = TYPE_SIT_EPSILON;
232
+ n = 2;
233
+ opt_save = OPTION_DEFAULT;
234
+ break;
235
+ case 1: /* epsilon1 */
236
+ pzp_type = TYPE_SIT_EPSILON_MU;
237
+ n = 2;
238
+ opt_save = OPTION_DEFAULT;
239
+ break;
240
+ }
241
+ if (return_value == EOF || return_value == KEYWORD)
242
+ break;
243
+ }
244
+ sit_model = TRUE;
245
+ return (return_value);
246
+ }
247
+
248
+ /* ---------------------------------------------------------------------- */
249
+ int Phreeqc::
250
+ calc_sit_param(class pitz_param *pz_ptr, LDBLE TK, LDBLE TR)
251
+ /* ---------------------------------------------------------------------- */
252
+ {
253
+ LDBLE param;
254
+ /*
255
+ */
256
+
257
+ if (fabs(TK - TR) < 0.01)
258
+ {
259
+ param = pz_ptr->a[0];
260
+ }
261
+ else
262
+ {
263
+ param = (pz_ptr->a[0] +
264
+ pz_ptr->a[1] * (1.e0 / TK - 1.e0 / TR) +
265
+ pz_ptr->a[2] * log(TK / TR) +
266
+ pz_ptr->a[3] * (TK - TR) +
267
+ pz_ptr->a[4] * (TK * TK - TR * TR));
268
+ }
269
+ pz_ptr->p = param;
270
+ switch (pz_ptr->type)
271
+ {
272
+ case TYPE_SIT_EPSILON:
273
+ pz_ptr->U.eps = param;
274
+ break;
275
+ case TYPE_SIT_EPSILON_MU:
276
+ pz_ptr->U.eps1 = param;
277
+ break;
278
+ case TYPE_Other:
279
+ default:
280
+ error_msg("Should not be TYPE_Other in function calc_sit_param",
281
+ STOP);
282
+ break;
283
+ }
284
+ return OK;
285
+ }
286
+ /* ---------------------------------------------------------------------- */
287
+ int Phreeqc::
288
+ sit(void)
289
+ /* ---------------------------------------------------------------------- */
290
+ {
291
+ int i, i0, i1;
292
+ LDBLE param, z0, z1;
293
+ LDBLE A, AGAMMA, T;
294
+ /*
295
+ LDBLE CONV, XI, XX, OSUM, BIGZ, DI, F, XXX, GAMCLM,
296
+ CSUM, PHIMAC, OSMOT, BMXP, ETHEAP, CMX, BMX, PHI,
297
+ BMXPHI, PHIPHI, AW, A, B;
298
+ */
299
+ /*
300
+ LDBLE CONV, XI, XX, OSUM, BIGZ, DI, F, XXX, GAMCLM, CSUM, PHIMAC, OSMOT,
301
+ B;
302
+ */
303
+ LDBLE XI, XX, OSUM, DI, F, OSMOT, B;
304
+ LDBLE I, TK;
305
+ /*
306
+ C
307
+ C INITIALIZE
308
+ C
309
+ */
310
+ //CONV = 1.0 / LOG_10;
311
+ XI = 0.0e0;
312
+ XX = 0.0e0;
313
+ OSUM = 0.0e0;
314
+ /*n
315
+ I = *I_X;
316
+ TK = *TK_X;
317
+ */
318
+ I = mu_x;
319
+ TK = tk_x;
320
+ /* DH_AB(TK, &A, &B); */
321
+ /*
322
+ C
323
+ C TRANSFER DATA FROM TO sit_M
324
+ C
325
+ */
326
+ double log_min = log10(MIN_TOTAL);
327
+ for (size_t j = 0; j < s_list.size(); j++)
328
+ {
329
+ i = s_list[j];
330
+ if (spec[i]->lm > log_min)
331
+ {
332
+ sit_M[i] = under(spec[i]->lm);
333
+ }
334
+ else
335
+ {
336
+ sit_M[i] = 0.0;
337
+ }
338
+ }
339
+ //for (i = 0; i < 3 * (int)s.size(); i++)
340
+ //{
341
+ // sit_IPRSNT[i] = FALSE;
342
+ // sit_M[i] = 0.0;
343
+ // if (spec[i] != NULL && spec[i]->in == TRUE)
344
+ // {
345
+ // if (spec[i]->type == EX ||
346
+ // spec[i]->type == SURF || spec[i]->type == SURF_PSI)
347
+ // continue;
348
+ // sit_M[i] = under(spec[i]->lm);
349
+ // if (sit_M[i] > MIN_TOTAL)
350
+ // sit_IPRSNT[i] = TRUE;
351
+ // }
352
+ //}
353
+ /*
354
+ C
355
+ C COMPUTE SIT COEFFICIENTS' TEMPERATURE DEPENDENCE
356
+ C
357
+ */
358
+ PTEMP_SIT(TK);
359
+ for (size_t j = 0; j < s_list.size(); j++)
360
+ {
361
+ int i = s_list[j];
362
+ sit_LGAMMA[i] = 0.0;
363
+ XX = XX + sit_M[i] * fabs(spec[i]->z);
364
+ XI = XI + sit_M[i] * spec[i]->z * spec[i]->z;
365
+ OSUM = OSUM + sit_M[i];
366
+ }
367
+ //for (i = 0; i < 2 * (int)s.size() + sit_count_anions; i++)
368
+ //{
369
+ // sit_LGAMMA[i] = 0.0;
370
+ // if (sit_IPRSNT[i] == TRUE)
371
+ // {
372
+ // XX = XX + sit_M[i] * fabs(spec[i]->z);
373
+ // XI = XI + sit_M[i] * spec[i]->z * spec[i]->z;
374
+ // OSUM = OSUM + sit_M[i];
375
+ // }
376
+ //}
377
+ I = XI / 2.0e0;
378
+ I = mu_x; // Added equation for MU
379
+ DI = sqrt(I);
380
+ /*
381
+ C
382
+ C CALCULATE F & GAMCLM
383
+ C
384
+ */
385
+ AGAMMA = 3*sit_A0; /* Grenthe p 379 */
386
+ A = AGAMMA / LOG_10;
387
+ /*
388
+ * F is now for log10 gamma
389
+ */
390
+
391
+ B = 1.5;
392
+ F = -A * (DI / (1.0e0 + B * DI));
393
+
394
+
395
+ /*OSMOT = -(sit_A0) * pow(I, 1.5e0) / (1.0e0 + B * DI);*/
396
+ T = 1.0 + B*DI;
397
+ OSMOT = -2.0*A/(B*B*B)*(T - 2.0*log(T) - 1.0/T);
398
+ /*
399
+ * Sums for sit_LGAMMA, and OSMOT
400
+ * epsilons are tabulated for log10 gamma (not ln gamma)
401
+ */
402
+ for (size_t j = 0; j < param_list.size(); j++)
403
+ {
404
+ int i = param_list[j];
405
+ i0 = sit_params[i]->ispec[0];
406
+ i1 = sit_params[i]->ispec[1];
407
+ //if (sit_IPRSNT[i0] == FALSE || sit_IPRSNT[i1] == FALSE) continue;
408
+ z0 = spec[i0]->z;
409
+ z1 = spec[i1]->z;
410
+ param = sit_params[i]->p;
411
+ switch (sit_params[i]->type)
412
+ {
413
+ case TYPE_SIT_EPSILON:
414
+ sit_LGAMMA[i0] += sit_M[i1] * param;
415
+ sit_LGAMMA[i1] += sit_M[i0] * param;
416
+ if (z0 == 0.0 && z1 == 0.0)
417
+ {
418
+ OSMOT += sit_M[i0] * sit_M[i1] * param / 2.0;
419
+ }
420
+ else
421
+ {
422
+ OSMOT += sit_M[i0] * sit_M[i1] * param;
423
+ }
424
+ break;
425
+ case TYPE_SIT_EPSILON_MU:
426
+ sit_LGAMMA[i0] += sit_M[i1] * I * param;
427
+ sit_LGAMMA[i1] += sit_M[i0] * I * param;
428
+ OSMOT += sit_M[i0] * sit_M[i1] * param;
429
+ if (z0 == 0.0 && z1 == 0.0)
430
+ {
431
+ OSMOT += sit_M[i0] * sit_M[i1] * param * I / 2.0;
432
+ }
433
+ else
434
+ {
435
+ OSMOT += sit_M[i0] * sit_M[i1] * param * I;
436
+ }
437
+ break;
438
+ default:
439
+ case TYPE_Other:
440
+ error_msg("TYPE_Other in pitz_param list.", STOP);
441
+ break;
442
+ }
443
+ }
444
+
445
+ /*
446
+ * Add F and CSUM terms to sit_LGAMMA
447
+ */
448
+ for (size_t j = 0; j < ion_list.size(); j++)
449
+ {
450
+ int i = ion_list[j];
451
+ z0 = spec[i]->z;
452
+ sit_LGAMMA[i] += z0 * z0 * F;
453
+ }
454
+ //for (i = 0; i < sit_count_cations; i++)
455
+ //{
456
+ // z0 = spec[i]->z;
457
+ // sit_LGAMMA[i] += z0 * z0 * F;
458
+ //}
459
+ //for (i = 2 * (int)s.size(); i < 2 * (int)s.size() + sit_count_anions; i++)
460
+ //{
461
+ // z0 = spec[i]->z;
462
+ // sit_LGAMMA[i] += z0 * z0 * F;
463
+ //}
464
+ /*
465
+ C
466
+ C CONVERT TO MACINNES CONVENTION
467
+ C
468
+ */
469
+ /*COSMOT = 1.0e0 + 2.0e0 * OSMOT / OSUM;*/
470
+ COSMOT = 1.0e0 + OSMOT*LOG_10 / OSUM;
471
+ /*
472
+ C
473
+ C CALCULATE THE ACTIVITY OF WATER
474
+ C
475
+ */
476
+ AW = exp(-OSUM * COSMOT / 55.50837e0);
477
+ /*if (AW > 1.0) AW = 1.0;*/
478
+ /*s_h2o->la=log10(AW); */
479
+ mu_x = I;
480
+ for (size_t j = 0; j < s_list.size(); j++)
481
+ {
482
+ int i = s_list[j];
483
+ spec[i]->lg_pitzer = sit_LGAMMA[i];
484
+ }
485
+ // for (i = 0; i < 2 * (int)s.size() + sit_count_anions; i++)
486
+ // {
487
+ // if (sit_IPRSNT[i] == FALSE) continue;
488
+ // spec[i]->lg_pitzer = sit_LGAMMA[i];
489
+ ///*
490
+ // output_msg(sformatf( "%d %s:\t%e\t%e\t%e\t%e \n", i, spec[i]->name, sit_M[i], spec[i]->la, spec[i]->lg_pitzer, spec[i]->lg));
491
+ //*/
492
+ // }
493
+ return (OK);
494
+ }
495
+ /* ---------------------------------------------------------------------- */
496
+ int Phreeqc::
497
+ sit_clean_up(void)
498
+ /* ---------------------------------------------------------------------- */
499
+ {
500
+ /*
501
+ * Free all allocated memory, except strings
502
+ */
503
+ int i;
504
+
505
+ for (i = 0; i < (int)sit_params.size(); i++)
506
+ {
507
+ delete sit_params[i];
508
+ }
509
+ sit_params.clear();
510
+ sit_param_map.clear();
511
+ sit_LGAMMA.clear();
512
+ sit_IPRSNT.clear();
513
+ spec.clear();
514
+ //delete aphi;
515
+ sit_M.clear();
516
+
517
+ return OK;
518
+ }
519
+
520
+ /* ---------------------------------------------------------------------- */
521
+ int Phreeqc::
522
+ set_sit(int initial)
523
+ /* ---------------------------------------------------------------------- */
524
+ {
525
+ /*
526
+ * Sets initial guesses for unknowns if initial == TRUE
527
+ * Revises guesses whether initial is true or not
528
+ */
529
+ int i;
530
+ cxxSolution *solution_ptr;
531
+ /*
532
+ * Set initial log concentrations to zero
533
+ */
534
+ iterations = -1;
535
+ solution_ptr = use.Get_solution_ptr();
536
+ for (i = 0; i < (int)this->s_x.size(); i++)
537
+ {
538
+ s_x[i]->lm = LOG_ZERO_MOLALITY;
539
+ s_x[i]->lg_pitzer = 0.0;
540
+ }
541
+ if (initial == TRUE || set_and_run_attempt > 0)
542
+ {
543
+ for (i = 0; i < (int)this->s_x.size(); i++)
544
+ {
545
+ s_x[i]->lg = 0.0;
546
+ }
547
+ }
548
+ /*
549
+ * Set master species activities
550
+ */
551
+ tc_x = solution_ptr->Get_tc();
552
+ tk_x = tc_x + 273.15;
553
+
554
+ patm_x = solution_ptr->Get_patm(); // done in calc_rho_0(tc, pa)
555
+ potV_x = solution_ptr->Get_potV();
556
+
557
+ /*
558
+ * H+, e-, H2O
559
+ */
560
+ mass_water_aq_x = solution_ptr->Get_mass_water();
561
+ mu_x = solution_ptr->Get_mu();
562
+ s_h2o->moles = mass_water_aq_x / gfw_water;
563
+ s_h2o->la = log10(solution_ptr->Get_ah2o());
564
+ AW = pow((LDBLE) 10.0E0, s_h2o->la);
565
+ s_hplus->la = -solution_ptr->Get_ph();
566
+ s_hplus->lm = s_hplus->la;
567
+ s_hplus->moles = exp(s_hplus->lm * LOG_10) * mass_water_aq_x;
568
+ s_eminus->la = -solution_ptr->Get_pe();
569
+ if (initial == TRUE) sit_initial_guesses();
570
+ if (dl_type_x != cxxSurface::NO_DL) initial_surface_water();
571
+ sit_revise_guesses();
572
+ return (OK);
573
+ }
574
+
575
+ /* ---------------------------------------------------------------------- */
576
+ int Phreeqc::
577
+ sit_initial_guesses(void)
578
+ /* ---------------------------------------------------------------------- */
579
+ {
580
+ /*
581
+ * Make initial guesses for activities of master species and
582
+ * ionic strength
583
+ */
584
+ int i;
585
+ cxxSolution *solution_ptr;
586
+
587
+ solution_ptr = use.Get_solution_ptr();
588
+ mu_x =
589
+ s_hplus->moles +
590
+ exp((solution_ptr->Get_ph() - 14.) * LOG_10) * mass_water_aq_x;
591
+ mu_x /= mass_water_aq_x;
592
+ s_h2o->la = 0.0;
593
+ for (i = 0; i < count_unknowns; i++)
594
+ {
595
+ if (x[i] == ph_unknown || x[i] == pe_unknown)
596
+ continue;
597
+ if (x[i]->type < CB)
598
+ {
599
+ mu_x +=
600
+ x[i]->moles / mass_water_aq_x * 0.5 * x[i]->master[0]->s->z *
601
+ x[i]->master[0]->s->z;
602
+ x[i]->master[0]->s->la = log10(x[i]->moles / mass_water_aq_x);
603
+ }
604
+ else if (x[i]->type == CB)
605
+ {
606
+ x[i]->master[0]->s->la =
607
+ log10(0.001 * x[i]->moles / mass_water_aq_x);
608
+ }
609
+ else if (x[i]->type == SOLUTION_PHASE_BOUNDARY)
610
+ {
611
+ x[i]->master[0]->s->la =
612
+ log10(0.001 * x[i]->moles / mass_water_aq_x);
613
+ }
614
+ else if (x[i]->type == EXCH)
615
+ {
616
+ if (x[i]->moles <= 0)
617
+ {
618
+ x[i]->master[0]->s->la = MIN_RELATED_LOG_ACTIVITY;
619
+ }
620
+ else
621
+ {
622
+ x[i]->master[0]->s->la = log10(x[i]->moles);
623
+ }
624
+ }
625
+ else if (x[i]->type == SURFACE)
626
+ {
627
+ if (x[i]->moles <= 0)
628
+ {
629
+ x[i]->master[0]->s->la = MIN_RELATED_LOG_ACTIVITY;
630
+ }
631
+ else
632
+ {
633
+ x[i]->master[0]->s->la = log10(0.1 * x[i]->moles);
634
+ }
635
+ }
636
+ else if (x[i]->type == SURFACE_CB)
637
+ {
638
+ x[i]->master[0]->s->la = 0.0;
639
+ }
640
+ }
641
+ return (OK);
642
+ }
643
+
644
+ /* ---------------------------------------------------------------------- */
645
+ int Phreeqc::
646
+ sit_revise_guesses(void)
647
+ /* ---------------------------------------------------------------------- */
648
+ {
649
+ /*
650
+ * Revise molalities species
651
+ */
652
+ int i;
653
+ int l_iter, max_iter, repeat, fail;
654
+ LDBLE weight, f;
655
+
656
+ max_iter = 100;
657
+ /* gammas(mu_x); */
658
+ l_iter = 0;
659
+ repeat = TRUE;
660
+ fail = FALSE;
661
+ double d = 2;
662
+ double logd = log10(d);
663
+ while (repeat == TRUE && fail == FALSE)
664
+ {
665
+ l_iter++;
666
+ if (debug_set == TRUE)
667
+ {
668
+ output_msg(sformatf( "\nBeginning set iteration %d.\n",
669
+ l_iter));
670
+ }
671
+ if (l_iter == max_iter + 1)
672
+ {
673
+ log_msg(sformatf(
674
+ "Did not converge in set, iteration %d.\n",
675
+ iterations));
676
+ fail = TRUE;
677
+ }
678
+ if (l_iter > 2 * max_iter)
679
+ {
680
+ log_msg(sformatf(
681
+ "Did not converge with relaxed criteria in set.\n"));
682
+ return (OK);
683
+ }
684
+ molalities(TRUE);
685
+ /*pitzer(); */
686
+ /*s_h2o->la = 0.0; */
687
+ /*molalities(TRUE); */
688
+ mb_sums();
689
+ if (state < REACTION)
690
+ {
691
+ sum_species();
692
+ }
693
+ else
694
+ {
695
+ for (i = 0; i < count_unknowns; i++)
696
+ {
697
+ x[i]->sum = x[i]->f;
698
+ }
699
+ }
700
+ /*n
701
+ if (debug_set == TRUE) {
702
+ pr.species = TRUE;
703
+ pr.all = TRUE;
704
+ print_species();
705
+ }
706
+ */
707
+ repeat = FALSE;
708
+ for (i = 0; i < count_unknowns; i++)
709
+ {
710
+ if (x[i] == ph_unknown || x[i] == pe_unknown)
711
+ continue;
712
+ if (x[i]->type == MB ||
713
+ /* x[i]->type == ALK || */
714
+ x[i]->type == CB ||
715
+ x[i]->type == SOLUTION_PHASE_BOUNDARY ||
716
+ x[i]->type == EXCH || x[i]->type == SURFACE)
717
+ {
718
+
719
+ if (debug_set == TRUE)
720
+ {
721
+ output_msg(sformatf(
722
+ "\n\t%5s at beginning of set %d: %e\t%e\t%e\n",
723
+ x[i]->description, l_iter, (double) x[i]->sum,
724
+ (double) x[i]->moles,
725
+ (double) x[i]->master[0]->s->la));
726
+ }
727
+ if (fabs(x[i]->moles) < 1e-30)
728
+ x[i]->moles = 0;
729
+ f = fabs(x[i]->sum);
730
+ if (f == 0 && x[i]->moles == 0)
731
+ {
732
+ x[i]->master[0]->s->la = MIN_RELATED_LOG_ACTIVITY;
733
+ continue;
734
+ }
735
+ else if (f == 0)
736
+ {
737
+ repeat = TRUE;
738
+ x[i]->master[0]->s->la += logd;
739
+ /*!!!!*/ if (x[i]->master[0]->s->la < -999.)
740
+ x[i]->master[0]->s->la = MIN_RELATED_LOG_ACTIVITY;
741
+ }
742
+ else if (f > d * fabs(x[i]->moles)
743
+ || f < 1.0/d * fabs(x[i]->moles))
744
+ {
745
+ weight = (f < 1.0/d * fabs(x[i]->moles)) ? 0.3 : 1.0;
746
+ if (x[i]->moles <= 0)
747
+ {
748
+ x[i]->master[0]->s->la = MIN_RELATED_LOG_ACTIVITY;
749
+ }
750
+ else
751
+ {
752
+ repeat = TRUE;
753
+ x[i]->master[0]->s->la +=
754
+ weight * log10(fabs(x[i]->moles / x[i]->sum));
755
+ }
756
+ if (debug_set == TRUE)
757
+ {
758
+ output_msg(sformatf(
759
+ "\t%5s not converged in set %d: %e\t%e\t%e\n",
760
+ x[i]->description, l_iter,
761
+ (double) x[i]->sum, (double) x[i]->moles,
762
+ (double) x[i]->master[0]->s->la));
763
+ }
764
+ }
765
+ }
766
+ else if (x[i]->type == ALK)
767
+ {
768
+ f = total_co2;
769
+ if (fail == TRUE && f < 1.5 * fabs(x[i]->moles))
770
+ {
771
+ continue;
772
+ }
773
+ if (f > 1.5 * fabs(x[i]->moles)
774
+ || f < 1.0/d * fabs(x[i]->moles))
775
+ {
776
+ repeat = TRUE;
777
+ weight = (f < 1.0/d * fabs(x[i]->moles)) ? 0.3 : 1.0;
778
+ x[i]->master[0]->s->la += weight *
779
+ log10(fabs(x[i]->moles / x[i]->sum));
780
+ if (debug_set == TRUE)
781
+ {
782
+ output_msg(sformatf(
783
+ "%s not converged in set. %e\t%e\t%e\n",
784
+ x[i]->description, (double) x[i]->sum,
785
+ (double) x[i]->moles,
786
+ (double) x[i]->master[0]->s->la));
787
+ }
788
+ }
789
+ }
790
+ }
791
+ }
792
+ log_msg(sformatf( "Iterations in sit_revise_guesses: %d\n", l_iter));
793
+ /*mu_x = mu_unknown->f * 0.5 / mass_water_aq_x; */
794
+ if (mu_x <= 1e-8)
795
+ {
796
+ mu_x = 1e-8;
797
+ }
798
+ /*gammas(mu_x); */
799
+ return (OK);
800
+ }
801
+ //#define ORIGINAL
802
+ #ifdef ORIGINAL
803
+ /* ---------------------------------------------------------------------- */
804
+ int Phreeqc::
805
+ jacobian_sit(void)
806
+ /* ---------------------------------------------------------------------- */
807
+ {
808
+ std::vector<double> base;
809
+ LDBLE d, d1, d2;
810
+ int i, j;
811
+ Restart:
812
+ size_t pz_max_unknowns = max_unknowns;
813
+ //k_temp(tc_x, patm_x);
814
+ if (full_pitzer == TRUE)
815
+ {
816
+ molalities(TRUE);
817
+ sit();
818
+ residuals();
819
+ }
820
+ base = residual; // std::vectors
821
+ d = 0.0001;
822
+ d1 = d * LOG_10;
823
+ d2 = 0;
824
+ for (i = 0; i < count_unknowns; i++)
825
+ {
826
+ switch (x[i]->type)
827
+ {
828
+ case MB:
829
+ case ALK:
830
+ case CB:
831
+ case SOLUTION_PHASE_BOUNDARY:
832
+ case EXCH:
833
+ case SURFACE:
834
+ case SURFACE_CB:
835
+ case SURFACE_CB1:
836
+ case SURFACE_CB2:
837
+ x[i]->master[0]->s->la += d;
838
+ d2 = d1;
839
+ break;
840
+ case AH2O:
841
+ x[i]->master[0]->s->la += d;
842
+ d2 = d1;
843
+ break;
844
+ case PITZER_GAMMA:
845
+ if (!full_pitzer)
846
+ continue;
847
+ x[i]->s->lg += d;
848
+ d2 = d;
849
+ break;
850
+ case MH2O:
851
+ mass_water_aq_x *= (1.0 + d);
852
+ x[i]->master[0]->s->moles = mass_water_aq_x / gfw_water;
853
+ d2 = log(1.0 + d);
854
+ break;
855
+ case MH:
856
+ s_eminus->la += d;
857
+ d2 = d1;
858
+ break;
859
+ /*
860
+ if (pitzer_pe == TRUE)
861
+ {
862
+ s_eminus->la += d;
863
+ d2 = d1;
864
+ break;
865
+ }
866
+ else
867
+ {
868
+ continue;
869
+ }
870
+ */
871
+ case GAS_MOLES:
872
+ if (gas_in == FALSE)
873
+ continue;
874
+ d2 = (x[i]->moles > 1 ? 1 : 20);
875
+ d2 *= d * x[i]->moles;
876
+ if (d2 < 1e-14)
877
+ d2 = 1e-14;
878
+ x[i]->moles += d2;
879
+ break;
880
+ case MU:
881
+ //continue;
882
+ d2 = d * mu_x;
883
+ mu_x += d2;
884
+ //k_temp(tc_x, patm_x);
885
+ gammas(mu_x);
886
+ break;
887
+ case PP:
888
+ case SS_MOLES:
889
+ continue;
890
+ break;
891
+ }
892
+ molalities(TRUE);
893
+ if (max_unknowns > pz_max_unknowns)
894
+ {
895
+ gammas_sit();
896
+ jacobian_sums();
897
+ goto Restart;
898
+ }
899
+ if (full_pitzer == TRUE)
900
+ sit();
901
+ mb_sums();
902
+ residuals();
903
+ for (j = 0; j < count_unknowns; j++)
904
+ {
905
+ my_array[(size_t)j * (count_unknowns + 1) + (size_t)i] =
906
+ -(residual[j] - base[j]) / d2;
907
+ }
908
+ switch (x[i]->type)
909
+ {
910
+ case MB:
911
+ case ALK:
912
+ case CB:
913
+ case SOLUTION_PHASE_BOUNDARY:
914
+ case EXCH:
915
+ case SURFACE:
916
+ case SURFACE_CB:
917
+ case SURFACE_CB1:
918
+ case SURFACE_CB2:
919
+ case AH2O:
920
+ x[i]->master[0]->s->la -= d;
921
+ break;
922
+ case MH:
923
+ s_eminus->la -= d;
924
+ if (my_array[(size_t)i * (count_unknowns + 1) + (size_t)i] == 0)
925
+ {
926
+ my_array[(size_t)i * (count_unknowns + 1) + (size_t)i] =
927
+ exp(s_h2->lm * LOG_10) * 2;
928
+ }
929
+ break;
930
+ case PITZER_GAMMA:
931
+ x[i]->s->lg -= d;
932
+ break;
933
+ case MH2O:
934
+ mass_water_aq_x /= (1 + d);
935
+ x[i]->master[0]->s->moles = mass_water_aq_x / gfw_water;
936
+ break;
937
+ case MU:
938
+ mu_x -= d2;
939
+ //k_temp(tc_x, patm_x);
940
+ gammas(mu_x);
941
+ break;
942
+ case GAS_MOLES:
943
+ if (gas_in == FALSE)
944
+ continue;
945
+ x[i]->moles -= d2;
946
+ break;
947
+ }
948
+ }
949
+ molalities(TRUE);
950
+ if (full_pitzer == TRUE)
951
+ sit();
952
+ mb_sums();
953
+ residuals();
954
+ return OK;
955
+ }
956
+ #else
957
+ /* ---------------------------------------------------------------------- */
958
+ int Phreeqc::
959
+ jacobian_sit(void)
960
+ /* ---------------------------------------------------------------------- */
961
+ {
962
+ std::vector<double> base;
963
+ LDBLE d, d1, d2;
964
+ int i, j;
965
+ std::vector<class phase*> phase_ptrs;
966
+ std::vector<class phase> base_phases;
967
+ cxxGasPhase base_gas_phase;
968
+ cxxSurface base_surface;
969
+ Restart:
970
+ if (use.Get_surface_ptr() != NULL)
971
+ {
972
+ base_surface = *use.Get_surface_ptr();
973
+ }
974
+ if (use.Get_gas_phase_ptr() != NULL)
975
+ {
976
+ cxxGasPhase* gas_phase_ptr = use.Get_gas_phase_ptr();
977
+ base_gas_phase = *gas_phase_ptr;
978
+ base_phases.resize(gas_phase_ptr->Get_gas_comps().size());
979
+ for (size_t i = 0; i < gas_phase_ptr->Get_gas_comps().size(); i++)
980
+ {
981
+ const cxxGasComp* gas_comp_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
982
+ class phase* phase_ptr = phase_bsearch(gas_comp_ptr->Get_phase_name().c_str(), &j, FALSE);
983
+ phase_ptrs.push_back(phase_ptr);
984
+ base_phases[i] = *phase_ptr;
985
+ }
986
+ }
987
+ calculating_deriv = 1;
988
+ size_t pz_max_unknowns = max_unknowns;
989
+ //k_temp(tc_x, patm_x);
990
+ molalities(TRUE);
991
+ if (full_pitzer == TRUE)
992
+ {
993
+
994
+ sit();
995
+ }
996
+ mb_sums();
997
+ residuals();
998
+ base = residual; // std::vectors
999
+ d = 0.0001;
1000
+ d1 = d * LOG_10;
1001
+ d2 = 0;
1002
+ for (i = 0; i < count_unknowns; i++)
1003
+ {
1004
+ switch (x[i]->type)
1005
+ {
1006
+ case MB:
1007
+ case ALK:
1008
+ case CB:
1009
+ case SOLUTION_PHASE_BOUNDARY:
1010
+ case EXCH:
1011
+ case SURFACE:
1012
+ case SURFACE_CB:
1013
+ case SURFACE_CB1:
1014
+ case SURFACE_CB2:
1015
+ x[i]->master[0]->s->la += d;
1016
+ d2 = d1;
1017
+ break;
1018
+ case AH2O:
1019
+ x[i]->master[0]->s->la += d;
1020
+ d2 = d1;
1021
+ break;
1022
+ case PITZER_GAMMA:
1023
+ if (!full_pitzer)
1024
+ continue;
1025
+ x[i]->s->lg += d;
1026
+ d2 = d;
1027
+ break;
1028
+ case MH2O:
1029
+ mass_water_aq_x *= (1.0 + d);
1030
+ x[i]->master[0]->s->moles = mass_water_aq_x / gfw_water;
1031
+ d2 = log(1.0 + d);
1032
+ break;
1033
+ case MH:
1034
+ s_eminus->la += d;
1035
+ d2 = d1;
1036
+ break;
1037
+ /*
1038
+ if (pitzer_pe == TRUE)
1039
+ {
1040
+ s_eminus->la += d;
1041
+ d2 = d1;
1042
+ break;
1043
+ }
1044
+ else
1045
+ {
1046
+ continue;
1047
+ }
1048
+ */
1049
+ case GAS_MOLES:
1050
+ if (gas_in == FALSE)
1051
+ continue;
1052
+ d2 = (x[i]->moles > 1 ? 1 : 20);
1053
+ d2 *= d * x[i]->moles;
1054
+ if (d2 < 1e-14)
1055
+ d2 = 1e-14;
1056
+ x[i]->moles += d2;
1057
+ break;
1058
+ case MU:
1059
+ //continue;
1060
+ d2 = d * mu_x;
1061
+ mu_x += d2;
1062
+ //k_temp(tc_x, patm_x);
1063
+ gammas_sit();
1064
+ break;
1065
+ case PP:
1066
+ case SS_MOLES:
1067
+ continue;
1068
+ break;
1069
+ }
1070
+ molalities(TRUE);
1071
+ if (max_unknowns > pz_max_unknowns)
1072
+ {
1073
+ gammas_sit();
1074
+ jacobian_sums();
1075
+ goto Restart;
1076
+ }
1077
+ if (full_pitzer == TRUE)
1078
+ sit();
1079
+ mb_sums();
1080
+ residuals();
1081
+ for (j = 0; j < count_unknowns; j++)
1082
+ {
1083
+ my_array[(size_t)j * (count_unknowns + 1) + (size_t)i] =
1084
+ -(residual[j] - base[j]) / d2;
1085
+ }
1086
+ switch (x[i]->type)
1087
+ {
1088
+ case MB:
1089
+ case ALK:
1090
+ case CB:
1091
+ case SOLUTION_PHASE_BOUNDARY:
1092
+ case EXCH:
1093
+ case SURFACE:
1094
+ case SURFACE_CB:
1095
+ case SURFACE_CB1:
1096
+ case SURFACE_CB2:
1097
+ case AH2O:
1098
+ x[i]->master[0]->s->la -= d;
1099
+ break;
1100
+ case MH:
1101
+ s_eminus->la -= d;
1102
+ if (my_array[(size_t)i * (count_unknowns + 1) + (size_t)i] == 0)
1103
+ {
1104
+ my_array[(size_t)i * (count_unknowns + 1) + (size_t)i] =
1105
+ exp(s_h2->lm * LOG_10) * 2;
1106
+ }
1107
+ break;
1108
+ case PITZER_GAMMA:
1109
+ x[i]->s->lg -= d;
1110
+ break;
1111
+ case MH2O:
1112
+ mass_water_aq_x /= (1 + d);
1113
+ x[i]->master[0]->s->moles = mass_water_aq_x / gfw_water;
1114
+ break;
1115
+ case MU:
1116
+ mu_x -= d2;
1117
+ //k_temp(tc_x, patm_x);
1118
+ gammas_sit();
1119
+ break;
1120
+ case GAS_MOLES:
1121
+ if (gas_in == FALSE)
1122
+ continue;
1123
+ x[i]->moles -= d2;
1124
+ break;
1125
+ }
1126
+ if (use.Get_surface_ptr() != NULL)
1127
+ {
1128
+ *use.Get_surface_ptr() = base_surface;
1129
+ }
1130
+ if (use.Get_gas_phase_ptr() != NULL)
1131
+ {
1132
+ *use.Get_gas_phase_ptr() = base_gas_phase;
1133
+ for (size_t g = 0; g < base_phases.size(); g++)
1134
+ {
1135
+ *phase_ptrs[g] = base_phases[g];
1136
+ }
1137
+ }
1138
+ }
1139
+ molalities(TRUE);
1140
+ if (full_pitzer == TRUE)
1141
+ sit();
1142
+ mb_sums();
1143
+ residuals();
1144
+ //for (i = 0; i < count_unknowns; i++)
1145
+ //{
1146
+ // //Debugging
1147
+ // if (fabs(2.0 * (residual[i] - base[i]) / (residual[i] + base[i])) > 1e-2 &&
1148
+ // fabs(residual[i]) + fabs(base[i]) > 1e-8)
1149
+ // {
1150
+ // std::cerr << i << ": " << x[i]->description << " " << residual[i] << " " << base[i] << std::endl;
1151
+ // }
1152
+ //}
1153
+ calculating_deriv = 0;
1154
+ return OK;
1155
+ }
1156
+ #endif
1157
+ /* ---------------------------------------------------------------------- */
1158
+ int Phreeqc::
1159
+ model_sit(void)
1160
+ /* ---------------------------------------------------------------------- */
1161
+ {
1162
+ /*
1163
+ * model is called after the equations have been set up by prep
1164
+ * and initial guesses have been made in set.
1165
+ *
1166
+ * Here is the outline of the calculation sequence:
1167
+ * residuals--residuals are calculated, if small we are done
1168
+ * sum_jacobian--jacobian is calculated
1169
+ * ineq--inequality solver is called
1170
+ * reset--estimates of unknowns revised, if changes are small solution
1171
+ * has been found, usually convergence is found in residuals.
1172
+ * gammas--new activity coefficients
1173
+ * molalities--calculate molalities
1174
+ * mb_sums--calculate mass-balance sums
1175
+ * mb_gases--decide if gas_phase exists
1176
+ * mb_ss--decide if solid_solutions exists
1177
+ * switch_bases--check to see if new basis species is needed
1178
+ * reprep--rewrite equations with new basis species if needed
1179
+ * sit_revise_guesses--revise unknowns to get initial mole balance
1180
+ * check_residuals--check convergence one last time
1181
+ * sum_species--calculate sums of elements from species concentrations
1182
+ *
1183
+ * An additional pass through may be needed if unstable phases still exist
1184
+ * in the phase assemblage.
1185
+ */
1186
+ int l_kode, return_kode;
1187
+ int r;
1188
+ int count_infeasible, count_basis_change;
1189
+ int debug_model_save;
1190
+ int mass_water_switch_save;
1191
+
1192
+ /* debug_model = TRUE; */
1193
+ /* debug_prep = TRUE; */
1194
+ /* debug_set = TRUE; */
1195
+ /* mass_water_switch == TRUE, mass of water is constant */
1196
+ mass_water_switch_save = mass_water_switch;
1197
+ if (mass_water_switch_save == FALSE && delay_mass_water == TRUE)
1198
+ {
1199
+ mass_water_switch = TRUE;
1200
+ }
1201
+ debug_model_save = debug_model;
1202
+ pe_step_size_now = pe_step_size;
1203
+ step_size_now = step_size;
1204
+ #ifdef NPP
1205
+ if (!use.Get_kinetics_in()) status(0, NULL);
1206
+ #else
1207
+ status(0, NULL);
1208
+ #endif
1209
+ iterations = 0;
1210
+ gamma_iterations = 0;
1211
+ count_basis_change = count_infeasible = 0;
1212
+ stop_program = FALSE;
1213
+ remove_unstable_phases = FALSE;
1214
+ if (always_full_pitzer == TRUE)
1215
+ {
1216
+ full_pitzer = TRUE;
1217
+ }
1218
+ else
1219
+ {
1220
+ full_pitzer = FALSE;
1221
+ }
1222
+ //sit_make_lists();
1223
+ for (;;)
1224
+ {
1225
+ mb_gases();
1226
+ mb_ss();
1227
+ l_kode = 1;
1228
+ while ((r = residuals()) != CONVERGED
1229
+ || remove_unstable_phases == TRUE)
1230
+ {
1231
+ #if defined(PHREEQCI_GUI)
1232
+ PhreeqcIWait(this);
1233
+ #endif
1234
+ iterations++;
1235
+ overall_iterations++;
1236
+ if (iterations > itmax - 1 && debug_model == FALSE
1237
+ && pr.logfile == TRUE)
1238
+ {
1239
+ set_forward_output_to_log(TRUE);
1240
+ debug_model = TRUE;
1241
+ }
1242
+ if (debug_model == TRUE)
1243
+ {
1244
+ output_msg(sformatf(
1245
+ "\nIteration %d\tStep_size = %f\n", iterations,
1246
+ (double) step_size_now));
1247
+ output_msg(sformatf( "\t\tPe_step_size = %f\n\n",
1248
+ (double) pe_step_size_now));
1249
+ }
1250
+ /*
1251
+ * Iterations exceeded
1252
+ */
1253
+ if (iterations > itmax)
1254
+ {
1255
+ error_string = sformatf( "Maximum iterations exceeded, %d\n",
1256
+ itmax);
1257
+ warning_msg(error_string);
1258
+ stop_program = TRUE;
1259
+ break;
1260
+ }
1261
+ /*
1262
+ * Calculate jacobian
1263
+ */
1264
+ gammas_sit();
1265
+ jacobian_sums();
1266
+ jacobian_sit();
1267
+ /*
1268
+ * Full matrix with pure phases
1269
+ */
1270
+ if (r == OK || remove_unstable_phases == TRUE)
1271
+ {
1272
+ return_kode = ineq(l_kode);
1273
+ if (return_kode != OK)
1274
+ {
1275
+ if (debug_model == TRUE)
1276
+ {
1277
+ output_msg(sformatf(
1278
+ "Ineq had infeasible solution, "
1279
+ "kode %d, iteration %d\n", return_kode,
1280
+ iterations));
1281
+ }
1282
+ log_msg(sformatf( "Ineq had infeasible solution, "
1283
+ "kode %d, iteration %d\n", return_kode,
1284
+ iterations));
1285
+ count_infeasible++;
1286
+ }
1287
+ if (return_kode == 2)
1288
+ {
1289
+ ineq(0);
1290
+ }
1291
+ reset();
1292
+ }
1293
+ gammas_sit();
1294
+ if (full_pitzer == TRUE)
1295
+ sit();
1296
+ if (always_full_pitzer == TRUE)
1297
+ {
1298
+ full_pitzer = TRUE;
1299
+ }
1300
+ else
1301
+ {
1302
+ full_pitzer = FALSE;
1303
+ }
1304
+ if (molalities(FALSE) == ERROR)
1305
+ {
1306
+ sit_revise_guesses();
1307
+ }
1308
+ if (use.Get_surface_ptr() != NULL &&
1309
+ use.Get_surface_ptr()->Get_dl_type() != cxxSurface::NO_DL &&
1310
+ use.Get_surface_ptr()->Get_related_phases() == TRUE)
1311
+ initial_surface_water();
1312
+ mb_sums();
1313
+ mb_gases();
1314
+ mb_ss();
1315
+ /*
1316
+ * Switch bases if necessary
1317
+ */
1318
+ if (switch_bases() == TRUE)
1319
+ {
1320
+
1321
+ count_basis_change++;
1322
+ //count_unknowns -= (int)this->s_x.size();
1323
+ count_unknowns -= sit_aqueous_unknowns;
1324
+ reprep();
1325
+ full_pitzer = false;
1326
+ }
1327
+ /* debug
1328
+ species_list_sort();
1329
+ sum_species();
1330
+ print_species();
1331
+ print_exchange();
1332
+ print_surface();
1333
+ */
1334
+ if (stop_program == TRUE)
1335
+ {
1336
+ break;
1337
+ }
1338
+ }
1339
+ /*
1340
+ * Check for stop_program
1341
+ */
1342
+
1343
+ if (stop_program == TRUE)
1344
+ {
1345
+ break;
1346
+ }
1347
+ if (check_residuals() == ERROR)
1348
+ {
1349
+ stop_program = TRUE;
1350
+ break;
1351
+ }
1352
+ /* remove_unstable_phases is set in check_residuals */
1353
+ if (remove_unstable_phases == FALSE && mass_water_switch_save == FALSE
1354
+ && mass_water_switch == TRUE)
1355
+ {
1356
+ log_msg(sformatf(
1357
+ "\nChanging water switch to FALSE. Iteration %d.\n",
1358
+ iterations));
1359
+ mass_water_switch = FALSE;
1360
+ continue;
1361
+ }
1362
+ gamma_iterations++;
1363
+ if (gamma_iterations > itmax)
1364
+ {
1365
+ error_string = sformatf( "Maximum gamma iterations exceeded, %d\n",
1366
+ itmax);
1367
+ warning_msg(error_string);
1368
+ stop_program = TRUE;
1369
+ break;
1370
+ }
1371
+ if (check_gammas_sit() != TRUE)
1372
+ {
1373
+ full_pitzer = TRUE;
1374
+ continue;
1375
+ }
1376
+ if (remove_unstable_phases == FALSE)
1377
+ break;
1378
+ if (debug_model == TRUE)
1379
+ {
1380
+ output_msg(sformatf(
1381
+ "\nRemoving unstable phases. Iteration %d.\n",
1382
+ iterations));
1383
+ }
1384
+ log_msg(sformatf( "\nRemoving unstable phases. Iteration %d.\n",
1385
+ iterations));
1386
+ }
1387
+ log_msg(sformatf( "\nNumber of infeasible solutions: %d\n",
1388
+ count_infeasible));
1389
+ log_msg(sformatf( "Number of basis changes: %d\n\n",
1390
+ count_basis_change));
1391
+ log_msg(sformatf( "Number of iterations: %d\n", iterations));
1392
+ log_msg(sformatf( "Number of gamma iterations: %d\n\n", gamma_iterations));
1393
+ debug_model = debug_model_save;
1394
+ set_forward_output_to_log(FALSE);
1395
+ if (stop_program == TRUE)
1396
+ {
1397
+ return (ERROR);
1398
+ }
1399
+ return (OK);
1400
+ }
1401
+
1402
+ /* ---------------------------------------------------------------------- */
1403
+ int Phreeqc::
1404
+ check_gammas_sit(void)
1405
+ /* ---------------------------------------------------------------------- */
1406
+ {
1407
+ LDBLE old_mu, tol;
1408
+ int converge, i;
1409
+
1410
+ old_mu = mu_x;
1411
+ sit();
1412
+ molalities(TRUE);
1413
+ mb_sums();
1414
+ converge = TRUE;
1415
+ tol = convergence_tolerance * 10.;
1416
+ for (i = 0; i < count_unknowns; i++)
1417
+ {
1418
+ if (x[i]->type != PITZER_GAMMA)
1419
+ continue;
1420
+ if (fabs(x[i]->s->lg - x[i]->s->lg_pitzer) > tol)
1421
+ {
1422
+ converge = FALSE;
1423
+ }
1424
+ }
1425
+ if (fabs(old_mu - mu_x) > tol)
1426
+ {
1427
+ converge = FALSE;
1428
+ }
1429
+ if ((pow((LDBLE) 10.0, s_h2o->la) - AW) > tol)
1430
+ {
1431
+ converge = FALSE;
1432
+ }
1433
+ return converge;
1434
+ }
1435
+
1436
+ /* ---------------------------------------------------------------------- */
1437
+ int Phreeqc::
1438
+ gammas_sit()
1439
+ /* ---------------------------------------------------------------------- */
1440
+ {
1441
+ /*
1442
+ * Need exchange gammas for pitzer
1443
+ */
1444
+ int i, j;
1445
+ LDBLE coef;
1446
+ /* Initialize */
1447
+ k_temp(tc_x, patm_x);
1448
+ /*
1449
+ * Calculate activity coefficients
1450
+ */
1451
+ for (i = 0; i < (int)this->s_x.size(); i++)
1452
+ {
1453
+ switch (s_x[i]->gflag)
1454
+ {
1455
+ case 0: /* uncharged */
1456
+ case 1: /* Davies */
1457
+ case 2: /* Extended D-H, WATEQ D-H */
1458
+ case 3: /* Always 1.0 */
1459
+ break;
1460
+ case 4: /* Exchange */
1461
+ /* Now calculated in next loop */
1462
+ break;
1463
+ case 5: /* Always 1.0 */
1464
+ break;
1465
+ case 6: /* Surface */
1466
+ /*
1467
+ * Find moles of sites.
1468
+ * s_x[i]->equiv is stoichiometric coefficient of sites in species
1469
+ */
1470
+ for (j = 1; s_x[i]->rxn_x.token[j].s != NULL; j++)
1471
+ {
1472
+ if (s_x[i]->rxn_x.token[j].s->type == SURF)
1473
+ {
1474
+ s_x[i]->alk =
1475
+ s_x[i]->rxn_x.token[j].s->primary->unknown->moles;
1476
+ break;
1477
+ }
1478
+ }
1479
+ if (s_x[i]->alk > 0)
1480
+ {
1481
+ s_x[i]->lg = log10(s_x[i]->equiv / s_x[i]->alk);
1482
+ s_x[i]->dg = 0.0;
1483
+ }
1484
+ else
1485
+ {
1486
+ s_x[i]->lg = 0.0;
1487
+ s_x[i]->dg = 0.0;
1488
+ }
1489
+ break;
1490
+ case 7: /* LLNL */
1491
+ break;
1492
+ case 8: /* LLNL CO2 */
1493
+ break;
1494
+ case 9: /* activity water */
1495
+ s_x[i]->lg = log10(exp(s_h2o->la * LOG_10) * gfw_water);
1496
+ s_x[i]->dg = 0.0;
1497
+ break;
1498
+ }
1499
+ /*
1500
+ if (mu_unknown != NULL) {
1501
+ if (fabs(residual[mu_unknown->number]) > 0.1 &&
1502
+ fabs(residual[mu_unknown->number])/mu_x > 0.5) {
1503
+ s_x[i]->dg = 0.0;
1504
+ }
1505
+ }
1506
+ */
1507
+ }
1508
+ /*
1509
+ * calculate exchange gammas
1510
+ */
1511
+
1512
+ if (use.Get_exchange_ptr() != NULL)
1513
+ {
1514
+ for (i = 0; i < (int)this->s_x.size(); i++)
1515
+ {
1516
+ switch (s_x[i]->gflag)
1517
+ {
1518
+ case 0: /* uncharged */
1519
+ case 1: /* Davies */
1520
+ case 2: /* Extended D-H, WATEQ D-H */
1521
+ case 3: /* Always 1.0 */
1522
+ case 5: /* Always 1.0 */
1523
+ case 6: /* Surface */
1524
+ case 7: /* LLNL */
1525
+ case 8: /* LLNL CO2 */
1526
+ case 9: /* activity water */
1527
+ break;
1528
+ case 4: /* Exchange */
1529
+
1530
+ /*
1531
+ * Find CEC
1532
+ * z contains valence of cation for exchange species, alk contains cec
1533
+ */
1534
+ /* !!!!! */
1535
+ for (j = 1; s_x[i]->rxn_x.token[j].s != NULL; j++)
1536
+ {
1537
+ if (s_x[i]->rxn_x.token[j].s->type == EX)
1538
+ {
1539
+ s_x[i]->alk =
1540
+ s_x[i]->rxn_x.token[j].s->primary->unknown->
1541
+ moles;
1542
+ break;
1543
+ }
1544
+ }
1545
+ /*
1546
+ * Master species is a dummy variable with meaningless activity and mass
1547
+ */
1548
+ s_x[i]->lg = 0.0;
1549
+ s_x[i]->dg = 0.0;
1550
+ if (s_x[i]->primary != NULL)
1551
+ {
1552
+ break;
1553
+ }
1554
+ /*
1555
+ * All other species
1556
+ */
1557
+
1558
+ /* modific 29 july 2005... */
1559
+ if (s_x[i]->equiv != 0 && s_x[i]->alk > 0)
1560
+ {
1561
+ s_x[i]->lg = log10(fabs(s_x[i]->equiv) / s_x[i]->alk);
1562
+ }
1563
+ if (use.Get_exchange_ptr()->Get_pitzer_exchange_gammas())
1564
+ {
1565
+ /* Assume equal gamma's of solute and exchangeable species... */
1566
+ for (j = 1; s_x[i]->rxn_x.token[j].s != NULL; j++)
1567
+ {
1568
+ if (s_x[i]->rxn_x.token[j].s->type == EX)
1569
+ continue;
1570
+ coef = s_x[i]->rxn_x.token[j].coef;
1571
+ s_x[i]->lg += coef * s_x[i]->rxn_x.token[j].s->lg;
1572
+ s_x[i]->dg += coef * s_x[i]->rxn_x.token[j].s->dg;
1573
+ }
1574
+ }
1575
+ }
1576
+ }
1577
+ }
1578
+ /* ...end modific 29 july 2005 */
1579
+
1580
+ return (OK);
1581
+ }
1582
+ /* ---------------------------------------------------------------------- */
1583
+ int Phreeqc::
1584
+ PTEMP_SIT(LDBLE TK)
1585
+ /* ---------------------------------------------------------------------- */
1586
+ {
1587
+ /*
1588
+ C
1589
+ C SUBROUTINE TO CALCULATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER
1590
+ C
1591
+ */
1592
+ LDBLE TR = 298.15;
1593
+
1594
+ if (fabs(TK - OTEMP) < 0.001 && fabs(patm_x - OPRESS) < 0.1) return OK;
1595
+ /*
1596
+ C Set DW0
1597
+ */
1598
+ DW0 = rho_0 = calc_rho_0(TK - 273.15, patm_x);
1599
+ VP = patm_x;
1600
+ for (size_t j = 0; j < param_list.size(); j++)
1601
+ {
1602
+ int i = param_list[j];
1603
+ calc_sit_param(sit_params[i], TK, TR);
1604
+ }
1605
+ calc_dielectrics(TK - 273.15, patm_x);
1606
+ sit_A0 = A0;
1607
+ OTEMP = TK;
1608
+ OPRESS = patm_x;
1609
+ return OK;
1610
+ }
1611
+
1612
+ /* ---------------------------------------------------------------------- */
1613
+ void Phreeqc::
1614
+ sit_make_lists(void)
1615
+ /* ---------------------------------------------------------------------- */
1616
+ {
1617
+ double log_min = log10(MIN_TOTAL);
1618
+ s_list.clear();
1619
+ cation_list.clear();
1620
+ neutral_list.clear();
1621
+ anion_list.clear();
1622
+ ion_list.clear();
1623
+ param_list.clear();
1624
+ OTEMP = -100.0;
1625
+ for (int j = 0; j < 3; j++)
1626
+ {
1627
+ int min, max;
1628
+ switch (j)
1629
+ {
1630
+ case 0:
1631
+ min = 0;
1632
+ max = sit_count_cations;
1633
+ break;
1634
+ case 1:
1635
+ min = (int)s.size();
1636
+ max = (int)s.size() + sit_count_neutrals;
1637
+ break;
1638
+ case 2:
1639
+ min = 2*(int)s.size();
1640
+ max = 2*(int)s.size() + sit_count_anions;
1641
+ break;
1642
+ }
1643
+ for (int i = min; i < max; i++)
1644
+ {
1645
+ sit_IPRSNT[i] = FALSE;
1646
+ sit_M[i] = 0.0;
1647
+ if (spec[i] != NULL && spec[i]->in == TRUE)
1648
+ {
1649
+ if (spec[i]->type == EX ||
1650
+ spec[i]->type == SURF || spec[i]->type == SURF_PSI)
1651
+ continue;
1652
+ sit_IPRSNT[i] = TRUE;
1653
+ s_list.push_back(i);
1654
+ if (i < (int)s.size())
1655
+ {
1656
+ cation_list.push_back(i);
1657
+ }
1658
+ if (i >= (int)s.size() && i < 2*(int)s.size())
1659
+ {
1660
+ neutral_list.push_back(i);
1661
+ }
1662
+ if (i >= 2*(int)s.size())
1663
+ {
1664
+ anion_list.push_back(i);
1665
+ }
1666
+ if (i < (int)s.size() || i >= 2*(int)s.size())
1667
+ {
1668
+ ion_list.push_back(i);
1669
+ }
1670
+ if (spec[i]->lm > log_min)
1671
+ {
1672
+ sit_M[i] = under(spec[i]->lm);
1673
+ }
1674
+ }
1675
+ }
1676
+ }
1677
+ for (int i = 0; i < (int)sit_params.size(); i++)
1678
+ {
1679
+ int i0 = sit_params[i]->ispec[0];
1680
+ int i1 = sit_params[i]->ispec[1];
1681
+ if (sit_IPRSNT[i0] == FALSE || sit_IPRSNT[i1] == FALSE) continue;
1682
+ param_list.push_back(i);
1683
+ }
1684
+ }