diff --git a/ChemistryLib/PhreeqcKernelData/AqueousSolution.cpp b/ChemistryLib/PhreeqcKernelData/AqueousSolution.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7812b7be12940483aef5640c02e62c5085054ff0 --- /dev/null +++ b/ChemistryLib/PhreeqcKernelData/AqueousSolution.cpp @@ -0,0 +1,27 @@ +/** + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "AqueousSolution.h" + +namespace ChemistryLib +{ +namespace PhreeqcKernelData +{ +AqueousSolution::AqueousSolution(double const temperature, + double const pressure, double const pe_value, + cxxISolution const& initial_aqueous_solution) +{ + new_def = true; + tc = temperature; + patm = pressure; + pe = pe_value; + initial_data = new cxxISolution(initial_aqueous_solution); +} +} // namespace PhreeqcKernelData +} // namespace ChemistryLib diff --git a/ChemistryLib/PhreeqcKernelData/AqueousSolution.h b/ChemistryLib/PhreeqcKernelData/AqueousSolution.h new file mode 100644 index 0000000000000000000000000000000000000000..7737d5d6742aa6a0c9305e3d73be72cbc27de81e --- /dev/null +++ b/ChemistryLib/PhreeqcKernelData/AqueousSolution.h @@ -0,0 +1,29 @@ +/** + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include "ThirdParty/iphreeqc/src/src/phreeqcpp/common/phrqtype.h" +#include "ThirdParty/iphreeqc/src/src/phreeqcpp/Solution.h" + +class cxxISolution; + +namespace ChemistryLib +{ +namespace PhreeqcKernelData +{ +class AqueousSolution final : public cxxSolution +{ +public: + AqueousSolution(double const temperature, double const pressure, + double const pe_value, + cxxISolution const& initial_aqueous_solution); +}; +} // namespace PhreeqcKernelData +} // namespace ChemistryLib diff --git a/ChemistryLib/PhreeqcKernelData/CreateAqueousSolution.cpp b/ChemistryLib/PhreeqcKernelData/CreateAqueousSolution.cpp new file mode 100644 index 0000000000000000000000000000000000000000..93c34dbdc5748b2ff259ac1d5240040ab02c769e --- /dev/null +++ b/ChemistryLib/PhreeqcKernelData/CreateAqueousSolution.cpp @@ -0,0 +1,39 @@ +/** + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#include "AqueousSolution.h" +#include "BaseLib/ConfigTree.h" +#include "CreateInitialAqueousSolution.h" +#include "InitialAqueousSolution.h" + +namespace ChemistryLib +{ +namespace PhreeqcKernelData +{ +AqueousSolution createAqueousSolution( + BaseLib::ConfigTree const& config, + std::vector<std::pair<int, std::string>> const& + process_id_to_component_name_map) +{ + //! \ogs_file_param{prj__chemical_system__solution__temperature} + auto const temperature = config.getConfigParameter<double>("temperature"); + + //! \ogs_file_param{prj__chemical_system__solution__pressure} + auto const pressure = config.getConfigParameter<double>("pressure"); + + //! \ogs_file_param{prj__chemical_system__solution__pe} + auto const pe = config.getConfigParameter<double>("pe"); + + auto const initial_aqueous_solution = + createInitialAqueousSolution(config, process_id_to_component_name_map); + + return {temperature, pressure, pe, initial_aqueous_solution}; +} +} // namespace PhreeqcKernelData +} // namespace ChemistryLib diff --git a/ChemistryLib/PhreeqcKernelData/CreateAqueousSolution.h b/ChemistryLib/PhreeqcKernelData/CreateAqueousSolution.h new file mode 100644 index 0000000000000000000000000000000000000000..279714668e61413eba1c361284ecfc0567603ebc --- /dev/null +++ b/ChemistryLib/PhreeqcKernelData/CreateAqueousSolution.h @@ -0,0 +1,31 @@ +/** + * \copyright + * Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org) + * Distributed under a Modified BSD License. + * See accompanying file LICENSE.txt or + * http://www.opengeosys.org/project/license + * + */ + +#pragma once + +#include <string> +#include <vector> + +namespace BaseLib +{ +class ConfigTree; +} + +namespace ChemistryLib +{ +namespace PhreeqcKernelData +{ +class AqueousSolution; + +AqueousSolution createAqueousSolution( + BaseLib::ConfigTree const& config, + std::vector<std::pair<int, std::string>> const& + process_id_to_component_name_map); +} // namespace PhreeqcKernelData +} // namespace ChemistryLib