![]() |
PHREESQL
..
|
PHREESQL is a toolkit for efficiently storing and managing the huge amount of data coming from geochemical speciation computation run by PHREEQC. High efficiency in data extraction and filtering is guaranteed thanks to an relational SQL database structure. PHREESQL enables the geochemical community to explore the potentiality of huge water chemistry database and the developers to embed the code in application where unstructured meshes are involved or real-time sensors acquire a set of compositional and chemical-physical parameters. PHREESQL includes both a C++ library and a command-line interface to ease the usability of PHREESQL by geochemists with low programming skills.
PHREESQL is an easy-to-use framework supporting PHREEQC speciation calculations only (keyword data block SOLUTION-END), as well as performing storage and query of results. The production of a relational SQL database is the core of that toolkit. The relational database management system (RDBMS) makes it possible to permanently store in a structured framework a very large number of geochemical calculations compacting all data in a SQL binary data.
To guarantee usability by both developers and users with low programming expertise, PHREESQL includes both a C++ library and a command-line interface, namely PHREESQLib and PHREESQLexe respectively. Thus PHREESQL exhibits the following capabilities, being able to:
PHREESQL works as shown in the here.
Documentation is available here. Please, be aware that it is still work in progress, and a complete version will be available soon.
The repository includes some submodules necessary to make PHREESQL work. Please, clone it recursively:
git clone --recursive https://github.com/DanielaCabiddu/PHREESQL/
PHREESQLib is an header-only C++ library having some mandatory dependences:
To exploit PHREESQLib in your C++ project:
PHREESQLExe is an example of usage, and provides the possibility to automatically perform speciation calculation and storage starting from a given dataset. The complete set of options is available here. PHREESQLExe can be easily built (see Building). Binaries are available here.
To build PHREESQLExe, use the build.sh script available located in the root directory ROOT (where this README lies). To test it, use the test.sh script available in the same folder.
To build PHREESQLExe, use the build.sh script available located in the root directory ROOT (where this README lies). To test it, use the test.sh script available in the same folder.
Generate the Visual Studio solution via CMake and build it.
Our case study is described in the paper and exploits the Ireland EPA database (https://gis.epa.ie/GetData/Download). To guarantee replicability, data and source code of our case study is provided in the example folder. If you wish to replicate our case study, please run the case_study.sh script located located in the root directory ROOT (where this README lies) to create the complete set of PHREESQL databases:
${ROOT}/case_study.sh
The PHREESQL databases will be available in the ${ROOT}/example/DB folder.
To run some examples of database queries and generate plots, please run the ${ROOT}/example/query.sh script by providing the full database path (<DB_PATH>) of the database to be queried:
${ROOT}/example/query.sh <DB_PATH>
If you use PHREESQL in your academic projects, please consider citing the library using the following BibTeX entry:
[BIBTEX REFERENCE AFTER PUBLICATION]
Submitted - UNDER REVIEW