18 std::size_t
const chemical_system_id)
const
22 os <<
"pressure " <<
pressure <<
"\n";
24 double const pH_value = -std::log10(
H_plus_activity[chemical_system_id]);
29 os <<
"pH " << pH_value <<
" charge" <<
"\n";
30 os <<
"pe " << (*pe)[chemical_system_id] <<
"\n";
33 os <<
"pH " << pH_value <<
"\n";
34 os <<
"pe " << (*pe)[chemical_system_id] <<
" charge" <<
"\n";
37 os <<
"pH " << pH_value <<
"\n";
38 os <<
"pe " << (*pe)[chemical_system_id] <<
"\n";
42 os <<
"units mol/kgw\n";
46 os << component.name <<
" " << component.amount[chemical_system_id];
47 component.chemical_formula.empty()
49 : os <<
" as " << component.chemical_formula <<
"\n";
56 std::size_t
const chemical_system_id,
58 double const warning_threshold)
61 auto& components = aqueous_solution.
components;
62 for (
unsigned component_id = 0; component_id < components.size();
65 components[component_id].amount[chemical_system_id] =
66 stats.
clamp(concentrations[component_id], warning_threshold,
67 components[component_id].name);
81 double const h_plus_activity = concentrations.back();
82 if (h_plus_activity <= 0.0)
85 "H+ activity (10^-pH) at chemical system {:d} is {:g} <= 0, which "
86 "is physically impossible (PHREEQC's 1 kg-water assumption "
87 "guarantees a positive H+ activity).",
88 chemical_system_id, h_plus_activity);
Per-system aqueous state exchanged with PHREEQC.
ClampingStats setAqueousSolution(std::vector< double > const &concentrations, std::size_t const chemical_system_id, AqueousSolution &aqueous_solution, double const warning_threshold)
std::vector< Component > components
std::vector< double > H_plus_activity
H+ activity 10^-pH, per chemical_system_id.
ChargeBalance const charge_balance
void print(std::ostream &os, std::size_t const chemical_system_id) const
std::size_t n_severe_values
total severe values clamped
std::size_t n_severe_cells
cells with a severe clamp
double clamp(double c, double warning_threshold, std::string_view name)
std::size_t n_values
total values clamped
std::size_t n_cells
cells with any clamping