solution: update with tc and patm in setter

This commit is contained in:
Max Luebke 2025-07-28 12:13:10 +02:00
parent 265cd0ae27
commit 281595c39f
3 changed files with 14 additions and 14 deletions

View File

@ -58,7 +58,7 @@ void SolutionWrapper::set(const std::span<LDBLE> &data) {
new_totals[tot_name] = value;
}
this->solution->Update(total_h, total_o, cb,
this->solution->Update(total_h, total_o, cb, tc, patm,
_with_redox ? new_totals
: new_totals.Simplify_redox());
}

View File

@ -1061,26 +1061,26 @@ void cxxSolution::read_raw(CParser &parser, bool check) {
return;
}
void cxxSolution::Update(LDBLE h_tot, LDBLE o_tot, LDBLE charge,
void cxxSolution::Update(LDBLE h_tot, LDBLE o_tot, LDBLE charge, LDBLE tc, LDBLE patm,
const cxxNameDouble &const_nd) {
this->new_def = false;
this->patm = 1.0;
this->potV = 0.0;
this->tc = 25.0;
this->ph = 7.0;
this->pe = 4.0;
this->mu = 1e-7;
this->ah2o = 1.0;
this->patm = patm;
// this->potV = 0.0;
this->tc = tc;
// this->ph = 7.0;
// this->pe = 4.0;
// this->mu = 1e-7;
// this->ah2o = 1.0;
// H, O, charge, totals, and activities of solution are updated
this->total_h = h_tot;
this->total_o = o_tot;
this->cb = charge;
this->mass_water = o_tot / 55.55;
this->density = 1.0;
this->viscosity = 1.0;
this->soln_vol = 1.0;
this->total_alkalinity = 0.0;
// this->density = 1.0;
// this->viscosity = 1.0;
// this->soln_vol = 1.0;
// this->total_alkalinity = 0.0;
this->master_activity.clear();
this->species_gamma.clear();

View File

@ -123,7 +123,7 @@ public:
// void modify_activities(const cxxSolution & original);
// void Simplify_totals();
void Update(const cxxNameDouble &nd);
void Update(LDBLE h_tot, LDBLE o_tot, LDBLE charge, const cxxNameDouble &nd);
void Update(LDBLE h_tot, LDBLE o_tot, LDBLE charge, LDBLE tc, LDBLE patm, const cxxNameDouble &nd);
void Update_activities(const cxxNameDouble &original_tot);
void Serialize(Dictionary &dictionary, std::vector<int> &ints,
std::vector<double> &doubles);