mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
Merge commit 'afff58ffb022065fab2fe9b960633f0b86e2066b'
This commit is contained in:
commit
90c958c7a4
@ -822,6 +822,7 @@ void Phreeqc::init(void)
|
||||
paren_count = 0;
|
||||
iterations = 0;
|
||||
gamma_iterations = 0;
|
||||
density_iterations = 0;
|
||||
run_reactions_iterations= 0;
|
||||
overall_iterations = 0;
|
||||
max_line = MAX_LINE;
|
||||
@ -1563,6 +1564,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
||||
paren_count = 0;
|
||||
iterations = 0;
|
||||
gamma_iterations = 0;
|
||||
density_iterations = 0;
|
||||
run_reactions_iterations = 0;
|
||||
overall_iterations = 0;
|
||||
free_check_null(line);
|
||||
|
||||
@ -1502,6 +1502,7 @@ protected:
|
||||
int paren_count;
|
||||
int iterations;
|
||||
int gamma_iterations;
|
||||
size_t density_iterations;
|
||||
int run_reactions_iterations;
|
||||
int overall_iterations;
|
||||
|
||||
|
||||
@ -2456,7 +2456,9 @@ total(const char *total_name)
|
||||
{
|
||||
return (total_o_x / mass_water_aq_x);
|
||||
}
|
||||
master_ptr = master_bsearch(total_name);
|
||||
std::string noplus = total_name;
|
||||
replace(noplus, "+", "");
|
||||
master_ptr = master_bsearch(noplus.c_str());
|
||||
t = 0.0;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
@ -2525,7 +2527,9 @@ total_mole(const char *total_name)
|
||||
{
|
||||
return (total_o_x);
|
||||
}
|
||||
master_ptr = master_bsearch(total_name);
|
||||
std::string noplus = total_name;
|
||||
replace(noplus, "+", "");
|
||||
master_ptr = master_bsearch(noplus.c_str());
|
||||
t = 0.0;
|
||||
if (master_ptr == NULL)
|
||||
{
|
||||
|
||||
@ -392,6 +392,7 @@ initial_solutions(int print)
|
||||
int count_iterations = 0;
|
||||
std::string input_units = solution_ref.Get_initial_data()->Get_units();
|
||||
cxxISolution *initial_data_ptr = solution_ref.Get_initial_data();
|
||||
density_iterations = 0;
|
||||
for (;;)
|
||||
{
|
||||
prep();
|
||||
@ -408,6 +409,7 @@ initial_solutions(int print)
|
||||
set(TRUE);
|
||||
converge = model();
|
||||
}
|
||||
density_iterations++;
|
||||
if (solution_ref.Get_initial_data()->Get_calc_density())
|
||||
{
|
||||
solution_ref.Set_density(calc_dens());
|
||||
@ -436,6 +438,7 @@ initial_solutions(int print)
|
||||
add_isotopes(solution_ref);
|
||||
punch_all();
|
||||
print_all();
|
||||
density_iterations = 0;
|
||||
/* free_model_allocs(); */
|
||||
// remove pr_in
|
||||
for (size_t i = 0; i < count_unknowns; i++)
|
||||
|
||||
@ -1798,7 +1798,25 @@ convert_units(cxxSolution *solution_ptr)
|
||||
/*
|
||||
* Convert units
|
||||
*/
|
||||
#ifdef ORIGINAL
|
||||
sum_solutes = exp(-solution_ptr->Get_ph() * LOG_10);
|
||||
#else
|
||||
double g_h, g_oh;
|
||||
compute_gfw("H", &g_h);
|
||||
compute_gfw("OH", &g_oh);
|
||||
if (density_iterations == 0)
|
||||
{
|
||||
sum_solutes = exp(-solution_ptr->Get_ph() * LOG_10) * g_h;
|
||||
sum_solutes += exp((-14 + solution_ptr->Get_ph()) * LOG_10) * g_oh;
|
||||
}
|
||||
else
|
||||
{
|
||||
double soln_vol = calc_solution_volume();
|
||||
sum_solutes = s_hplus->moles / soln_vol * g_h;
|
||||
species* s_oh = s_search("OH-");
|
||||
sum_solutes += s_oh->moles / soln_vol * g_oh;
|
||||
}
|
||||
#endif
|
||||
cxxISolution *initial_data_ptr = solution_ptr->Get_initial_data();
|
||||
std::map<std::string, cxxISolutionComp >::iterator jit = initial_data_ptr->Get_comps().begin();
|
||||
for ( ; jit != initial_data_ptr->Get_comps().end(); jit++)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user