mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 16:44:49 +01:00
limit on eps_r in utilities.cpp.
Added check when reading pitzer parameters that the right number of species is read. git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@9390 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
parent
ffd459c6db
commit
4d47ed13fc
@ -79,8 +79,16 @@ pitz_param_read(char *string, int n)
|
||||
ptr = string;
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
if (copy_token(token, &ptr, &l) == EMPTY)
|
||||
int j = copy_token(token, &ptr, &l);
|
||||
if (j == EMPTY)
|
||||
return (NULL);
|
||||
if (j != UPPER)
|
||||
{
|
||||
input_error++;
|
||||
std::ostringstream err;
|
||||
err << "Wrong number of species for a Pitzer parameter.\n" << line;
|
||||
error_msg(err.str().c_str(), CONTINUE);
|
||||
}
|
||||
pzp.species[i] = string_hsave(token);
|
||||
}
|
||||
k = 0;
|
||||
|
||||
@ -237,6 +237,11 @@ calc_dielectrics(LDBLE tc, LDBLE pa)
|
||||
LDBLE b = u7 + u8 / T + u9 * T;
|
||||
LDBLE pb = pa * 1.01325; // pa in bar
|
||||
eps_r = d1000 + c * log((b + pb) / (b + 1e3)); // relative dielectric constant
|
||||
if (eps_r <= 0)
|
||||
{
|
||||
eps_r = 10.;
|
||||
warning_msg("Relative dielectric constant is negative.\nTemperature is out of range of parameterization.");
|
||||
}
|
||||
|
||||
/* qe^2 / (eps_r * kB * T) = 4.803204e-10**2 / 1.38065e-16 / (eps_r * T)
|
||||
= 1.671008e-3 (esu^2 / (erg/K)) / (eps_r * T) */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user