OGS
PhreeqcKernel.h
Go to the documentation of this file.
1
11#pragma once
12
13#include <phreeqcpp/Phreeqc.h>
14
15#include <map>
16#include <vector>
17
21
22class cxxSolution;
23class cxxISolution;
24
25namespace ChemistryLib
26{
27namespace PhreeqcKernelData
28{
29class AqueousSolution;
30class ReactionRate;
31
32class PhreeqcKernel final : public ChemicalSolverInterface, private Phreeqc
33{
34public:
36 std::size_t const num_chemical_systems,
37 std::vector<std::pair<int, std::string>> const&
38 process_id_to_component_name_map,
39 std::string const& database, AqueousSolution aqueous_solution,
40 std::unique_ptr<EquilibriumReactants>&& equilibrium_reactants,
41 std::unique_ptr<Kinetics>&& kinetic_reactants,
42 std::vector<ReactionRate>&& reaction_rates);
43
44 void executeSpeciationCalculation(double const dt) override;
45
47 std::vector<GlobalVector*> const& process_solutions);
48
49 void callPhreeqc(std::vector<GlobalVector*>& process_solutions);
50
52 std::vector<GlobalVector*> const& process_solutions,
53 std::size_t const node_id);
54
55private:
56 void initializePhreeqcGeneralSettings() { do_initialize(); }
57
59 EquilibriumReactants const& equilibrium_reactants);
60
61 void loadDatabase(std::string const& database);
62
63 void reinitializeRates();
64
65 void setConvergenceTolerance() { convergence_tolerance = 1e-12; }
66
67 void configureOutputSettings() { pr.all = false; }
68
70 cxxSolution& aqueous_solution);
71
72 void setTimeStepSize(double const dt);
73
74 void reset(std::size_t const chemical_system_id);
75
76 std::map<int, struct master*> _process_id_to_master_map;
77 std::unique_ptr<cxxISolution const> _initial_aqueous_solution;
78 std::unique_ptr<cxxSolution const> _aqueous_solution;
79 std::vector<ReactionRate> const _reaction_rates;
80};
81} // namespace PhreeqcKernelData
82} // namespace ChemistryLib
std::vector< ReactionRate > const _reaction_rates
std::map< int, struct master * > _process_id_to_master_map
void setAqueousSolutions(std::vector< GlobalVector * > const &process_solutions)
void tidyEquilibriumReactants(EquilibriumReactants const &equilibrium_reactants)
void loadDatabase(std::string const &database)
void updateNodalProcessSolutions(std::vector< GlobalVector * > const &process_solutions, std::size_t const node_id)
std::unique_ptr< cxxSolution const > _aqueous_solution
cxxISolution * getOrCreateInitialAqueousSolution(cxxSolution &aqueous_solution)
std::unique_ptr< cxxISolution const > _initial_aqueous_solution
void callPhreeqc(std::vector< GlobalVector * > &process_solutions)
void executeSpeciationCalculation(double const dt) override
void reset(std::size_t const chemical_system_id)