Skip to content
Snippets Groups Projects
Commit 2dc7449b authored by renchao.lu's avatar renchao.lu
Browse files

[CL] Get int_pt_process_solutions from chemical solver interface.

parent ffa81a05
No related branches found
No related tags found
No related merge requests found
......@@ -25,6 +25,8 @@ public:
virtual void doWaterChemistryCalculation(
std::vector<GlobalVector*>& process_solutions, double const dt) = 0;
virtual std::vector<GlobalVector*> getIntPtProcessSolutions() const = 0;
virtual std::vector<std::string> const getComponentList() const
{
return {};
......
......@@ -124,9 +124,22 @@ void PhreeqcIO::executeInitialCalculation(
execute();
readOutputsFromFile();
}
setAqueousSolutionsOrUpdateProcessSolutions(
process_solutions, Status::UpdatingProcessSolutions);
std::vector<GlobalVector*> PhreeqcIO::getIntPtProcessSolutions() const
{
auto const& aqueous_solution = _chemical_system->aqueous_solution;
std::vector<GlobalVector*> int_pt_process_solutions;
int_pt_process_solutions.reserve(aqueous_solution->components.size() + 1);
std::transform(aqueous_solution->components.begin(),
aqueous_solution->components.end(),
std::back_inserter(int_pt_process_solutions),
[](auto const& c) { return c.amount.get(); });
int_pt_process_solutions.push_back(aqueous_solution->pH.get());
return int_pt_process_solutions;
}
void PhreeqcIO::doWaterChemistryCalculation(
......
......@@ -63,6 +63,8 @@ public:
void readOutputsFromFile();
std::vector<GlobalVector*> getIntPtProcessSolutions() const override;
friend std::ostream& operator<<(std::ostream& os,
PhreeqcIO const& phreeqc_io);
......
......@@ -53,6 +53,11 @@ public:
void execute(std::vector<GlobalVector*>& process_solutions);
std::vector<GlobalVector*> getIntPtProcessSolutions() const override
{
return {};
}
void updateNodalProcessSolutions(
std::vector<GlobalVector*> const& process_solutions,
std::size_t const node_id);
......
......@@ -455,11 +455,8 @@ void TimeLoop::initialize()
time_phreeqc.start();
auto& pcs = _per_process_data[0]->process;
auto const interpolated_process_solutions =
pcs.interpolateNodalValuesToIntegrationPoints(_process_solutions);
_chemical_solver_interface->executeInitialCalculation(
interpolated_process_solutions);
pcs.interpolateNodalValuesToIntegrationPoints(_process_solutions));
INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed());
}
......@@ -823,11 +820,9 @@ TimeLoop::solveCoupledEquationSystemsByStaggeredScheme(
time_phreeqc.start();
auto& pcs = _per_process_data[0]->process;
auto const interpolated_process_solutions =
pcs.interpolateNodalValuesToIntegrationPoints(_process_solutions);
_chemical_solver_interface->doWaterChemistryCalculation(
interpolated_process_solutions, dt);
pcs.interpolateNodalValuesToIntegrationPoints(_process_solutions),
dt);
INFO("[time] Phreeqc took {:g} s.", time_phreeqc.elapsed());
}
......
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