Skip to content
Snippets Groups Projects
Commit 041b36f0 authored by renchao.lu's avatar renchao.lu Committed by Dmitri Naumov
Browse files

[CL] Fix inconsistent parameter name.

parent a3f682b4
No related branches found
No related tags found
No related merge requests found
...@@ -341,7 +341,7 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config, ...@@ -341,7 +341,7 @@ ProjectData::ProjectData(BaseLib::ConfigTree const& project_config,
//! \ogs_file_param{prj__nonlinear_solvers} //! \ogs_file_param{prj__nonlinear_solvers}
parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers")); parseNonlinearSolvers(project_config.getConfigSubtree("nonlinear_solvers"));
parseChemicalSystem( parseChemicalSolverInterface(
//! \ogs_file_param{prj__chemical_system} //! \ogs_file_param{prj__chemical_system}
project_config.getConfigSubtreeOptional("chemical_system"), project_config.getConfigSubtreeOptional("chemical_system"),
output_directory); output_directory);
...@@ -974,9 +974,9 @@ void ProjectData::parseTimeLoop(BaseLib::ConfigTree const& config, ...@@ -974,9 +974,9 @@ void ProjectData::parseTimeLoop(BaseLib::ConfigTree const& config,
{ {
DBUG("Reading time loop configuration."); DBUG("Reading time loop configuration.");
_time_loop = ProcessLib::createTimeLoop(config, output_directory, _time_loop = ProcessLib::createTimeLoop(
_processes, _nonlinear_solvers, config, output_directory, _processes, _nonlinear_solvers, _mesh_vec,
_mesh_vec, _chemical_system); _chemical_solver_interface);
if (!_time_loop) if (!_time_loop)
{ {
...@@ -1049,7 +1049,7 @@ void ProjectData::parseCurves( ...@@ -1049,7 +1049,7 @@ void ProjectData::parseCurves(
} }
} }
void ProjectData::parseChemicalSystem( void ProjectData::parseChemicalSolverInterface(
boost::optional<BaseLib::ConfigTree> const& config, boost::optional<BaseLib::ConfigTree> const& config,
std::string const& output_directory) std::string const& output_directory)
{ {
...@@ -1080,10 +1080,11 @@ void ProjectData::parseChemicalSystem( ...@@ -1080,10 +1080,11 @@ void ProjectData::parseChemicalSystem(
"Configuring phreeqc interface for water chemistry " "Configuring phreeqc interface for water chemistry "
"calculation using file-based approach."); "calculation using file-based approach.");
_chemical_system = ChemistryLib::createChemicalSolverInterface< _chemical_solver_interface =
ChemistryLib::ChemicalSolver::Phreeqc>( ChemistryLib::createChemicalSolverInterface<
_mesh_vec, process_id_to_component_name_map, *config, ChemistryLib::ChemicalSolver::Phreeqc>(
output_directory); _mesh_vec, process_id_to_component_name_map, *config,
output_directory);
} }
else if (boost::iequals(chemical_solver, "PhreeqcKernel")) else if (boost::iequals(chemical_solver, "PhreeqcKernel"))
{ {
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#include "MaterialLib/MPL/Medium.h" #include "MaterialLib/MPL/Medium.h"
#include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h" #include "MathLib/InterpolationAlgorithms/PiecewiseLinearInterpolation.h"
#include "ChemistryLib/PhreeqcIO.h" #include "ChemistryLib/ChemicalSolverInterface.h"
#include "ParameterLib/CoordinateSystem.h" #include "ParameterLib/CoordinateSystem.h"
#include "ParameterLib/Parameter.h" #include "ParameterLib/Parameter.h"
#include "ProcessLib/Process.h" #include "ProcessLib/Process.h"
...@@ -113,8 +113,9 @@ private: ...@@ -113,8 +113,9 @@ private:
void parseCurves(boost::optional<BaseLib::ConfigTree> const& config); void parseCurves(boost::optional<BaseLib::ConfigTree> const& config);
void parseChemicalSystem(boost::optional<BaseLib::ConfigTree> const& config, void parseChemicalSolverInterface(
const std::string& output_directory); boost::optional<BaseLib::ConfigTree> const& config,
const std::string& output_directory);
std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec; std::vector<std::unique_ptr<MeshLib::Mesh>> _mesh_vec;
std::vector<std::unique_ptr<ProcessLib::Process>> _processes; std::vector<std::unique_ptr<ProcessLib::Process>> _processes;
...@@ -138,5 +139,6 @@ private: ...@@ -138,5 +139,6 @@ private:
std::unique_ptr<MathLib::PiecewiseLinearInterpolation>> std::unique_ptr<MathLib::PiecewiseLinearInterpolation>>
_curves; _curves;
std::unique_ptr<ChemistryLib::ChemicalSolverInterface> _chemical_system; std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
_chemical_solver_interface;
}; };
...@@ -25,7 +25,8 @@ std::unique_ptr<TimeLoop> createTimeLoop( ...@@ -25,7 +25,8 @@ std::unique_ptr<TimeLoop> createTimeLoop(
const std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>& const std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>>&
nonlinear_solvers, nonlinear_solvers,
std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes,
std::unique_ptr<ChemistryLib::ChemicalSolverInterface>& phreeqc_io) std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&
chemical_solver_interface)
{ {
auto const& coupling_config auto const& coupling_config
//! \ogs_file_param{prj__time_loop__global_process_coupling} //! \ogs_file_param{prj__time_loop__global_process_coupling}
...@@ -93,7 +94,7 @@ std::unique_ptr<TimeLoop> createTimeLoop( ...@@ -93,7 +94,7 @@ std::unique_ptr<TimeLoop> createTimeLoop(
return std::make_unique<TimeLoop>( return std::make_unique<TimeLoop>(
std::move(output), std::move(per_process_data), max_coupling_iterations, std::move(output), std::move(per_process_data), max_coupling_iterations,
std::move(global_coupling_conv_criteria), std::move(phreeqc_io), std::move(global_coupling_conv_criteria),
start_time, end_time); std::move(chemical_solver_interface), start_time, end_time);
} }
} // namespace ProcessLib } // namespace ProcessLib
...@@ -50,6 +50,7 @@ std::unique_ptr<TimeLoop> createTimeLoop( ...@@ -50,6 +50,7 @@ std::unique_ptr<TimeLoop> createTimeLoop(
std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>> const& std::map<std::string, std::unique_ptr<NumLib::NonlinearSolverBase>> const&
nonlinear_solvers, nonlinear_solvers,
std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes, std::vector<std::unique_ptr<MeshLib::Mesh>> const& meshes,
std::unique_ptr<ChemistryLib::ChemicalSolverInterface>& phreeqc_io); std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&
chemical_solver_interface);
} // namespace ProcessLib } // namespace ProcessLib
...@@ -224,21 +224,21 @@ NumLib::NonlinearSolverStatus solveOneTimeStepOneProcess( ...@@ -224,21 +224,21 @@ NumLib::NonlinearSolverStatus solveOneTimeStepOneProcess(
return nonlinear_solver_status; return nonlinear_solver_status;
} }
TimeLoop::TimeLoop( TimeLoop::TimeLoop(std::unique_ptr<Output>&& output,
std::unique_ptr<Output>&& output, std::vector<std::unique_ptr<ProcessData>>&& per_process_data,
std::vector<std::unique_ptr<ProcessData>>&& per_process_data, const int global_coupling_max_iterations,
const int global_coupling_max_iterations, std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>&&
std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>&& global_coupling_conv_crit,
global_coupling_conv_crit, std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&&
std::unique_ptr<ChemistryLib::ChemicalSolverInterface>&& chemical_system, chemical_solver_interface,
const double start_time, const double end_time) const double start_time, const double end_time)
: _output(std::move(output)), : _output(std::move(output)),
_per_process_data(std::move(per_process_data)), _per_process_data(std::move(per_process_data)),
_start_time(start_time), _start_time(start_time),
_end_time(end_time), _end_time(end_time),
_global_coupling_max_iterations(global_coupling_max_iterations), _global_coupling_max_iterations(global_coupling_max_iterations),
_global_coupling_conv_crit(std::move(global_coupling_conv_crit)), _global_coupling_conv_crit(std::move(global_coupling_conv_crit)),
_chemical_system(std::move(chemical_system)) _chemical_solver_interface(std::move(chemical_solver_interface))
{ {
} }
...@@ -444,11 +444,12 @@ void TimeLoop::initialize() ...@@ -444,11 +444,12 @@ void TimeLoop::initialize()
std::tie(_process_solutions, _process_solutions_prev) = std::tie(_process_solutions, _process_solutions_prev) =
setInitialConditions(_start_time, _per_process_data); setInitialConditions(_start_time, _per_process_data);
if (_chemical_system != nullptr) if (_chemical_solver_interface)
{ {
BaseLib::RunTime time_phreeqc; BaseLib::RunTime time_phreeqc;
time_phreeqc.start(); time_phreeqc.start();
_chemical_system->executeInitialCalculation(_process_solutions); _chemical_solver_interface->executeInitialCalculation(
_process_solutions);
INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed()); INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed());
} }
...@@ -800,7 +801,7 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme( ...@@ -800,7 +801,7 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme(
timestep_id, t); timestep_id, t);
} }
if (_chemical_system != nullptr) if (_chemical_solver_interface)
{ {
// Sequential non-iterative approach applied here to perform water // Sequential non-iterative approach applied here to perform water
// chemistry calculation followed by resolving component transport // chemistry calculation followed by resolving component transport
...@@ -809,7 +810,8 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme( ...@@ -809,7 +810,8 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme(
// space and localized chemical equilibrium between solutes. // space and localized chemical equilibrium between solutes.
BaseLib::RunTime time_phreeqc; BaseLib::RunTime time_phreeqc;
time_phreeqc.start(); time_phreeqc.start();
_chemical_system->doWaterChemistryCalculation(_process_solutions, dt); _chemical_solver_interface->doWaterChemistryCalculation(
_process_solutions, dt);
INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed()); INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed());
} }
......
...@@ -125,7 +125,8 @@ private: ...@@ -125,7 +125,8 @@ private:
std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>> std::vector<std::unique_ptr<NumLib::ConvergenceCriterion>>
_global_coupling_conv_crit; _global_coupling_conv_crit;
std::unique_ptr<ChemistryLib::ChemicalSolverInterface> _chemical_system; std::unique_ptr<ChemistryLib::ChemicalSolverInterface>
_chemical_solver_interface;
/// Solutions of the previous coupling iteration for the convergence /// Solutions of the previous coupling iteration for the convergence
/// criteria of the coupling iteration. /// criteria of the coupling iteration.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment