diff --git a/ChemistryLib/PhreeqcIOData/AqueousSolution.h b/ChemistryLib/PhreeqcIOData/AqueousSolution.h index c646666a1d1c772b04b34a877dcc5d3aec5c08f5..96fd71db1c49c97ef5bf0795189d3a1ea8c1a002 100644 --- a/ChemistryLib/PhreeqcIOData/AqueousSolution.h +++ b/ChemistryLib/PhreeqcIOData/AqueousSolution.h @@ -45,11 +45,12 @@ struct Component struct AqueousSolution { - AqueousSolution(double temperature_, double pressure_, - MeshLib::PropertyVector<double>* pe_, double const pe0_, - std::vector<Component>&& components_, + AqueousSolution(bool const fixing_pe_, double temperature_, + double pressure_, MeshLib::PropertyVector<double>* pe_, + double const pe0_, std::vector<Component>&& components_, ChargeBalance charge_balance_) - : temperature(temperature_), + : fixing_pe(fixing_pe_), + temperature(temperature_), pressure(pressure_), pe(pe_), pe0(pe0_), @@ -60,6 +61,7 @@ struct AqueousSolution void print(std::ostream& os, std::size_t const chemical_system_id) const; + bool const fixing_pe; double const temperature; double const pressure; std::unique_ptr<GlobalVector> pH; diff --git a/ChemistryLib/PhreeqcIOData/CreateAqueousSolution.cpp b/ChemistryLib/PhreeqcIOData/CreateAqueousSolution.cpp index 2392d48af05d3a0d3076f516912f2e06aa94c093..0ff8d94c96a58fbd975cf66cc2f12174146fdf3a 100644 --- a/ChemistryLib/PhreeqcIOData/CreateAqueousSolution.cpp +++ b/ChemistryLib/PhreeqcIOData/CreateAqueousSolution.cpp @@ -23,6 +23,9 @@ namespace PhreeqcIOData std::unique_ptr<AqueousSolution> createAqueousSolution( BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh) { + //! \ogs_file_attr{prj__chemical_system__solution__fixing_pe} + auto const fixing_pe = config.getConfigAttribute<bool>("fixing_pe", false); + //! \ogs_file_param{prj__chemical_system__solution__temperature} auto const temperature = config.getConfigParameter<double>("temperature"); @@ -39,8 +42,9 @@ std::unique_ptr<AqueousSolution> createAqueousSolution( auto charge_balance = createChargeBalance(config); - return std::make_unique<AqueousSolution>( - temperature, pressure, pe, pe0, std::move(components), charge_balance); + return std::make_unique<AqueousSolution>(fixing_pe, temperature, pressure, + pe, pe0, std::move(components), + charge_balance); } } // namespace PhreeqcIOData } // namespace ChemistryLib