added function phase_vm and test case.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@11201 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2016-06-03 18:46:13 +00:00
parent edf7f8f6f6
commit f65078e910
4 changed files with 33 additions and 2 deletions

View File

@ -1587,6 +1587,9 @@ listtokens(FILE * f, tokenrec * l_buf)
case tokvm:
output_msg("VM"); // mole volume of aqueous solute
break;
case tokphase_vm:
output_msg("PHASE_VM"); // mole volume of a phase
break;
case tokdh_a:
output_msg("DH_A"); // Debye-Hueckel A
break;
@ -3653,6 +3656,12 @@ factor(struct LOC_exec * LINK)
n.UU.val = (parse_all) ? 1 : PhreeqcPtr->aqueous_vm(str);
}
break;
case tokphase_vm:
{
const char * str = stringfactor(STR1, LINK);
n.UU.val = (parse_all) ? 1 : PhreeqcPtr->phase_vm(str);
}
break;
case toksin:
n.UU.val = sin(realfactor(LINK));
@ -7237,7 +7246,8 @@ const std::map<const std::string, PBasic::BASIC_TOKEN>::value_type temp_tokens[]
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("edl_species", PBasic::tokedl_species),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("rho_0", PBasic::tokrho_0),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("kinetics_formula", PBasic::tokkinetics_formula),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("kinetics_formula$", PBasic::tokkinetics_formula)
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("kinetics_formula$", PBasic::tokkinetics_formula),
std::map<const std::string, PBasic::BASIC_TOKEN>::value_type("phase_vm", PBasic::tokphase_vm)
};
std::map<const std::string, PBasic::BASIC_TOKEN> PBasic::command_tokens(temp_tokens, temp_tokens + sizeof temp_tokens / sizeof temp_tokens[0]);

View File

@ -327,7 +327,8 @@ public:
tokcallback,
tokdiff_c,
toksa_declercq,
tokedl_species
tokedl_species,
tokphase_vm
};
#if !defined(PHREEQCI_GUI)

View File

@ -100,6 +100,7 @@ public:
LDBLE activity_coefficient(const char *species_name);
LDBLE log_activity_coefficient(const char *species_name);
LDBLE aqueous_vm(const char *species_name);
LDBLE phase_vm(const char *phase_name);
LDBLE diff_c(const char *species_name);
LDBLE sa_declercq(double type, double sa, double d, double m, double m0, double gfw);
LDBLE calc_SC(void);

View File

@ -98,7 +98,26 @@ aqueous_vm(const char *species_name)
}
return (g);
}
/* ---------------------------------------------------------------------- */
LDBLE Phreeqc::
phase_vm(const char *phase_name)
/* ---------------------------------------------------------------------- */
{
struct phase *phase_ptr;
int l;
LDBLE g;
phase_ptr = phase_bsearch(phase_name, &l, FALSE);
if (phase_ptr == NULL)
{
g = 0.0;
}
else
{
g = phase_ptr->logk[vm0];
}
return (g);
}
/* ---------------------------------------------------------------------- */
LDBLE Phreeqc::
sa_declercq(double sa_type, double Sa, double d, double m, double m0, double gfw)