mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-16 00:28:23 +01:00
Merge commit 'bc9ab58d16539fa4c3580b66a7cd309db1c3568e'
This commit is contained in:
commit
28517a89ce
@ -1676,26 +1676,41 @@ molality(const char *species_name)
|
|||||||
}
|
}
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
LDBLE Phreeqc::
|
LDBLE Phreeqc::
|
||||||
pr_pressure(const char *phase_name)
|
pr_pressure(const char* phase_name)
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
class phase *phase_ptr;
|
|
||||||
int l;
|
|
||||||
|
|
||||||
phase_ptr = phase_bsearch(phase_name, &l, FALSE);
|
cxxGasPhase* gas_phase_ptr = use.Get_gas_phase_ptr();
|
||||||
if (phase_ptr == NULL)
|
if (gas_phase_ptr != NULL)
|
||||||
{
|
{
|
||||||
error_string = sformatf( "Gas %s, not found.", phase_name);
|
int l;
|
||||||
warning_msg(error_string);
|
class phase* phase_ptr = phase_bsearch(phase_name, &l, FALSE);
|
||||||
return (1e-99);
|
if (phase_ptr == NULL)
|
||||||
|
{
|
||||||
|
error_string = sformatf("Gas %s, not found.", phase_name);
|
||||||
|
warning_msg(error_string);
|
||||||
|
return (1e-99);
|
||||||
|
}
|
||||||
|
for (size_t i = 0; i < gas_phase_ptr->Get_gas_comps().size(); i++)
|
||||||
|
{
|
||||||
|
const cxxGasComp* gas_comp_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||||
|
int j;
|
||||||
|
class phase* phase_ptr_gas = phase_bsearch(gas_comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||||
|
if (phase_ptr == phase_ptr_gas)
|
||||||
|
{
|
||||||
|
if (gas_phase_ptr->Get_pr_in())
|
||||||
|
{
|
||||||
|
return phase_ptr->pr_p;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return gas_comp_ptr->Get_p();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (phase_ptr->in != FALSE && phase_ptr->pr_in)
|
return(0.0);
|
||||||
{
|
|
||||||
return phase_ptr->pr_p;
|
|
||||||
}
|
|
||||||
return (0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
LDBLE Phreeqc::
|
LDBLE Phreeqc::
|
||||||
pressure(void)
|
pressure(void)
|
||||||
@ -1703,26 +1718,42 @@ pressure(void)
|
|||||||
{
|
{
|
||||||
return (patm_x);
|
return (patm_x);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
LDBLE Phreeqc::
|
LDBLE Phreeqc::
|
||||||
pr_phi(const char *phase_name)
|
pr_phi(const char* phase_name)
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
class phase *phase_ptr;
|
cxxGasPhase* gas_phase_ptr = use.Get_gas_phase_ptr();
|
||||||
int l;
|
if (gas_phase_ptr != NULL)
|
||||||
|
|
||||||
phase_ptr = phase_bsearch(phase_name, &l, FALSE);
|
|
||||||
if (phase_ptr == NULL)
|
|
||||||
{
|
{
|
||||||
error_string = sformatf( "Gas %s, not found.", phase_name);
|
int l;
|
||||||
warning_msg(error_string);
|
class phase* phase_ptr = phase_bsearch(phase_name, &l, FALSE);
|
||||||
return (1e-99);
|
if (phase_ptr == NULL)
|
||||||
|
{
|
||||||
|
error_string = sformatf("Gas %s, not found.", phase_name);
|
||||||
|
warning_msg(error_string);
|
||||||
|
return (1e-99);
|
||||||
|
}
|
||||||
|
for (size_t i = 0; i < gas_phase_ptr->Get_gas_comps().size(); i++)
|
||||||
|
{
|
||||||
|
const cxxGasComp* gas_comp_ptr = &(gas_phase_ptr->Get_gas_comps()[i]);
|
||||||
|
int j;
|
||||||
|
class phase* phase_ptr_gas = phase_bsearch(gas_comp_ptr->Get_phase_name().c_str(), &j, FALSE);
|
||||||
|
if (phase_ptr == phase_ptr_gas)
|
||||||
|
{
|
||||||
|
if (gas_phase_ptr->Get_pr_in())
|
||||||
|
{
|
||||||
|
return phase_ptr->pr_phi;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return gas_comp_ptr->Get_phi();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (phase_ptr->in != FALSE && phase_ptr->pr_in)
|
return(1.0);
|
||||||
{
|
|
||||||
return phase_ptr->pr_phi;
|
|
||||||
}
|
|
||||||
return (1.0);
|
|
||||||
}
|
}
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
LDBLE Phreeqc::
|
LDBLE Phreeqc::
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user