roughed in equi_delay

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@10582 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2015-12-16 00:53:27 +00:00
parent ca4c8f9e55
commit 5476982186
5 changed files with 23 additions and 7 deletions

View File

@ -725,6 +725,7 @@ void Phreeqc::init(void)
diagonal_scale = FALSE;
mass_water_switch = FALSE;
delay_mass_water = FALSE;
equi_delay = 0;
dampen_ah2o = false;
censor = 0.0;
aqueous_only = 0;
@ -1909,6 +1910,7 @@ Phreeqc::InternalCopy(const Phreeqc *pSrc)
diagonal_scale = pSrc->diagonal_scale;
mass_water_switch = pSrc->mass_water_switch;
delay_mass_water = pSrc->delay_mass_water;
equi_delay = pSrc->equi_delay;
dampen_ah2o = pSrc->dampen_ah2o;
censor = pSrc->censor;
aqueous_only = pSrc->aqueous_only;

View File

@ -1627,6 +1627,7 @@ protected:
int diagonal_scale; /* 0 not used, 1 used */
int mass_water_switch;
int delay_mass_water;
int equi_delay;
bool dampen_ah2o;
LDBLE censor;
int aqueous_only;

View File

@ -1265,6 +1265,7 @@ set_and_run_wrapper(int i, int use_mix, int use_kinetics, int nsaver,
old_pe = pe_step_size;
old_min_value = min_value;
old_pp_column_scale = pp_column_scale;
int old_equi_delay = equi_delay;
if (state == TRANSPORT || state == PHAST)
{
@ -1338,6 +1339,14 @@ set_and_run_wrapper(int i, int use_mix, int use_kinetics, int nsaver,
}
else if (j == 4)
{
if (equi_delay > 0)
{
equi_delay = 0;
}
else
{
equi_delay = 1;
}
always_full_pitzer = TRUE;
itmax *= 2;
if (diagonal_scale == TRUE)
@ -1468,6 +1477,7 @@ set_and_run_wrapper(int i, int use_mix, int use_kinetics, int nsaver,
pe_step_size = old_pe;
min_value = old_min_value;
pp_column_scale = old_pp_column_scale;
equi_delay = old_equi_delay;
aqueous_only = 0;
negative_concentrations = FALSE;
always_full_pitzer = FALSE;

View File

@ -1126,8 +1126,7 @@ ineq(int in_kode)
if (x[i]->phase->in == FALSE)
continue;
// delay removing phase
int delay = 0;
if (x[i]->moles > 0.0 || x[i]->f <= 0.0 || iterations == 0 || delay == 0)
if (x[i]->moles > 0.0 || x[i]->f <= 0.0 || iterations == 0 || equi_delay == 0)
{
x[i]->iteration = iterations;
}
@ -1137,7 +1136,7 @@ ineq(int in_kode)
continue;
/* Undersaturated and no mass, ignore */
if (x[i]->f > 0e-8 && x[i]->moles <= 0
&& iterations >= x[i]->iteration + delay
&& iterations >= x[i]->iteration + equi_delay
&& comp_ptr->Get_add_formula().size() == 0)
{
continue;

View File

@ -8255,11 +8255,12 @@ read_debug(void)
"convergence_tolerance", /* 14 */
"numerical_derivatives", /* 15 */
"tries", /* 16 */
"try", /* 17 */
"numerical_fixed_volume", /* 18 */
"force_numerical_fixed_volume" /* 19 */
"try", /* 17 */
"numerical_fixed_volume", /* 18 */
"force_numerical_fixed_volume", /* 19 */
"equi_delay" /* 20 */
};
int count_opt_list = 20;
int count_opt_list = 21;
/*
* Read parameters:
* ineq_tol;
@ -8352,6 +8353,9 @@ read_debug(void)
case 19: /* debug_inverse */
force_numerical_fixed_volume = (get_true_false(next_char, TRUE) == TRUE);
break;
case 20: /* equi_delay */
sscanf(next_char, "%d", &equi_delay);
break;
}
if (return_value == EOF || return_value == KEYWORD)
break;