mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
git-svn-id: svn://136.177.114.72/svn_GW/IPhreeqc/trunk@8028 1feff8c3-07ed-0310-ac33-dd36852eb9cd
55 lines
2.2 KiB
C++
55 lines
2.2 KiB
C++
#include <cstdlib>
|
|
#include <iostream>
|
|
#include <IPhreeqc.hpp>
|
|
|
|
int main(void)
|
|
{
|
|
IPhreeqc iphreeqc;
|
|
|
|
if (iphreeqc.LoadDatabase("phreeqc.dat") != 0) {
|
|
std::cout << iphreeqc.GetErrorString() << std::endl;
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
iphreeqc.SetCurrentSelectedOutputUserNumber(1);
|
|
iphreeqc.SetSelectedOutputStringOn(true);
|
|
iphreeqc.SetSelectedOutputFileOn(true);
|
|
iphreeqc.SetSelectedOutputFileName("state.sel");
|
|
|
|
iphreeqc.SetCurrentSelectedOutputUserNumber(2);
|
|
iphreeqc.SetSelectedOutputStringOn(true);
|
|
iphreeqc.SetSelectedOutputFileOn(true);
|
|
iphreeqc.SetSelectedOutputFileName("si.sel");
|
|
|
|
|
|
iphreeqc.AccumulateLine("TITLE Temperature dependence of solubility");
|
|
iphreeqc.AccumulateLine(" of gypsum and anhydrite ");
|
|
iphreeqc.AccumulateLine("SOLUTION 1 Pure water ");
|
|
iphreeqc.AccumulateLine(" pH 7.0 ");
|
|
iphreeqc.AccumulateLine(" temp 25.0 ");
|
|
iphreeqc.AccumulateLine("EQUILIBRIUM_PHASES 1 ");
|
|
iphreeqc.AccumulateLine(" Gypsum 0.0 1.0 ");
|
|
iphreeqc.AccumulateLine(" Anhydrite 0.0 1.0 ");
|
|
iphreeqc.AccumulateLine("REACTION_TEMPERATURE 1 ");
|
|
iphreeqc.AccumulateLine(" 25.0 75.0 in 51 steps ");
|
|
iphreeqc.AccumulateLine("SELECTED_OUTPUT 1 ");
|
|
iphreeqc.AccumulateLine(" -temperature ");
|
|
iphreeqc.AccumulateLine("SELECTED_OUTPUT 2 ");
|
|
iphreeqc.AccumulateLine(" -si anhydrite gypsum ");
|
|
iphreeqc.AccumulateLine("END ");
|
|
|
|
if (iphreeqc.RunAccumulated() != 0) {
|
|
std::cout << iphreeqc.GetErrorString() << std::endl;
|
|
return EXIT_FAILURE;
|
|
}
|
|
|
|
int c = iphreeqc.GetSelectedOutputCount();
|
|
for (int k = 0; k < c; ++k) {
|
|
int n = iphreeqc.GetNthSelectedOutputUserNumber(k);
|
|
iphreeqc.SetCurrentSelectedOutputUserNumber(n);
|
|
std::cout << "selected-output " << n << ":" << std::endl;
|
|
std::cout << iphreeqc.GetSelectedOutputString() << std::endl;
|
|
}
|
|
return EXIT_SUCCESS;
|
|
}
|