OGS
PhreeqcIOData/AqueousSolution.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "AqueousSolution.h"
5
6#include <cmath>
7#include <ostream>
8
12
13namespace ChemistryLib
14{
15namespace PhreeqcIOData
16{
17void AqueousSolution::print(std::ostream& os,
18 std::size_t const chemical_system_id) const
19{
20 os << "temp " << temperature << "\n";
21
22 os << "pressure " << pressure << "\n";
23
25 switch (charge_balance)
26 {
28 os << "pH " << -std::log10((*pH)[chemical_system_id]) << " charge"
29 << "\n";
30 os << "pe " << (*pe)[chemical_system_id] << "\n";
31 break;
33 os << "pH " << -std::log10((*pH)[chemical_system_id]) << "\n";
34 os << "pe " << (*pe)[chemical_system_id] << " charge"
35 << "\n";
36 break;
38 os << "pH " << -std::log10((*pH)[chemical_system_id]) << "\n";
39 os << "pe " << (*pe)[chemical_system_id] << "\n";
40 break;
41 }
42
43 os << "units mol/kgw\n";
44
45 for (auto const& component : components)
46 {
48 os << component.name << " " << (*component.amount)[chemical_system_id];
49 component.chemical_formula.empty()
50 ? os << "\n"
51 : os << " as " << component.chemical_formula << "\n";
52 }
53
54 os << "\n\n";
55}
56} // namespace PhreeqcIOData
57} // namespace ChemistryLib
Per-system aqueous state exchanged with PHREEQC.
void setLocalAccessibleVector(PETScVector const &x)
Definition LinAlg.cpp:20
void print(std::ostream &os, std::size_t const chemical_system_id) const