OGS
PhreeqcIOData/CreateAqueousSolution.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
6#include "AqueousSolution.h"
10#include "MeshLib/Mesh.h"
12
13namespace ChemistryLib
14{
15namespace PhreeqcIOData
16{
17std::unique_ptr<AqueousSolution> createAqueousSolution(
18 BaseLib::ConfigTree const& config, MeshLib::Mesh& mesh)
19{
21 auto const fixing_pe = config.getConfigAttribute<bool>("fixing_pe", false);
22
24 auto const temperature = config.getConfigParameter<double>("temperature");
25
27 auto const pressure = config.getConfigParameter<double>("pressure");
28
30 auto const pe0 = config.getConfigParameter<double>("pe");
31
34
35 auto components = createSolutionComponents(config);
36
37 auto charge_balance = createChargeBalance(config);
38
39 return std::make_unique<AqueousSolution>(fixing_pe, temperature, pressure,
40 pe, pe0, std::move(components),
41 charge_balance);
42}
43} // namespace PhreeqcIOData
44} // namespace ChemistryLib
Per-system aqueous state exchanged with PHREEQC.
T getConfigParameter(std::string const &param) const
T getConfigAttribute(std::string const &attr) const
std::unique_ptr< AqueousSolution > createAqueousSolution(BaseLib::ConfigTree const &config, MeshLib::Mesh &mesh)
std::vector< Component > createSolutionComponents(BaseLib::ConfigTree const &config)
ChargeBalance createChargeBalance(BaseLib::ConfigTree const &config)
PropertyVector< T > * getOrCreateMeshProperty(Mesh &mesh, std::string const &property_name, MeshItemType const item_type, int const number_of_components)