OGS
CreateChemicalSystem.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
5
7#include "ChemicalSystem.h"
10#include "CreateExchange.h"
12#include "CreateSurface.h"
13#include "EquilibriumReactant.h"
14#include "Exchange.h"
15#include "KineticReactant.h"
16#include "Surface.h"
17
18namespace ChemistryLib
19{
20namespace PhreeqcIOData
21{
22std::unique_ptr<ChemicalSystem> createChemicalSystem(
23 BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
24{
25 // solution
26 auto aqueous_solution = createAqueousSolution(
28 config.getConfigSubtree("solution"), mesh);
29
30 // kinetic reactants
31 auto kinetic_reactants = createKineticReactants(
33 config.getConfigSubtreeOptional("kinetic_reactants"), mesh);
34
35 // equilibrium reactants
36 auto equilibrium_reactants = createEquilibriumReactants(
38 config.getConfigSubtreeOptional("equilibrium_reactants"), mesh);
39
40 // exchangers
41 auto exchangers = createExchange(
43 config.getConfigSubtreeOptional("exchangers"), mesh);
44
45 // surface
46 auto surface = createSurface(
48 config.getConfigSubtreeOptional("surface"), mesh);
49
50 return std::make_unique<ChemicalSystem>(std::move(aqueous_solution),
51 std::move(kinetic_reactants),
52 std::move(equilibrium_reactants),
53 std::move(exchangers),
54 std::move(surface));
55}
56} // namespace PhreeqcIOData
57} // namespace ChemistryLib
Definition of one reactive chemical system for PHREEQC coupling.
std::optional< ConfigTree > getConfigSubtreeOptional(std::string const &root) const
ConfigTree getConfigSubtree(std::string const &root) const
std::vector< std::variant< DensityBasedSurfaceSite, MoleBasedSurfaceSite > > createSurface(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)
std::unique_ptr< AqueousSolution > createAqueousSolution(BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::unique_ptr< ChemicalSystem > createChemicalSystem(BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::vector< ExchangeSite > createExchange(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)
std::vector< EquilibriumReactant > createEquilibriumReactants(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)
std::vector< KineticReactant > createKineticReactants(std::optional< BaseLib::ConfigTree > const &config, MeshLib::Mesh &mesh)