Merge commit '679c637ed207c2a2418be64d4ee1ca140073ba90'

This commit is contained in:
Scott R Charlton 2019-11-18 22:29:45 -07:00
commit 589d6ba5d6
2 changed files with 39 additions and 132 deletions

View File

@ -1353,9 +1353,9 @@ print_pp_assemblage(void)
{ {
if (x[j]->type != PP) if (x[j]->type != PP)
continue; continue;
cxxPPassemblage * pp_assemblage_ptr = Utilities::Rxn_find(Rxn_pp_assemblage_map, use.Get_n_pp_assemblage_user()); //cxxPPassemblage * pp_assemblage_ptr = Utilities::Rxn_find(Rxn_pp_assemblage_map, use.Get_n_pp_assemblage_user());
cxxPPassemblageComp * comp_ptr = pp_assemblage_ptr->Find(x[j]->pp_assemblage_comp_name); //cxxPPassemblageComp * comp_ptr = pp_assemblage_ptr->Find(x[j]->pp_assemblage_comp_name);
//cxxPPassemblageComp * comp_ptr = (cxxPPassemblageComp * ) x[j]->pp_assemblage_comp_ptr; // appt, is sometimes lost?? cxxPPassemblageComp * comp_ptr = (cxxPPassemblageComp * ) x[j]->pp_assemblage_comp_ptr; // appt, is sometimes lost??
/* /*
* Print saturation index * Print saturation index
*/ */

View File

@ -612,27 +612,6 @@ transport(void)
if (i > 1) if (i > 1)
Utilities::Rxn_copy(Rxn_solution_map, -2, i - 1); Utilities::Rxn_copy(Rxn_solution_map, -2, i - 1);
saver(); saver();
/* maybe sorb a surface component... */
if (ishift == 0 && j == nmix && (stag_data->count_stag == 0
|| Utilities::Rxn_find(Rxn_solution_map, i + 1 + count_cells) == 0))
{
if (change_surf_count > 0)
{
for (k = 0; k < change_surf_count; k++)
{
if (change_surf[k].cell_no != i)
break;
reformat_surf(change_surf[k].comp_name,
change_surf[k].fraction,
change_surf[k].new_comp_name,
change_surf[k].new_Dw,
change_surf[k].cell_no);
change_surf[k].cell_no = -99;
}
change_surf_count = 0;
}
}
} }
if (!dV_dcell) if (!dV_dcell)
@ -787,29 +766,7 @@ transport(void)
kin_time = kin_time_save; kin_time = kin_time_save;
saver(); saver();
/* maybe sorb a surface component... */ /* If nmix is zero, stagnant zone mixing after advective step ... */
if (nmix == 0 && (stag_data->count_stag == 0 ||
(Utilities::Rxn_find(Rxn_solution_map, i + 1 + count_cells) == 0)))
{
if (change_surf_count > 0)
{
for (k = 0; k < change_surf_count; k++)
{
if (change_surf[k].cell_no != i)
break;
reformat_surf(change_surf[k].comp_name,
change_surf[k].fraction,
change_surf[k].new_comp_name,
change_surf[k].new_Dw,
change_surf[k].cell_no);
change_surf[k].cell_no = -99;
}
change_surf_count = 0;
}
}
/* If nmix is zero, stagnant zone mixing after
advective step ... */
if ((nmix == 0) && (stag_data->count_stag > 0)) if ((nmix == 0) && (stag_data->count_stag > 0))
{ {
mix_stag(i, stagkin_time, TRUE, step_fraction); mix_stag(i, stagkin_time, TRUE, step_fraction);
@ -916,32 +873,10 @@ transport(void)
if (i > 1) if (i > 1)
Utilities::Rxn_copy(Rxn_solution_map, -2, i - 1); Utilities::Rxn_copy(Rxn_solution_map, -2, i - 1);
saver(); saver();
/* maybe sorb a surface component... */
if ((j == nmix) && ((stag_data->count_stag == 0)
|| (Utilities::Rxn_find(Rxn_solution_map, i + 1 + count_cells) == 0)))
{
if (change_surf_count > 0)
{
for (k = 0; k < change_surf_count; k++)
{
if (change_surf[k].cell_no != i)
break;
reformat_surf(change_surf[k].comp_name,
change_surf[k].fraction,
change_surf[k].new_comp_name,
change_surf[k].new_Dw,
change_surf[k].cell_no);
change_surf[k].cell_no = -99;
}
change_surf_count = 0;
}
}
} }
if (!dV_dcell) if (!dV_dcell)
Utilities::Rxn_copy(Rxn_solution_map, -2, count_cells); Utilities::Rxn_copy(Rxn_solution_map, -2, count_cells);
/* Stagnant zone mixing after completion of each /* Stagnant zone mixing after completion of each diffusive/dispersive step ... */
diffusive/dispersive step ... */
rate_sim_time_start = rate_sim_time_start =
(transport_step - 1) * timest + (j - 1) * stagkin_time; (transport_step - 1) * timest + (j - 1) * stagkin_time;
rate_sim_time = rate_sim_time_start + stagkin_time; rate_sim_time = rate_sim_time_start + stagkin_time;
@ -1138,6 +1073,25 @@ print_punch(int i, boolean active)
punch_all(); punch_all();
if (cell_data[i].print && (transport_step % print_modulus == 0)) if (cell_data[i].print && (transport_step % print_modulus == 0))
print_all(); print_all();
/* maybe sorb a surface component... */
if (change_surf_count > 0)
{
for (int k = 0; k < change_surf_count; k++)
{
if (change_surf[k].cell_no != i)
break;
reformat_surf(change_surf[k].comp_name,
change_surf[k].fraction,
change_surf[k].new_comp_name,
change_surf[k].new_Dw,
change_surf[k].cell_no);
change_surf[k].cell_no = -99;
}
change_surf_count = 0;
save.n_surface_user = save.n_solution_user;
save.n_surface_user_end = save.n_solution_user_end;
}
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
@ -1431,7 +1385,7 @@ int Phreeqc::
mix_stag(int i, LDBLE kin_time, int l_punch, LDBLE step_fraction) mix_stag(int i, LDBLE kin_time, int l_punch, LDBLE step_fraction)
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
{ {
int j, n, k; int n, k;
LDBLE t_imm; LDBLE t_imm;
cxxSolution *ptr_imm, *ptr_m; cxxSolution *ptr_imm, *ptr_m;
k = -1000; // compiler says k may be undefined k = -1000; // compiler says k may be undefined
@ -1512,23 +1466,6 @@ mix_stag(int i, LDBLE kin_time, int l_punch, LDBLE step_fraction)
print_punch(i, true); print_punch(i, true);
saver(); // save solution i in -2, original can be used in other stagnant mixes saver(); // save solution i in -2, original can be used in other stagnant mixes
} }
/* maybe sorb a surface component... */
if (l_punch && change_surf_count)
{
for (j = 0; j < change_surf_count; j++)
{
if (change_surf[j].cell_no != i)
break;
reformat_surf(change_surf[j].comp_name,
change_surf[j].fraction,
change_surf[j].new_comp_name,
change_surf[j].new_Dw,
change_surf[j].cell_no);
change_surf[j].cell_no = -99;
}
change_surf_count = 0;
}
} }
cell_no = k; cell_no = k;
@ -1540,23 +1477,6 @@ mix_stag(int i, LDBLE kin_time, int l_punch, LDBLE step_fraction)
fill_spec(cell_no, i); fill_spec(cell_no, i);
saver(); // save solution k in -2 - k, original k can be used in other stagnant mixes saver(); // save solution k in -2 - k, original k can be used in other stagnant mixes
/* maybe sorb a surface component... */
if (l_punch && change_surf_count)
{
for (j = 0; j < change_surf_count; j++)
{
if (change_surf[j].cell_no != k)
break;
reformat_surf(change_surf[j].comp_name,
change_surf[j].fraction,
change_surf[j].new_comp_name,
change_surf[j].new_Dw,
change_surf[j].cell_no);
change_surf[j].cell_no = -99;
}
change_surf_count = 0;
}
done_mixing = true; done_mixing = true;
} }
else if (n == 1 && l_punch && !implicit) else if (n == 1 && l_punch && !implicit)
@ -1840,7 +1760,7 @@ set_initial_moles(int i)
temp_exchange.Set_solution_equilibria(true); temp_exchange.Set_solution_equilibria(true);
temp_exchange.Set_n_solution(i); temp_exchange.Set_n_solution(i);
cxxExchComp comp(this->phrq_io); cxxExchComp comp;
count_elts = 0; count_elts = 0;
paren_count = 0; paren_count = 0;
strcpy(token, "X"); strcpy(token, "X");
@ -3397,7 +3317,7 @@ multi_D(LDBLE DDt, int mobile_cell, int stagnant)
} }
if (jcell > last_c2) if (jcell > last_c2)
last_c2 = jcell; last_c2 = jcell;
mixf = fraction[i] / nmix; mixf = (nmix ? fraction[i] / nmix : fraction[i]);
} }
else else
{ /* regular column... */ { /* regular column... */
@ -5626,11 +5546,8 @@ diff_stag_surf(int mobile_cell)
if (multi_Dflag) if (multi_Dflag)
{ {
mixf_store *= mixf_store *=
(cell_data[i1].por <= (cell_data[i1].por <= cell_data[i2].por ? cell_data[i1].por : cell_data[i2].por);
cell_data[i2].por ? cell_data[i1].por : cell_data[i2]. mixf_store /= (default_Dw * pow(multi_Dpor, multi_Dn) * multi_Dpor);
por);
mixf_store /= (default_Dw * pow(multi_Dpor, multi_Dn) *
multi_Dpor);
} }
/* mix in comps with the same charge structure... */ /* mix in comps with the same charge structure... */
@ -5646,8 +5563,7 @@ diff_stag_surf(int mobile_cell)
for (k1 = 0; k1 < k; k1++) for (k1 = 0; k1 < k; k1++)
{ {
cxxSurfaceComp *comp_k1_ptr = &(surface_ptr2->Get_surface_comps()[k1]); cxxSurfaceComp *comp_k1_ptr = &(surface_ptr2->Get_surface_comps()[k1]);
if (comp_k_ptr->Get_charge_name() == if (comp_k_ptr->Get_charge_name() == comp_k1_ptr->Get_charge_name())
comp_k1_ptr->Get_charge_name())
{ {
charge_done = TRUE; charge_done = TRUE;
break; break;
@ -5670,10 +5586,7 @@ diff_stag_surf(int mobile_cell)
if (strcmp(comp_k1_ptr->Get_formula().c_str(), if (strcmp(comp_k1_ptr->Get_formula().c_str(),
comp_k_ptr->Get_formula().c_str()) != 0) comp_k_ptr->Get_formula().c_str()) != 0)
continue; continue;
Dp1 = Dp1 = comp_k1_ptr->Get_Dw() * pow(cell_data[i1].por, multi_Dn) * viscos_f;
comp_k1_ptr->Get_Dw() *
pow(cell_data[i1].por,
multi_Dn) * viscos_f;
break; break;
} }
} }
@ -5710,8 +5623,7 @@ diff_stag_surf(int mobile_cell)
for (k1 = 0; k1 < k; k1++) for (k1 = 0; k1 < k; k1++)
{ {
cxxSurfaceComp *comp_k1_ptr = &(surface_ptr1->Get_surface_comps()[k1]); cxxSurfaceComp *comp_k1_ptr = &(surface_ptr1->Get_surface_comps()[k1]);
if (comp_k_ptr->Get_charge_name() == if (comp_k_ptr->Get_charge_name() == comp_k1_ptr->Get_charge_name())
comp_k1_ptr->Get_charge_name())
{ {
charge_done = TRUE; charge_done = TRUE;
break; break;
@ -5723,9 +5635,7 @@ diff_stag_surf(int mobile_cell)
/* find diffusion coefficients of surfaces... */ /* find diffusion coefficients of surfaces... */
if (multi_Dflag) if (multi_Dflag)
{ {
Dp1 = Dp1 = comp_k_ptr->Get_Dw() * pow(cell_data[i1].por, multi_Dn) * viscos_f;
comp_k_ptr->Get_Dw() *
pow(cell_data[i1].por, multi_Dn) * viscos_f;
Dp2 = 0; Dp2 = 0;
if (surf2) if (surf2)
@ -5736,10 +5646,7 @@ diff_stag_surf(int mobile_cell)
if (strcmp(comp_k1_ptr->Get_formula().c_str(), if (strcmp(comp_k1_ptr->Get_formula().c_str(),
comp_k_ptr->Get_formula().c_str()) != 0) comp_k_ptr->Get_formula().c_str()) != 0)
continue; continue;
Dp2 = Dp2 = comp_k1_ptr->Get_Dw() * pow(cell_data[i2].por, multi_Dn) * viscos_f;
comp_k1_ptr->Get_Dw() *
pow(cell_data[i2].por,
multi_Dn) * viscos_f;
break; break;
} }
} }
@ -5795,11 +5702,11 @@ diff_stag_surf(int mobile_cell)
if (i >= 0 && i <= 1 + count_cells * (1 + stag_data->count_stag)) if (i >= 0 && i <= 1 + count_cells * (1 + stag_data->count_stag))
{ {
surface_ptr1 = Utilities::Rxn_find(Rxn_surface_map, i); surface_ptr1 = Utilities::Rxn_find(Rxn_surface_map, i);
if (surface_ptr1 != NULL) //if (surface_ptr1 != NULL)
{ //{
Rxn_surface_map[i] = jit->second; // Rxn_surface_map[i] = jit->second;
} //}
else //else
{ {
//Add to map //Add to map
Rxn_surface_map[i] = jit->second; Rxn_surface_map[i] = jit->second;