Page MenuHomec4science

reactive_transport_solver.hpp
No OneTemporary

File Metadata

Created
Tue, Jun 4, 03:00

reactive_transport_solver.hpp

#ifndef SPECMICP_REACTMICP_SATURATED_DIFFUSION_REACTIVETRANSPORTSOLVER_HPP
#define SPECMICP_REACTMICP_SATURATED_DIFFUSION_REACTIVETRANSPORTSOLVER_HPP
#include "options.hpp"
#include "variables.hpp"
#include "transport_program.hpp"
#include "dfpmsolver/parabolic_driver.hpp"
#include "boundary_conditions.hpp"
namespace specmicp {
namespace reactmicp {
using namespace systems::siasaturated;
//! \brief SIA solver for saturated reactive transport problem
//!
class SIASaturatedReactiveTransportSolver
{
public:
SIASaturatedReactiveTransportSolver(
std::shared_ptr<mesh::Mesh1D> the_mesh,
std::shared_ptr<database::DataContainer> the_database,
std::shared_ptr<SaturatedDiffusionTransportParameters> transport_parameters
):
m_mesh(the_mesh),
m_variables(the_database, the_mesh, transport_parameters),
m_transport_program(the_mesh, the_database, transport_parameters),
m_transport_solver(m_transport_program),
m_bcs(the_mesh->nnodes())
{}
void apply_boundary_conditions(SIABoundaryConditions bcs);
SIASaturatedVariables& get_variables() {return m_variables;}
//! \brief Solve a timestep
void solve_timestep(double dt);
void restart_transport_iterations();
void restart_speciation_iterations();
void solve_speciation_node(int node);
void check_convergence();
//! \brief Return a read-write reference to the options
SIASaturatedReactiveTransportSolverOptions& get_options() {return m_options;}
//! \brief Return a read-only reference to the options
const SIASaturatedReactiveTransportSolverOptions& get_options() const {return m_options;}
private:
void initialize();
SIASaturatedReactiveTransportSolverOptions m_options;
std::shared_ptr<mesh::Mesh1D> m_mesh;
SIASaturatedVariables m_variables;
// transport program
SaturatedDiffusionProgram m_transport_program;
dfpmsolver::ParabolicDriver<SaturatedDiffusionProgram> m_transport_solver;
//
Eigen::VectorXi m_bcs;
};
} // end namespace reactmicp
} // end namespace specmicp
#endif // SPECMICP_REACTMICP_SATURATED_DIFFUSION_REACTIVETRANSPORTSOLVER_HPP

Event Timeline