Skip to content

Commit

Permalink
Use state.SetConcentration for each species.
Browse files Browse the repository at this point in the history
  • Loading branch information
dwfncar committed Oct 10, 2023
1 parent 96806d9 commit 2e215b0
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/kpp/test_kpp_to_micm.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include <micm/configure/solver_config.hpp>
#include <micm/process/arrhenius_rate_constant.hpp>
#include <micm/solver/rosenbrock.hpp>
#include <micm/system/species.hpp>

template<class T>
using SparseMatrixPolicy = micm::SparseMatrix<T>;
Expand Down Expand Up @@ -109,15 +110,27 @@ int main(const int argc, const char *argv[])
std::cout << "O2 " << n_O2 << std::endl;
std::cout << "O3 " << n_O3 << std::endl;

std::unordered_map<std::string, std::vector<double>> intial_concentration = {
std::unordered_map<std::string, std::vector<double>> initial_concentration = {
{ "M", { n_M } },
{ "O2", { n_O2 } },
{ "O3", { n_O3 } },
{ "O", { 0.0 } }, // [O] / [O3] ~ 3e-5, S&P3e p.124
{ "O1D", { 0.0 } },
};

state.SetConcentrations(solver_params.system_, intial_concentration);
// state.SetConcentrations(solver_params.system_, initial_concentration);

micm::Species M("M");
micm::Species O2("O2");
micm::Species O3("O3");
micm::Species O("O");
micm::Species O1D("O1D");

state.SetConcentration(M, n_M);
state.SetConcentration(O2, n_O2);
state.SetConcentration(O3, n_O3);
state.SetConcentration(O, 0.0);
state.SetConcentration(O1D, 0.0);

double time_step = 60; // s
int nstep = 20;
Expand Down

0 comments on commit 2e215b0

Please sign in to comment.