Modification to use REACTION_PRESSURE for a

fixed-pressure gas phase.

Fixed Basic function GAS_VM for a fixed-pressure gas phase.

git-svn-id: svn://136.177.114.72/svn_GW/phreeqc3/trunk@8532 1feff8c3-07ed-0310-ac33-dd36852eb9cd
This commit is contained in:
David L Parkhurst 2014-02-28 15:33:20 +00:00
parent e284f1167e
commit 38bfd3328b
2 changed files with 13 additions and 5 deletions

View File

@ -922,9 +922,13 @@ find_gas_vm(void)
return (0);
if (gas_unknown->moles < 1e-12)
return (0);
gas_phase_ptr->Set_total_moles(gas_unknown->moles);
gas_phase_ptr->Set_volume(gas_phase_ptr->Get_total_moles() * R_LITER_ATM * tk_x /
gas_phase_ptr->Get_total_p());
if (gas_phase_ptr->Get_v_m() >= 0.01)
gas_phase_ptr->Set_volume(gas_phase_ptr->Get_v_m() * gas_unknown->moles);
}
// also for non-PR gas phases...
return (gas_phase_ptr->Get_volume() / gas_phase_ptr->Get_total_moles());
return gas_phase_ptr->Get_volume() / gas_phase_ptr->Get_total_moles();
}
/* ---------------------------------------------------------------------- */
@ -3593,9 +3597,6 @@ void Phreeqc::
basic_free(void)
{
delete this->basic_interpreter;
// Reset pointer to make sure we cannot attempt to free it twice (which obviously will result in a crash)
this->basic_interpreter = 0;
}
double Phreeqc::

View File

@ -1211,6 +1211,13 @@ gas_phase_check(cxxGasPhase *gas_phase_ptr)
if (gas_phase_ptr == NULL)
return (OK);
// set gas pressure to reaction_pressure...
if (use.Get_pressure_ptr() != NULL && gas_phase_ptr->Get_type() == cxxGasPhase::GP_PRESSURE)
{
gas_phase_ptr->Set_total_p(patm_x);
k_temp(tc_x, patm_x);
}
/*
* Check that all elements are in solution for phases with zero mass
*/