Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/tespy/connections/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@
from tespy.tools.fluid_properties.functions import p_sat_T
from tespy.tools.fluid_properties.helpers import get_mixture_temperature_range
from tespy.tools.fluid_properties.helpers import single_fluid
from tespy.tools.fluid_properties.mixtures import _water_in_mixture
from tespy.tools.fluid_properties.mixtures import cond_check
from tespy.tools.fluid_properties.wrappers import wrapper_registry
from tespy.tools.global_vars import ERR
from tespy.tools.global_vars import fluid_property_data as fpd
Expand Down Expand Up @@ -1534,6 +1536,22 @@ def calc_phase(self):
except NotImplementedError:
return np.nan

def calc_liquid_water_in_mixture(self):
fluid = single_fluid(self.fluid_data)
if fluid is None:
water_alias = _water_in_mixture(self.fluid_data)
if water_alias:
water_alias = next(iter(water_alias))
mass_fractions_gas, molar_fraction_gas, mass_liquid, _, p_sat, pp_water = cond_check(
self.p.val_SI, self.calc_T(), self.fluid_data, water_alias
)
return mass_liquid
else:
return 0
else:
# not a mixture
return np.nan

def calc_results(self, units):
self.T.val_SI = self.calc_T()
fluid = single_fluid(self.fluid_data)
Expand Down