mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 08:38:23 +01:00
Tony's changes from 20180305
This commit is contained in:
parent
b0fdcc41e4
commit
86a55b5b5d
7
Form1.h
7
Form1.h
@ -1134,11 +1134,8 @@ namespace zdg_ui2 {
|
||||
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form1::typeid));
|
||||
try
|
||||
{
|
||||
#ifdef NPP
|
||||
this->Icon = gcnew System::Drawing::Icon("c:\\phreeqc\\phreex.ico");
|
||||
#else
|
||||
this->Icon = (cli::safe_cast<System::Drawing::Icon^ >(resources->GetObject(L"$this.Icon")));
|
||||
#endif
|
||||
//this->Icon = gcnew System::Drawing::Icon("c:\\phreeqc\\phreex.ico");
|
||||
this->Icon = (cli::safe_cast<System::Drawing::Icon^>(resources->GetObject(L"$this.Icon")));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
|
||||
@ -106,6 +106,7 @@ public:
|
||||
void Set_diffuse_layer_totals(cxxNameDouble & nd) {this->diffuse_layer_totals = nd;}
|
||||
std::map<LDBLE, cxxSurfDL> &Get_g_map(void) {return g_map;}
|
||||
void Set_g_map(std::map<LDBLE, cxxSurfDL> & t) {g_map = t;}
|
||||
std::map<LDBLE, LDBLE> &Get_z_gMCD_map(void) { return z_gMCD_map; } // z, exp(-zF Psi / RT) * fraction of dl water
|
||||
std::map<int, double> & Get_dl_species_map(void) {return this->dl_species_map;}
|
||||
void Serialize(Dictionary & dictionary, std::vector < int >&ints, std::vector < double >&doubles);
|
||||
void Deserialize(Dictionary & dictionary, std::vector < int >&ints, std::vector < double >&doubles, int &ii, int &dd);
|
||||
@ -122,6 +123,7 @@ protected:
|
||||
// workspace variables
|
||||
LDBLE sigma0, sigma1, sigma2, sigmaddl;
|
||||
std::map<LDBLE, cxxSurfDL> g_map;
|
||||
std::map<LDBLE, LDBLE> z_gMCD_map;
|
||||
const static std::vector < std::string > vopts;
|
||||
std::map<int, double> dl_species_map;
|
||||
};
|
||||
|
||||
@ -277,8 +277,8 @@ write_banner(void)
|
||||
|
||||
/* version */
|
||||
#ifdef NPP
|
||||
//len = sprintf(buffer, "* PHREEQC-%s *", "3.4.1 AmpŠre");
|
||||
len = sprintf(buffer, "* PHREEQC-%s *", "3.4.1");
|
||||
//len = sprintf(buffer, "* PHREEQC-%s *", "3.4.2 AmpŠre");
|
||||
len = sprintf(buffer, "* PHREEQC-%s *", "3.4.2");
|
||||
#else
|
||||
len = sprintf(buffer, "* PHREEQC-%s *", "@VERSION@");
|
||||
#endif
|
||||
@ -302,7 +302,7 @@ write_banner(void)
|
||||
|
||||
/* date */
|
||||
#ifdef NPP
|
||||
len = sprintf(buffer, "%s", "February 15, 2018");
|
||||
len = sprintf(buffer, "%s", "February 27, 2018");
|
||||
#else
|
||||
len = sprintf(buffer, "%s", "@VER_DATE@");
|
||||
#endif
|
||||
@ -492,12 +492,12 @@ process_file_names(int argc, char *argv[], std::istream **db_cookie,
|
||||
screen_msg(sformatf("Database file: %s\n\n", token));
|
||||
strcpy(db_file, token);
|
||||
#ifdef NPP
|
||||
//output_msg(sformatf("Using PHREEQC: version 3.4.1 Ampère, compiled February 15, 2018\n"));
|
||||
//output_msg(sformatf("Using PHREEQC: version 3.4.2 Ampère, compiled February 27, 2018\n"));
|
||||
#endif
|
||||
output_msg(sformatf(" Input file: %s\n", in_file));
|
||||
output_msg(sformatf(" Output file: %s\n", out_file));
|
||||
#ifdef NPP
|
||||
output_msg(sformatf("Using PHREEQC: version 3.4.1, compiled February 15, 2018\n"));
|
||||
output_msg(sformatf("Using PHREEQC: version 3.4.2, compiled February 27, 2018\n"));
|
||||
#endif
|
||||
output_msg(sformatf("Database file: %s\n\n", token));
|
||||
#ifdef NPP
|
||||
|
||||
@ -742,7 +742,7 @@ calc_all_donnan(void)
|
||||
{
|
||||
bool converge;
|
||||
int cd_m;
|
||||
LDBLE new_g, f_psi, surf_chrg_eq, psi_avg, f_sinh, A_surf, ratio_aq;
|
||||
LDBLE new_g, f_psi, surf_chrg_eq, psi_avg, f_sinh, A_surf, ratio_aq, ratio_aq_tot;
|
||||
LDBLE new_g2, f_psi2, surf_chrg_eq2, psi_avg2, dif, var1;
|
||||
|
||||
if (use.Get_surface_ptr() == NULL)
|
||||
@ -813,6 +813,7 @@ calc_all_donnan(void)
|
||||
|
||||
/* fill in g's */
|
||||
ratio_aq = charge_ptr->Get_mass_water() / mass_water_aq_x;
|
||||
ratio_aq_tot = charge_ptr->Get_mass_water() / mass_water_bulk_x;
|
||||
|
||||
for (it = charge_group_map.begin(); it != charge_group_map.end(); it++)
|
||||
{
|
||||
@ -821,13 +822,14 @@ calc_all_donnan(void)
|
||||
{
|
||||
charge_ptr->Get_g_map()[z].Set_g(0);
|
||||
charge_ptr->Get_g_map()[z].Set_dg(0);
|
||||
charge_ptr->Get_z_gMCD_map()[z] = 0;
|
||||
converge = true;
|
||||
continue;
|
||||
}
|
||||
new_g = ratio_aq * (exp(cd_m * z * psi_avg) - 1);
|
||||
if (use.Get_surface_ptr()->Get_only_counter_ions() &&
|
||||
((surf_chrg_eq < 0 && z < 0)
|
||||
|| (surf_chrg_eq > 0 && z > 0)))
|
||||
if (use.Get_surface_ptr()->Get_only_counter_ions() && surf_chrg_eq * z > 0)
|
||||
//((surf_chrg_eq < 0 && z < 0)
|
||||
// || (surf_chrg_eq > 0 && z > 0)))
|
||||
new_g = -ratio_aq;
|
||||
if (new_g <= -ratio_aq)
|
||||
new_g = -ratio_aq + G_TOL * 1e-3;
|
||||
@ -861,7 +863,19 @@ calc_all_donnan(void)
|
||||
{
|
||||
charge_ptr->Get_g_map()[z].Set_dg(-z);
|
||||
}
|
||||
/* save g for species */
|
||||
/* save Boltzmann factor * water fraction for MCD calc's in transport */
|
||||
if (converge)
|
||||
{
|
||||
if (use.Get_surface_ptr()->Get_only_counter_ions())
|
||||
{
|
||||
if (surf_chrg_eq * z > 0) // co-ions are not in the DL
|
||||
charge_ptr->Get_z_gMCD_map()[z] = 0;
|
||||
else // assume that counter-ions have the free water conc for diffusion
|
||||
charge_ptr->Get_z_gMCD_map()[z] = ratio_aq_tot;
|
||||
}
|
||||
else
|
||||
charge_ptr->Get_z_gMCD_map()[z] = (new_g / ratio_aq + 1) * ratio_aq_tot;
|
||||
}
|
||||
}
|
||||
if (debug_diffuse_layer == TRUE)
|
||||
{
|
||||
|
||||
@ -2303,7 +2303,6 @@ model_pz(void)
|
||||
{
|
||||
|
||||
count_basis_change++;
|
||||
//count_unknowns -= (int) s_list.size();
|
||||
count_unknowns -= count_s_x;
|
||||
reprep();
|
||||
full_pitzer = false;
|
||||
|
||||
@ -2286,13 +2286,13 @@ print_totals(void)
|
||||
"Total alkalinity (eq/kg) = ",
|
||||
(double) (total_alkalinity / mass_water_aq_x)));
|
||||
}
|
||||
if (carbon_unknown == NULL && total_carbon > 0.0)
|
||||
if (carbon_unknown == NULL && total_carbon)
|
||||
{
|
||||
output_msg(sformatf("%45s%11.3e\n",
|
||||
"Total carbon (mol/kg) = ",
|
||||
(double) (total_carbon / mass_water_aq_x)));
|
||||
}
|
||||
if (total_co2 > 0.0)
|
||||
if (total_co2)
|
||||
output_msg(sformatf("%45s%11.3e\n", "Total CO2 (mol/kg) = ",
|
||||
(double) (total_co2 / mass_water_aq_x)));
|
||||
#ifdef NO_UTF8_ENCODING
|
||||
@ -2309,7 +2309,7 @@ print_totals(void)
|
||||
(double) patm_x));
|
||||
}
|
||||
|
||||
if (potV_x != 0.0)
|
||||
if (potV_x)
|
||||
{
|
||||
output_msg(sformatf("%45s%5.2f\n", "Electrical Potential (Volt) = ",
|
||||
(double)potV_x));
|
||||
|
||||
1
sit.cpp
1
sit.cpp
@ -1313,7 +1313,6 @@ model_sit(void)
|
||||
{
|
||||
|
||||
count_basis_change++;
|
||||
//count_unknowns -= (int) s_list.size();
|
||||
count_unknowns -= count_s_x;
|
||||
reprep();
|
||||
full_pitzer = false;
|
||||
|
||||
932
transport.cpp
932
transport.cpp
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user