pyEQL 1.4.0rc9__cp310-cp310-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.
- pyEQL/__init__.py +50 -0
- pyEQL/_phreeqc.cpython-310-darwin.so +0 -0
- pyEQL/activity_correction.py +879 -0
- pyEQL/database/geothermal.dat +5693 -0
- pyEQL/database/llnl.dat +19305 -0
- pyEQL/database/phreeqc_license.txt +54 -0
- pyEQL/database/pyeql_db.json +35607 -0
- pyEQL/engines.py +1153 -0
- pyEQL/equilibrium.py +227 -0
- pyEQL/functions.py +281 -0
- pyEQL/phreeqc/__init__.py +5 -0
- pyEQL/phreeqc/bindings.cpp +84 -0
- pyEQL/phreeqc/core.py +239 -0
- pyEQL/phreeqc/database/Amm.dat +1968 -0
- pyEQL/phreeqc/database/CMakeLists.txt +32 -0
- pyEQL/phreeqc/database/ColdChem.dat +267 -0
- pyEQL/phreeqc/database/Concrete_PHR.dat +158 -0
- pyEQL/phreeqc/database/Concrete_PZ.dat +195 -0
- pyEQL/phreeqc/database/Kinec.v2.dat +12039 -0
- pyEQL/phreeqc/database/Kinec_v3.dat +12159 -0
- pyEQL/phreeqc/database/Makefile.am +28 -0
- pyEQL/phreeqc/database/Makefile.in +530 -0
- pyEQL/phreeqc/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
- pyEQL/phreeqc/database/Tipping_Hurley.dat +4137 -0
- pyEQL/phreeqc/database/__init__.py +0 -0
- pyEQL/phreeqc/database/core10.dat +6824 -0
- pyEQL/phreeqc/database/frezchem.dat +634 -0
- pyEQL/phreeqc/database/iso.dat +7235 -0
- pyEQL/phreeqc/database/llnl.dat +19310 -0
- pyEQL/phreeqc/database/minteq.dat +5654 -0
- pyEQL/phreeqc/database/minteq.v4.dat +13212 -0
- pyEQL/phreeqc/database/phreeqc.dat +1972 -0
- pyEQL/phreeqc/database/phreeqc_rates.dat +3158 -0
- pyEQL/phreeqc/database/pitzer.dat +1044 -0
- pyEQL/phreeqc/database/sit.dat +14348 -0
- pyEQL/phreeqc/database/wateq4f.dat +4036 -0
- pyEQL/phreeqc/ext/README.md +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/CMakeLists.txt +476 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/INSTALL +302 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqc.rc +61 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/IPhreeqcConfig.cmake.in +4 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.am +8 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/Makefile.in +816 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/aclocal.m4 +1217 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/CTestScript.cmake +167 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/CSelectedOutput.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqcLib.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/IPhreeqc_interface_F.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/Var.c.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Dictionary.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ExchComp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Exchange.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/GasComp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/GasPhase.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ISolution.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ISolutionComp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/KineticsComp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/NameDouble.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/NumKeyword.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PBasic.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PHRQ_io_output.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PPassemblage.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PPassemblageComp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Phreeqc.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Pressure.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Reaction.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/ReadClass.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SS.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SSassemblage.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SScomp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SelectedOutput.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Serializer.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Solution.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SolutionIsotope.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/StorageBin.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/StorageBinList.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Surface.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SurfaceCharge.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/SurfaceComp.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/System.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Temperature.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/Use.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/UserPunch.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/advection.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/basicsubs.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cl1.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/PHRQ_base.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/PHRQ_io.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/Parser.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/common/Utils.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cvdense.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cvode.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cxxKinetics.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/cxxMix.cxx.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/dense.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/dumper.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/gases.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/input.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/integrate.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/inverse.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/isotopes.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/kinetics.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/mainsubs.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/model.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/nvector.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/nvector_serial.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/parse.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/phqalloc.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/pitzer.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/pitzer_structures.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/prep.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/print.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/read.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/readtr.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/runner.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/sit.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/smalldense.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/spread.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/step.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/structures.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/sundialsmath.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/tally.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/tidy.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/transport.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CMakeFiles/IPhreeqc.dir/src/phreeqcpp/utilities.cpp.o +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/CTestTestfile.cmake +6 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/DartConfiguration.tcl +109 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/cmake_install.cmake +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/build/libIPhreeqc.a +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ar-lib +270 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/compile +347 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.guess +1441 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/config.sub +1813 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/depcomp +791 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/install-sh +508 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/ltmain.sh +11156 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/missing +215 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/config/test-driver +148 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure +23867 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/configure.ac +136 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Amm.dat +1968 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/CMakeLists.txt +32 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/ColdChem.dat +267 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PHR.dat +158 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Concrete_PZ.dat +195 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec.v2.dat +12039 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Kinec_v3.dat +12159 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.am +28 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Makefile.in +530 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/PHREEQC_ThermoddemV1.10_15Dec2020.dat +12965 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/Tipping_Hurley.dat +4137 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/core10.dat +6824 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/frezchem.dat +634 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/iso.dat +7235 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/llnl.dat +19310 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.dat +5654 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/minteq.v4.dat +13212 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc.dat +1972 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/phreeqc_rates.dat +3158 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/pitzer.dat +1044 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/sit.dat +14348 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/database/wateq4f.dat +4036 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/CMakeLists.txt +35 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/IPhreeqc.pdf +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.am +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Makefile.in +545 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/NOTICE +51 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_2_1999_manual.pdf +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/Phreeqc_3_2013_manual.pdf +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/README +428 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/RELEASE +7294 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h.html +5096 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8h_source.html +389 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp.html +83 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/IPhreeqc_8hpp_source.html +478 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h.html +318 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/Var_8h_source.html +200 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bc_s.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/bdwn.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.html +2274 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqc.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.html +69 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/classIPhreeqcStop.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/closed.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +68 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.css +1440 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/doxygen.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/dynsections.js +97 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2blank.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2doc.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderclosed.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2folderopen.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2lastnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2link.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mlastnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2mnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2node.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2plastnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2pnode.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2splitbar.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/ftv2vertline.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/index.html +58 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/jquery.js +31 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_f.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_g.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/nav_h.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/open.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/structVAR.html +143 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_off.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/sync_on.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_a.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_b.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_h.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tab_s.png +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/html/tabs.css +60 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/doc/phreeqc3.chm +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/CMakeLists.txt +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.am +88 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/Makefile.in +696 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/CMakeLists.txt +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt +35 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/CMakeLists.txt.in +21 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/README.txt +44 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/advect.c +101 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/ic +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/c/advect/phreeqc.dat +1579 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/CMakeLists.txt +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/README.txt +3 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/CMakeLists.txt +9 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/phreeqc.dat +1582 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/runphreeqc.xls +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/excel/withcallback.xls +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/CMakeLists.txt +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/Gypsum.py +52 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/parallel_advect.py +465 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/phreeqc.dat +1582 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/pitzer.dat +790 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/com/python/wateq4f.dat +3846 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/CMakeLists.txt +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt +35 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/CMakeLists.txt.in +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/README.txt +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/advect.cpp +110 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/ic +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/cpp/advect/phreeqc.dat +1579 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/CMakeLists.txt +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt +44 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/CMakeLists.txt.in +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/README.txt +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/advect.F90 +102 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/ic +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/fortran/advect/phreeqc.dat +1579 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt +26 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/CMakeLists.txt.in +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/README.txt +37 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/ex2 +26 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/main.cpp +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/phreeqc.dat +1837 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/examples/using-cmake/post-install.cmake.in +7 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/CMakeLists.txt +185 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.cpp +171 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/FileTest.h +34 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.am +18 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/Makefile.in +466 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestCVar.cpp +9 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqc.cpp +4901 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestIPhreeqcLib.cpp +4644 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestSelectedOutput.cpp +669 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/TestVar.cpp +10 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/conv_fail.in +11 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/dump +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/iso.dat +7231 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/kinn20140218 +349 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/missing_e.dat +1556 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch +105 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/multi_punch_no_set +102 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.90a6449 +1935 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/gtest/phreeqc.dat.old +1556 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/libtool.m4 +8388 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltoptions.m4 +437 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltsugar.m4 +124 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/ltversion.m4 +23 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/m4/lt~obsolete.m4 +99 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/resource.h +14 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.cpp +401 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CSelectedOutput.hxx +77 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/CVar.hxx +162 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Debug.h +12 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/ErrorReporter.hxx +70 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.cpp +1889 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f.inc +91 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.f90.inc +603 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.h +2182 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc.hpp +1027 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcCallbacks.h +19 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcF.f +653 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqcLib.cpp +1098 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface.F90 +1283 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.cpp +535 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/IPhreeqc_interface_F.h +162 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.am +210 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Makefile.in +1294 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/README.Fortran +17 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.c +84 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Var.h +152 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/Version.h +36 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fimpl.h +282 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.cpp +646 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap.h +163 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap1.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap2.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap3.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap4.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap5.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap6.cpp +25 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap7.cpp +25 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/fwrap8.cpp +24 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.cpp +225 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartHandler.h +59 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.cpp +1382 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ChartObject.h +444 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.cpp +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/CurveObject.h +79 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.cpp +41 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Dictionary.h +28 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.cxx +398 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ExchComp.h +117 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.cxx +466 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Exchange.h +74 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.h +1184 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Form1.resX +36 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.cxx +265 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasComp.h +59 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.cxx +659 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/GasPhase.h +103 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.cxx +40 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolution.h +53 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.cxx +202 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ISolutionComp.h +138 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.cxx +318 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/KineticsComp.h +81 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NA.h +1 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.cxx +537 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NameDouble.h +66 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.cxx +190 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/NumKeyword.h +67 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.cpp +8350 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PBasic.h +572 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PHRQ_io_output.cpp +411 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.cxx +375 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblage.h +70 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.cxx +441 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PPassemblageComp.h +83 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.cpp +2087 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Phreeqc.h +2164 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.cpp +242 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/PhreeqcKeywords/Keywords.h +104 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.cxx +417 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Pressure.h +43 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.cxx +284 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Reaction.h +57 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ReadClass.cxx +1150 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.cxx +609 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SS.h +128 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.cxx +317 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SSassemblage.h +59 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.cxx +297 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SScomp.h +66 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.cpp +115 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SelectedOutput.h +209 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.cxx +213 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Serializer.h +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.cxx +1795 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Solution.h +154 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.cxx +333 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SolutionIsotope.h +85 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.cxx +1507 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBin.h +141 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.cpp +358 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/StorageBinList.h +81 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.cxx +837 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Surface.h +108 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.cxx +617 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceCharge.h +137 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.cxx +509 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/SurfaceComp.h +70 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.cxx +103 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/System.h +89 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.cxx +423 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Temperature.h +42 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.cpp +78 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/Use.h +159 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.cpp +32 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/UserPunch.h +39 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/ZedGraph.dll +0 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/advection.cpp +140 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/basicsubs.cpp +4333 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cl1.cpp +881 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.cxx +117 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_base.h +48 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_exports.h +20 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.cpp +914 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/PHRQ_io.h +207 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.cxx +1331 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Parser.h +310 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.cxx +263 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/Utils.h +29 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/common/phrqtype.h +18 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.cpp +566 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvdense.h +267 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.cpp +3939 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cvode.h +940 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.cxx +617 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxKinetics.h +78 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.cxx +154 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/cxxMix.h +58 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.cpp +175 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dense.h +341 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.cpp +277 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/dumper.h +60 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/gases.cpp +748 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/global_structures.h +1672 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/input.cpp +133 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/integrate.cpp +1219 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/inverse.cpp +5135 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/isotopes.cpp +1813 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/kinetics.cpp +3180 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/mainsubs.cpp +2320 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/model.cpp +5843 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.cpp +272 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector.h +485 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.cpp +1032 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/nvector_serial.h +369 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/parse.cpp +1044 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.cpp +316 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/phqalloc.h +47 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer.cpp +2709 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/pitzer_structures.cpp +225 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/prep.cpp +6267 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/print.cpp +3673 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/read.cpp +10245 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/readtr.cpp +1495 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.cpp +158 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/runner.h +33 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sit.cpp +1684 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.cpp +324 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/smalldense.h +261 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/spread.cpp +1309 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/step.cpp +1566 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/structures.cpp +3381 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.cpp +133 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialsmath.h +162 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/sundialstypes.h +183 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tally.cpp +1288 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/tidy.cpp +5600 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/transport.cpp +6403 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/phreeqcpp/utilities.cpp +1339 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/src/thread.h +64 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/CMakeLists.txt +133 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.am +45 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/Makefile.in +1128 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/ex2.in +26 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main.f90 +31 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main77.f +6 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/main_fortran.cxx +8 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/phreeqc.dat.in +1556 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_c.c +148 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_cxx.cxx +152 -0
- pyEQL/phreeqc/ext/iphreeqc-3.8.6-17100/tests/test_f90.F90 +328 -0
- pyEQL/phreeqc/iphreeqc_wrapper.cpp +75 -0
- pyEQL/phreeqc/solution.py +74 -0
- pyEQL/phreeqc/var.py +50 -0
- pyEQL/presets/Ringers lactate.yaml +20 -0
- pyEQL/presets/__init__.py +17 -0
- pyEQL/presets/normal saline.yaml +17 -0
- pyEQL/presets/rainwater.yaml +17 -0
- pyEQL/presets/seawater.yaml +29 -0
- pyEQL/presets/urine.yaml +26 -0
- pyEQL/presets/wastewater.yaml +21 -0
- pyEQL/py.typed +0 -0
- pyEQL/salt_ion_match.py +112 -0
- pyEQL/solute.py +163 -0
- pyEQL/solution.py +2714 -0
- pyEQL/utils.py +237 -0
- pyeql-1.4.0rc9.dist-info/METADATA +130 -0
- pyeql-1.4.0rc9.dist-info/RECORD +491 -0
- pyeql-1.4.0rc9.dist-info/WHEEL +6 -0
- pyeql-1.4.0rc9.dist-info/licenses/AUTHORS.md +21 -0
- pyeql-1.4.0rc9.dist-info/licenses/LICENSE.txt +20 -0
|
@@ -0,0 +1,1219 @@
|
|
|
1
|
+
#include "Phreeqc.h"
|
|
2
|
+
#include "phqalloc.h"
|
|
3
|
+
#include "Utils.h"
|
|
4
|
+
#include "Solution.h"
|
|
5
|
+
|
|
6
|
+
#define MAX_QUAD 20
|
|
7
|
+
#define K_POLY 5
|
|
8
|
+
|
|
9
|
+
#if defined(PHREEQCI_GUI)
|
|
10
|
+
#ifdef _DEBUG
|
|
11
|
+
#define new DEBUG_NEW
|
|
12
|
+
#undef THIS_FILE
|
|
13
|
+
static char THIS_FILE[] = __FILE__;
|
|
14
|
+
#endif
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
/* ---------------------------------------------------------------------- */
|
|
18
|
+
int Phreeqc::
|
|
19
|
+
calc_all_g(void)
|
|
20
|
+
/* ---------------------------------------------------------------------- */
|
|
21
|
+
{
|
|
22
|
+
int converge, converge1;
|
|
23
|
+
LDBLE new_g, xd1;
|
|
24
|
+
LDBLE epsilon;
|
|
25
|
+
|
|
26
|
+
if (use.Get_surface_ptr() == NULL)
|
|
27
|
+
return (OK);
|
|
28
|
+
/*
|
|
29
|
+
* calculate g for each surface
|
|
30
|
+
*/
|
|
31
|
+
epsilon = convergence_tolerance;
|
|
32
|
+
if (convergence_tolerance >= 1e-8)
|
|
33
|
+
{
|
|
34
|
+
G_TOL = 1e-9;
|
|
35
|
+
}
|
|
36
|
+
else
|
|
37
|
+
{
|
|
38
|
+
G_TOL = 1e-10;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
converge = TRUE;
|
|
42
|
+
|
|
43
|
+
for (int j = 0; j < count_unknowns; j++)
|
|
44
|
+
{
|
|
45
|
+
if (x[j]->type != SURFACE_CB)
|
|
46
|
+
continue;
|
|
47
|
+
if (debug_diffuse_layer == TRUE)
|
|
48
|
+
output_msg(sformatf("Calc_all_g, X[%d]\n", j));
|
|
49
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[j]->surface_charge);
|
|
50
|
+
std::map<LDBLE, cxxSurfDL> temp_g_map;
|
|
51
|
+
cxxSurfDL temp_g;
|
|
52
|
+
charge_ptr->Get_g_map()[0] = temp_g;
|
|
53
|
+
temp_g_map[0] = temp_g;
|
|
54
|
+
xd_global = exp(-2 * x[j]->master[0]->s->la * LOG_10);
|
|
55
|
+
/* alpha = 0.02935 @ 25; (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
|
56
|
+
/* 1000 J/kJ and 1000 L/m**3 */
|
|
57
|
+
//alpha_global = sqrt(EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) * 1000.0 *
|
|
58
|
+
// tk_x * 0.5);
|
|
59
|
+
alpha_global = sqrt(eps_r * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) * 1000.0 *
|
|
60
|
+
tk_x * 0.5);
|
|
61
|
+
/*
|
|
62
|
+
* calculate g for given surface for each species
|
|
63
|
+
*/
|
|
64
|
+
for (int i = 0; i < (int)this->s_x.size(); i++)
|
|
65
|
+
{
|
|
66
|
+
if (s_x[i]->type > HPLUS)
|
|
67
|
+
continue;
|
|
68
|
+
if (temp_g_map.find(s_x[i]->z) != temp_g_map.end())
|
|
69
|
+
continue;
|
|
70
|
+
z_global = s_x[i]->z;
|
|
71
|
+
if (charge_ptr->Get_grams() > 0.0)
|
|
72
|
+
{
|
|
73
|
+
|
|
74
|
+
if ((use.Get_surface_ptr()->Get_only_counter_ions() == false) ||
|
|
75
|
+
(((x[j]->master[0]->s->la > 0) && (z_global < 0))
|
|
76
|
+
|| ((x[j]->master[0]->s->la < 0) && (z_global > 0))))
|
|
77
|
+
{
|
|
78
|
+
if (xd_global > 0.1)
|
|
79
|
+
{
|
|
80
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, xd_global);
|
|
81
|
+
}
|
|
82
|
+
else if (xd_global > 0.01)
|
|
83
|
+
{
|
|
84
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
85
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, xd_global);
|
|
86
|
+
}
|
|
87
|
+
else if (xd_global > 0.001)
|
|
88
|
+
{
|
|
89
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
90
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
91
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, xd_global);
|
|
92
|
+
}
|
|
93
|
+
else if (xd_global > 0.0001)
|
|
94
|
+
{
|
|
95
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
96
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
97
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, .001);
|
|
98
|
+
new_g += qromb_midpnt(charge_ptr, 0.001, xd_global);
|
|
99
|
+
}
|
|
100
|
+
else if (xd_global > 0.00001)
|
|
101
|
+
{
|
|
102
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
103
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
104
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, .001);
|
|
105
|
+
new_g += qromb_midpnt(charge_ptr, 0.001, .0001);
|
|
106
|
+
new_g += qromb_midpnt(charge_ptr, 0.0001, xd_global);
|
|
107
|
+
}
|
|
108
|
+
else if (xd_global > 0.000001)
|
|
109
|
+
{
|
|
110
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
111
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
112
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, .001);
|
|
113
|
+
new_g += qromb_midpnt(charge_ptr, 0.001, .0001);
|
|
114
|
+
new_g += qromb_midpnt(charge_ptr, 0.0001, .00001);
|
|
115
|
+
new_g += qromb_midpnt(charge_ptr, 0.00001, xd_global);
|
|
116
|
+
}
|
|
117
|
+
else if (xd_global > 0.0000001)
|
|
118
|
+
{
|
|
119
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
120
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
121
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, .001);
|
|
122
|
+
new_g += qromb_midpnt(charge_ptr, 0.001, .0001);
|
|
123
|
+
new_g += qromb_midpnt(charge_ptr, 0.0001, .00001);
|
|
124
|
+
new_g += qromb_midpnt(charge_ptr, 0.00001, .000001);
|
|
125
|
+
new_g += qromb_midpnt(charge_ptr, 0.000001, xd_global);
|
|
126
|
+
}
|
|
127
|
+
else if (xd_global > 0.00000001)
|
|
128
|
+
{
|
|
129
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
130
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
131
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, .001);
|
|
132
|
+
new_g += qromb_midpnt(charge_ptr, 0.001, .0001);
|
|
133
|
+
new_g += qromb_midpnt(charge_ptr, 0.0001, .00001);
|
|
134
|
+
new_g += qromb_midpnt(charge_ptr, 0.00001, .000001);
|
|
135
|
+
new_g += qromb_midpnt(charge_ptr, 0.000001, .0000001);
|
|
136
|
+
new_g += qromb_midpnt(charge_ptr, 0.0000001, xd_global);
|
|
137
|
+
}
|
|
138
|
+
else
|
|
139
|
+
{
|
|
140
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, 0.1);
|
|
141
|
+
new_g += qromb_midpnt(charge_ptr, 0.1, 0.01);
|
|
142
|
+
new_g += qromb_midpnt(charge_ptr, 0.01, .001);
|
|
143
|
+
new_g += qromb_midpnt(charge_ptr, 0.001, .0001);
|
|
144
|
+
new_g += qromb_midpnt(charge_ptr, 0.0001, .00001);
|
|
145
|
+
new_g += qromb_midpnt(charge_ptr, 0.00001, .000001);
|
|
146
|
+
new_g += qromb_midpnt(charge_ptr, 0.000001, .0000001);
|
|
147
|
+
new_g += qromb_midpnt(charge_ptr, 0.0000001, .00000001);
|
|
148
|
+
new_g += qromb_midpnt(charge_ptr, 0.00000001, xd_global);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
else
|
|
152
|
+
{
|
|
153
|
+
new_g = 0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
else
|
|
157
|
+
{
|
|
158
|
+
new_g = 0.0;
|
|
159
|
+
}
|
|
160
|
+
if ((use.Get_surface_ptr()->Get_only_counter_ions()) && new_g < 0)
|
|
161
|
+
new_g = 0;
|
|
162
|
+
converge1 = TRUE;
|
|
163
|
+
if (fabs(new_g) >= 1.)
|
|
164
|
+
{
|
|
165
|
+
if (fabs((new_g - charge_ptr->Get_g_map()[z_global].Get_g()) / new_g) > epsilon)
|
|
166
|
+
{
|
|
167
|
+
converge1 = FALSE;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else
|
|
171
|
+
{
|
|
172
|
+
if (fabs(new_g - charge_ptr->Get_g_map()[z_global].Get_g()) > epsilon)
|
|
173
|
+
{
|
|
174
|
+
converge1 = FALSE;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (converge1 == FALSE)
|
|
178
|
+
{
|
|
179
|
+
converge = FALSE;
|
|
180
|
+
if (debug_diffuse_layer == TRUE)
|
|
181
|
+
{
|
|
182
|
+
output_msg(sformatf(
|
|
183
|
+
"\t%12f\t%12.4e\t%12.4e\t%12.4e\n",
|
|
184
|
+
(double)z_global,
|
|
185
|
+
(double)charge_ptr->Get_g_map()[z_global].Get_g(),
|
|
186
|
+
(double)new_g,
|
|
187
|
+
(double)(new_g - charge_ptr->Get_g_map()[z_global].Get_g())));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
charge_ptr->Get_g_map()[z_global].Set_g(new_g);
|
|
191
|
+
if (new_g == 0)
|
|
192
|
+
{
|
|
193
|
+
charge_ptr->Get_g_map()[z_global].Set_dg(0.);
|
|
194
|
+
}
|
|
195
|
+
else
|
|
196
|
+
{
|
|
197
|
+
if (charge_ptr->Get_grams() > 0.0)
|
|
198
|
+
{
|
|
199
|
+
LDBLE dg = charge_ptr->Get_grams() *
|
|
200
|
+
charge_ptr->Get_specific_area() * alpha_global *
|
|
201
|
+
g_function(xd_global) / F_C_MOL;
|
|
202
|
+
dg *=
|
|
203
|
+
-2. / (exp(x[j]->master[0]->s->la * LOG_10) *
|
|
204
|
+
exp(x[j]->master[0]->s->la * LOG_10));
|
|
205
|
+
if ((xd_global - 1) < 0.0)
|
|
206
|
+
{
|
|
207
|
+
dg *= -1.0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (fabs(dg) < 1e-8)
|
|
211
|
+
{
|
|
212
|
+
xd1 = exp(-2 * 1e-3 * LOG_10);
|
|
213
|
+
new_g = qromb_midpnt(charge_ptr, 1.0, xd1);
|
|
214
|
+
dg = new_g / .001;
|
|
215
|
+
}
|
|
216
|
+
charge_ptr->Get_g_map()[z_global].Set_dg(dg);
|
|
217
|
+
}
|
|
218
|
+
else
|
|
219
|
+
{
|
|
220
|
+
charge_ptr->Get_g_map()[z_global].Set_dg(0.0);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
temp_g_map[z_global] = charge_ptr->Get_g_map()[z_global];
|
|
224
|
+
}
|
|
225
|
+
if (debug_diffuse_layer == TRUE)
|
|
226
|
+
{
|
|
227
|
+
output_msg(sformatf("\nSurface component %d: charge,\tg,\tdg/dlny,\txd\n",
|
|
228
|
+
(int)charge_ptr->Get_g_map().size()));
|
|
229
|
+
std::map<LDBLE, cxxSurfDL>::iterator it;
|
|
230
|
+
for (it = charge_ptr->Get_g_map().begin(); it != charge_ptr->Get_g_map().end(); it++)
|
|
231
|
+
{
|
|
232
|
+
output_msg(sformatf(
|
|
233
|
+
"\t%12f\t%12.4e\t%12.4e\t%12.4e\n",
|
|
234
|
+
(double)it->first,
|
|
235
|
+
(double)it->second.Get_g(),
|
|
236
|
+
(double)it->second.Get_dg(),
|
|
237
|
+
(double)xd_global));
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
return (converge);
|
|
242
|
+
}
|
|
243
|
+
/* ---------------------------------------------------------------------- */
|
|
244
|
+
LDBLE Phreeqc::
|
|
245
|
+
g_function(LDBLE x_value)
|
|
246
|
+
/* ---------------------------------------------------------------------- */
|
|
247
|
+
{
|
|
248
|
+
LDBLE sum, return_value, sum1;
|
|
249
|
+
int i;
|
|
250
|
+
LDBLE ln_x_value;
|
|
251
|
+
|
|
252
|
+
if (equal(x_value, 1.0, G_TOL * 100) == TRUE)
|
|
253
|
+
return (0.0);
|
|
254
|
+
sum = 0.0;
|
|
255
|
+
ln_x_value = log(x_value);
|
|
256
|
+
|
|
257
|
+
cxxSurfaceCharge *charge_ptr = &(use.Get_surface_ptr()->Get_surface_charges()[0]);
|
|
258
|
+
std::map<LDBLE, cxxSurfDL>::iterator it = charge_ptr->Get_g_map().begin();
|
|
259
|
+
for (; it != charge_ptr->Get_g_map().end(); it++)
|
|
260
|
+
{
|
|
261
|
+
it->second.Set_psi_to_z(exp(ln_x_value * it->first) - 1.0);
|
|
262
|
+
}
|
|
263
|
+
for (i = 0; i < (int)this->s_x.size(); i++)
|
|
264
|
+
{
|
|
265
|
+
if (s_x[i]->type < H2O && s_x[i]->z != 0.0)
|
|
266
|
+
{
|
|
267
|
+
sum += s_x[i]->moles * charge_ptr->Get_g_map()[s_x[i]->z].Get_psi_to_z();
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
if (sum < 0.0)
|
|
271
|
+
{
|
|
272
|
+
sum = 0.0;
|
|
273
|
+
sum1 = 0.0;
|
|
274
|
+
output_msg(sformatf(
|
|
275
|
+
"Species\tmoles\tX**z-1\tsum\tsum charge\n"));
|
|
276
|
+
for (i = 0; i < (int)this->s_x.size(); i++)
|
|
277
|
+
{
|
|
278
|
+
if (s_x[i]->type < H2O && s_x[i]->z != 0.0)
|
|
279
|
+
{
|
|
280
|
+
sum += s_x[i]->moles * (pow(x_value, s_x[i]->z) - 1.0);
|
|
281
|
+
sum1 += s_x[i]->moles * s_x[i]->z;
|
|
282
|
+
output_msg(sformatf("%s\t%e\t%e\t%e\t%e\n",
|
|
283
|
+
s_x[i]->name, (double)s_x[i]->moles,
|
|
284
|
+
(double)(pow((LDBLE)x_value, (LDBLE)s_x[i]->z) -
|
|
285
|
+
1.0), (double)sum, (double)sum1));
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
error_string = sformatf("Negative sum in g_function, %e\t%e.",
|
|
289
|
+
(double)sum, (double)x_value);
|
|
290
|
+
error_msg(error_string, CONTINUE);
|
|
291
|
+
error_string = sformatf(
|
|
292
|
+
"Solutions must be charge balanced, charge imbalance is %e\n",
|
|
293
|
+
(double)sum1);
|
|
294
|
+
error_msg(error_string, STOP);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return_value =
|
|
298
|
+
(exp(ln_x_value * z_global) -
|
|
299
|
+
1) / sqrt((x_value * x_value * mass_water_aq_x * sum));
|
|
300
|
+
return (return_value);
|
|
301
|
+
}
|
|
302
|
+
/* ---------------------------------------------------------------------- */
|
|
303
|
+
void Phreeqc::
|
|
304
|
+
polint(LDBLE * xa, LDBLE * ya, int n, LDBLE xv, LDBLE * yv, LDBLE * dy)
|
|
305
|
+
/* ---------------------------------------------------------------------- */
|
|
306
|
+
{
|
|
307
|
+
int i, m, ns;
|
|
308
|
+
LDBLE den, dif, dift, ho, hp, w;
|
|
309
|
+
|
|
310
|
+
ns = 1;
|
|
311
|
+
dif = fabs(xv - xa[1]);
|
|
312
|
+
/*
|
|
313
|
+
* Malloc work space
|
|
314
|
+
*/
|
|
315
|
+
std::vector<double> c, d;
|
|
316
|
+
c.resize((size_t)n + 1);
|
|
317
|
+
d.resize((size_t)n + 1);
|
|
318
|
+
|
|
319
|
+
for (i = 1; i <= n; i++)
|
|
320
|
+
{
|
|
321
|
+
dift = fabs(xv - xa[i]);
|
|
322
|
+
if (dift < dif)
|
|
323
|
+
{
|
|
324
|
+
ns = i;
|
|
325
|
+
dif = dift;
|
|
326
|
+
}
|
|
327
|
+
c[i] = ya[i];
|
|
328
|
+
d[i] = ya[i];
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
*yv = ya[ns--];
|
|
332
|
+
for (m = 1; m < n; m++)
|
|
333
|
+
{
|
|
334
|
+
for (size_t i = 1; i <= n - m; i++)
|
|
335
|
+
{
|
|
336
|
+
ho = xa[i] - xv;
|
|
337
|
+
hp = xa[i + m] - xv;
|
|
338
|
+
w = c[i + 1] - d[i];
|
|
339
|
+
if ((den = ho - hp) == 0.0)
|
|
340
|
+
{
|
|
341
|
+
error_msg("In subroutine polint.", STOP);
|
|
342
|
+
}
|
|
343
|
+
den = w / den;
|
|
344
|
+
d[i] = hp * den;
|
|
345
|
+
c[i] = ho * den;
|
|
346
|
+
}
|
|
347
|
+
if (2 * ns < (n - m))
|
|
348
|
+
{
|
|
349
|
+
*dy = c[(size_t)ns + 1];
|
|
350
|
+
}
|
|
351
|
+
else
|
|
352
|
+
{
|
|
353
|
+
*dy = d[ns--];
|
|
354
|
+
}
|
|
355
|
+
*yv += *dy;
|
|
356
|
+
|
|
357
|
+
/* *yv += (*dy = (2 * ns < (n-m) ? c[ns+1] : d[ns--])); */
|
|
358
|
+
}
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
/* ---------------------------------------------------------------------- */
|
|
363
|
+
LDBLE Phreeqc::
|
|
364
|
+
midpnt(LDBLE x1, LDBLE x2, int n)
|
|
365
|
+
/* ---------------------------------------------------------------------- */
|
|
366
|
+
{
|
|
367
|
+
LDBLE xv, tnm, sum, del, ddel;
|
|
368
|
+
int it, j;
|
|
369
|
+
|
|
370
|
+
if (n == 1)
|
|
371
|
+
{
|
|
372
|
+
midpoint_sv = (x2 - x1) * g_function(0.5 * (x1 + x2));
|
|
373
|
+
return (midpoint_sv);
|
|
374
|
+
}
|
|
375
|
+
else
|
|
376
|
+
{
|
|
377
|
+
for (it = 1, j = 1; j < n - 1; j++)
|
|
378
|
+
it *= 3;
|
|
379
|
+
tnm = (LDBLE)it;
|
|
380
|
+
del = (x2 - x1) / (3 * tnm);
|
|
381
|
+
ddel = del + del;
|
|
382
|
+
xv = x1 + 0.5 * del;
|
|
383
|
+
sum = 0.0;
|
|
384
|
+
for (j = 1; j <= it; j++)
|
|
385
|
+
{
|
|
386
|
+
#if defined(PHREEQCI_GUI)
|
|
387
|
+
PhreeqcIWait(this);
|
|
388
|
+
#endif
|
|
389
|
+
sum += g_function(xv);
|
|
390
|
+
xv += ddel;
|
|
391
|
+
sum += g_function(xv);
|
|
392
|
+
xv += del;
|
|
393
|
+
}
|
|
394
|
+
midpoint_sv = (midpoint_sv + (x2 - x1) * sum / tnm) / 3.0;
|
|
395
|
+
return midpoint_sv;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/* ---------------------------------------------------------------------- */
|
|
400
|
+
LDBLE Phreeqc::
|
|
401
|
+
qromb_midpnt(cxxSurfaceCharge *charge_ptr, LDBLE x1, LDBLE x2)
|
|
402
|
+
/* ---------------------------------------------------------------------- */
|
|
403
|
+
{
|
|
404
|
+
LDBLE ss, dss;
|
|
405
|
+
LDBLE sv[MAX_QUAD + 2], h[MAX_QUAD + 2];
|
|
406
|
+
int j;
|
|
407
|
+
|
|
408
|
+
h[0] = 1.0;
|
|
409
|
+
sv[0] = midpnt(x1, x2, 1);
|
|
410
|
+
for (j = 1; j < MAX_QUAD; j++)
|
|
411
|
+
{
|
|
412
|
+
sv[j] = midpnt(x1, x2, j + 1);
|
|
413
|
+
h[j] = h[j - 1] / 9.0;
|
|
414
|
+
|
|
415
|
+
if (fabs(sv[j] - sv[j - 1]) <= G_TOL * fabs(sv[j]))
|
|
416
|
+
{
|
|
417
|
+
sv[j] *= charge_ptr->Get_grams() * charge_ptr->Get_specific_area() * alpha_global / F_C_MOL; /* (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
|
418
|
+
if ((x2 - 1) < 0.0)
|
|
419
|
+
sv[j] *= -1.0;
|
|
420
|
+
if (debug_diffuse_layer == TRUE)
|
|
421
|
+
{
|
|
422
|
+
output_msg(sformatf(
|
|
423
|
+
"Iterations in qromb_midpnt: %d\n", j));
|
|
424
|
+
}
|
|
425
|
+
return (sv[j]);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
if (j >= K_POLY - 1)
|
|
429
|
+
{
|
|
430
|
+
polint(&h[j - K_POLY], &sv[j - K_POLY], K_POLY, 0.0, &ss, &dss);
|
|
431
|
+
if (fabs(dss) <= G_TOL * fabs(ss) || fabs(dss) < G_TOL)
|
|
432
|
+
{
|
|
433
|
+
ss *= charge_ptr->Get_grams() * charge_ptr->Get_specific_area() * alpha_global / F_C_MOL; /* (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
|
434
|
+
if ((x2 - 1) < 0.0)
|
|
435
|
+
ss *= -1.0;
|
|
436
|
+
if (debug_diffuse_layer == TRUE)
|
|
437
|
+
{
|
|
438
|
+
output_msg(sformatf(
|
|
439
|
+
"Iterations in qromb_midpnt: %d\n", j));
|
|
440
|
+
}
|
|
441
|
+
return (ss);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
}
|
|
446
|
+
error_string = sformatf(
|
|
447
|
+
"\nToo many iterations integrating diffuse layer.\n");
|
|
448
|
+
error_msg(error_string, STOP);
|
|
449
|
+
return (-999.9);
|
|
450
|
+
}
|
|
451
|
+
/* ---------------------------------------------------------------------- */
|
|
452
|
+
int Phreeqc::
|
|
453
|
+
calc_init_g(void)
|
|
454
|
+
/* ---------------------------------------------------------------------- */
|
|
455
|
+
{
|
|
456
|
+
if (use.Get_surface_ptr() == NULL)
|
|
457
|
+
return (OK);
|
|
458
|
+
/*
|
|
459
|
+
* calculate g for each surface
|
|
460
|
+
*/
|
|
461
|
+
for (int j = 0; j < count_unknowns; j++)
|
|
462
|
+
{
|
|
463
|
+
if (x[j]->type != SURFACE_CB)
|
|
464
|
+
continue;
|
|
465
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[j]->surface_charge);
|
|
466
|
+
xd_global = exp(-2 * x[j]->master[0]->s->la * LOG_10);
|
|
467
|
+
/* alpha = 0.02935 @ 25; (ee0RT/2)**1/2, (L/mol)**1/2 C / m**2 */
|
|
468
|
+
/* second 1000 is liters/m**3 */
|
|
469
|
+
//alpha_global = sqrt(EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) *
|
|
470
|
+
// 1000.0 * tk_x * 0.5);
|
|
471
|
+
alpha_global = sqrt(eps_r * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) *
|
|
472
|
+
1000.0 * tk_x * 0.5);
|
|
473
|
+
|
|
474
|
+
if (charge_ptr->Get_g_map().size() == 0)
|
|
475
|
+
{
|
|
476
|
+
cxxSurfDL temp_g;
|
|
477
|
+
charge_ptr->Get_g_map()[0.0] = temp_g;
|
|
478
|
+
}
|
|
479
|
+
/*
|
|
480
|
+
* calculate g for given surface for each species
|
|
481
|
+
*/
|
|
482
|
+
for (int i = 0; i < (int)this->s_x.size(); i++)
|
|
483
|
+
{
|
|
484
|
+
if (s_x[i]->type > HPLUS)
|
|
485
|
+
continue;
|
|
486
|
+
|
|
487
|
+
if (charge_ptr->Get_g_map().find(s_x[i]->z) == charge_ptr->Get_g_map().end())
|
|
488
|
+
{
|
|
489
|
+
cxxSurfDL temp_g;
|
|
490
|
+
/* save g for charge */
|
|
491
|
+
if (charge_ptr->Get_grams() > 0.0)
|
|
492
|
+
{
|
|
493
|
+
temp_g.Set_g(2 * alpha_global * sqrt(mu_x) * (pow(xd_global, s_x[i]->z / 2.0) - 1) *
|
|
494
|
+
charge_ptr->Get_grams() *
|
|
495
|
+
charge_ptr->Get_specific_area() / F_C_MOL);
|
|
496
|
+
temp_g.Set_dg(-s_x[i]->z);
|
|
497
|
+
if (use.Get_surface_ptr()->Get_only_counter_ions() &&
|
|
498
|
+
temp_g.Get_g() < 0)
|
|
499
|
+
{
|
|
500
|
+
temp_g.Set_g(0);
|
|
501
|
+
temp_g.Set_dg(0);
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
else
|
|
505
|
+
{
|
|
506
|
+
temp_g.Set_g(0);
|
|
507
|
+
temp_g.Set_dg(-s_x[i]->z);
|
|
508
|
+
}
|
|
509
|
+
charge_ptr->Get_g_map()[s_x[i]->z] = temp_g;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
{
|
|
513
|
+
int is = s_x[i]->number;
|
|
514
|
+
assert(is < (int)s_diff_layer.size());
|
|
515
|
+
// species found in diff_layer
|
|
516
|
+
s_diff_layer[is][charge_ptr->Get_name()].Set_g_moles(0);
|
|
517
|
+
s_diff_layer[is][charge_ptr->Get_name()].Set_dg_g_moles(0);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (debug_diffuse_layer == TRUE)
|
|
521
|
+
{
|
|
522
|
+
output_msg(sformatf(
|
|
523
|
+
"\nSurface component %d: charge,\tg,\tdg\n",
|
|
524
|
+
(int)charge_ptr->Get_g_map().size()));
|
|
525
|
+
std::map<LDBLE, cxxSurfDL>::iterator it;
|
|
526
|
+
for (it = charge_ptr->Get_g_map().begin(); it != charge_ptr->Get_g_map().end(); it++)
|
|
527
|
+
{
|
|
528
|
+
output_msg(sformatf("\t%12f\t%12.4e\t%12.4e\n",
|
|
529
|
+
(double)it->first,
|
|
530
|
+
(double)it->second.Get_g(),
|
|
531
|
+
(double)it->second.Get_dg()));
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return (OK);
|
|
536
|
+
}
|
|
537
|
+
/* ---------------------------------------------------------------------- */
|
|
538
|
+
int Phreeqc::
|
|
539
|
+
initial_surface_water(void)
|
|
540
|
+
/* ---------------------------------------------------------------------- */
|
|
541
|
+
{
|
|
542
|
+
/*
|
|
543
|
+
* In initial surface calculation, need to calculate
|
|
544
|
+
* mass of water in diffuse layer.
|
|
545
|
+
* diffuse layer water + aqueous solution water = bulk water.
|
|
546
|
+
* Ionic strength is fixed, so diffuse-layer water will not change
|
|
547
|
+
*/
|
|
548
|
+
LDBLE debye_length, b, r, rd, ddl_limit, rd_limit, fraction, sum_surfs, l_s;
|
|
549
|
+
LDBLE damp_aq;
|
|
550
|
+
/*
|
|
551
|
+
* Debye length = 1/k = sqrt[eta*eta_zero*R*T/(2*F**2*mu_x*1000)], Dzombak and Morel, p 36
|
|
552
|
+
*
|
|
553
|
+
* 1000 converts kJ to J; 1000 converts Liters to meter**3; debye_length is in meters.
|
|
554
|
+
*/
|
|
555
|
+
//debye_length = (EPSILON * EPSILON_ZERO * R_KJ_DEG_MOL * 1000.0 * tk_x)
|
|
556
|
+
// / (2. * F_C_MOL * F_C_MOL * mu_x * 1000.);
|
|
557
|
+
debye_length = (eps_r * EPSILON_ZERO * R_KJ_DEG_MOL * 1000.0 * tk_x)
|
|
558
|
+
/ (2. * F_C_MOL * F_C_MOL * mu_x * 1000.);
|
|
559
|
+
debye_length = sqrt(debye_length);
|
|
560
|
+
|
|
561
|
+
/* ddl is at most the fraction ddl_limit of bulk water */
|
|
562
|
+
ddl_limit = use.Get_surface_ptr()->Get_DDL_limit();
|
|
563
|
+
|
|
564
|
+
/*
|
|
565
|
+
* Loop through all surface components, calculate each H2O surface (diffuse layer),
|
|
566
|
+
* H2O aq, and H2O bulk (diffuse layers plus aqueous).
|
|
567
|
+
*/
|
|
568
|
+
|
|
569
|
+
if (use.Get_surface_ptr()->Get_debye_lengths() > 0)
|
|
570
|
+
{
|
|
571
|
+
sum_surfs = 0.0;
|
|
572
|
+
for (int i = 0; i < count_unknowns; i++)
|
|
573
|
+
{
|
|
574
|
+
if (x[i]->type != SURFACE_CB)
|
|
575
|
+
continue;
|
|
576
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[i]->surface_charge);
|
|
577
|
+
sum_surfs +=
|
|
578
|
+
charge_ptr->Get_specific_area() *
|
|
579
|
+
charge_ptr->Get_grams();
|
|
580
|
+
}
|
|
581
|
+
rd = debye_length * use.Get_surface_ptr()->Get_debye_lengths();
|
|
582
|
+
use.Get_surface_ptr()->Set_thickness(rd);
|
|
583
|
+
|
|
584
|
+
if (!sum_surfs)
|
|
585
|
+
{
|
|
586
|
+
for (int i = 0; i < count_unknowns; i++)
|
|
587
|
+
{
|
|
588
|
+
if (x[i]->type != SURFACE_CB)
|
|
589
|
+
continue;
|
|
590
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[i]->surface_charge);
|
|
591
|
+
charge_ptr->Set_mass_water(0);
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
else if (state == INITIAL_SURFACE)
|
|
595
|
+
{
|
|
596
|
+
/* distribute water over DDL (rd) and free pore (r - rd) */
|
|
597
|
+
/* find r: free pore (m3) = pi * (r - rd)^2 * L, where L = A / (2*pi*r),
|
|
598
|
+
A = sum_surfs = sum of the surface areas */
|
|
599
|
+
b = -2 * (rd + use.Get_solution_ptr()->Get_mass_water() / (1000 * sum_surfs));
|
|
600
|
+
r = 0.5 * (-b + sqrt(b * b - 4 * rd * rd));
|
|
601
|
+
/* DDL (m3) = pi * (r^2 - (r - rd)^2) * L */
|
|
602
|
+
rd_limit = (1 - sqrt(1 - ddl_limit)) * r;
|
|
603
|
+
/* rd should be smaller than r and the ddl limit */
|
|
604
|
+
if (rd > rd_limit)
|
|
605
|
+
{
|
|
606
|
+
mass_water_surfaces_x =
|
|
607
|
+
use.Get_solution_ptr()->Get_mass_water() * ddl_limit / (1 - ddl_limit);
|
|
608
|
+
r = 0.002 * (mass_water_surfaces_x +
|
|
609
|
+
use.Get_solution_ptr()->Get_mass_water()) / sum_surfs;
|
|
610
|
+
rd_limit = (1 - sqrt(1 - ddl_limit)) * r;
|
|
611
|
+
rd = rd_limit;
|
|
612
|
+
use.Get_surface_ptr()->Set_thickness(rd);
|
|
613
|
+
}
|
|
614
|
+
else
|
|
615
|
+
mass_water_surfaces_x =
|
|
616
|
+
(r * r / pow(r - rd, 2) - 1) * use.Get_solution_ptr()->Get_mass_water();
|
|
617
|
+
for (int i = 0; i < count_unknowns; i++)
|
|
618
|
+
{
|
|
619
|
+
if (x[i]->type != SURFACE_CB)
|
|
620
|
+
continue;
|
|
621
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[i]->surface_charge);
|
|
622
|
+
l_s = charge_ptr->Get_specific_area() * charge_ptr->Get_grams();
|
|
623
|
+
charge_ptr->Set_mass_water(mass_water_surfaces_x * l_s / sum_surfs);
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
else
|
|
627
|
+
{
|
|
628
|
+
r = 0.002 * mass_water_bulk_x / sum_surfs;
|
|
629
|
+
rd_limit = (1 - sqrt(1 - ddl_limit)) * r;
|
|
630
|
+
if (rd > rd_limit)
|
|
631
|
+
{
|
|
632
|
+
rd = rd_limit;
|
|
633
|
+
use.Get_surface_ptr()->Set_thickness(rd);
|
|
634
|
+
fraction = ddl_limit;
|
|
635
|
+
}
|
|
636
|
+
else
|
|
637
|
+
fraction = 1 - pow(r - rd, 2) / (r * r);
|
|
638
|
+
damp_aq = 1.0;
|
|
639
|
+
if (g_iterations > 10)
|
|
640
|
+
damp_aq = 0.2;
|
|
641
|
+
else if (g_iterations > 5)
|
|
642
|
+
damp_aq = 0.5;
|
|
643
|
+
mass_water_surfaces_x = damp_aq * fraction * mass_water_bulk_x +
|
|
644
|
+
(1 - damp_aq) * mass_water_surfaces_x;
|
|
645
|
+
for (int i = 0; i < count_unknowns; i++)
|
|
646
|
+
{
|
|
647
|
+
if (x[i]->type != SURFACE_CB)
|
|
648
|
+
continue;
|
|
649
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[i]->surface_charge);
|
|
650
|
+
l_s = charge_ptr->Get_specific_area() *
|
|
651
|
+
charge_ptr->Get_grams();
|
|
652
|
+
charge_ptr->Set_mass_water(mass_water_surfaces_x * l_s / sum_surfs);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
else
|
|
657
|
+
{
|
|
658
|
+
/* take constant thickness of, default 1e-8 m (100 Angstroms) */
|
|
659
|
+
mass_water_surfaces_x = 0.0;
|
|
660
|
+
for (int i = 0; i < count_unknowns; i++)
|
|
661
|
+
{
|
|
662
|
+
if (x[i]->type != SURFACE_CB)
|
|
663
|
+
continue;
|
|
664
|
+
cxxSurfaceCharge *charge_ptr = use.Get_surface_ptr()->Find_charge(x[i]->surface_charge);
|
|
665
|
+
charge_ptr->Set_mass_water(charge_ptr->Get_specific_area() *
|
|
666
|
+
charge_ptr->Get_grams() * use.Get_surface_ptr()->Get_thickness() *
|
|
667
|
+
1000);
|
|
668
|
+
mass_water_surfaces_x += charge_ptr->Get_mass_water();
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
if (use.Get_surface_ptr()->Get_type() == cxxSurface::CD_MUSIC)
|
|
673
|
+
mass_water_bulk_x = mass_water_aq_x + mass_water_surfaces_x;
|
|
674
|
+
else
|
|
675
|
+
{
|
|
676
|
+
/* for variable distribution of water over DDL and bulk... */
|
|
677
|
+
if (state > INITIAL_SURFACE)
|
|
678
|
+
mass_water_aq_x = mass_water_bulk_x - mass_water_surfaces_x;
|
|
679
|
+
else
|
|
680
|
+
mass_water_bulk_x = mass_water_aq_x + mass_water_surfaces_x;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
return (OK);
|
|
684
|
+
}
|
|
685
|
+
/* ---------------------------------------------------------------------- */
|
|
686
|
+
int Phreeqc::
|
|
687
|
+
sum_diffuse_layer(cxxSurfaceCharge *charge_ptr)
|
|
688
|
+
/* ---------------------------------------------------------------------- */
|
|
689
|
+
{
|
|
690
|
+
LDBLE mass_water_surface;
|
|
691
|
+
LDBLE molality, moles_excess, moles_surface;
|
|
692
|
+
|
|
693
|
+
if (use.Get_surface_ptr() == NULL)
|
|
694
|
+
return (OK);
|
|
695
|
+
/*
|
|
696
|
+
* Find position of component in list of components
|
|
697
|
+
*/
|
|
698
|
+
|
|
699
|
+
/*
|
|
700
|
+
* Loop through all surface components, calculate each H2O surface (diffuse layer),
|
|
701
|
+
* H2O aq, and H2O bulk (diffuse layers plus aqueous).
|
|
702
|
+
*/
|
|
703
|
+
count_elts = 0;
|
|
704
|
+
paren_count = 0;
|
|
705
|
+
mass_water_surface = charge_ptr->Get_mass_water();
|
|
706
|
+
for (int j = 0; j < (int)this->s_x.size(); j++)
|
|
707
|
+
{
|
|
708
|
+
if (s_x[j]->type > HPLUS)
|
|
709
|
+
continue;
|
|
710
|
+
molality = under(s_x[j]->lm);
|
|
711
|
+
LDBLE g = charge_ptr->Get_g_map()[s_x[j]->z].Get_g();
|
|
712
|
+
if (s_x[j]->erm_ddl != 1)
|
|
713
|
+
{
|
|
714
|
+
LDBLE ratio_aq = mass_water_surface / mass_water_aq_x;
|
|
715
|
+
LDBLE g2 = g / ratio_aq + 1;
|
|
716
|
+
g = ratio_aq * (g2 * s_x[j]->erm_ddl - 1);
|
|
717
|
+
}
|
|
718
|
+
moles_excess = mass_water_aq_x * molality * g;
|
|
719
|
+
moles_surface = mass_water_surface * molality + moles_excess;
|
|
720
|
+
/*
|
|
721
|
+
* Accumulate elements in diffuse layer
|
|
722
|
+
*/
|
|
723
|
+
add_elt_list(s_x[j]->next_elt, moles_surface);
|
|
724
|
+
}
|
|
725
|
+
add_elt_list(s_h2o->next_elt, mass_water_surface / gfw_water);
|
|
726
|
+
elt_list_combine();
|
|
727
|
+
return (OK);
|
|
728
|
+
}
|
|
729
|
+
/* ---------------------------------------------------------------------- */
|
|
730
|
+
int Phreeqc::
|
|
731
|
+
calc_all_donnan(void)
|
|
732
|
+
/* ---------------------------------------------------------------------- */
|
|
733
|
+
{
|
|
734
|
+
bool converge;
|
|
735
|
+
int cd_m;
|
|
736
|
+
LDBLE new_g, f_psi, surf_chrg_eq, psi_avg, f_sinh, A_surf, ratio_aq, ratio_surf_aq, co_ion;
|
|
737
|
+
LDBLE new_g2, f_psi2, surf_chrg_eq2, psi_avg2, dif, var1, viscos;
|
|
738
|
+
cxxSurface *surf_ptr = use.Get_surface_ptr();
|
|
739
|
+
|
|
740
|
+
if (surf_ptr == NULL)
|
|
741
|
+
return (OK);
|
|
742
|
+
f_sinh = sqrt(8000.0 * eps_r * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) *
|
|
743
|
+
tk_x * mu_x);
|
|
744
|
+
bool only_count = surf_ptr->Get_only_counter_ions();
|
|
745
|
+
bool correct_D = surf_ptr->Get_correct_D();
|
|
746
|
+
/* calculate g for each surface...
|
|
747
|
+
*/
|
|
748
|
+
if (!calculating_deriv || surf_ptr->Get_debye_lengths() ||
|
|
749
|
+
correct_D) // DL_pitz && correct_D
|
|
750
|
+
initial_surface_water();
|
|
751
|
+
// z1, z2, fr_cat2 are the counter-ions, z_1, z_2, fr_ani2 are for co-ions.
|
|
752
|
+
LDBLE nDbl = 1, db_lim = 2, f_free, fr_cat2, fr_ani2;
|
|
753
|
+
LDBLE z1, z2, z_1, z_2;
|
|
754
|
+
z1 = z2 = z_1 = z_2 = f_free = fr_cat2 = fr_ani2 = 0;
|
|
755
|
+
/*
|
|
756
|
+
* sum eq of each charge number in solution...
|
|
757
|
+
*/
|
|
758
|
+
std::map<LDBLE, LDBLE>::iterator it;
|
|
759
|
+
for (it = charge_group_map.begin(); it != charge_group_map.end(); it++)
|
|
760
|
+
{
|
|
761
|
+
it->second = 0.0;
|
|
762
|
+
}
|
|
763
|
+
charge_group_map.clear();
|
|
764
|
+
for (int i = 0; i < (int)this->s_x.size(); i++)
|
|
765
|
+
{
|
|
766
|
+
if (s_x[i]->type > HPLUS)
|
|
767
|
+
continue;
|
|
768
|
+
charge_group_map[s_x[i]->z] += s_x[i]->z * s_x[i]->moles * s_x[i]->erm_ddl;
|
|
769
|
+
}
|
|
770
|
+
for (it = charge_group_map.begin(); it != charge_group_map.end(); it++)
|
|
771
|
+
{
|
|
772
|
+
if (it->first < -1.5) { z_2 += it->second; continue; }
|
|
773
|
+
else if (it->first < 0) { z_1 += it->second; continue; }
|
|
774
|
+
else if (it->first < 1.5) { z1 += it->second; continue; }
|
|
775
|
+
else { z2 += it->second; continue; }
|
|
776
|
+
}
|
|
777
|
+
if (correct_D)
|
|
778
|
+
{
|
|
779
|
+
if ((nDbl = surf_ptr->Get_debye_lengths()) == 0)
|
|
780
|
+
{
|
|
781
|
+
LDBLE debye_length = f_sinh / (F_C_MOL * mu_x * 4e3);
|
|
782
|
+
nDbl = surf_ptr->Get_thickness() / debye_length;
|
|
783
|
+
}
|
|
784
|
+
fr_ani2 = z_2 / (z_1 + z_2);
|
|
785
|
+
fr_cat2 = z2 / (z1 + z2);
|
|
786
|
+
db_lim = 2 - 0.5 * (fr_cat2 + fr_ani2);
|
|
787
|
+
if (nDbl > db_lim)
|
|
788
|
+
{
|
|
789
|
+
f_free = 1 - db_lim / nDbl;
|
|
790
|
+
if (f_free < 0) f_free = 0;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
converge = TRUE;
|
|
795
|
+
viscos = 0;
|
|
796
|
+
for (int j = 0; j < count_unknowns; j++)
|
|
797
|
+
{
|
|
798
|
+
if (x[j]->type != SURFACE_CB)
|
|
799
|
+
continue;
|
|
800
|
+
cxxSurfaceCharge *charge_ptr = surf_ptr->Find_charge(x[j]->surface_charge);
|
|
801
|
+
|
|
802
|
+
if (debug_diffuse_layer == TRUE)
|
|
803
|
+
output_msg(sformatf("Calc_all_g, X[%d]\n", j));
|
|
804
|
+
|
|
805
|
+
/* find surface charge from potential... */
|
|
806
|
+
A_surf = charge_ptr->Get_specific_area() * charge_ptr->Get_grams();
|
|
807
|
+
if (surf_ptr->Get_type() == cxxSurface::CD_MUSIC)
|
|
808
|
+
{
|
|
809
|
+
f_psi = x[(size_t)j + 2]->master[0]->s->la * LOG_10; /* -FPsi/RT */
|
|
810
|
+
f_psi = f_psi / 2;
|
|
811
|
+
cd_m = 1;
|
|
812
|
+
}
|
|
813
|
+
else
|
|
814
|
+
{
|
|
815
|
+
f_psi = x[j]->master[0]->s->la * LOG_10;
|
|
816
|
+
cd_m = -1;
|
|
817
|
+
}
|
|
818
|
+
surf_chrg_eq = A_surf * f_sinh * sinh(f_psi) / F_C_MOL;
|
|
819
|
+
LDBLE lim_seq = 5e3;
|
|
820
|
+
if (correct_D) lim_seq = 5e3;
|
|
821
|
+
if (fabs(surf_chrg_eq) > lim_seq)
|
|
822
|
+
{
|
|
823
|
+
surf_chrg_eq = (surf_chrg_eq < 0 ? -lim_seq : lim_seq);
|
|
824
|
+
var1 = surf_chrg_eq / (A_surf * f_sinh / F_C_MOL);
|
|
825
|
+
var1 = (var1 + sqrt(var1 * var1 + 1));
|
|
826
|
+
f_psi = (var1 > 1e-8 ? log(var1) : -18.4);
|
|
827
|
+
surf_chrg_eq = A_surf * f_sinh * sinh(f_psi) / F_C_MOL;
|
|
828
|
+
x[j]->master[0]->s->la = f_psi / LOG_10;
|
|
829
|
+
}
|
|
830
|
+
/* also for the derivative... */
|
|
831
|
+
dif = 1e-5;
|
|
832
|
+
f_psi2 = f_psi + dif;
|
|
833
|
+
surf_chrg_eq2 = A_surf * f_sinh * sinh(f_psi2) / F_C_MOL;
|
|
834
|
+
|
|
835
|
+
/* find psi_avg that matches surface charge... */
|
|
836
|
+
std::vector<LDBLE> zcorr(charge_group_map.size());
|
|
837
|
+
std::vector<LDBLE> zcorr2(charge_group_map.size());
|
|
838
|
+
//LDBLE fD = 0;
|
|
839
|
+
psi_avg = calc_psi_avg(charge_ptr, surf_chrg_eq, nDbl, f_free, zcorr);
|
|
840
|
+
psi_avg2 = calc_psi_avg(charge_ptr, surf_chrg_eq2, nDbl, f_free, zcorr2);
|
|
841
|
+
|
|
842
|
+
/*output_msg(sformatf( "psi's %e %e %e\n", f_psi, psi_avg, surf_chrg_eq)); */
|
|
843
|
+
|
|
844
|
+
/* fill in g's */
|
|
845
|
+
ratio_aq = charge_ptr->Get_mass_water() / mass_water_aq_x;
|
|
846
|
+
ratio_surf_aq = charge_ptr->Get_mass_water() / mass_water_surfaces_x;
|
|
847
|
+
//ratio_surf_aq = charge_ptr->Get_mass_water() / mass_water_bulk_x;
|
|
848
|
+
if (correct_D)
|
|
849
|
+
ratio_aq *= (1 - f_free);
|
|
850
|
+
int z_iter = 0;
|
|
851
|
+
for (it = charge_group_map.begin(); it != charge_group_map.end(); it++)
|
|
852
|
+
{
|
|
853
|
+
LDBLE z = it->first, z1 = z;
|
|
854
|
+
co_ion = surf_chrg_eq * z;
|
|
855
|
+
if (correct_D)
|
|
856
|
+
z1 = zcorr[z_iter];
|
|
857
|
+
|
|
858
|
+
if (!ratio_aq)
|
|
859
|
+
{
|
|
860
|
+
charge_ptr->Get_g_map()[z].Set_g(0);
|
|
861
|
+
charge_ptr->Get_g_map()[z].Set_dg(0);
|
|
862
|
+
charge_ptr->Get_z_gMCD_map()[z] = 0;
|
|
863
|
+
converge = true;
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
new_g = ratio_aq * (exp(cd_m * z1 * psi_avg) - 1);
|
|
867
|
+
if (only_count && co_ion > 0)
|
|
868
|
+
new_g = -ratio_aq;
|
|
869
|
+
if (new_g <= -ratio_aq)
|
|
870
|
+
new_g = -ratio_aq + G_TOL * 1e-3;
|
|
871
|
+
new_g2 = ratio_aq * (exp(cd_m * z1 * psi_avg2) - 1);
|
|
872
|
+
if (only_count && co_ion > 0)
|
|
873
|
+
new_g2 = -ratio_aq;
|
|
874
|
+
if (new_g2 <= -ratio_aq)
|
|
875
|
+
new_g2 = -ratio_aq + G_TOL * 1e-3;
|
|
876
|
+
if (fabs(new_g) >= 1)
|
|
877
|
+
{
|
|
878
|
+
if (fabs((new_g - charge_ptr->Get_g_map()[z].Get_g()) / new_g) > convergence_tolerance)
|
|
879
|
+
{
|
|
880
|
+
converge = FALSE;
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
else
|
|
884
|
+
{
|
|
885
|
+
if (fabs(new_g - charge_ptr->Get_g_map()[z].Get_g()) > convergence_tolerance)
|
|
886
|
+
{
|
|
887
|
+
converge = FALSE;
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
charge_ptr->Get_g_map()[z].Set_g(new_g);
|
|
891
|
+
if (new_g != 0)
|
|
892
|
+
{
|
|
893
|
+
charge_ptr->Get_g_map()[z].Set_dg((new_g2 - new_g) / dif);
|
|
894
|
+
}
|
|
895
|
+
else
|
|
896
|
+
{
|
|
897
|
+
charge_ptr->Get_g_map()[z].Set_dg(-z);
|
|
898
|
+
}
|
|
899
|
+
/* save Boltzmann factor * water fraction for MCD calc's in transport */
|
|
900
|
+
if (converge)
|
|
901
|
+
{
|
|
902
|
+
if (only_count && co_ion > 0) // co-ions are not in the DL
|
|
903
|
+
charge_ptr->Get_z_gMCD_map()[z] = 0;
|
|
904
|
+
else
|
|
905
|
+
{
|
|
906
|
+
charge_ptr->Get_z_gMCD_map()[z] = (exp(cd_m * z1 * psi_avg) * (1 - f_free) + f_free) *
|
|
907
|
+
ratio_surf_aq;// * s_x[]->moles == mol_DL in charge_ptr
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
z_iter++;
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
charge_ptr->Set_f_free(f_free);
|
|
914
|
+
if (debug_diffuse_layer == TRUE)
|
|
915
|
+
{
|
|
916
|
+
std::string name = x[j]->master[0]->elt->name;
|
|
917
|
+
Utilities::replace("_psi", "", name);
|
|
918
|
+
output_msg(sformatf(
|
|
919
|
+
"\nDonnan all on %s (%d): charge, \tg, \tdg, \tzcorr, \tPsi_surface = %8f V, \tDebye lengths = %8f. \n",
|
|
920
|
+
name.c_str(), (int)charge_ptr->Get_g_map().size(),
|
|
921
|
+
x[j]->master[0]->s->la * 2 * LOG_10 * R_KJ_DEG_MOL * tk_x / F_KJ_V_EQ,
|
|
922
|
+
nDbl));
|
|
923
|
+
int i = 0;
|
|
924
|
+
for (std::map<LDBLE, cxxSurfDL>::iterator i_it = charge_ptr->Get_g_map().begin();
|
|
925
|
+
i_it != charge_ptr->Get_g_map().end(); i_it++)
|
|
926
|
+
{
|
|
927
|
+
output_msg(sformatf("\t%12f\t%12.4e\t%12.4e\t%12.4e\n",
|
|
928
|
+
(double)i_it->first,
|
|
929
|
+
(double)i_it->second.Get_g(),
|
|
930
|
+
(double)i_it->second.Get_dg(),
|
|
931
|
+
(double)zcorr[i]));
|
|
932
|
+
i++;
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
}
|
|
936
|
+
return (converge);
|
|
937
|
+
}
|
|
938
|
+
/* ---------------------------------------------------------------------- */
|
|
939
|
+
int Phreeqc::
|
|
940
|
+
calc_init_donnan(void)
|
|
941
|
+
/* ---------------------------------------------------------------------- */
|
|
942
|
+
{
|
|
943
|
+
LDBLE f_psi, surf_chrg_eq, psi_avg, f_sinh, A_surf, ratio_aq;
|
|
944
|
+
cxxSurface *surf_ptr = use.Get_surface_ptr();
|
|
945
|
+
|
|
946
|
+
if (surf_ptr == NULL)
|
|
947
|
+
return (OK);
|
|
948
|
+
f_sinh =
|
|
949
|
+
//sqrt(8000.0 * EPSILON * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) *
|
|
950
|
+
// tk_x * mu_x);
|
|
951
|
+
sqrt(8000.0 * eps_r * EPSILON_ZERO * (R_KJ_DEG_MOL * 1000.0) *
|
|
952
|
+
tk_x * mu_x);
|
|
953
|
+
if (convergence_tolerance >= 1e-8)
|
|
954
|
+
{
|
|
955
|
+
G_TOL = 1e-9;
|
|
956
|
+
}
|
|
957
|
+
else
|
|
958
|
+
{
|
|
959
|
+
G_TOL = 1e-13;
|
|
960
|
+
}
|
|
961
|
+
/*
|
|
962
|
+
* sum eq of each charge number in solution...
|
|
963
|
+
*/
|
|
964
|
+
charge_group_map.clear();
|
|
965
|
+
charge_group_map[0.0] = 0.0;
|
|
966
|
+
|
|
967
|
+
for (int i = 0; i < (int)this->s_x.size(); i++)
|
|
968
|
+
{
|
|
969
|
+
if (s_x[i]->type > HPLUS)
|
|
970
|
+
continue;
|
|
971
|
+
if (charge_group_map.find(s_x[i]->z) != charge_group_map.end())
|
|
972
|
+
{
|
|
973
|
+
charge_group_map.find(s_x[i]->z)->second += s_x[i]->z * s_x[i]->moles * s_x[i]->erm_ddl;
|
|
974
|
+
}
|
|
975
|
+
else
|
|
976
|
+
{
|
|
977
|
+
charge_group_map[s_x[i]->z] = s_x[i]->z * s_x[i]->moles * s_x[i]->erm_ddl;
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
std::vector<LDBLE> zcorr(charge_group_map.size());
|
|
981
|
+
/*
|
|
982
|
+
* calculate g for each surface...
|
|
983
|
+
*/
|
|
984
|
+
for (int j = 0; j < count_unknowns; j++)
|
|
985
|
+
{
|
|
986
|
+
if (x[j]->type != SURFACE_CB)
|
|
987
|
+
continue;
|
|
988
|
+
cxxSurfaceCharge *charge_ptr = surf_ptr->Find_charge(x[j]->surface_charge);
|
|
989
|
+
charge_ptr->Get_g_map().clear();
|
|
990
|
+
|
|
991
|
+
/* find surface charge from potential... */
|
|
992
|
+
A_surf = charge_ptr->Get_specific_area() * charge_ptr->Get_grams();
|
|
993
|
+
if (surf_ptr->Get_type() == cxxSurface::CD_MUSIC)
|
|
994
|
+
{
|
|
995
|
+
f_psi = x[(size_t)j + 2]->master[0]->s->la * LOG_10; /* -FPsi/RT */
|
|
996
|
+
f_psi = f_psi / 2;
|
|
997
|
+
}
|
|
998
|
+
else
|
|
999
|
+
f_psi = x[j]->master[0]->s->la * LOG_10;
|
|
1000
|
+
surf_chrg_eq = A_surf * f_sinh * sinh(f_psi) / F_C_MOL;
|
|
1001
|
+
|
|
1002
|
+
/* find psi_avg that matches surface charge... */
|
|
1003
|
+
psi_avg = calc_psi_avg(charge_ptr, 0 * surf_chrg_eq, 0, 0, zcorr);
|
|
1004
|
+
|
|
1005
|
+
/* fill in g's */
|
|
1006
|
+
ratio_aq = charge_ptr->Get_mass_water() / mass_water_aq_x;
|
|
1007
|
+
|
|
1008
|
+
std::map<LDBLE, LDBLE>::iterator kit;
|
|
1009
|
+
for (kit = charge_group_map.begin(); kit != charge_group_map.end(); kit++)
|
|
1010
|
+
{
|
|
1011
|
+
LDBLE z = kit->first;
|
|
1012
|
+
LDBLE eq = kit->second;
|
|
1013
|
+
|
|
1014
|
+
charge_ptr->Get_g_map()[z].Set_g(ratio_aq * (exp(-z * psi_avg) - 1));
|
|
1015
|
+
|
|
1016
|
+
if (surf_ptr->Get_only_counter_ions()
|
|
1017
|
+
&& ((surf_chrg_eq < 0 && z < 0)
|
|
1018
|
+
|| (surf_chrg_eq > 0 && z > 0)))
|
|
1019
|
+
charge_ptr->Get_g_map()[z].Set_g(-ratio_aq);
|
|
1020
|
+
|
|
1021
|
+
if (charge_ptr->Get_g_map()[z].Get_g() != 0)
|
|
1022
|
+
{
|
|
1023
|
+
charge_ptr->Get_g_map()[z].Set_dg(-A_surf * f_sinh * cosh(f_psi) /
|
|
1024
|
+
(eq * F_C_MOL));
|
|
1025
|
+
}
|
|
1026
|
+
else
|
|
1027
|
+
{
|
|
1028
|
+
charge_ptr->Get_g_map()[z].Set_dg(-z);
|
|
1029
|
+
}
|
|
1030
|
+
/* save g for species */
|
|
1031
|
+
for (int i = 0; i < (int)this->s_x.size(); i++)
|
|
1032
|
+
{
|
|
1033
|
+
int is = s_x[i]->number;
|
|
1034
|
+
assert(is < (int)s_diff_layer.size());
|
|
1035
|
+
|
|
1036
|
+
s_diff_layer[is][charge_ptr->Get_name()].Set_g_moles(0.0);
|
|
1037
|
+
s_diff_layer[is][charge_ptr->Get_name()].Set_dg_g_moles(0.0);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (debug_diffuse_layer == TRUE)
|
|
1041
|
+
{
|
|
1042
|
+
std::string name = x[j]->master[0]->elt->name;
|
|
1043
|
+
Utilities::replace("_psi", "", name);
|
|
1044
|
+
output_msg(sformatf(
|
|
1045
|
+
"\nDonnan init on %s : charge, \tg, \tdg, \tzcorr, Psi_surface = %8f V. \n",
|
|
1046
|
+
name.c_str(),
|
|
1047
|
+
x[j]->master[0]->s->la * 2 * LOG_10 * R_KJ_DEG_MOL *
|
|
1048
|
+
tk_x / F_KJ_V_EQ));
|
|
1049
|
+
for (std::map<LDBLE, cxxSurfDL>::iterator i_it = charge_ptr->Get_g_map().begin();
|
|
1050
|
+
i_it != charge_ptr->Get_g_map().end(); i_it++)
|
|
1051
|
+
{
|
|
1052
|
+
output_msg(sformatf("\t%12f\t%12.4e\t%12.4e\t%12.4e\n",
|
|
1053
|
+
(double)i_it->first,
|
|
1054
|
+
(double)i_it->second.Get_g(),
|
|
1055
|
+
(double)i_it->second.Get_dg()));
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
}
|
|
1059
|
+
return (OK);
|
|
1060
|
+
}
|
|
1061
|
+
/* ---------------------------------------------------------------------- */
|
|
1062
|
+
LDBLE Phreeqc::
|
|
1063
|
+
calc_psi_avg(cxxSurfaceCharge *charge_ptr, LDBLE surf_chrg_eq, LDBLE nDbl, LDBLE f_free, std::vector<LDBLE> &zcorr)
|
|
1064
|
+
/* ---------------------------------------------------------------------- */
|
|
1065
|
+
{
|
|
1066
|
+
/*
|
|
1067
|
+
* calculate the average (F * Psi / RT) that lets the DL charge counter the surface charge
|
|
1068
|
+
*/
|
|
1069
|
+
LDBLE fd, fd1, p, /*psi_DL, */p_psi = R_KJ_DEG_MOL * tk_x / F_KJ_V_EQ, temp, ratio_aq, z, Z1, Z1_c, eq, co_ion, sum_counter, sum_co;
|
|
1070
|
+
LDBLE z1, z2, z_1, z_2;
|
|
1071
|
+
ratio_aq = charge_ptr->Get_mass_water() / mass_water_aq_x;
|
|
1072
|
+
p = 0;
|
|
1073
|
+
if (surf_chrg_eq == 0 || ratio_aq == 0)
|
|
1074
|
+
return (0.0);
|
|
1075
|
+
else if (surf_chrg_eq < 0)
|
|
1076
|
+
p = -0.5 * log(-surf_chrg_eq * ratio_aq * (1 - f_free) / mu_x + 1);
|
|
1077
|
+
else if (surf_chrg_eq > 0)
|
|
1078
|
+
p = 0.5 * log(surf_chrg_eq * ratio_aq * (1 - f_free) / mu_x + 1);
|
|
1079
|
+
/*
|
|
1080
|
+
* Optimize p in SS{s_x[i]->moles * z_i * g(p)} = -surf_chrg_eq
|
|
1081
|
+
* g(p) = exp(-p * z_i) * ratio_aq * (1 - f_free)
|
|
1082
|
+
* Elsewhere in PHREEQC, g is the excess, after subtraction of conc's for p = 0:
|
|
1083
|
+
* g(p) = (exp(-p *z_i) - 1) * ratio_aq
|
|
1084
|
+
* with correct_D true and f_free > 0:
|
|
1085
|
+
c_edl = c_free * (f_free + (1 - f_free) * exp(-p * z_i))
|
|
1086
|
+
* with correct_D true and f_free == 0:
|
|
1087
|
+
* correct ions to better match the integrated PB concentrations:
|
|
1088
|
+
Gamma = abs(surf_chrg_eq / A_surf / 1e-6)
|
|
1089
|
+
a = cgc[1] * nDbl**cgc[2]
|
|
1090
|
+
b = Gamma**cgc[3] / abs(log10(I))
|
|
1091
|
+
counter_ions...
|
|
1092
|
+
z == 1? z1 = cgc[0] * I**(a * b)
|
|
1093
|
+
z == 2? z2 = 2 * cgc[4] * I**(cgc[5] * a * b)
|
|
1094
|
+
co_ions...
|
|
1095
|
+
c = cgc[7] * nDbl**cgc[8] * Gamma**cgc[9]
|
|
1096
|
+
z == -1? z_1 = -cgc[6] * I**(c)
|
|
1097
|
+
z == -2? z_2 = -2 * cgc[10] * I**(c * cgc[11])
|
|
1098
|
+
c_edl = c_free * exp(-p * z_i)
|
|
1099
|
+
*/
|
|
1100
|
+
|
|
1101
|
+
cxxSurface *surf_ptr = use.Get_surface_ptr();
|
|
1102
|
+
bool correct_D = surf_ptr->Get_correct_D(), local_correct_D = correct_D;
|
|
1103
|
+
bool only_count = surf_ptr->Get_only_counter_ions();
|
|
1104
|
+
LDBLE Gamma, cgc[12] = { 0.3805, -0.0106, 1.96, 0.812,
|
|
1105
|
+
0.395, 2.13,
|
|
1106
|
+
0.380, 0.0408, 0.799, 0.594,
|
|
1107
|
+
0.373, 1.181 };
|
|
1108
|
+
if (correct_D)
|
|
1109
|
+
{
|
|
1110
|
+
if (f_free)
|
|
1111
|
+
{
|
|
1112
|
+
z1 = z2 = z_1 = z_2 = 1;
|
|
1113
|
+
}
|
|
1114
|
+
else
|
|
1115
|
+
{
|
|
1116
|
+
if (!surf_ptr->Donnan_factors.empty())
|
|
1117
|
+
{
|
|
1118
|
+
std::copy(surf_ptr->Donnan_factors.begin(), surf_ptr->Donnan_factors.end(), cgc);
|
|
1119
|
+
z1 = cgc[0];
|
|
1120
|
+
z2 = cgc[1];
|
|
1121
|
+
z_1 = cgc[2];
|
|
1122
|
+
z_2 = cgc[3];
|
|
1123
|
+
}
|
|
1124
|
+
else
|
|
1125
|
+
{
|
|
1126
|
+
Gamma = fabs(surf_chrg_eq) / (charge_ptr->Get_specific_area() * charge_ptr->Get_grams()) / 1e-6;
|
|
1127
|
+
LDBLE a = cgc[1] * pow(nDbl, cgc[2]),
|
|
1128
|
+
b = pow(Gamma, cgc[3]) / abs(log10(mu_x));
|
|
1129
|
+
// counter_ions...
|
|
1130
|
+
z1 = cgc[0] * pow(mu_x, (a * b));
|
|
1131
|
+
z2 = cgc[4] * pow(mu_x, (cgc[5] * a * b));
|
|
1132
|
+
if (z1 > 1) z1 = 1;
|
|
1133
|
+
if (z2 > 1) z2 = 1;
|
|
1134
|
+
// co_ions...
|
|
1135
|
+
LDBLE c = cgc[7] * pow(nDbl, cgc[8]) * pow(Gamma, cgc[9]);
|
|
1136
|
+
z_1 = cgc[6] * pow(mu_x, c);
|
|
1137
|
+
z_2 = cgc[10] * pow(mu_x, (c * cgc[11]));
|
|
1138
|
+
}
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
int l_iter = 0, z_iter;
|
|
1143
|
+
sum_co = sum_counter = 0;
|
|
1144
|
+
do
|
|
1145
|
+
{
|
|
1146
|
+
fd = surf_chrg_eq;
|
|
1147
|
+
fd1 = 0.0;
|
|
1148
|
+
z_iter = 0;
|
|
1149
|
+
if (l_iter == 1 && local_correct_D && fabs(sum_counter) < fabs(sum_co))
|
|
1150
|
+
{
|
|
1151
|
+
local_correct_D = false;
|
|
1152
|
+
l_iter = 0;
|
|
1153
|
+
}
|
|
1154
|
+
std::map<LDBLE, LDBLE>::iterator it;
|
|
1155
|
+
for (it = charge_group_map.begin(); it != charge_group_map.end(); it++)
|
|
1156
|
+
{
|
|
1157
|
+
z = it->first;
|
|
1158
|
+
Z1 = z;
|
|
1159
|
+
if (l_iter == 0) zcorr[z_iter] = z;
|
|
1160
|
+
co_ion = surf_chrg_eq * z;
|
|
1161
|
+
if (!z || (only_count && co_ion > 0))
|
|
1162
|
+
{
|
|
1163
|
+
z_iter++;
|
|
1164
|
+
continue;
|
|
1165
|
+
}
|
|
1166
|
+
if (nDbl && local_correct_D)
|
|
1167
|
+
{
|
|
1168
|
+
/*psi_DL = fabs(p * p_psi);*/
|
|
1169
|
+
if (co_ion < 0)
|
|
1170
|
+
{//counter-ion
|
|
1171
|
+
if (fabs(z) > 1.5) temp = z2;
|
|
1172
|
+
else temp = z1;
|
|
1173
|
+
sum_counter += z * temp;
|
|
1174
|
+
}
|
|
1175
|
+
else
|
|
1176
|
+
{// co-ion
|
|
1177
|
+
if (fabs(z) > 1.5) temp = z_2;
|
|
1178
|
+
else temp = z_1;
|
|
1179
|
+
sum_co += z * temp;
|
|
1180
|
+
}
|
|
1181
|
+
zcorr[z_iter] = z * temp;
|
|
1182
|
+
}
|
|
1183
|
+
Z1 = zcorr[z_iter];
|
|
1184
|
+
eq = it->second;
|
|
1185
|
+
temp = exp(-Z1 * p) * ratio_aq * (1 - f_free);
|
|
1186
|
+
|
|
1187
|
+
fd += eq * temp;
|
|
1188
|
+
fd1 -= Z1 * eq * temp;
|
|
1189
|
+
if (z == 1) Z1_c = Z1;
|
|
1190
|
+
z_iter++;
|
|
1191
|
+
}
|
|
1192
|
+
fd /= -fd1;
|
|
1193
|
+
p += (fd > 1) ? 1 : ((fd < -1) ? -1 : fd);
|
|
1194
|
+
if (fabs(p) < G_TOL)
|
|
1195
|
+
p = 0.0;
|
|
1196
|
+
l_iter++;
|
|
1197
|
+
if (l_iter > 50)
|
|
1198
|
+
{
|
|
1199
|
+
pr.all = TRUE;
|
|
1200
|
+
pr.exchange = TRUE;
|
|
1201
|
+
pr.headings = TRUE;
|
|
1202
|
+
pr.pp_assemblage = TRUE;
|
|
1203
|
+
pr.species = TRUE;
|
|
1204
|
+
pr.surface = TRUE;
|
|
1205
|
+
pr.totals = TRUE;
|
|
1206
|
+
print_all();
|
|
1207
|
+
error_string = sformatf(
|
|
1208
|
+
"\nToo many iterations in subroutine calc_psi_avg; surface charge = %12.4e; surface water = %12.4e.\n",
|
|
1209
|
+
(double)surf_chrg_eq, (double)charge_ptr->Get_mass_water());
|
|
1210
|
+
error_msg(error_string, STOP);
|
|
1211
|
+
}
|
|
1212
|
+
} while (fabs(fd) > 1e-12 && p != 0.0);
|
|
1213
|
+
if (debug_diffuse_layer == TRUE)
|
|
1214
|
+
output_msg(sformatf(
|
|
1215
|
+
"iter in calc_psi_avg = %d. g(+1) = %8f, surface charge = %12.4e, psi_DL = %12.3e V.\n",
|
|
1216
|
+
l_iter, (double)(exp(-p) - 1), (double)surf_chrg_eq, (double)(p * Z1_c * p_psi)));
|
|
1217
|
+
|
|
1218
|
+
return (p);
|
|
1219
|
+
}
|