mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Merge commit '622bc5fb4cc8f67f9303e45c98397b97fe30822f'
This commit is contained in:
commit
7f683b4082
@ -673,7 +673,7 @@ namespace zdg_ui2 {
|
|||||||
// Respond to a Zoom Event
|
// Respond to a Zoom Event
|
||||||
void MyZoomEvent( ZedGraphControl ^control, ZoomState ^oldState, ZoomState ^newState )
|
void MyZoomEvent( ZedGraphControl ^control, ZoomState ^oldState, ZoomState ^newState )
|
||||||
{
|
{
|
||||||
// Here we get notification everytime the user zooms
|
// Here we get notification every time the user zooms
|
||||||
}
|
}
|
||||||
void SetChartOptions( System::Object ^sender, System::EventArgs ^e )
|
void SetChartOptions( System::Object ^sender, System::EventArgs ^e )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
# Release
|
# Release
|
||||||
# Debug
|
# Debug
|
||||||
#
|
#
|
||||||
# Serial verisons: Release Debug
|
# Serial versions: Release Debug
|
||||||
#
|
#
|
||||||
# Makefile sets CFG variable, cd's to appropriate directory, runs Makefile recursively
|
# Makefile sets CFG variable, cd's to appropriate directory, runs Makefile recursively
|
||||||
# Recursive make sets appropriate compiler, objects, options, libraries, and compiles PHREEQC
|
# Recursive make sets appropriate compiler, objects, options, libraries, and compiles PHREEQC
|
||||||
|
|||||||
@ -2441,8 +2441,8 @@ factor(struct LOC_exec * LINK)
|
|||||||
require(tokcomma, LINK);
|
require(tokcomma, LINK);
|
||||||
varrec* area_varrec = LINK->t->UU.vp;
|
varrec* area_varrec = LINK->t->UU.vp;
|
||||||
if (LINK->t->kind != tokvar || area_varrec->stringvar != 0)
|
if (LINK->t->kind != tokvar || area_varrec->stringvar != 0)
|
||||||
snerr(": Missing or wrong type area varaiable.");
|
snerr(": Missing or wrong type area variable.");
|
||||||
// varaiable for thickness
|
// variable for thickness
|
||||||
LINK->t = LINK->t->next;
|
LINK->t = LINK->t->next;
|
||||||
require(tokcomma, LINK);
|
require(tokcomma, LINK);
|
||||||
varrec* thickness_varrec = LINK->t->UU.vp;
|
varrec* thickness_varrec = LINK->t->UU.vp;
|
||||||
@ -5595,7 +5595,7 @@ cmdput(struct LOC_exec *LINK)
|
|||||||
/* get parentheses */
|
/* get parentheses */
|
||||||
require(toklp, LINK);
|
require(toklp, LINK);
|
||||||
|
|
||||||
/* get first argumen */
|
/* get first argument */
|
||||||
double value = realexpr(LINK);
|
double value = realexpr(LINK);
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
@ -5628,7 +5628,7 @@ cmdput_(struct LOC_exec* LINK)
|
|||||||
/* get parentheses */
|
/* get parentheses */
|
||||||
require(toklp, LINK);
|
require(toklp, LINK);
|
||||||
|
|
||||||
/* get first argumen */
|
/* get first argument */
|
||||||
char* str = strexpr(LINK);
|
char* str = strexpr(LINK);
|
||||||
std::string s_value = str;
|
std::string s_value = str;
|
||||||
PhreeqcPtr->PHRQ_free(str);
|
PhreeqcPtr->PHRQ_free(str);
|
||||||
|
|||||||
@ -1966,7 +1966,7 @@ Phreeqc::InternalCopy(const Phreeqc* pSrc)
|
|||||||
//count_tally_table_rows = 0;
|
//count_tally_table_rows = 0;
|
||||||
|
|
||||||
/* transport.cpp ------------------------------- */
|
/* transport.cpp ------------------------------- */
|
||||||
/* storage is created and freed in tranport.cpp */
|
/* storage is created and freed in transport.cpp */
|
||||||
sol_D = NULL;
|
sol_D = NULL;
|
||||||
sol_D_dbg = NULL;
|
sol_D_dbg = NULL;
|
||||||
J_ij = NULL;
|
J_ij = NULL;
|
||||||
|
|||||||
@ -1409,7 +1409,7 @@ cxxSolution::add(const cxxSolution & addee, LDBLE extensive)
|
|||||||
this->ph = f1 * this->ph + f2 * addee.ph;
|
this->ph = f1 * this->ph + f2 * addee.ph;
|
||||||
this->pe = f1 * this->pe + f2 * addee.pe;
|
this->pe = f1 * this->pe + f2 * addee.pe;
|
||||||
this->mu = f1 * this->mu + f2 * addee.mu;
|
this->mu = f1 * this->mu + f2 * addee.mu;
|
||||||
this->ah2o = f1 * this->mu + f2 * addee.ah2o;
|
this->ah2o = f1 * this->ah2o + f2 * addee.ah2o;
|
||||||
this->total_h += addee.total_h * extensive;
|
this->total_h += addee.total_h * extensive;
|
||||||
this->total_o += addee.total_o * extensive;
|
this->total_o += addee.total_o * extensive;
|
||||||
this->cb += addee.cb * extensive;
|
this->cb += addee.cb * extensive;
|
||||||
|
|||||||
@ -460,7 +460,7 @@ cl1(int k, int l, int m, int n,
|
|||||||
#endif
|
#endif
|
||||||
if (kk < 0)
|
if (kk < 0)
|
||||||
{
|
{
|
||||||
/* no positive value found in L340 or bypass intermediate verticies */
|
/* no positive value found in L340 or bypass intermediate vertices */
|
||||||
*l_kode = 2;
|
*l_kode = 2;
|
||||||
goto L590;
|
goto L590;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -603,7 +603,7 @@ cl1mp(int k, int l, int m, int n,
|
|||||||
#endif
|
#endif
|
||||||
if (kk < 0)
|
if (kk < 0)
|
||||||
{
|
{
|
||||||
/* no positive value found in L340 or bypass intermediate verticies */
|
/* no positive value found in L340 or bypass intermediate vertices */
|
||||||
*kode = 2;
|
*kode = 2;
|
||||||
goto L590;
|
goto L590;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class CParser: public PHRQ_base
|
|||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
string Input, character string used in printing error message
|
string Input, character string used in printing error message
|
||||||
allow_empty Input, True or false, if a blank line is accepable
|
allow_empty Input, True or false, if a blank line is acceptable
|
||||||
if false, another line is read
|
if false, another line is read
|
||||||
allow_eof Input, True or false, if EOF is acceptable
|
allow_eof Input, True or false, if EOF is acceptable
|
||||||
allow_keyword Input, True or false, if a keyword is acceptable
|
allow_keyword Input, True or false, if a keyword is acceptable
|
||||||
|
|||||||
@ -155,7 +155,7 @@ Utilities::convert_time(double t, std::string in, std::string out)
|
|||||||
{
|
{
|
||||||
t = t * 3600. * 24. * 365.25;
|
t = t * 3600. * 24. * 365.25;
|
||||||
}
|
}
|
||||||
// convert to ouput units
|
// convert to output units
|
||||||
if (out.substr(0,1) == "m")
|
if (out.substr(0,1) == "m")
|
||||||
{
|
{
|
||||||
t = t / 60.;
|
t = t / 60.;
|
||||||
|
|||||||
@ -1672,7 +1672,7 @@ CVEwtSet(CVodeMem cv_mem, N_Vector ycur)
|
|||||||
|
|
||||||
/*********************** CVEwtSetSS *********************************
|
/*********************** CVEwtSetSS *********************************
|
||||||
|
|
||||||
This routine sets ewt as decribed above in the case tol_type = SS.
|
This routine sets ewt as described above in the case tol_type = SS.
|
||||||
It tests for non-positive components before inverting. CVEwtSetSS
|
It tests for non-positive components before inverting. CVEwtSetSS
|
||||||
returns TRUE if ewt is successfully set to a positive vector
|
returns TRUE if ewt is successfully set to a positive vector
|
||||||
and FALSE otherwise. In the latter case, ewt is considered
|
and FALSE otherwise. In the latter case, ewt is considered
|
||||||
@ -1698,7 +1698,7 @@ CVEwtSetSS(CVodeMem cv_mem, N_Vector ycur)
|
|||||||
|
|
||||||
/*********************** CVEwtSetSV *********************************
|
/*********************** CVEwtSetSV *********************************
|
||||||
|
|
||||||
This routine sets ewt as decribed above in the case tol_type = SV.
|
This routine sets ewt as described above in the case tol_type = SV.
|
||||||
It tests for non-positive components before inverting. CVEwtSetSV
|
It tests for non-positive components before inverting. CVEwtSetSV
|
||||||
returns TRUE if ewt is successfully set to a positive vector
|
returns TRUE if ewt is successfully set to a positive vector
|
||||||
and FALSE otherwise. In the latter case, ewt is considered
|
and FALSE otherwise. In the latter case, ewt is considered
|
||||||
@ -3249,7 +3249,7 @@ static void
|
|||||||
CVSetEta(CVodeMem cv_mem)
|
CVSetEta(CVodeMem cv_mem)
|
||||||
{
|
{
|
||||||
|
|
||||||
/* If eta below the threshhold THRESH, reject a change of step size */
|
/* If eta below the threshold THRESH, reject a change of step size */
|
||||||
if (eta < THRESH)
|
if (eta < THRESH)
|
||||||
{
|
{
|
||||||
eta = ONE;
|
eta = ONE;
|
||||||
@ -3320,7 +3320,7 @@ CVComputeEtaqp1(CVodeMem cv_mem)
|
|||||||
corresponding value of q. If there is a tie, the preference
|
corresponding value of q. If there is a tie, the preference
|
||||||
order is to (1) keep the same order, then (2) decrease the order,
|
order is to (1) keep the same order, then (2) decrease the order,
|
||||||
and finally (3) increase the order. If the maximum eta value
|
and finally (3) increase the order. If the maximum eta value
|
||||||
is below the threshhold THRESH, the order is kept unchanged and
|
is below the threshold THRESH, the order is kept unchanged and
|
||||||
eta is set to 1.
|
eta is set to 1.
|
||||||
|
|
||||||
******************************************************************/
|
******************************************************************/
|
||||||
|
|||||||
@ -109,7 +109,7 @@
|
|||||||
#define TRANSPORT 8
|
#define TRANSPORT 8
|
||||||
#define PHAST 9
|
#define PHAST 9
|
||||||
|
|
||||||
/* constaints in mass balance */
|
/* constants in mass balance */
|
||||||
#define EITHER 0
|
#define EITHER 0
|
||||||
#define DISSOLVE 1
|
#define DISSOLVE 1
|
||||||
#define PRECIPITATE -1
|
#define PRECIPITATE -1
|
||||||
@ -981,7 +981,7 @@ public:
|
|||||||
alk = 0;
|
alk = 0;
|
||||||
// default gfw for species
|
// default gfw for species
|
||||||
gfw = 1;
|
gfw = 1;
|
||||||
// formula from which to calcuate gfw
|
// formula from which to calculate gfw
|
||||||
gfw_formula = NULL;
|
gfw_formula = NULL;
|
||||||
// pointer to unknown structure
|
// pointer to unknown structure
|
||||||
unknown = NULL;
|
unknown = NULL;
|
||||||
|
|||||||
@ -55,7 +55,7 @@ check_line_impl(const char *string, int allow_empty, int allow_eof,
|
|||||||
*
|
*
|
||||||
* Arguments:
|
* Arguments:
|
||||||
* string Input, character string used in printing error message
|
* string Input, character string used in printing error message
|
||||||
* allow_empty Input, True or false, if a blank line is accepable
|
* allow_empty Input, True or false, if a blank line is acceptable
|
||||||
* if false, another line is read
|
* if false, another line is read
|
||||||
* allow_eof Input, True or false, if EOF is acceptable
|
* allow_eof Input, True or false, if EOF is acceptable
|
||||||
* allow_keyword Input, True or false, if a keyword is acceptable
|
* allow_keyword Input, True or false, if a keyword is acceptable
|
||||||
|
|||||||
@ -74,7 +74,7 @@ inverse_models(void)
|
|||||||
fprintf(netpath_file, "2.14 # File format\n");
|
fprintf(netpath_file, "2.14 # File format\n");
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Fill in stucture "use".
|
* Fill in structure "use".
|
||||||
*/
|
*/
|
||||||
use.Set_inverse_in(true);
|
use.Set_inverse_in(true);
|
||||||
use.Set_inverse_ptr(&inverse[n]);
|
use.Set_inverse_ptr(&inverse[n]);
|
||||||
|
|||||||
@ -931,7 +931,7 @@ saver(void)
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Save results of calcuations (data in variables with _x,
|
* Save results of calculations (data in variables with _x,
|
||||||
* in unknown structure x, in master, or s) into structure
|
* in unknown structure x, in master, or s) into structure
|
||||||
* arrays. Structure "save" has info on whether to save
|
* arrays. Structure "save" has info on whether to save
|
||||||
* data for each entity (solution, ex, surf, pp, gas, or s_s).
|
* data for each entity (solution, ex, surf, pp, gas, or s_s).
|
||||||
|
|||||||
@ -1964,7 +1964,7 @@ jacobian_sums(void)
|
|||||||
*sum_jacob2[k].target += *sum_jacob2[k].source * sum_jacob2[k].coef;
|
*sum_jacob2[k].target += *sum_jacob2[k].source * sum_jacob2[k].coef;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Make final adustments to jacobian array
|
* Make final adjustments to jacobian array
|
||||||
*/
|
*/
|
||||||
/*
|
/*
|
||||||
* Ionic strength
|
* Ionic strength
|
||||||
|
|||||||
@ -12,7 +12,7 @@
|
|||||||
*------------------------------------------------------------------------*
|
*------------------------------------------------------------------------*
|
||||||
* This is the implementation file for a serial implementation *
|
* This is the implementation file for a serial implementation *
|
||||||
* of the NVECTOR package. It contains the implementation of *
|
* of the NVECTOR package. It contains the implementation of *
|
||||||
* the serial machine environment intialization and free *
|
* the serial machine environment initialization and free *
|
||||||
* routines (and of the Fortran callable interfaces to them) *
|
* routines (and of the Fortran callable interfaces to them) *
|
||||||
* and of the N_Vector kernels listed in nvector_serial.h. *
|
* and of the N_Vector kernels listed in nvector_serial.h. *
|
||||||
* *
|
* *
|
||||||
|
|||||||
@ -107,7 +107,7 @@
|
|||||||
|
|
||||||
/****************************************************************
|
/****************************************************************
|
||||||
* PART I: *
|
* PART I: *
|
||||||
* Serial implementaion of M_Env and N_Vector *
|
* Serial implementation of M_Env and N_Vector *
|
||||||
****************************************************************/
|
****************************************************************/
|
||||||
|
|
||||||
/* The serial implementation of the machine environment has
|
/* The serial implementation of the machine environment has
|
||||||
|
|||||||
@ -737,7 +737,7 @@ PTEMP(LDBLE TK)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
C
|
C
|
||||||
C SUBROUTINE TO CALUCLATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER
|
C SUBROUTINE TO CALCULATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER
|
||||||
C
|
C
|
||||||
*/
|
*/
|
||||||
LDBLE TR = 298.15;
|
LDBLE TR = 298.15;
|
||||||
|
|||||||
@ -674,7 +674,7 @@ build_ss_assemblage(void)
|
|||||||
/* include mole fraction */
|
/* include mole fraction */
|
||||||
store_mb(&(x[i]->phase->log10_fraction_x), &(x[i]->f), 1.0);
|
store_mb(&(x[i]->phase->log10_fraction_x), &(x[i]->f), 1.0);
|
||||||
|
|
||||||
/* include activity coeficient */
|
/* include activity coefficient */
|
||||||
store_mb(&(x[i]->phase->log10_lambda), &(x[i]->f), 1.0);
|
store_mb(&(x[i]->phase->log10_lambda), &(x[i]->f), 1.0);
|
||||||
/*
|
/*
|
||||||
* Put coefficients into mass action equations
|
* Put coefficients into mass action equations
|
||||||
@ -4478,7 +4478,7 @@ setup_solution(void)
|
|||||||
(ph_unknown == charge_balance_unknown)
|
(ph_unknown == charge_balance_unknown)
|
||||||
&& (alkalinity_unknown != NULL))
|
&& (alkalinity_unknown != NULL))
|
||||||
{
|
{
|
||||||
error_msg("pH adustment cannot attain charge balance"
|
error_msg("pH adjustment cannot attain charge balance"
|
||||||
" when alkalinity is fixed.", CONTINUE);
|
" when alkalinity is fixed.", CONTINUE);
|
||||||
input_error++;
|
input_error++;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7477,7 +7477,7 @@ read_title(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Read additonal lines
|
* Read additional lines
|
||||||
*/
|
*/
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
@ -9161,7 +9161,7 @@ read_solid_solutions(void)
|
|||||||
if (j != 1)
|
if (j != 1)
|
||||||
{
|
{
|
||||||
error_string = sformatf(
|
error_string = sformatf(
|
||||||
"Expected temperature (Celcius) for parameters, assemblage %d, solid solution %s, using 25 C",
|
"Expected temperature (Celsius) for parameters, assemblage %d, solid solution %s, using 25 C",
|
||||||
n_user,
|
n_user,
|
||||||
ss_ptr->Get_name().c_str());
|
ss_ptr->Get_name().c_str());
|
||||||
warning_msg(error_string);
|
warning_msg(error_string);
|
||||||
|
|||||||
@ -1586,7 +1586,7 @@ PTEMP_SIT(LDBLE TK)
|
|||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
C
|
C
|
||||||
C SUBROUTINE TO CALUCLATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER
|
C SUBROUTINE TO CALCULATE TEMPERATURE DEPENDENCE OF PITZER PARAMETER
|
||||||
C
|
C
|
||||||
*/
|
*/
|
||||||
LDBLE TR = 298.15;
|
LDBLE TR = 298.15;
|
||||||
|
|||||||
@ -620,10 +620,86 @@ add_mix(cxxMix *mix_ptr)
|
|||||||
* and other variables.
|
* and other variables.
|
||||||
*/
|
*/
|
||||||
LDBLE sum_fractions, intensive, extensive;
|
LDBLE sum_fractions, intensive, extensive;
|
||||||
|
LDBLE sum_fractions_water=0, sum_positive_water=0, intensive_water=0, extensive_water=0;
|
||||||
cxxSolution *solution_ptr;
|
cxxSolution *solution_ptr;
|
||||||
int count_positive;
|
int count_positive;
|
||||||
LDBLE sum_positive;
|
LDBLE sum_positive;
|
||||||
|
|
||||||
|
if (mix_ptr == NULL)
|
||||||
|
return (OK);
|
||||||
|
if (mix_ptr->Get_mixComps().size() == 0)
|
||||||
|
return (OK);
|
||||||
|
sum_fractions = 0.0;
|
||||||
|
sum_positive = 0.0;
|
||||||
|
count_positive = 0;
|
||||||
|
std::map<int, LDBLE>::const_iterator it;
|
||||||
|
for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++)
|
||||||
|
{
|
||||||
|
solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
|
||||||
|
if (solution_ptr == NULL)
|
||||||
|
{
|
||||||
|
error_string = sformatf("Mix solution not found, %d.",
|
||||||
|
it->first);
|
||||||
|
error_msg(error_string, CONTINUE);
|
||||||
|
input_error++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
sum_fractions += it->second;
|
||||||
|
sum_fractions_water += it->second * solution_ptr->Get_mass_water();
|
||||||
|
if (it->second > 0)
|
||||||
|
{
|
||||||
|
sum_positive += it->second;
|
||||||
|
sum_positive_water += it->second * solution_ptr->Get_mass_water();
|
||||||
|
count_positive++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (it = mix_ptr->Get_mixComps().begin(); it != mix_ptr->Get_mixComps().end(); it++)
|
||||||
|
{
|
||||||
|
solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
|
||||||
|
if (solution_ptr == NULL)
|
||||||
|
{
|
||||||
|
error_string = sformatf( "Mix solution not found, %d.",
|
||||||
|
it->first);
|
||||||
|
error_msg(error_string, CONTINUE);
|
||||||
|
input_error++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
extensive = it->second;
|
||||||
|
extensive_water = it->second * solution_ptr->Get_mass_water();
|
||||||
|
intensive = extensive / sum_fractions;
|
||||||
|
intensive_water = extensive_water / sum_fractions_water;
|
||||||
|
|
||||||
|
if (count_positive < (int) mix_ptr->Get_mixComps().size())
|
||||||
|
{
|
||||||
|
if (it->second > 0)
|
||||||
|
{
|
||||||
|
intensive = extensive / sum_positive;
|
||||||
|
intensive_water = extensive_water / sum_positive;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
intensive = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
add_solution(solution_ptr, extensive, intensive_water);
|
||||||
|
}
|
||||||
|
return (OK);
|
||||||
|
}
|
||||||
|
#ifdef SKIP_ERROR
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
int Phreeqc::
|
||||||
|
add_mix(cxxMix* mix_ptr)
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* calls add_solution to accumulate all data in master->totals
|
||||||
|
* and other variables.
|
||||||
|
*/
|
||||||
|
LDBLE sum_fractions, intensive, extensive;
|
||||||
|
cxxSolution* solution_ptr;
|
||||||
|
int count_positive;
|
||||||
|
LDBLE sum_positive;
|
||||||
|
|
||||||
if (mix_ptr == NULL)
|
if (mix_ptr == NULL)
|
||||||
return (OK);
|
return (OK);
|
||||||
if (mix_ptr->Get_mixComps().size() == 0)
|
if (mix_ptr->Get_mixComps().size() == 0)
|
||||||
@ -646,7 +722,7 @@ add_mix(cxxMix *mix_ptr)
|
|||||||
solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
|
solution_ptr = Utilities::Rxn_find(Rxn_solution_map, it->first);
|
||||||
if (solution_ptr == NULL)
|
if (solution_ptr == NULL)
|
||||||
{
|
{
|
||||||
error_string = sformatf( "Mix solution not found, %d.",
|
error_string = sformatf("Mix solution not found, %d.",
|
||||||
it->first);
|
it->first);
|
||||||
error_msg(error_string, CONTINUE);
|
error_msg(error_string, CONTINUE);
|
||||||
input_error++;
|
input_error++;
|
||||||
@ -654,7 +730,7 @@ add_mix(cxxMix *mix_ptr)
|
|||||||
}
|
}
|
||||||
extensive = it->second;
|
extensive = it->second;
|
||||||
intensive = extensive / sum_fractions;
|
intensive = extensive / sum_fractions;
|
||||||
if (count_positive < (int) mix_ptr->Get_mixComps().size())
|
if (count_positive < (int)mix_ptr->Get_mixComps().size())
|
||||||
{
|
{
|
||||||
if (it->second > 0)
|
if (it->second > 0)
|
||||||
{
|
{
|
||||||
@ -669,6 +745,7 @@ add_mix(cxxMix *mix_ptr)
|
|||||||
}
|
}
|
||||||
return (OK);
|
return (OK);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
int Phreeqc::
|
int Phreeqc::
|
||||||
add_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
|
add_pp_assemblage(cxxPPassemblage *pp_assemblage_ptr)
|
||||||
|
|||||||
@ -2488,7 +2488,7 @@ unknown_delete(int i)
|
|||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Delete unknow from list x
|
* Delete unknown from list x
|
||||||
*/
|
*/
|
||||||
unknown_free(x[i]);
|
unknown_free(x[i]);
|
||||||
x.erase(x.begin() + (size_t)i);
|
x.erase(x.begin() + (size_t)i);
|
||||||
@ -2636,7 +2636,7 @@ logk_init(class logk *logk_ptr)
|
|||||||
*/
|
*/
|
||||||
logk_ptr->name = NULL;
|
logk_ptr->name = NULL;
|
||||||
/*
|
/*
|
||||||
* set varibles = 0
|
* set variables = 0
|
||||||
*/
|
*/
|
||||||
logk_ptr->lk = 0.0;
|
logk_ptr->lk = 0.0;
|
||||||
for (i = 0; i < MAX_LOG_K_INDICES; i++)
|
for (i = 0; i < MAX_LOG_K_INDICES; i++)
|
||||||
|
|||||||
@ -31,7 +31,7 @@ get_tally_table_rows_columns(int *rows, int *columns)
|
|||||||
returns number of rows and columns in table
|
returns number of rows and columns in table
|
||||||
get_tally_table_row_heading(int row, char *string)
|
get_tally_table_row_heading(int row, char *string)
|
||||||
row is C row number
|
row is C row number
|
||||||
returns row descripter for row
|
returns row descriptor for row
|
||||||
get_tally_table_column_heading(int column, int *type, char *string)
|
get_tally_table_column_heading(int column, int *type, char *string)
|
||||||
column is C column number
|
column is C column number
|
||||||
returns column heading for column
|
returns column heading for column
|
||||||
@ -803,7 +803,7 @@ build_tally_table(void)
|
|||||||
char token[MAX_LENGTH];
|
char token[MAX_LENGTH];
|
||||||
const char* cptr;
|
const char* cptr;
|
||||||
/*
|
/*
|
||||||
* make list of all elements in all entitites
|
* make list of all elements in all entities
|
||||||
* defines the number of rows in the table
|
* defines the number of rows in the table
|
||||||
*/
|
*/
|
||||||
get_all_components();
|
get_all_components();
|
||||||
@ -811,7 +811,7 @@ build_tally_table(void)
|
|||||||
save_print_use = pr.use;
|
save_print_use = pr.use;
|
||||||
pr.use = FALSE;
|
pr.use = FALSE;
|
||||||
/*
|
/*
|
||||||
* find nuber of columns
|
* find number of columns
|
||||||
*/
|
*/
|
||||||
count_tally_table_columns = 0;
|
count_tally_table_columns = 0;
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -4661,7 +4661,7 @@ ss_prep(LDBLE t, cxxSS *ss_ptr, int print)
|
|||||||
{
|
{
|
||||||
if (print == TRUE)
|
if (print == TRUE)
|
||||||
output_msg(sformatf(
|
output_msg(sformatf(
|
||||||
"\nLocal minimum in the solidus curve coresponding to a maximum\nin the minimum stoichiometric saturation curve.\n\n"));
|
"\nLocal minimum in the solidus curve corresponding to a maximum\nin the minimum stoichiometric saturation curve.\n\n"));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,7 +28,7 @@ struct CURRENT_CELLS
|
|||||||
LDBLE dif, ele, R; // diffusive and electric components, relative cell resistance
|
LDBLE dif, ele, R; // diffusive and electric components, relative cell resistance
|
||||||
} *current_cells;
|
} *current_cells;
|
||||||
LDBLE sum_R, sum_Rd; // sum of R, sum of (current_cells[0].dif - current_cells[i].dif) * R
|
LDBLE sum_R, sum_Rd; // sum of R, sum of (current_cells[0].dif - current_cells[i].dif) * R
|
||||||
struct V_M // For calculating Vinograd and McBain's zero-charge, diffusive tranfer of individual solutes
|
struct V_M // For calculating Vinograd and McBain's zero-charge, diffusive transfer of individual solutes
|
||||||
{
|
{
|
||||||
LDBLE grad, D, z, c, zc, Dz, Dzc;
|
LDBLE grad, D, z, c, zc, Dz, Dzc;
|
||||||
LDBLE b_ij; // harmonic mean of cell properties, with EDL enrichment
|
LDBLE b_ij; // harmonic mean of cell properties, with EDL enrichment
|
||||||
@ -1653,14 +1653,17 @@ init_heat_mix(int l_nmix)
|
|||||||
{
|
{
|
||||||
if (implicit)
|
if (implicit)
|
||||||
{
|
{
|
||||||
LDBLE viscos_f0;
|
LDBLE viscos_f;
|
||||||
l_heat_nmix = l_nmix;
|
l_heat_nmix = l_nmix;
|
||||||
for (i = 1; i <= count_cells + 1; i++)
|
for (i = 1; i <= count_cells + 1; i++)
|
||||||
{
|
{
|
||||||
heat_mix_array[i - 1] = heat_mix_array[i] / l_heat_nmix; /* for implicit, m[i] has mixf with higher cell */
|
heat_mix_array[i - 1] = heat_mix_array[i] / l_heat_nmix; /* for implicit, m[i] has mixf with higher cell */
|
||||||
viscos_f0 = sol_D[i - 1].viscos_f0 * exp(heat_diffc / sol_D[i - 1].tk_x - heat_diffc / 298.15);
|
if (print_viscosity)
|
||||||
viscos_f0 += sol_D[i].viscos_f0 * exp(heat_diffc / sol_D[i].tk_x - heat_diffc / 298.15);
|
{
|
||||||
heat_mix_array[i - 1] *= (viscos_f0 / 2);
|
viscos_f = sol_D[i - 1].viscos_f * exp(heat_diffc / sol_D[i - 1].tk_x - heat_diffc / 298.15);
|
||||||
|
viscos_f += sol_D[i].viscos_f * exp(heat_diffc / sol_D[i].tk_x - heat_diffc / 298.15);
|
||||||
|
heat_mix_array[i - 1] *= (viscos_f / 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -3871,7 +3874,7 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant)
|
|||||||
for IL: A * por_il / por.
|
for IL: A * por_il / por.
|
||||||
|
|
||||||
por_il should be entered for the cell with the maximal cec.
|
por_il should be entered for the cell with the maximal cec.
|
||||||
IL water is related to X-, thus the cec (eq/L IL water) is the same for all cells if X is difined.
|
IL water is related to X-, thus the cec (eq/L IL water) is the same for all cells if X is defined.
|
||||||
IL-water = (free + DL porewater) * por_il / por.
|
IL-water = (free + DL porewater) * por_il / por.
|
||||||
for IL: A * aq_il / t_aq.
|
for IL: A * aq_il / t_aq.
|
||||||
*/
|
*/
|
||||||
@ -4352,9 +4355,9 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant)
|
|||||||
b_j *= sol_D[icell].spec[i].Dwt;
|
b_j *= sol_D[icell].spec[i].Dwt;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dum2 = sol_D[icell].spec[i].Dwt / sol_D[icell].viscos_f0;
|
dum2 = sol_D[icell].spec[i].Dwt / sol_D[icell].viscos_f;
|
||||||
dum2 *= exp(sol_D[icell].spec[i].dw_t / sol_D[jcell].tk_x - sol_D[icell].spec[i].dw_t / sol_D[icell].tk_x);
|
dum2 *= exp(sol_D[icell].spec[i].dw_t / sol_D[jcell].tk_x - sol_D[icell].spec[i].dw_t / sol_D[icell].tk_x);
|
||||||
dum2 *= sol_D[jcell].viscos_f0;
|
dum2 *= sol_D[jcell].viscos_f;
|
||||||
b_j *= dum2;
|
b_j *= dum2;
|
||||||
}
|
}
|
||||||
if (sol_D[icell].spec[i].dw_a_v_dif)
|
if (sol_D[icell].spec[i].dw_a_v_dif)
|
||||||
@ -4463,9 +4466,9 @@ find_J(int icell, int jcell, LDBLE mixf, LDBLE DDt, int stagnant)
|
|||||||
b_i *= sol_D[jcell].spec[j].Dwt;
|
b_i *= sol_D[jcell].spec[j].Dwt;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dum2 = sol_D[jcell].spec[j].Dwt / sol_D[jcell].viscos_f0;
|
dum2 = sol_D[jcell].spec[j].Dwt / sol_D[jcell].viscos_f;
|
||||||
dum2 *= exp(sol_D[jcell].spec[j].dw_t / sol_D[icell].tk_x - sol_D[jcell].spec[j].dw_t / sol_D[jcell].tk_x);
|
dum2 *= exp(sol_D[jcell].spec[j].dw_t / sol_D[icell].tk_x - sol_D[jcell].spec[j].dw_t / sol_D[jcell].tk_x);
|
||||||
dum2 *= sol_D[icell].viscos_f0;
|
dum2 *= sol_D[icell].viscos_f;
|
||||||
b_i *= dum2;
|
b_i *= dum2;
|
||||||
}
|
}
|
||||||
if (sol_D[icell].spec[i].dw_a_v_dif)
|
if (sol_D[icell].spec[i].dw_a_v_dif)
|
||||||
@ -5602,7 +5605,7 @@ diff_stag_surf(int mobile_cell)
|
|||||||
* Diffuse stagnant and mobile surfaces, following the steps of disp_surf.
|
* Diffuse stagnant and mobile surfaces, following the steps of disp_surf.
|
||||||
* First the mobile/stagnant surfaces are mixed, then the stagnant surfaces
|
* First the mobile/stagnant surfaces are mixed, then the stagnant surfaces
|
||||||
* when not already done.
|
* when not already done.
|
||||||
* If mixing factors among the cells are defined expicitly, it is assumed that
|
* If mixing factors among the cells are defined explicitly, it is assumed that
|
||||||
* mixing with a lower numbered cell was done when that cell was processed:
|
* mixing with a lower numbered cell was done when that cell was processed:
|
||||||
* for any cell in MCD, need only include the mixing factors for higher numbered cells.
|
* for any cell in MCD, need only include the mixing factors for higher numbered cells.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -483,7 +483,7 @@ get_token(const char** eqnaddr, std::string& string, LDBLE* l_z, int* l)
|
|||||||
cptr = *eqnaddr;
|
cptr = *eqnaddr;
|
||||||
i = 0;
|
i = 0;
|
||||||
/*
|
/*
|
||||||
* Find end of token or begining of charge
|
* Find end of token or beginning of charge
|
||||||
*/
|
*/
|
||||||
while (((c = *cptr) != '+') && (c != '-') && (c != '=') && (c != '\0'))
|
while (((c = *cptr) != '+') && (c != '-') && (c != '=') && (c != '\0'))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user