Tony's latest changes.

New test case SC_Ohm, added to Makefile.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/branches/concrete@10983 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2016-03-26 20:11:29 +00:00
parent d5e7aa0ab3
commit d2dba8c291
3 changed files with 179 additions and 147 deletions

View File

@ -1408,6 +1408,7 @@ protected:
int multi_Dflag; /* signals calc'n of multicomponent diffusion */
int interlayer_Dflag; /* multicomponent diffusion and diffusion through interlayer porosity */
LDBLE default_Dw; /* default species diffusion coefficient in water at 25oC, m2/s */
int correct_Dw; /* if true, Dw is adapted in calc_SC */
LDBLE multi_Dpor; /* uniform porosity of free porewater in solid medium */
LDBLE interlayer_Dpor; /* uniform porosity of interlayer space of montmorillonite in solid medium */
LDBLE multi_Dpor_lim; /* limiting free porewater porosity where transport stops */

View File

@ -519,6 +519,7 @@ read_transport(void)
multi_Dpor = 0.3;
multi_Dpor_lim = 0.0;
multi_Dn = 1.0;
correct_Dw = 0;
if (copy_token(token, &next_char, &l) == EMPTY)
break;
else
@ -574,6 +575,23 @@ read_transport(void)
break;
}
}
if (copy_token(token, &next_char, &l) == EMPTY)
break;
else
{
str_tolower(token);
if (strstr(token, "f") == token)
correct_Dw = 0;
else if (strstr(token, "t") == token)
correct_Dw = 1;
else
{
input_error++;
error_msg
("Expected 'true' or 'false' for correcting Dw's as in Specific Conductance.",
CONTINUE);
}
}
opt_save = OPTION_DEFAULT;
break;
case 41: /* interlayer diffusion */
@ -793,7 +811,6 @@ read_transport(void)
"No porosities were read; used the minimal value %8.2e from -multi_D.", multi_Dpor);
warning_msg(error_string);
for (i = old_cells + 1; i < all_cells; i++)
//for (i = old_cells; i < all_cells; i++)
cell_data[i].por = multi_Dpor;
}
}

View File

@ -527,7 +527,7 @@ transport(void)
run_reactions(i, kin_time, NOMIX, step_fraction);
else
run_reactions(i, kin_time, DISP, step_fraction);
if (multi_Dflag && j < nmix)
if (multi_Dflag)
fill_spec(i);
/* punch and output file */
@ -707,7 +707,7 @@ transport(void)
transport_step, 0, i, max_iter);
status(0, token);
run_reactions(i, kin_time, NOMIX, step_fraction);
if (multi_Dflag == TRUE && j < nmix)
if (multi_Dflag == TRUE)
fill_spec(i);
if (iterations > max_iter)
max_iter = iterations;
@ -825,7 +825,7 @@ transport(void)
run_reactions(i, kin_time, NOMIX, step_fraction);
else
run_reactions(i, kin_time, DISP, step_fraction);
if (multi_Dflag == TRUE && j < nmix)
if (multi_Dflag == TRUE)
fill_spec(i);
if ((j == nmix) && (stag_data->count_stag == 0 || i == 0
|| (i != 1 + count_cells && Utilities::Rxn_find(Rxn_solution_map, i + 1 + count_cells) == 0)))
@ -1624,7 +1624,7 @@ fill_spec(int l_cell_no)
struct master *master_ptr;
LDBLE dum, dum2;
LDBLE lm;
LDBLE por, por_il, viscos_f, viscos_il_f, viscos;
LDBLE por, por_il, viscos_f, viscos_il_f, viscos, l_z, l_g, ff;
bool x_max_done = false;
s_ptr2 = NULL;
@ -1813,6 +1813,20 @@ fill_spec(int l_cell_no)
else
sol_D[l_cell_no].spec[count_spec].Dwt = s_ptr->dw * viscos_f;
}
if (correct_Dw)
{
if ((l_z = fabs(s_x[i]->z)) == 0)
{ // first approximation for neutral species (HTO), but is viscosity dependent
l_z = 1;
l_g = -DH_A * (sqrt(mu_x) / (1 + sqrt(mu_x)));
}
else
l_g = s_ptr->lg;
ff = (mu_x < .36 * l_z ? 0.6 / sqrt(l_z) : sqrt(mu_x) / l_z);
ff *= l_g;
if (ff > 0) ff = 0; // is viscosity dependent (ff > 0 in KCl)
sol_D[l_cell_no].spec[count_spec].Dwt *= under(ff);
}
if (sol_D[l_cell_no].spec[count_spec].Dwt * pow(por, multi_Dn) > diffc_max)
diffc_max = sol_D[l_cell_no].spec[count_spec].Dwt * pow(por, multi_Dn);
sol_D[l_cell_no].spec[count_spec].erm_ddl = s_ptr->erm_ddl;