Hack for bug with pressure, caused ternary to have low pressure result.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@9994 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2015-07-15 19:15:43 +00:00
parent e7915af7ac
commit 2fcfd8e79f

View File

@ -455,7 +455,16 @@ calc_PR(void)
if (gas_phase_ptr->Get_type() == cxxGasPhase::GP_VOLUME)
{
V_m = gas_phase_ptr->Get_volume() / m_sum;
P = R_TK / (V_m - b_sum) - a_aa_sum / (V_m * (V_m + 2 * b_sum) - b2);
P = 0.0;
while (P <= 0)
{
P = R_TK / (V_m - b_sum) - a_aa_sum / (V_m * (V_m + 2 * b_sum) - b2);
if (P <= 0.0)
{
V_m *= 2.0;
//a_aa_sum /= 2.0;
}
}
if (iterations > 0 && P < 150 && V_m < 1.01)
{
// check for 3-roots...