From 2d7255ea1f0e4560949a29827d3fab9d55c899f4 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 09:12:07 +0200 Subject: [PATCH 01/52] [184_lead_contamination], issue #184, Implementation of Polonium vapour pressure by Abakumov, 1994a. --- .../lead_contamination.py | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 lbh15/properties/lead_thermochemical_properties/lead_contamination.py diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py new file mode 100644 index 0000000..8e32335 --- /dev/null +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -0,0 +1,82 @@ +"""Module with the definition of some coumpounds properties +for contamination assessment""" +from math import log +from typing import List +from scipy.constants import atm +from ..interface import PropertyInterface +from ..._decorators import range_warning + + +class LeadPoloniumVapourPressureInterfaceAbakumov1994a(PropertyInterface): + """ + Liquid lead *Polonium compounds vapour pressure* property class + implementing the correlation by *abakumov1994a*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**((- 7270 / T) + 9.06) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_PbPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "abakumov1994a" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Polonium vapour pressure long name + """ + return "Vapour pressure of Polonium in pure lead" + + @property + def description(self) -> str: + """ + str : Polonium vapour pressure description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium + vapour pressure correlation function + """ + return [913.0, 1123.0] + \ No newline at end of file From 1206a5b7a9187c7979dc7940d2bdaf081d44e2b2 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 09:33:12 +0200 Subject: [PATCH 02/52] [184_lead_contamination], issue #184, Implementation of Polonium Henry constant by Ohno, 2006. --- .../lead_contamination.py | 75 ++++++++++++++++++- 1 file changed, 74 insertions(+), 1 deletion(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 8e32335..d12d1df 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -79,4 +79,77 @@ def range(self) -> List[float]: vapour pressure correlation function """ return [913.0, 1123.0] - \ No newline at end of file + + +class LeadPoloniumHenryConstantInterfaceOhno2006(PropertyInterface): + """ + Liquid lead *Polonium compounds Henry constant* property class + implementing the correlation by *ohno2006*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**((- 8348 / T) + 10.5357) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "ohno2006" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : Polonium Henry constant long name + """ + return "Henry constant of Polonium in pure lead" + + @property + def description(self) -> str: + """ + str : Polonium Henry constant description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium Henry constant + correlation function + """ + return [723.0, 1023.0] From 3fc51412966050df9fd0feaa910a91098db73a33 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 09:52:39 +0200 Subject: [PATCH 03/52] [184_lead_contamination], issue #184, Implementation of Polonium activity coefficient by Li, 1998. --- .../lead_contamination.py | 76 ++++++++++++++++++- 1 file changed, 74 insertions(+), 2 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index d12d1df..547a355 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -107,7 +107,7 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - pressure in :math:`[Pa]` + Henry constant in :math:`[Pa]` """ return 10**((- 8348 / T) + 10.5357) @@ -130,7 +130,7 @@ def units(self) -> str: """ str : Henry constant unit """ - return "[]" + return "[Pa]" @property def long_name(self) -> str: @@ -153,3 +153,75 @@ def range(self) -> List[float]: correlation function """ return [723.0, 1023.0] + +class LeadPoloniumActivityCoefficientInterfaceLi1998(PropertyInterface): + """ + Liquid lbe *Polonium compounds activity coefficient* property class. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compounds activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[]` + """ + return 10**((- 1830 / T) - 0.40) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_PbPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "Li1998" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : Polonium activity coefficient long name + """ + return "Activity coefficient of Polonium in pure lead" + + @property + def description(self) -> str: + """ + str : Polonium Activity coefficient description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium activity + coefficient correlation function. + """ + return [641.0, 877.0] From 078d5fa9b4a3d922ea7da5d297818b5a651531e9 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 09:59:10 +0200 Subject: [PATCH 04/52] [184_lead_contamination], issue #184, Implementation of Iodine vapour pressure by Konings, 1996. --- .../lead_contamination.py | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 547a355..5d2cf4b 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -154,6 +154,7 @@ def range(self) -> List[float]: """ return [723.0, 1023.0] + class LeadPoloniumActivityCoefficientInterfaceLi1998(PropertyInterface): """ Liquid lbe *Polonium compounds activity coefficient* property class. @@ -225,3 +226,77 @@ def range(self) -> List[float]: coefficient correlation function. """ return [641.0, 877.0] + + +class LeadIodineVapourPressureInterfaceKonings1996(PropertyInterface): + """ + Liquid lead *Iodine compounds vapour pressure* property class + implementing the correlation by *konings1996*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Iodine compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**((- 8691 / T) + 13.814) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_PbI2_a" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "konings1994" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Iodine vapour pressure long name + """ + return "Vapour pressure of Iodine in pure lead" + + @property + def description(self) -> str: + """ + str : Iodine vapour pressure description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Iodine + vapour pressure correlation function. + """ + return [600.6, 697.0] From a7943ebe918002abf120c4669d83b1b93f69668d Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 10:04:18 +0200 Subject: [PATCH 05/52] [184_lead_contamination], issue #184, Implementation of Iodine vapour pressure by Knacke, 1991. --- .../lead_contamination.py | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 5d2cf4b..a92765d 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -300,3 +300,76 @@ def range(self) -> List[float]: vapour pressure correlation function. """ return [600.6, 697.0] + +class LeadIodineVapourPressureInterfaceKnacke1991(PropertyInterface): + """ + Liquid lead *Iodine compounds vapour pressure* property class + implementing the correlation by *knacke1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Iodine compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**((- 9087 / T) + 31.897 - 6.16 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_PbI2_b" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "knacke1991" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Iodine vapour pressure long name + """ + return "Vapour pressure of Iodine in pure lead" + + @property + def description(self) -> str: + """ + str : Iodine vapour pressure description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Iodine + vapour pressure correlation function. + """ + return [697.1, 2021.1] From 5e749c6180088ce170d8fb34195da4dbc17db836 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 10:07:46 +0200 Subject: [PATCH 06/52] [184_lead_contamination], issue #184, Implementation of Caesium Henry constant by Yamshchikov, 2001. --- .../lead_contamination.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index a92765d..c6f4f8e 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -301,6 +301,7 @@ def range(self) -> List[float]: """ return [600.6, 697.0] + class LeadIodineVapourPressureInterfaceKnacke1991(PropertyInterface): """ Liquid lead *Iodine compounds vapour pressure* property class @@ -373,3 +374,78 @@ def range(self) -> List[float]: vapour pressure correlation function. """ return [697.1, 2021.1] + + +class LeadCaesiumHenryConstantInterfaceYamshchikov2001(PropertyInterface): + """ + Liquid lead *Caesium compounds Henry constant* property class + implementing the correlation by *yamshchikov2001*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Caesium compounds Henry Constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return 10**((- 4979.5799 / T) - 9.3234247 * log(T) + 0.0044733132 * T + - 8.684092 * 10**(-7) * T**(2) + 34.573234) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbCs" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "yamshchikov2001" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Caesium Henry constant long name + """ + return "Caesium compounds Henry Constant in pure lead" + + @property + def description(self) -> str: + """ + str : Caesium Henry constant description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Ceasium Henry constant + correlation function + """ + return [643.0, 933.0] From 86f80ca11538a1fd9520f04bd0c139eb8106b9d7 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 10:09:08 +0200 Subject: [PATCH 07/52] [184_lead_contamination], issue #184, Implementation of Caesium vapour pressure by Yamshchikov, 2001. --- .../lead_contamination.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index c6f4f8e..a83b90c 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -449,3 +449,79 @@ def range(self) -> List[float]: correlation function """ return [643.0, 933.0] + + +class LeadCaesiumVapourPressureInterfaceYamshchikov2001(PropertyInterface): + """ + Liquid lead *Caesium compounds vapour pressure* property class + implementing the correlation by *yamshchikov2001*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Caesium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**(-1.5) * 10**((- 4979.5799 / T) - 9.3234247 * log(T) + + 0.0044733132 * T - 8.684092 * + 10**(-7) * T**(2) + 34.573234) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_PbCs" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "yamshchikov2001" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Caesium vapour pressure long name + """ + return "Caesium compounds vapour pressure in pure lead" + + @property + def description(self) -> str: + """ + str : Caesium vapour pressure description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Ceasium vapour pressure + correlation function + """ + return [643.0, 933.0] From 8b6125c4a3e9fd165adfc68e741122806af289eb Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:10:55 +0200 Subject: [PATCH 08/52] [185_bismuth_contamination], issue #185, Implementation of Polonium activity coefficient by Joy (19663) and of Iodine vapour pressure by Cubicciotti (1959) --- .../bismuth_contamination.py | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py diff --git a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py new file mode 100644 index 0000000..da26823 --- /dev/null +++ b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py @@ -0,0 +1,154 @@ +"""Module with the definition of some coumpounds properties +for contamination assessment""" +from typing import List +from scipy.constants import atm +from ..interface import PropertyInterface +from ..._decorators import range_warning + + +class BismuthPoloniumActivityCoefficientInterfaceJoy1963(PropertyInterface): + """ + Liquid lead *Polonium compounds activity coeffcient* property class + implementing the correlation by *joy1963*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compounds activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[]` + """ + return 10**((- 2272.7 / T) + 0.1316) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_BiPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "joy1963" + + @property + def units(self) -> str: + """ + str : Activity coefficient unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : Polonium activity coefficient long name + """ + return "Activity coefficient of Polonium in pure bismuth" + + @property + def description(self) -> str: + """ + str : Polonium activity coefficient description + """ + return f"{self.long_name} in liquid bismuth" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the activity coefficient + correlation function + """ + return [723.0, 1123.0] + + +class BismuthIodineVapourPressureInterfaceCubicciotti1959(PropertyInterface): + """ + Liquid bismuth *Iodine compounds vapour pressure* property class + implementing the correlation by *cubicciotti1959*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Iodine compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**((- 4310 / T) + 10.29) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_BiI3" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "cubicciotti1959" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Iodine vapour pressure long name + """ + return "Vapour pressure of Iodine in pure bismuth" + + @property + def description(self) -> str: + """ + str : Iodine vapour pressure description + """ + return f"{self.long_name} in liquid bismuth" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Iodine vapour pressure + correlation function + """ + return [544.6, 1831.0] From d14441d92dcf95ed62027e749bc3aab02bedad80 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:28:36 +0200 Subject: [PATCH 09/52] [186_LBE_contamination], issue #186, Implementation of Polonium Henry constant by Ohno, 2006. --- .../lbe_contamination.py | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py new file mode 100644 index 0000000..caa6815 --- /dev/null +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -0,0 +1,81 @@ +"""Module with the definition of some coumpounds properties +for contamination assessment""" +from math import log +from typing import List +from scipy.constants import atm +from ..interface import PropertyInterface +from ..._decorators import range_warning + + +class LBEPoloniumHenryConstantInterfaceOhno2006(PropertyInterface): + """ + Liquid LBE *Polonium compounds Henry constant* property class + implementing the correlation by *ohno2006*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return 10**((- 8348 / T) + 10.5357) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBEPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "ohno2006" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Polonium Henry constant long name + """ + return "Henry constant of Polonium in LBE" + + @property + def description(self) -> str: + """ + str : Polonium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium Henry constant + correlation function + """ + return [723.0, 1023.0] From ccc6677543dc0b64c1ce90a893b6804a9f951e87 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:30:48 +0200 Subject: [PATCH 10/52] [186_LBE_contamination], issue #186, Implementation of Mercury Henry constant by Landolt, 1991. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index caa6815..5bf6e9c 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -79,3 +79,77 @@ def range(self) -> List[float]: correlation function """ return [723.0, 1023.0] + + +class LBEMercuryHenryConstantInterfaceLandolt1991(PropertyInterface): + """ + Liquid LBE *Mercury compounds Henry constant* property class + implementing the correlation by *landolt1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Mercury compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return 10**((- 3332.7 / T) + 12.6706 - 0.848 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBEHg" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "landolt1991" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Mercury Henry constant long name + """ + return "Henry constant of Mercury in LBE" + + @property + def description(self) -> str: + """ + str : Mercury Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Mercury Henry constant + correlation function + """ + return [625.0, 1927.0] From 68bab3d79e56c2e5b7ac995911596873aa9c73ad Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:31:49 +0200 Subject: [PATCH 11/52] [186_LBE_contamination], issue #186, Implementation of Cadmium Henry constant by Landolt, 1991. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 5bf6e9c..716b964 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -153,3 +153,77 @@ def range(self) -> List[float]: correlation function """ return [625.0, 1927.0] + + +class LBECadmiumHenryConstantInterfaceLandolt1991(PropertyInterface): + """ + Liquid LBE *Cadmium compounds Henry constant* property class + implementing the correlation by *landolt1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Cadmium compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return 10**((- 5711 / T) + 14.38 - 1.0867 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBECd" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "landolt1991" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Cadmium Henry constant long name + """ + return "Henry constant of Cadmium in LBE" + + @property + def description(self) -> str: + """ + str : Cadmium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Cadmium Henry constant + correlation function + """ + return [398.0, 1927.0] From 40d3fb9aeb03ef8260df605e3439923bc91e5954 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:33:00 +0200 Subject: [PATCH 12/52] [186_LBE_contamination], issue #186, Implementation of Cadmium vapour pressure by Landolt, 1991. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 716b964..e8feffa 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -227,3 +227,77 @@ def range(self) -> List[float]: correlation function """ return [398.0, 1927.0] + + +class LBECadmiumVapourPressureInterfaceLandolt1991(PropertyInterface): + """ + Liquid LBE *Cadmium compounds vapour pressure* property class + implementing the correlation by *landolt1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Cadmium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 0.25 * 10**((- 5711 / T) + 14.38 - 1.0867 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_LBECd" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "landolt1991" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Cadmium Vapour pressure long name + """ + return "Vapour pressure of Cadmium in LBE" + + @property + def description(self) -> str: + """ + str : Cadmium Vapour pressure description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Cadmium vapour + pressure correlation function. + """ + return [398.0, 1927.0] From 48bab57d68134121c42b6f44d8ef11d765f58541 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:37:25 +0200 Subject: [PATCH 13/52] [186_LBE_contamination], issue #186, Implementation of Thallium Henry constant by Landolt, 1991. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index e8feffa..a7843c3 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -301,3 +301,77 @@ def range(self) -> List[float]: pressure correlation function. """ return [398.0, 1927.0] + + +class LBEThalliumHenryConstantInterfaceLandolt1991(PropertyInterface): + """ + Liquid LBE *Thallium compounds Henry constant* property class + implementing the correltion by *landolt1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Thallium compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return 10**((- 9463 / T) + 13.264 - 0.892 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBETl" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "landolt1991" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Thallium Henry constant long name + """ + return "Henry constant of Thallium in LBE" + + @property + def description(self) -> str: + """ + str : Thallium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Thallium Henry + constant correlation function. + """ + return [398.0, 1927.0] From 075be96db10bae79983a706fbc11a3dfd52957c1 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:38:16 +0200 Subject: [PATCH 14/52] [186_LBE_contamination], issue #186, Implementation of Thallium vapour pressure by Landolt, 1991. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index a7843c3..a49179e 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -375,3 +375,77 @@ def range(self) -> List[float]: constant correlation function. """ return [398.0, 1927.0] + + +class LBEThalliumVapourPressureInterfaceLandolt1991(PropertyInterface): + """ + Liquid LBE *Thallium compounds vapour pressure* property class + implementing the correltion by *landolt1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Thallium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 1.25 * 10**((- 9463 / T) + 13.264 - 0.892 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_LBETl" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "landolt1991" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Thallium vapour pressure long name + """ + return "Vapour pressure of Thallium in LBE" + + @property + def description(self) -> str: + """ + str : Thallium vapour pressure description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the thallium + vapour pressure correlation function. + """ + return [398.0, 1927.0] From 5dd5ef6db58b5933ee1224d885b3885394b0362c Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:41:30 +0200 Subject: [PATCH 15/52] [186_LBE_contamination], issue #186, Implementation of Iodine Henry constant by Neuhausen, 2005. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index a49179e..d368e41 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -449,3 +449,77 @@ def range(self) -> List[float]: vapour pressure correlation function. """ return [398.0, 1927.0] + + +class LBEIodineHenryConstantInterfaceNeuhausen2005(PropertyInterface): + """ + Liquid LBE *Iodine compounds Henry constant* property class + implementing the correlation by *neuhausen2005*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Iodine compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return 10**((- 10407 / T) + 14.56) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBEI" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "neuheusen2005" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Iodine Henry constant long name + """ + return "Henry constant of Iodine in LBE" + + @property + def description(self) -> str: + """ + str : Iodine Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Iodine Henry constant + correlation function + """ + return [398.0, 1927.0] From 386d6cc46602cd11806c89a94c4192e0e5034031 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:42:27 +0200 Subject: [PATCH 16/52] [186_LBE_contamination], issue #186, Implementation of Caesium activity coefficient by Ohno, 2006. --- .../lbe_contamination.py | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index d368e41..0c2c995 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -523,3 +523,77 @@ def range(self) -> List[float]: correlation function """ return [398.0, 1927.0] + + +class LBECaesiumActivityCoefficientOhno2006(PropertyInterface): + """ + Liquid LBE *Caesium compounds activity coefficient* property class + implementing the correlation by *ohno2006*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Caesium compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[]` + """ + return 10**((- 10407 / T) + 14.56) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_LBECs" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "ohno2006" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : Caesium activity coefficient long name + """ + return "Activity coefficient of Caesium in LBE" + + @property + def description(self) -> str: + """ + str : Caesium activity coefficient description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Caesium + activity coefficient correlation function. + """ + return [723.0, 1023.0] From 879a0aa76cb18a82ac743fb1e4988cf979a1a113 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 19 Jul 2024 12:43:48 +0200 Subject: [PATCH 17/52] [186_LBE_contamination], issue #186, Implementation of Rubidium vapour pressure by Landolt (1960) and of Rubidium vapour pressure according to the Handbook. --- .../lbe_contamination.py | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 0c2c995..1bbead5 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -597,3 +597,151 @@ def range(self) -> List[float]: activity coefficient correlation function. """ return [723.0, 1023.0] + + +class LBERubidiumVapourPressureInterfaceLandolt1960(PropertyInterface): + """ + Liquid LBE *Rubidium compounds vapour pressure* property class + implementing the correlation by *landolt1960*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Rubidium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**((- 4588 / T) + 14.110 - 1.45 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_LBERb" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "landolt1960" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Rubidium vapour pressure long name + """ + return "Vapour pressure of Rubidium in pure LBE" + + @property + def description(self) -> str: + """ + str : Rubidium vapour pressure description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Rubidium + vapour pressure correlation function. + """ + return [398.0, 1927.0] + + +class LBERubidiumVapourPressureInterfaceHandbook(PropertyInterface): + """ + Liquid LBE *Rubidium compounds vapour pressure* property class + implementing the correlation by *handbook*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Rubidium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return 10**(-1.7) * 10**((- 4588 / T) + 14.110 - 1.45 * log(T)) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_LBERb" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "handbook" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Rubidium vapour pressure long name + """ + return "Vapour pressure of Rubidium in pure LBE" + + @property + def description(self) -> str: + """ + str : Rubidium vapour pressure description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Rubidium + vapour pressure correlation function. + """ + return [398.0, 1927.0] From 572794f329610f0fccf91034682770bd0fc1ef17 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 22 Jul 2024 11:03:03 +0200 Subject: [PATCH 18/52] [186_LBE_contamination], issue #186, Update of Rubidium's name from P_LBERb to P_LBERb_a and P_LBERb_b --- .../lbe_thermochemical_properties/lbe_contamination.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 1bbead5..f7a4a71 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -634,7 +634,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBERb" + return "P_LBERb_a" @property def correlation_name(self) -> str: @@ -708,7 +708,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBERb" + return "P_LBERb_b" @property def correlation_name(self) -> str: From d011b755b898a98a09fbcff014791ccd1fdc5c37 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 22 Jul 2024 16:54:43 +0200 Subject: [PATCH 19/52] [184_lead_contamination], issue #184, Implementation of lead_contamination path in __init__.py. --- lbh15/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbh15/__init__.py b/lbh15/__init__.py index e4b04b5..84b3a5a 100644 --- a/lbh15/__init__.py +++ b/lbh15/__init__.py @@ -21,4 +21,5 @@ from .properties.lead_thermochemical_properties import solubility_in_lead from .properties.lead_thermochemical_properties import diffusivity_in_lead from .properties.lead_thermochemical_properties import lead_thermochemical -from .properties.lead_thermochemical_properties import lead_oxygen_limits \ No newline at end of file +from .properties.lead_thermochemical_properties import lead_oxygen_limits +from .properties.lead_thermochemical_properties import lead_contamination \ No newline at end of file From 34843c07a8b1db1297276679d49806b103934969 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 22 Jul 2024 16:56:31 +0200 Subject: [PATCH 20/52] [185_bismuth_contamination], issue #185, Implementation of bismuth_contamination path in __init__.py. --- lbh15/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lbh15/__init__.py b/lbh15/__init__.py index e4b04b5..936df27 100644 --- a/lbh15/__init__.py +++ b/lbh15/__init__.py @@ -14,6 +14,7 @@ from .properties.bismuth_thermochemical_properties import solubility_in_bismuth from .properties.bismuth_thermochemical_properties import diffusivity_in_bismuth from .properties.bismuth_thermochemical_properties import bismuth_thermochemical +from .properties.bismuth_thermochemical_properties import bismuth_contamination from .properties.lbe_thermochemical_properties import solubility_in_lbe from .properties.lbe_thermochemical_properties import diffusivity_in_lbe from .properties.lbe_thermochemical_properties import lbe_thermochemical From dc9d78ec409e0e46adba5e35d4d293dd7931eba7 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 22 Jul 2024 16:58:40 +0200 Subject: [PATCH 21/52] [186_LBE_contamination], issue #186, Implementation of lbe_contamination path in __init__.py. --- lbh15/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lbh15/__init__.py b/lbh15/__init__.py index e4b04b5..70b8593 100644 --- a/lbh15/__init__.py +++ b/lbh15/__init__.py @@ -18,6 +18,7 @@ from .properties.lbe_thermochemical_properties import diffusivity_in_lbe from .properties.lbe_thermochemical_properties import lbe_thermochemical from .properties.lbe_thermochemical_properties import lbe_oxygen_limits +from .properties.lbe_thermochemical_properties import lbe_contamination from .properties.lead_thermochemical_properties import solubility_in_lead from .properties.lead_thermochemical_properties import diffusivity_in_lead from .properties.lead_thermochemical_properties import lead_thermochemical From 4977981d83ab4ed5e0df52965d39e80135d4b295 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Wed, 24 Jul 2024 17:12:44 +0200 Subject: [PATCH 22/52] [184_lead_contamination], issue #184, Changes made on vapour pressure by Abakumov (1994a) and activity coefficient of Polonium by Li (1998). Same changes made for the other classes. Removal of Henry constant by Ohno (2006). --- .../lead_contamination.py | 183 ++++++------------ 1 file changed, 55 insertions(+), 128 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index a83b90c..b4e7656 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -7,16 +7,16 @@ from ..._decorators import range_warning -class LeadPoloniumVapourPressureInterfaceAbakumov1994a(PropertyInterface): +class LeadPoloniumVapourPressureAbakumov1994a(PropertyInterface): """ - Liquid lead *Polonium compounds vapour pressure* property class + Liquid lead *PbPo Polonium compounds vapour pressure* property class implementing the correlation by *abakumov1994a*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compounds vapour pressure* by + Returns the value of the *PbPo Polonium compounds vapour pressure* by applying the property correlation. Parameters @@ -61,110 +61,37 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Polonium vapour pressure long name + str : PbPo Polonium compound vapour pressure long name """ - return "Vapour pressure of Polonium in pure lead" + return "Vapour pressure of PbPo compound in pure lead" @property def description(self) -> str: """ - str : Polonium vapour pressure description + str : PbPo Polonium compound vapour pressure description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium - vapour pressure correlation function + List[float] : Temperature validity range of the PbPo Polonium + compound vapour pressure correlation function """ return [913.0, 1123.0] -class LeadPoloniumHenryConstantInterfaceOhno2006(PropertyInterface): +class LeadPoloniumActivityCoefficientAbakumov1974a(PropertyInterface): """ - Liquid lead *Polonium compounds Henry constant* property class - implementing the correlation by *ohno2006*. + Liquid lead *PbPo Polonium compound activity coefficient* property class + implementing the correlation by *Abakumov1974a* """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compounds Henry constant* by - applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - Henry constant in :math:`[Pa]` - """ - return 10**((- 8348 / T) + 10.5357) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "K_PbPo" - - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "ohno2006" - - @property - def units(self) -> str: - """ - str : Henry constant unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : Polonium Henry constant long name - """ - return "Henry constant of Polonium in pure lead" - - @property - def description(self) -> str: - """ - str : Polonium Henry constant description - """ - return f"{self.long_name} in liquid lead" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the Polonium Henry constant - correlation function - """ - return [723.0, 1023.0] - - -class LeadPoloniumActivityCoefficientInterfaceLi1998(PropertyInterface): - """ - Liquid lbe *Polonium compounds activity coefficient* property class. - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *Polonium compounds activity coefficient* by - applying the property correlation. + Returns the value of the *PbPo Polonium compound activity coefficient* + by applying the property correlation. Parameters ---------- @@ -196,7 +123,7 @@ def correlation_name(self) -> str: """ str : Name of the correlation """ - return "Li1998" + return "Abakumov1974a" @property def units(self) -> str: @@ -208,36 +135,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Polonium activity coefficient long name + str : PbPo Polonium compound activity coefficient long name """ - return "Activity coefficient of Polonium in pure lead" + return "Activity coefficient of PbPo Polonium compound in pure lead" @property def description(self) -> str: """ - str : Polonium Activity coefficient description + str : PbPo Polonium compound activity coefficient description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium activity - coefficient correlation function. + List[float] : Temperature validity range of the PbPo Polonium + compound activity coefficient correlation function. """ - return [641.0, 877.0] + return [913.0, 1123.0] -class LeadIodineVapourPressureInterfaceKonings1996(PropertyInterface): +class LeadIodineVapourPressureKonings1996(PropertyInterface): """ - Liquid lead *Iodine compounds vapour pressure* property class + Liquid lead *PbI2 Iodine compounds vapour pressure* property class implementing the correlation by *konings1996*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Iodine compounds vapour pressure* by + Returns the value of the *PbI2 Iodine compounds vapour pressure* by applying the property correlation. Parameters @@ -282,36 +209,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Iodine vapour pressure long name + str : PbI2 Iodine vapour pressure long name """ - return "Vapour pressure of Iodine in pure lead" + return "Vapour pressure of PbI2 Iodine in pure lead" @property def description(self) -> str: """ - str : Iodine vapour pressure description + str : PbI2 Iodine vapour pressure description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Iodine - vapour pressure correlation function. + List[float] : Temperature validity range of the PbI2 + Iodine vapour pressure correlation function. """ return [600.6, 697.0] -class LeadIodineVapourPressureInterfaceKnacke1991(PropertyInterface): +class LeadIodineVapourPressureKnacke1991(PropertyInterface): """ - Liquid lead *Iodine compounds vapour pressure* property class + Liquid lead *PbI2 Iodine compounds vapour pressure* property class implementing the correlation by *knacke1991*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Iodine compounds vapour pressure* by + Returns the value of the *PbI2 Iodine compounds vapour pressure* by applying the property correlation. Parameters @@ -356,37 +283,37 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Iodine vapour pressure long name + str : PbI2 Iodine vapour pressure long name """ - return "Vapour pressure of Iodine in pure lead" + return "Vapour pressure of PbI2 Iodine in pure lead" @property def description(self) -> str: """ - str : Iodine vapour pressure description + str : PbI2 Iodine vapour pressure description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Iodine - vapour pressure correlation function. + List[float] : Temperature validity range of the PbI2 + Iodine vapour pressure correlation function. """ return [697.1, 2021.1] -class LeadCaesiumHenryConstantInterfaceYamshchikov2001(PropertyInterface): +class LeadCaesiumHenryConstantYamshchikov2001(PropertyInterface): """ - Liquid lead *Caesium compounds Henry constant* property class + Liquid lead *Cs-Pb Caesium intermetallic compounds Henry constant* property class implementing the correlation by *yamshchikov2001*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Caesium compounds Henry Constant* by - applying the property correlation. + Returns the value of the *Cs-Pb Caesium intermetallic compounds + Henry Constant* by applying the property correlation. Parameters ---------- @@ -431,37 +358,37 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Caesium Henry constant long name + str : Cs-Pb Caesium intermetallic compounds Henry constant long name """ - return "Caesium compounds Henry Constant in pure lead" + return "Cs-Pb Caesium intermetallic compounds Henry Constant in pure lead" @property def description(self) -> str: """ - str : Caesium Henry constant description + str : Cs-Pb Caesium intermetallic compounds Henry constant description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Ceasium Henry constant - correlation function + List[float] : Temperature validity range of the Cs-Pb Caesium + intermetallic compounds Henry constant correlation function """ return [643.0, 933.0] -class LeadCaesiumVapourPressureInterfaceYamshchikov2001(PropertyInterface): +class LeadCaesiumVapourPressureYamshchikov2001(PropertyInterface): """ - Liquid lead *Caesium compounds vapour pressure* property class - implementing the correlation by *yamshchikov2001*. + Liquid lead *Cs-Pb Caesium intermetallic compounds vapour pressure* + property class implementing the correlation by *yamshchikov2001*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Caesium compounds vapour pressure* by - applying the property correlation. + Returns the value of the *Cs-Pb Caesium intermetallic compounds + vapour pressure* by applying the property correlation. Parameters ---------- @@ -507,21 +434,21 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Caesium vapour pressure long name + str : Cs-Pb Caesium intermetallic compounds vapour pressure long name """ - return "Caesium compounds vapour pressure in pure lead" + return "Cs-Pb Caesium intermetallic compounds vapour pressure in pure lead" @property def description(self) -> str: """ - str : Caesium vapour pressure description + str : Cs-Pb Caesium intermetallic compounds vapour pressure description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Ceasium vapour pressure - correlation function + List[float] : Temperature validity range of the Cs-Pb Caesium + intermetallic compounds vapour pressure correlation function """ return [643.0, 933.0] From 2849fb99c6db682d038816ba58883f6c87a5e163 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Wed, 24 Jul 2024 17:28:42 +0200 Subject: [PATCH 23/52] [184_lead_contamination], issue #184, Removal of Polonium activity coefficient by Abakumov (1974a) for the same reasons as the removal of Henry constant by Ohno (2006). --- .../lead_contamination.py | 74 ------------------- 1 file changed, 74 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index b4e7656..488db88 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -81,80 +81,6 @@ def range(self) -> List[float]: return [913.0, 1123.0] -class LeadPoloniumActivityCoefficientAbakumov1974a(PropertyInterface): - """ - Liquid lead *PbPo Polonium compound activity coefficient* property class - implementing the correlation by *Abakumov1974a* - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *PbPo Polonium compound activity coefficient* - by applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - activity coefficient in :math:`[]` - """ - return 10**((- 1830 / T) - 0.40) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "gamma_PbPo" - - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "Abakumov1974a" - - @property - def units(self) -> str: - """ - str : activity coefficient unit - """ - return "[]" - - @property - def long_name(self) -> str: - """ - str : PbPo Polonium compound activity coefficient long name - """ - return "Activity coefficient of PbPo Polonium compound in pure lead" - - @property - def description(self) -> str: - """ - str : PbPo Polonium compound activity coefficient description - """ - return f"{self.long_name} in liquid lead" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the PbPo Polonium - compound activity coefficient correlation function. - """ - return [913.0, 1123.0] - - class LeadIodineVapourPressureKonings1996(PropertyInterface): """ Liquid lead *PbI2 Iodine compounds vapour pressure* property class From 5e095f22b5d7d7085ecab7e1bd6e68f20436aebd Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Thu, 25 Jul 2024 09:32:56 +0200 Subject: [PATCH 24/52] [184_lead_contamination], issue #184, Implementation of activity coefficient and Henry constant for Polonium. Same work done in prevision for Iodine and Caesium. --- .../lead_contamination.py | 470 +++++++++++++++++- 1 file changed, 456 insertions(+), 14 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 488db88..bfa292a 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -81,6 +81,154 @@ def range(self) -> List[float]: return [913.0, 1123.0] +class LeadPoloniumActivityCoefficientLi1998(PropertyInterface): + """ + Liquid lead *PbPo Polonium compounds activity coefficient* + property class implementing the correlation by *li1998*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbPo Polonium compounds activity coefficient* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[]` + """ + return 1 + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_PbPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "li1998" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : PbPo Polonium compound activity coefficient long name + """ + return "Activity coefficient of PbPo compound in pure lead" + + @property + def description(self) -> str: + """ + str : PbPo Polonium compound activity coefficient description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbPo Polonium + compound activity coefficient correlation function + """ + return [913.0, 1123.0] + + +class LeadPoloniumHenryConstantHandbook(PropertyInterface): + """ + Liquid lead *PbPo Polonium compounds Henry constant* + property class implementing the correlation by *handbook*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbPo Polonium compounds Henry constant* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return LeadPoloniumVapourPressureAbakumov1994a.correlation(T,p) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbPo" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "handbook" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbPo Polonium compound Henry constant long name + """ + return "Henry constant of PbPo compound in pure lead" + + @property + def description(self) -> str: + """ + str : PbPo Polonium compound Henry constant description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbPo Polonium + compound Henry constant correlation function + """ + return [913.0, 1123.0] + + class LeadIodineVapourPressureKonings1996(PropertyInterface): """ Liquid lead *PbI2 Iodine compounds vapour pressure* property class @@ -229,16 +377,238 @@ def range(self) -> List[float]: return [697.1, 2021.1] +class LeadIodineActivityCoefficientHandbook(PropertyInterface): + """ + Liquid lead *PbI2 Iodine compounds activity coefficient* + property class implementing the correlation by *handbook*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbI2 Iodine compounds activity coefficient* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[]` + """ + return 1 + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_PbI2" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "handbook" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : PbI2 iodine compound activity coefficient long name + """ + return "Activity coefficient of PbI2 compound in pure lead" + + @property + def description(self) -> str: + """ + str : PbI2 Iodine compound activity coefficient description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbI2 Iodine + compound activity coefficient correlation function + """ + return [600.6, 2021.1] + + +class LeadIodineHenryConstantKonings1996(PropertyInterface): + """ + Liquid lead *PbI2 Iodine compounds Henry constant* + property class implementing the correlation by *konings1996*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbI2 Iodine compounds Henry constant* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return LeadIodineVapourPressureKonings1996.correlation(T,p) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbI2_a" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "konings1996" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbI2 Iodine compound Henry constant long name + """ + return "Henry constant of PbI2 compound in pure lead" + + @property + def description(self) -> str: + """ + str : PbI2 iodine compound Henry constant description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbI2 Iodine + compound Henry constant correlation function + """ + return [600.6, 697.0] + + +class LeadIodineHenryConstantKnacke1991(PropertyInterface): + """ + Liquid lead *PbI2 Iodine compounds Henry constant* + property class implementing the correlation by *knacke1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbI2 Iodine compounds Henry constant* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return LeadIodineVapourPressureKnacke1991.correlation(T,p) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbI2_b" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "knacke1991" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbI2 Iodine compound Henry constant long name + """ + return "Henry constant of PbI2 compound in pure lead" + + @property + def description(self) -> str: + """ + str : PbI2 iodine compound Henry constant description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbI2 Iodine + compound Henry constant correlation function + """ + return [697.1, 2021.1] + + class LeadCaesiumHenryConstantYamshchikov2001(PropertyInterface): """ - Liquid lead *Cs-Pb Caesium intermetallic compounds Henry constant* property class + Liquid lead *Cs-Pb Caesium intermetallic compound Henry constant* property class implementing the correlation by *yamshchikov2001*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cs-Pb Caesium intermetallic compounds + Returns the value of the *Cs-Pb Caesium intermetallic compound Henry Constant* by applying the property correlation. Parameters @@ -284,14 +654,88 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Cs-Pb Caesium intermetallic compounds Henry constant long name + str : Cs-Pb Caesium intermetallic compound Henry constant long name + """ + return "Cs-Pb Caesium intermetallic compound Henry Constant in pure lead" + + @property + def description(self) -> str: + """ + str : Cs-Pb Caesium intermetallic compound Henry constant description + """ + return f"{self.long_name} in liquid lead" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Cs-Pb Caesium + intermetallic compound Henry constant correlation function + """ + return [643.0, 933.0] + + +class LeadCaesiumActivityCoefficientHandbook(PropertyInterface): + """ + Liquid lead *Cs-Pb Caesium intermetallic compound activity coefficient* + property class implementing the correlation by *handbook*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Cs-Pb Caesium intermetallic compound activity coefficient* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[]` + """ + return 10**(-1.5) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_PbCs" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "handbook" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[]" + + @property + def long_name(self) -> str: + """ + str : Cs-Pb Caesium intermetallic compound activity coefficient long name """ - return "Cs-Pb Caesium intermetallic compounds Henry Constant in pure lead" + return "Activity coefficient of Cs-Pb Caesium intermetallic compound in pure lead" @property def description(self) -> str: """ - str : Cs-Pb Caesium intermetallic compounds Henry constant description + str : Cs-Pb Caesium intermetallic compound activity coefficient description """ return f"{self.long_name} in liquid lead" @@ -299,14 +743,14 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the Cs-Pb Caesium - intermetallic compounds Henry constant correlation function + intermetallic compound compound activity coefficient correlation function """ return [643.0, 933.0] class LeadCaesiumVapourPressureYamshchikov2001(PropertyInterface): """ - Liquid lead *Cs-Pb Caesium intermetallic compounds vapour pressure* + Liquid lead *Cs-Pb Caesium intermetallic compound vapour pressure* property class implementing the correlation by *yamshchikov2001*. """ @range_warning @@ -332,9 +776,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return 10**(-1.5) * 10**((- 4979.5799 / T) - 9.3234247 * log(T) - + 0.0044733132 * T - 8.684092 * - 10**(-7) * T**(2) + 34.573234) + return LeadCaesiumActivityCoefficientHandbook.correlation(T,p) * LeadCaesiumHenryConstantYamshchikov2001.correlation(T,p) @property def name(self) -> str: @@ -360,14 +802,14 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Cs-Pb Caesium intermetallic compounds vapour pressure long name + str : Cs-Pb Caesium intermetallic compound vapour pressure long name """ - return "Cs-Pb Caesium intermetallic compounds vapour pressure in pure lead" + return "Cs-Pb Caesium intermetallic compound vapour pressure in pure lead" @property def description(self) -> str: """ - str : Cs-Pb Caesium intermetallic compounds vapour pressure description + str : Cs-Pb Caesium intermetallic compound vapour pressure description """ return f"{self.long_name} in liquid lead" @@ -375,6 +817,6 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the Cs-Pb Caesium - intermetallic compounds vapour pressure correlation function + intermetallic compound vapour pressure correlation function """ return [643.0, 933.0] From 3f4eaad2970875bffa09b35e8d6587d381e115a9 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 08:58:38 +0200 Subject: [PATCH 25/52] [184_lead_contamination], issue #184, Correction of errors in docstrings. --- .../lead_contamination.py | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index bfa292a..5f32487 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -9,14 +9,14 @@ class LeadPoloniumVapourPressureAbakumov1994a(PropertyInterface): """ - Liquid lead *PbPo Polonium compounds vapour pressure* property class + Liquid lead *PbPo Polonium compound vapour pressure* property class implementing the correlation by *abakumov1994a*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbPo Polonium compounds vapour pressure* by + Returns the value of the *PbPo Polonium compound vapour pressure* by applying the property correlation. Parameters @@ -83,14 +83,14 @@ def range(self) -> List[float]: class LeadPoloniumActivityCoefficientLi1998(PropertyInterface): """ - Liquid lead *PbPo Polonium compounds activity coefficient* + Liquid lead *PbPo Polonium compound activity coefficient* property class implementing the correlation by *li1998*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbPo Polonium compounds activity coefficient* + Returns the value of the *PbPo Polonium compound activity coefficient* by applying the property correlation. Parameters @@ -157,14 +157,14 @@ def range(self) -> List[float]: class LeadPoloniumHenryConstantHandbook(PropertyInterface): """ - Liquid lead *PbPo Polonium compounds Henry constant* + Liquid lead *PbPo Polonium compound Henry constant* property class implementing the correlation by *handbook*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbPo Polonium compounds Henry constant* + Returns the value of the *PbPo Polonium compound Henry constant* by applying the property correlation. Parameters @@ -231,14 +231,14 @@ def range(self) -> List[float]: class LeadIodineVapourPressureKonings1996(PropertyInterface): """ - Liquid lead *PbI2 Iodine compounds vapour pressure* property class + Liquid lead *PbI2 Iodine compound vapour pressure* property class implementing the correlation by *konings1996*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds vapour pressure* by + Returns the value of the *PbI2 Iodine compound vapour pressure* by applying the property correlation. Parameters @@ -285,12 +285,12 @@ def long_name(self) -> str: """ str : PbI2 Iodine vapour pressure long name """ - return "Vapour pressure of PbI2 Iodine in pure lead" + return "Vapour pressure of PbI2 Iodine compound in pure lead" @property def description(self) -> str: """ - str : PbI2 Iodine vapour pressure description + str : PbI2 Iodine compound vapour pressure description """ return f"{self.long_name} in liquid lead" @@ -298,21 +298,21 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the PbI2 - Iodine vapour pressure correlation function. + Iodine compound vapour pressure correlation function. """ return [600.6, 697.0] class LeadIodineVapourPressureKnacke1991(PropertyInterface): """ - Liquid lead *PbI2 Iodine compounds vapour pressure* property class + Liquid lead *PbI2 Iodine compound vapour pressure* property class implementing the correlation by *knacke1991*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds vapour pressure* by + Returns the value of the *PbI2 Iodine compound vapour pressure* by applying the property correlation. Parameters @@ -357,14 +357,14 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : PbI2 Iodine vapour pressure long name + str : PbI2 Iodine compound vapour pressure long name """ - return "Vapour pressure of PbI2 Iodine in pure lead" + return "Vapour pressure of PbI2 Iodine compound in pure lead" @property def description(self) -> str: """ - str : PbI2 Iodine vapour pressure description + str : PbI2 Iodine compound vapour pressure description """ return f"{self.long_name} in liquid lead" @@ -372,21 +372,21 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the PbI2 - Iodine vapour pressure correlation function. + Iodine compound vapour pressure correlation function. """ return [697.1, 2021.1] class LeadIodineActivityCoefficientHandbook(PropertyInterface): """ - Liquid lead *PbI2 Iodine compounds activity coefficient* + Liquid lead *PbI2 Iodine compound activity coefficient* property class implementing the correlation by *handbook*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds activity coefficient* + Returns the value of the *PbI2 Iodine compound activity coefficient* by applying the property correlation. Parameters @@ -433,7 +433,7 @@ def long_name(self) -> str: """ str : PbI2 iodine compound activity coefficient long name """ - return "Activity coefficient of PbI2 compound in pure lead" + return "Activity coefficient of PbI2 Iodine compound in pure lead" @property def description(self) -> str: @@ -453,14 +453,14 @@ def range(self) -> List[float]: class LeadIodineHenryConstantKonings1996(PropertyInterface): """ - Liquid lead *PbI2 Iodine compounds Henry constant* + Liquid lead *PbI2 Iodine compound Henry constant* property class implementing the correlation by *konings1996*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds Henry constant* + Returns the value of the *PbI2 Iodine compound Henry constant* by applying the property correlation. Parameters @@ -507,12 +507,12 @@ def long_name(self) -> str: """ str : PbI2 Iodine compound Henry constant long name """ - return "Henry constant of PbI2 compound in pure lead" + return "Henry constant of PbI2 Iodine compound in pure lead" @property def description(self) -> str: """ - str : PbI2 iodine compound Henry constant description + str : PbI2 Iodine compound Henry constant description """ return f"{self.long_name} in liquid lead" @@ -527,14 +527,14 @@ def range(self) -> List[float]: class LeadIodineHenryConstantKnacke1991(PropertyInterface): """ - Liquid lead *PbI2 Iodine compounds Henry constant* + Liquid lead *PbI2 Iodine compound Henry constant* property class implementing the correlation by *knacke1991*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds Henry constant* + Returns the value of the *PbI2 Iodine compound Henry constant* by applying the property correlation. Parameters @@ -581,7 +581,7 @@ def long_name(self) -> str: """ str : PbI2 Iodine compound Henry constant long name """ - return "Henry constant of PbI2 compound in pure lead" + return "Henry constant of PbI2 Iodine compound in pure lead" @property def description(self) -> str: @@ -757,7 +757,7 @@ class LeadCaesiumVapourPressureYamshchikov2001(PropertyInterface): def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cs-Pb Caesium intermetallic compounds + Returns the value of the *Cs-Pb Caesium intermetallic compound vapour pressure* by applying the property correlation. Parameters From 311b621d6ec607ce706bca820a3c8f240e24d24c Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 09:57:54 +0200 Subject: [PATCH 26/52] [184_lead_contamination], issue #184, Modifications on docstrings. --- .../lead_contamination.py | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 5f32487..3bab2f2 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -84,7 +84,7 @@ def range(self) -> List[float]: class LeadPoloniumActivityCoefficientLi1998(PropertyInterface): """ Liquid lead *PbPo Polonium compound activity coefficient* - property class implementing the correlation by *li1998*. + property class implementing the suggestion by *li1998*. """ @range_warning def correlation(self, T: float, p: float = atm, @@ -107,7 +107,7 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[]` + activity coefficient in :math:`[-]` """ return 1 @@ -130,14 +130,14 @@ def units(self) -> str: """ str : activity coefficient unit """ - return "[]" + return "[-]" @property def long_name(self) -> str: """ str : PbPo Polonium compound activity coefficient long name """ - return "Activity coefficient of PbPo compound in pure lead" + return "Activity coefficient of PbPo compound" @property def description(self) -> str: @@ -183,7 +183,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LeadPoloniumVapourPressureAbakumov1994a.correlation(T,p) + return LeadPoloniumVapourPressureAbakumov1994a().correlation(T,p) @property def name(self) -> str: @@ -211,7 +211,7 @@ def long_name(self) -> str: """ str : PbPo Polonium compound Henry constant long name """ - return "Henry constant of PbPo compound in pure lead" + return "Henry constant of PbPo compound" @property def description(self) -> str: @@ -285,7 +285,7 @@ def long_name(self) -> str: """ str : PbI2 Iodine vapour pressure long name """ - return "Vapour pressure of PbI2 Iodine compound in pure lead" + return "Vapour pressure of PbI2 Iodine compound" @property def description(self) -> str: @@ -359,7 +359,7 @@ def long_name(self) -> str: """ str : PbI2 Iodine compound vapour pressure long name """ - return "Vapour pressure of PbI2 Iodine compound in pure lead" + return "Vapour pressure of PbI2 Iodine compound" @property def description(self) -> str: @@ -380,7 +380,7 @@ def range(self) -> List[float]: class LeadIodineActivityCoefficientHandbook(PropertyInterface): """ Liquid lead *PbI2 Iodine compound activity coefficient* - property class implementing the correlation by *handbook*. + property class implementing the suggestion by *handbook*. """ @range_warning def correlation(self, T: float, p: float = atm, @@ -403,7 +403,7 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[]` + activity coefficient in :math:`[-]` """ return 1 @@ -426,14 +426,14 @@ def units(self) -> str: """ str : activity coefficient unit """ - return "[]" + return "[-]" @property def long_name(self) -> str: """ str : PbI2 iodine compound activity coefficient long name """ - return "Activity coefficient of PbI2 Iodine compound in pure lead" + return "Activity coefficient of PbI2 Iodine compound" @property def description(self) -> str: @@ -507,7 +507,7 @@ def long_name(self) -> str: """ str : PbI2 Iodine compound Henry constant long name """ - return "Henry constant of PbI2 Iodine compound in pure lead" + return "Henry constant of PbI2 Iodine compound" @property def description(self) -> str: @@ -581,7 +581,7 @@ def long_name(self) -> str: """ str : PbI2 Iodine compound Henry constant long name """ - return "Henry constant of PbI2 Iodine compound in pure lead" + return "Henry constant of PbI2 Iodine compound" @property def description(self) -> str: @@ -656,7 +656,7 @@ def long_name(self) -> str: """ str : Cs-Pb Caesium intermetallic compound Henry constant long name """ - return "Cs-Pb Caesium intermetallic compound Henry Constant in pure lead" + return "Cs-Pb Caesium intermetallic compound Henry constant" @property def description(self) -> str: @@ -700,7 +700,7 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[]` + activity coefficient in :math:`[-]` """ return 10**(-1.5) @@ -723,14 +723,14 @@ def units(self) -> str: """ str : activity coefficient unit """ - return "[]" + return "[-]" @property def long_name(self) -> str: """ str : Cs-Pb Caesium intermetallic compound activity coefficient long name """ - return "Activity coefficient of Cs-Pb Caesium intermetallic compound in pure lead" + return "Activity coefficient of Cs-Pb Caesium intermetallic compound" @property def description(self) -> str: @@ -804,7 +804,7 @@ def long_name(self) -> str: """ str : Cs-Pb Caesium intermetallic compound vapour pressure long name """ - return "Cs-Pb Caesium intermetallic compound vapour pressure in pure lead" + return "Cs-Pb Caesium intermetallic compound vapour pressure" @property def description(self) -> str: From a8ec760b5f8d3e4da90b4db666f6eef1085f4b9c Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 12:56:04 +0200 Subject: [PATCH 27/52] [184_lead_contamination], issue #184, Changes from 10** to np.power for all the classes of the module. Verification of the good handling of array-like elements. --- .../lead_contamination.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 3bab2f2..8c35af5 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -1,6 +1,6 @@ """Module with the definition of some coumpounds properties for contamination assessment""" -from math import log +import numpy as np from typing import List from scipy.constants import atm from ..interface import PropertyInterface @@ -35,7 +35,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return 10**((- 7270 / T) + 9.06) + return np.power(10,(- 7270 / T) + 9.06) @property def name(self) -> str: @@ -257,7 +257,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return 10**((- 8691 / T) + 13.814) + return np.power(10,(- 8691 / T) + 13.814) @property def name(self) -> str: @@ -331,7 +331,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return 10**((- 9087 / T) + 31.897 - 6.16 * log(T)) + return np.power(10,(- 9087 / T) - 6.16 * np.log(T) + 31.897) @property def name(self) -> str: @@ -479,7 +479,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LeadIodineVapourPressureKonings1996.correlation(T,p) + return LeadIodineVapourPressureKonings1996().correlation(T,p) @property def name(self) -> str: @@ -553,7 +553,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LeadIodineVapourPressureKnacke1991.correlation(T,p) + return LeadIodineVapourPressureKnacke1991().correlation(T,p) @property def name(self) -> str: @@ -627,7 +627,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return 10**((- 4979.5799 / T) - 9.3234247 * log(T) + 0.0044733132 * T + return np.power(10,(- 4979.5799 / T) - 9.3234247 * np.log(T) + 0.0044733132 * T - 8.684092 * 10**(-7) * T**(2) + 34.573234) @property @@ -702,7 +702,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return 10**(-1.5) + return np.power(10,-1.5) @property def name(self) -> str: @@ -776,7 +776,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return LeadCaesiumActivityCoefficientHandbook.correlation(T,p) * LeadCaesiumHenryConstantYamshchikov2001.correlation(T,p) + return LeadCaesiumActivityCoefficientHandbook().correlation(T,p) * LeadCaesiumHenryConstantYamshchikov2001().correlation(T,p) @property def name(self) -> str: From ac2cf84d62224e69a65efbcf1ee7282ae520f3ea Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 13:12:37 +0200 Subject: [PATCH 28/52] [184_lead_contamination], issue #184, All the modifications suggested by lelaus have been made. --- .../lead_contamination.py | 49 ++++++------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 8c35af5..4a96493 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -5,6 +5,8 @@ from scipy.constants import atm from ..interface import PropertyInterface from ..._decorators import range_warning +from ..._commons import LEAD_MELTING_TEMPERATURE as T_m0 +from ..._commons import LEAD_BOILING_TEMPERATURE as T_b0 class LeadPoloniumVapourPressureAbakumov1994a(PropertyInterface): @@ -155,7 +157,7 @@ def range(self) -> List[float]: return [913.0, 1123.0] -class LeadPoloniumHenryConstantHandbook(PropertyInterface): +class LeadPoloniumHenryConstant(PropertyInterface): """ Liquid lead *PbPo Polonium compound Henry constant* property class implementing the correlation by *handbook*. @@ -192,13 +194,6 @@ def name(self) -> str: """ return "K_PbPo" - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "handbook" - @property def units(self) -> str: """ @@ -264,14 +259,14 @@ def name(self) -> str: """ str : Name of the property """ - return "P_PbI2_a" + return "P_PbI2_s" @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "konings1994" + return "konings1996" @property def units(self) -> str: @@ -300,7 +295,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound vapour pressure correlation function. """ - return [600.6, 697.0] + return [T_m0, 697.0] class LeadIodineVapourPressureKnacke1991(PropertyInterface): @@ -338,7 +333,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_PbI2_b" + return "P_PbI2_l" @property def correlation_name(self) -> str: @@ -374,10 +369,10 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound vapour pressure correlation function. """ - return [697.1, 2021.1] + return [697.0, T_b0] -class LeadIodineActivityCoefficientHandbook(PropertyInterface): +class LeadIodineActivityCoefficient(PropertyInterface): """ Liquid lead *PbI2 Iodine compound activity coefficient* property class implementing the suggestion by *handbook*. @@ -414,13 +409,6 @@ def name(self) -> str: """ return "gamma_PbI2" - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "handbook" - @property def units(self) -> str: """ @@ -448,7 +436,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound activity coefficient correlation function """ - return [600.6, 2021.1] + return [T_m0, T_b0] class LeadIodineHenryConstantKonings1996(PropertyInterface): @@ -486,7 +474,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_PbI2_a" + return "K_PbI2_s" @property def correlation_name(self) -> str: @@ -522,7 +510,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound Henry constant correlation function """ - return [600.6, 697.0] + return [T_m0, 697.0] class LeadIodineHenryConstantKnacke1991(PropertyInterface): @@ -560,7 +548,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_PbI2_b" + return "K_PbI2_l" @property def correlation_name(self) -> str: @@ -596,7 +584,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound Henry constant correlation function """ - return [697.1, 2021.1] + return [697.0, T_b0] class LeadCaesiumHenryConstantYamshchikov2001(PropertyInterface): @@ -674,7 +662,7 @@ def range(self) -> List[float]: return [643.0, 933.0] -class LeadCaesiumActivityCoefficientHandbook(PropertyInterface): +class LeadCaesiumActivityCoefficient(PropertyInterface): """ Liquid lead *Cs-Pb Caesium intermetallic compound activity coefficient* property class implementing the correlation by *handbook*. @@ -711,13 +699,6 @@ def name(self) -> str: """ return "gamma_PbCs" - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "handbook" - @property def units(self) -> str: """ From 38d8d4cf4f2d3364ba2f8673b2a9ace7c9260f25 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 15:17:47 +0200 Subject: [PATCH 29/52] [185_bismuth_contamination], issue #185, Modifications made based on the suggestions made by lelaus and panDanieleN in pull request #192 --- .../bismuth_contamination.py | 106 +++++++++++++++--- 1 file changed, 88 insertions(+), 18 deletions(-) diff --git a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py index da26823..f855510 100644 --- a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py +++ b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py @@ -2,20 +2,23 @@ for contamination assessment""" from typing import List from scipy.constants import atm +import numpy as np from ..interface import PropertyInterface from ..._decorators import range_warning +from ..._commons import BISMUTH_MELTING_TEMPERATURE as T_m0 +from ..._commons import BISMUTH_BOILING_TEMPERATURE as T_b0 -class BismuthPoloniumActivityCoefficientInterfaceJoy1963(PropertyInterface): +class BismuthPoloniumActivityCoefficientJoy1963(PropertyInterface): """ - Liquid lead *Polonium compounds activity coeffcient* property class + Liquid lead *Polonium compound activity coeffcient* property class implementing the correlation by *joy1963*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compounds activity coefficient* by + Returns the value of the *Polonium compound activity coefficient* by applying the property correlation. Parameters @@ -32,16 +35,16 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[]` + activity coefficient in :math:`[-]` """ - return 10**((- 2272.7 / T) + 0.1316) + return np.power(10,(- 2728.3 / T) + 1.1176) @property def name(self) -> str: """ str : Name of the property """ - return "gamma_BiPo" + return "gamma_BiPo_a" @property def correlation_name(self) -> str: @@ -55,14 +58,14 @@ def units(self) -> str: """ str : Activity coefficient unit """ - return "[]" + return "[-]" @property def long_name(self) -> str: """ str : Polonium activity coefficient long name """ - return "Activity coefficient of Polonium in pure bismuth" + return "Activity coefficient of Polonium" @property def description(self) -> str: @@ -80,16 +83,83 @@ def range(self) -> List[float]: return [723.0, 1123.0] -class BismuthIodineVapourPressureInterfaceCubicciotti1959(PropertyInterface): +class BismuthPoloniumActivityCoefficient(PropertyInterface): """ - Liquid bismuth *Iodine compounds vapour pressure* property class + Liquid lead *Polonium compound activity coeffcient* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compound activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` + """ + return np.power(10,(- 2272.7 / T) + 0.1316) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_BiPo_b" + + @property + def units(self) -> str: + """ + str : Activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Polonium activity coefficient long name + """ + return "Activity coefficient of Polonium" + + @property + def description(self) -> str: + """ + str : Polonium activity coefficient description + """ + return f"{self.long_name} in liquid bismuth" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the activity coefficient + correlation function + """ + return [923.0, 1038.0] + + +class BismuthIodineVapourPressureCubicciotti1959(PropertyInterface): + """ + Liquid bismuth *BiI3 Iodide compound vapour pressure* property class implementing the correlation by *cubicciotti1959*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Iodine compounds vapour pressure* by + Returns the value of the *BiI3 Iodide compound vapour pressure* by applying the property correlation. Parameters @@ -108,7 +178,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return 10**((- 4310 / T) + 10.29) + return np.power(10,(- 4310 / T) + 10.29) @property def name(self) -> str: @@ -134,21 +204,21 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Iodine vapour pressure long name + str : BiI3 Iodide vapour pressure long name """ - return "Vapour pressure of Iodine in pure bismuth" + return "Vapour pressure of BiI3 Iodide" @property def description(self) -> str: """ - str : Iodine vapour pressure description + str : BiI3 Iodide vapour pressure description """ return f"{self.long_name} in liquid bismuth" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Iodine vapour pressure - correlation function + List[float] : Temperature validity range of the BiI3 Iodide + vapour pressure correlation function """ - return [544.6, 1831.0] + return [T_m0, T_b0] From 760bae5a63979b3237a28d02236600238d8bc1f2 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 17:14:24 +0200 Subject: [PATCH 30/52] [186_LBE_contamination], issue #186, Modifications made based upon the suggestions proposed by lelaus and panDanieleN in pull request #192. --- .../lbe_contamination.py | 935 +++++++++++++++--- 1 file changed, 793 insertions(+), 142 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index f7a4a71..75f4cf8 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -1,22 +1,24 @@ """Module with the definition of some coumpounds properties for contamination assessment""" -from math import log +import numpy as np from typing import List from scipy.constants import atm from ..interface import PropertyInterface from ..._decorators import range_warning +from..._commons import LBE_MELTING_TEMPERATURE as T_m0 +from ..._commons import LBE_BOILING_TEMPERATURE as T_b0 -class LBEPoloniumHenryConstantInterfaceOhno2006(PropertyInterface): +class LBEPoloniumHenryConstantOhno2006(PropertyInterface): """ - Liquid LBE *Polonium compounds Henry constant* property class + Liquid LBE *Polonium compound Henry constant* property class implementing the correlation by *ohno2006*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compounds Henry constant* by + Returns the value of the *Polonium compound Henry constant* by applying the property correlation. Parameters @@ -35,14 +37,14 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return 10**((- 8348 / T) + 10.5357) + return np.power(10,(- 8348 / T) + 10.5357) @property def name(self) -> str: """ str : Name of the property """ - return "K_LBEPo" + return "K_LBEPo_a" @property def correlation_name(self) -> str: @@ -63,7 +65,7 @@ def long_name(self) -> str: """ str : Polonium Henry constant long name """ - return "Henry constant of Polonium in LBE" + return "Henry constant of Polonium" @property def description(self) -> str: @@ -75,22 +77,505 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium Henry constant + List[float] : Temperature validity range of the Polonium + Henry constant correlation function + """ + return [723.0, 1023.0] + + +class LBEPoloniumActivityCoefficientOhno2006(PropertyInterface): + """ + Liquid LBE *Polonium compound activity coefficient* property class + implementing the correlation by *ohno2006*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compound activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` + """ + return np.power(10,(- 2908 / T) + 1.079) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_LBEPo_a" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "ohno2006" + + @property + def units(self) -> str: + """ + str : Activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Polonium activity coefficient long name + """ + return "activity coefficient of Polonium" + + @property + def description(self) -> str: + """ + str : Polonium activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium + activity coefficient correlation function + """ + return [723.0, 877.0] + + +class LBEPoloniumHenryConstantBuongiorno2003(PropertyInterface): + """ + Liquid LBE *Polonium compound Henry constant* property class + implementing the correlation by *buongiorno2003*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compound Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return np.power(10,(- 6790 / T) + 1.26) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBEPo_b" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "buongiorno2003" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Polonium Henry constant long name + """ + return "Henry constant of Polonium" + + @property + def description(self) -> str: + """ + str : Polonium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium + Henry constant correlation function + """ + return [665.0, 823.0] + + +class LBEPoloniumActivityCoefficient(PropertyInterface): + """ + Liquid LBE *Polonium compound activity coefficient* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Polonium compound activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` + """ + return np.power(10,(- 1830 / T) + 0.40) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_LBEPo_b" + + @property + def units(self) -> str: + """ + str : Activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Polonium activity coefficient long name + """ + return "activity coefficient of Polonium" + + @property + def description(self) -> str: + """ + str : Polonium activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Polonium + activity coefficient correlation function + """ + return [913.0, 1123.0] + + +class LBEMercuryHenryConstant(PropertyInterface): + """ + Liquid LBE *Mercury compound Henry constant* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Mercury compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return np.power(10,(- 3332.7 / T) - 0.848 * np.log(T) + 12.6706) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBEHg" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Mercury Henry constant long name + """ + return "Henry constant of Mercury" + + @property + def description(self) -> str: + """ + str : Mercury Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Mercury + Henry constant correlation function + """ + return [603.0, T_b0] + + +class LBEMercuryActivityCoefficient(PropertyInterface): + """ + Liquid LBE *Mercury compound activity coefficient* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Mercury compounds activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` + """ + return 2 + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_LBEHg" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Mercury activity coefficient long name + """ + return "Activity coefficient of Mercury" + + @property + def description(self) -> str: + """ + str : Mercury activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Mercury + activity coefficient correlation function + """ + return [603.0, T_b0] + + +class LBEMercuryVapourPressure(PropertyInterface): + """ + Liquid LBE *Mercury compound vapour pressure* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Mercury compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Vapour pressure in :math:`[Pa]` + """ + return LBEMercuryHenryConstant().correlation(T,p) / LBEMercuryActivityCoefficient().correlation(T,p) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_LBEHg" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Mercury vapour pressure long name + """ + return "Vapour pressure of Mercury" + + @property + def description(self) -> str: + """ + str : Mercury vapour pressure description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Mercury + vapour pressure correlation function + """ + return [603.0, T_b0] + + +class LBECadmiumHenryConstant(PropertyInterface): + """ + Liquid LBE *Cadmium compound Henry constant* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Cadmium compound Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return np.power(10,(- 5711 / T) - 1.0867 * np.log(T) + 14.38) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBECd" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Cadmium Henry constant long name + """ + return "Henry constant of Cadmium" + + @property + def description(self) -> str: + """ + str : Cadmium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Cadmium Henry constant correlation function """ - return [723.0, 1023.0] + return [T_m0, T_b0] -class LBEMercuryHenryConstantInterfaceLandolt1991(PropertyInterface): +class LBECadmiumActivityCoefficient(PropertyInterface): """ - Liquid LBE *Mercury compounds Henry constant* property class - implementing the correlation by *landolt1991*. + Liquid LBE *Cadmium compound activity coefficient* property class + implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Mercury compounds Henry constant* by + Returns the value of the *Cadmium compounds activity coefficient* by applying the property correlation. Parameters @@ -107,64 +592,124 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - Henry constant in :math:`[Pa]` + activity coefficient in :math:`[-]` """ - return 10**((- 3332.7 / T) + 12.6706 - 0.848 * log(T)) + return 4 @property def name(self) -> str: """ str : Name of the property """ - return "K_LBEHg" + return "gamma_LBECd" @property - def correlation_name(self) -> str: + def units(self) -> str: """ - str : Name of the correlation + str : activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Cadmium activity coefficient long name + """ + return "Activity coefficient of Cadmium" + + @property + def description(self) -> str: + """ + str : Cadmium activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Cadmium + activity coefficient correlation function + """ + return [T_m0, T_b0] + + +class LBECadmiumVapourPressure(PropertyInterface): + """ + Liquid LBE *Cadmium compound vapour pressure* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Cadmium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + vapour pressure in :math:`[Pa]` + """ + return LBECadmiumHenryConstant().correlation(T,p) / LBECadmiumActivityCoefficient().correlation(T,p) + + @property + def name(self) -> str: + """ + str : Name of the property """ - return "landolt1991" + return "P_LBECd" @property def units(self) -> str: """ - str : Henry constant unit + str : vapour pressure unit """ return "[Pa]" @property def long_name(self) -> str: """ - str : Mercury Henry constant long name + str : Cadmium vapour pressure long name """ - return "Henry constant of Mercury in LBE" + return "Vapour pressure of Cadmium" @property def description(self) -> str: """ - str : Mercury Henry constant description + str : Cadmium vapour pressure description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Mercury Henry constant - correlation function + List[float] : Temperature validity range of the Cadmium + vapour pressure correlation function """ - return [625.0, 1927.0] - + return [T_m0, T_b0] -class LBECadmiumHenryConstantInterfaceLandolt1991(PropertyInterface): + +class LBEThalliumHenryConstant(PropertyInterface): """ - Liquid LBE *Cadmium compounds Henry constant* property class - implementing the correlation by *landolt1991*. + Liquid LBE *Thallium compounds Henry constant* property class + implementing the correltion by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cadmium compounds Henry constant* by + Returns the value of the *Thallium compounds Henry constant* by applying the property correlation. Parameters @@ -183,21 +728,14 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return 10**((- 5711 / T) + 14.38 - 1.0867 * log(T)) + return np.power(10,(- 9463 / T) - 0.892 * np.log(T) + 13.264) @property def name(self) -> str: """ str : Name of the property """ - return "K_LBECd" - - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "landolt1991" + return "K_LBETl" @property def units(self) -> str: @@ -209,36 +747,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Cadmium Henry constant long name + str : Thallium Henry constant long name """ - return "Henry constant of Cadmium in LBE" + return "Henry constant of Thallium" @property def description(self) -> str: """ - str : Cadmium Henry constant description + str : Thallium Henry constant description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Cadmium Henry constant - correlation function + List[float] : Temperature validity range of the Thallium Henry + constant correlation function. """ - return [398.0, 1927.0] + return [T_m0, T_b0] -class LBECadmiumVapourPressureInterfaceLandolt1991(PropertyInterface): +class LBEThalliumActivityCoefficient(PropertyInterface): """ - Liquid LBE *Cadmium compounds vapour pressure* property class - implementing the correlation by *landolt1991*. + Liquid LBE *Thallium compound activity coefficient* property class + implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cadmium compounds vapour pressure* by + Returns the value of the *Thallium compounds activity coefficient* by applying the property correlation. Parameters @@ -255,64 +793,124 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - pressure in :math:`[Pa]` + activity coefficient in :math:`[-]` """ - return 0.25 * 10**((- 5711 / T) + 14.38 - 1.0867 * log(T)) + return 0.8 @property def name(self) -> str: """ str : Name of the property """ - return "P_LBECd" + return "gamma_LBETl" @property - def correlation_name(self) -> str: + def units(self) -> str: """ - str : Name of the correlation + str : activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Thallium activity coefficient long name + """ + return "Activity coefficient of Thallium" + + @property + def description(self) -> str: + """ + str : Thallium activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Thallium + activity coefficient correlation function + """ + return [T_m0, T_b0] + + +class LBEThalliumVapourPressure(PropertyInterface): + """ + Liquid LBE *Thallium compound vapour pressure* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Thallium compounds vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + vapour pressure in :math:`[Pa]` + """ + return LBEThalliumHenryConstant().correlation(T,p) / LBEThalliumActivityCoefficient().correlation(T,p) + + @property + def name(self) -> str: """ - return "landolt1991" + str : Name of the property + """ + return "P_LBETl" @property def units(self) -> str: """ - str : Vapour pressure unit + str : vapour pressure unit """ return "[Pa]" @property def long_name(self) -> str: """ - str : Cadmium Vapour pressure long name + str : Thallium vapour pressure long name """ - return "Vapour pressure of Cadmium in LBE" + return "Vapour pressure of Thallium" @property def description(self) -> str: """ - str : Cadmium Vapour pressure description + str : Thallium vapour pressure description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Cadmium vapour - pressure correlation function. + List[float] : Temperature validity range of the Thallium + vapour pressure correlation function """ - return [398.0, 1927.0] + return [T_m0, T_b0] -class LBEThalliumHenryConstantInterfaceLandolt1991(PropertyInterface): +class LBEIodineHenryConstantNeuhausen2005(PropertyInterface): """ - Liquid LBE *Thallium compounds Henry constant* property class - implementing the correltion by *landolt1991*. + Liquid LBE *PbI2 Iodine compounds Henry constant* property class + implementing the correlation by *neuhausen2005*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Thallium compounds Henry constant* by + Returns the value of the *PbI2 Iodine compounds Henry constant* by applying the property correlation. Parameters @@ -331,21 +929,21 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return 10**((- 9463 / T) + 13.264 - 0.892 * log(T)) + return np.power(10,(- 10407 / T) + 14.56) @property def name(self) -> str: """ str : Name of the property """ - return "K_LBETl" + return "K_LBEPbI2" @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "landolt1991" + return "neuheusen2005" @property def units(self) -> str: @@ -357,36 +955,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Thallium Henry constant long name + str : PbI2 Iodine Henry constant long name """ - return "Henry constant of Thallium in LBE" + return "Henry constant of PbI2 Iodine" @property def description(self) -> str: """ - str : Thallium Henry constant description + str : PbI2 Iodine Henry constant description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Thallium Henry - constant correlation function. + List[float] : Temperature validity range of the PbI2 Iodine + Henry constant correlation function """ - return [398.0, 1927.0] + return [T_m0, T_b0] -class LBEThalliumVapourPressureInterfaceLandolt1991(PropertyInterface): +class LBEIodineActivityCoefficientNeuhasen2005c(PropertyInterface): """ - Liquid LBE *Thallium compounds vapour pressure* property class - implementing the correltion by *landolt1991*. + Liquid LBE *PbI2 Iodine compound activity coefficient* property class + implementing the correlation by *neuhasen2005c*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Thallium compounds vapour pressure* by + Returns the value of the *PbI2 Iodine compounds activity coefficient* by applying the property correlation. Parameters @@ -403,64 +1001,64 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - pressure in :math:`[Pa]` + activity coefficient in :math:`[-]` """ - return 1.25 * 10**((- 9463 / T) + 13.264 - 0.892 * log(T)) + return 1 @property def name(self) -> str: """ str : Name of the property """ - return "P_LBETl" + return "gamma_LBEPbI2" @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "landolt1991" + return "neuhasen2005c" @property def units(self) -> str: """ - str : Vapour pressure unit + str : activity coefficient unit """ - return "[Pa]" + return "[-]" @property def long_name(self) -> str: """ - str : Thallium vapour pressure long name + str : PbI2 Iodine activity coefficient long name """ - return "Vapour pressure of Thallium in LBE" + return "Activity coefficient of PbI2 Iodine" @property def description(self) -> str: """ - str : Thallium vapour pressure description + str : PbI2 Iodine activity coefficient description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the thallium - vapour pressure correlation function. + List[float] : Temperature validity range of the PbI2 Iodine + activity coefficient correlation function """ - return [398.0, 1927.0] + return [T_m0, T_b0] -class LBEIodineHenryConstantInterfaceNeuhausen2005(PropertyInterface): +class LBEIodineVapourPressure(PropertyInterface): """ - Liquid LBE *Iodine compounds Henry constant* property class - implementing the correlation by *neuhausen2005*. + Liquid LBE *PbI2 Iodine compound vapour pressure* property class + implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Iodine compounds Henry constant* by + Returns the value of the *PbI2 Iodine compounds vapour pressure* by applying the property correlation. Parameters @@ -477,64 +1075,57 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - Henry constant in :math:`[Pa]` + vapour pressure in :math:`[Pa]` """ - return 10**((- 10407 / T) + 14.56) + return LBEIodineHenryConstantNeuhausen2005().correlation(T,p) / LBEIodineActivityCoefficientNeuhasen2005c().correlation(T,p) @property def name(self) -> str: """ str : Name of the property """ - return "K_LBEI" - - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "neuheusen2005" + return "P_LBEPbI2" @property def units(self) -> str: """ - str : Henry constant unit + str : vapour pressure unit """ return "[Pa]" @property def long_name(self) -> str: """ - str : Iodine Henry constant long name + str : PbI2 Iodine vapour pressure long name """ - return "Henry constant of Iodine in LBE" + return "Vapour pressure of PbI2 Iodine" @property def description(self) -> str: """ - str : Iodine Henry constant description + str : PbI2 Iodine vapour pressure description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Iodine Henry constant - correlation function + List[float] : Temperature validity range of the PbI2 Iodine + vapour pressure correlation function """ - return [398.0, 1927.0] + return [T_m0, T_b0] class LBECaesiumActivityCoefficientOhno2006(PropertyInterface): """ - Liquid LBE *Caesium compounds activity coefficient* property class + Liquid LBE *Caesium compound activity coefficient* property class implementing the correlation by *ohno2006*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Caesium compounds Henry constant* by + Returns the value of the *Caesium compound Henry constant* by applying the property correlation. Parameters @@ -551,9 +1142,9 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[]` + activity coefficient in :math:`[-]` """ - return 10**((- 10407 / T) + 14.56) + return np.power(10,(- 2677 / T) + 0.75) @property def name(self) -> str: @@ -574,26 +1165,26 @@ def units(self) -> str: """ str : activity coefficient unit """ - return "[]" + return "[-]" @property def long_name(self) -> str: """ - str : Caesium activity coefficient long name + str : Caesium compound activity coefficient long name """ - return "Activity coefficient of Caesium in LBE" + return "Activity coefficient of Caesium compound" @property def description(self) -> str: """ - str : Caesium activity coefficient description + str : Caesium compound activity coefficient description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Caesium + List[float] : Temperature validity range of the Caesium compound activity coefficient correlation function. """ return [723.0, 1023.0] @@ -627,14 +1218,14 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return 10**((- 4588 / T) + 14.110 - 1.45 * log(T)) + return np.power(10,(- 4588 / T) - 1.45 * np.log(T) + 14.110) @property def name(self) -> str: """ str : Name of the property """ - return "P_LBERb_a" + return "P_LBERb" @property def correlation_name(self) -> str: @@ -655,7 +1246,7 @@ def long_name(self) -> str: """ str : Rubidium vapour pressure long name """ - return "Vapour pressure of Rubidium in pure LBE" + return "Vapour pressure of Rubidium" @property def description(self) -> str: @@ -670,19 +1261,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium vapour pressure correlation function. """ - return [398.0, 1927.0] + return [T_m0, T_b0] -class LBERubidiumVapourPressureInterfaceHandbook(PropertyInterface): +class LBERubidiumActivityCoefficient(PropertyInterface): """ - Liquid LBE *Rubidium compounds vapour pressure* property class - implementing the correlation by *handbook*. + Liquid LBE *Rubidium compound activity coefficient* property class + implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Rubidium compounds vapour pressure* by + Returns the value of the *Rubidium compounds activity coefficient* by applying the property correlation. Parameters @@ -699,42 +1290,102 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - pressure in :math:`[Pa]` + activity coefficient in :math:`[-]` """ - return 10**(-1.7) * 10**((- 4588 / T) + 14.110 - 1.45 * log(T)) + return np.power(10,-1.7) @property def name(self) -> str: """ str : Name of the property """ - return "P_LBERb_b" + return "gamma_LBERb" @property - def correlation_name(self) -> str: + def units(self) -> str: """ - str : Name of the correlation + str : activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Rubidium activity coefficient long name + """ + return "Activity coefficient of Rubidium" + + @property + def description(self) -> str: + """ + str : Rubidium activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Rubidium + activity coefficient correlation function + """ + return [T_m0, T_b0] + + +class LBERubidiumHenryConstant(PropertyInterface): + """ + Liquid LBE *Rubidium compounds Henry constant* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Rubidium compounds Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return LBERubidiumVapourPressureInterfaceLandolt1960().correlation(T,p) * LBERubidiumActivityCoefficient().correlation(T,p) + + @property + def name(self) -> str: + """ + str : Name of the property """ - return "handbook" + return "K_LBERb" @property def units(self) -> str: """ - str : Vapour pressure unit + str : Henry constant unit """ return "[Pa]" @property def long_name(self) -> str: """ - str : Rubidium vapour pressure long name + str : Rubidium Henry constant long name """ - return "Vapour pressure of Rubidium in pure LBE" + return "Henry constant of Rubidium" @property def description(self) -> str: """ - str : Rubidium vapour pressure description + str : Rubidium Henry constant description """ return f"{self.long_name} in liquid LBE" @@ -742,6 +1393,6 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the Rubidium - vapour pressure correlation function. + Henry constant correlation function. """ - return [398.0, 1927.0] + return [T_m0, T_b0] From af513cdeca2d9557756a9d9ac15a7d226203fd01 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 17:45:55 +0200 Subject: [PATCH 31/52] [184_lead_contamination], issue #184, Small modifications on correlations' syntaxes. --- .../lead_contamination.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 4a96493..97d981e 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -37,7 +37,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return np.power(10,(- 7270 / T) + 9.06) + return np.power(10, - 7270 / T + 9.06) @property def name(self) -> str: @@ -185,7 +185,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LeadPoloniumVapourPressureAbakumov1994a().correlation(T,p) + return LeadPoloniumVapourPressureAbakumov1994a().correlation(T, p) @property def name(self) -> str: @@ -252,7 +252,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return np.power(10,(- 8691 / T) + 13.814) + return np.power(10, - 8691 / T + 13.814) @property def name(self) -> str: @@ -326,7 +326,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return np.power(10,(- 9087 / T) - 6.16 * np.log(T) + 31.897) + return np.power(10, - 9087 / T - 6.16 * np.log(T) + 31.897) @property def name(self) -> str: @@ -467,7 +467,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LeadIodineVapourPressureKonings1996().correlation(T,p) + return LeadIodineVapourPressureKonings1996().correlation(T, p) @property def name(self) -> str: @@ -541,7 +541,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LeadIodineVapourPressureKnacke1991().correlation(T,p) + return LeadIodineVapourPressureKnacke1991().correlation(T, p) @property def name(self) -> str: @@ -615,7 +615,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10,(- 4979.5799 / T) - 9.3234247 * np.log(T) + 0.0044733132 * T + return np.power(10, - 4979.5799 / T - 9.3234247 * np.log(T) + 0.0044733132 * T - 8.684092 * 10**(-7) * T**(2) + 34.573234) @property @@ -690,7 +690,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10,-1.5) + return np.power(10, -1.5) @property def name(self) -> str: @@ -757,7 +757,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return LeadCaesiumActivityCoefficientHandbook().correlation(T,p) * LeadCaesiumHenryConstantYamshchikov2001().correlation(T,p) + return LeadCaesiumHenryConstantYamshchikov2001().correlation(T, p) / LeadCaesiumActivityCoefficient().correlation(T, p) @property def name(self) -> str: From 16c5e023475c72a09e158ed45b4db78bfa12b5da Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 17:58:06 +0200 Subject: [PATCH 32/52] [184_lead_contamination], issue #184, Small modifications on correlations' syntaxes. --- .../lead_thermochemical_properties/lead_contamination.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 97d981e..0d04446 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -589,8 +589,8 @@ def range(self) -> List[float]: class LeadCaesiumHenryConstantYamshchikov2001(PropertyInterface): """ - Liquid lead *Cs-Pb Caesium intermetallic compound Henry constant* property class - implementing the correlation by *yamshchikov2001*. + Liquid lead *Cs-Pb Caesium intermetallic compound Henry constant* property + class implementing the correlation by *yamshchikov2001*. """ @range_warning def correlation(self, T: float, p: float = atm, @@ -726,7 +726,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Cs-Pb Caesium intermetallic compound compound activity coefficient correlation function """ - return [643.0, 933.0] + return [643.0, 1100.0] class LeadCaesiumVapourPressureYamshchikov2001(PropertyInterface): From 8badf5b6933995565539e997229b6aaae6b10cf0 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 18:14:51 +0200 Subject: [PATCH 33/52] [184_lead_contamination], issue #184, Modifications related to Caesium properties required in the review have been made. --- .../lead_contamination.py | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 0d04446..fe314a8 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -615,8 +615,8 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10, - 4979.5799 / T - 9.3234247 * np.log(T) + 0.0044733132 * T - - 8.684092 * 10**(-7) * T**(2) + 34.573234) + return np.power(10, - 4980 / T - 9.323 * np.log(T) + 0.004473 * T + - 8.684 * 10**(-7) * T**(2) + 33.07) @property def name(self) -> str: @@ -665,14 +665,14 @@ def range(self) -> List[float]: class LeadCaesiumActivityCoefficient(PropertyInterface): """ Liquid lead *Cs-Pb Caesium intermetallic compound activity coefficient* - property class implementing the correlation by *handbook*. + property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cs-Pb Caesium intermetallic compound activity coefficient* - by applying the property correlation. + Returns the value of the *Cs-Pb Caesium intermetallic compound + activity coefficient* by applying the property correlation. Parameters ---------- @@ -709,14 +709,16 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Cs-Pb Caesium intermetallic compound activity coefficient long name + str : Cs-Pb Caesium intermetallic compound activity coefficient + long name """ return "Activity coefficient of Cs-Pb Caesium intermetallic compound" @property def description(self) -> str: """ - str : Cs-Pb Caesium intermetallic compound activity coefficient description + str : Cs-Pb Caesium intermetallic compound activity coefficient + description """ return f"{self.long_name} in liquid lead" @@ -724,15 +726,15 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the Cs-Pb Caesium - intermetallic compound compound activity coefficient correlation function + intermetallic compound activity coefficient correlation function """ - return [643.0, 1100.0] + return [T_m0, 1100.0] -class LeadCaesiumVapourPressureYamshchikov2001(PropertyInterface): +class LeadCaesiumVapourPressure(PropertyInterface): """ Liquid lead *Cs-Pb Caesium intermetallic compound vapour pressure* - property class implementing the correlation by *yamshchikov2001*. + property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, @@ -757,7 +759,8 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return LeadCaesiumHenryConstantYamshchikov2001().correlation(T, p) / LeadCaesiumActivityCoefficient().correlation(T, p) + return LeadCaesiumHenryConstantYamshchikov2001().correlation(T, p)\ + / LeadCaesiumActivityCoefficient().correlation(T, p) @property def name(self) -> str: @@ -766,13 +769,6 @@ def name(self) -> str: """ return "P_PbCs" - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "yamshchikov2001" - @property def units(self) -> str: """ From 553be78ccf1aaaaed832a47df66c815c83e7832b Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 18:24:16 +0200 Subject: [PATCH 34/52] [184_lead_contamination], issue #184, Reviewed code according to pycodestyle. --- .../lead_contamination.py | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index fe314a8..e54117b 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -77,7 +77,7 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbPo Polonium + List[float] : Temperature validity range of the PbPo Polonium compound vapour pressure correlation function """ return [913.0, 1123.0] @@ -85,7 +85,7 @@ def range(self) -> List[float]: class LeadPoloniumActivityCoefficientLi1998(PropertyInterface): """ - Liquid lead *PbPo Polonium compound activity coefficient* + Liquid lead *PbPo Polonium compound activity coefficient* property class implementing the suggestion by *li1998*. """ @range_warning @@ -151,7 +151,7 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbPo Polonium + List[float] : Temperature validity range of the PbPo Polonium compound activity coefficient correlation function """ return [913.0, 1123.0] @@ -159,7 +159,7 @@ def range(self) -> List[float]: class LeadPoloniumHenryConstant(PropertyInterface): """ - Liquid lead *PbPo Polonium compound Henry constant* + Liquid lead *PbPo Polonium compound Henry constant* property class implementing the correlation by *handbook*. """ @range_warning @@ -218,7 +218,7 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbPo Polonium + List[float] : Temperature validity range of the PbPo Polonium compound Henry constant correlation function """ return [913.0, 1123.0] @@ -292,10 +292,10 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbI2 + List[float] : Temperature validity range of the PbI2 Iodine compound vapour pressure correlation function. """ - return [T_m0, 697.0] + return [T_m0, 697.0] class LeadIodineVapourPressureKnacke1991(PropertyInterface): @@ -374,7 +374,7 @@ def range(self) -> List[float]: class LeadIodineActivityCoefficient(PropertyInterface): """ - Liquid lead *PbI2 Iodine compound activity coefficient* + Liquid lead *PbI2 Iodine compound activity coefficient* property class implementing the suggestion by *handbook*. """ @range_warning @@ -441,7 +441,7 @@ def range(self) -> List[float]: class LeadIodineHenryConstantKonings1996(PropertyInterface): """ - Liquid lead *PbI2 Iodine compound Henry constant* + Liquid lead *PbI2 Iodine compound Henry constant* property class implementing the correlation by *konings1996*. """ @range_warning @@ -510,12 +510,12 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound Henry constant correlation function """ - return [T_m0, 697.0] + return [T_m0, 697.0] class LeadIodineHenryConstantKnacke1991(PropertyInterface): """ - Liquid lead *PbI2 Iodine compound Henry constant* + Liquid lead *PbI2 Iodine compound Henry constant* property class implementing the correlation by *knacke1991*. """ @range_warning @@ -584,7 +584,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound Henry constant correlation function """ - return [697.0, T_b0] + return [697.0, T_b0] class LeadCaesiumHenryConstantYamshchikov2001(PropertyInterface): @@ -616,7 +616,7 @@ def correlation(self, T: float, p: float = atm, Henry constant in :math:`[Pa]` """ return np.power(10, - 4980 / T - 9.323 * np.log(T) + 0.004473 * T - - 8.684 * 10**(-7) * T**(2) + 33.07) + - 8.684 * 10**(-7) * T**(2) + 33.07) @property def name(self) -> str: @@ -656,7 +656,7 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Cs-Pb Caesium + List[float] : Temperature validity range of the Cs-Pb Caesium intermetallic compound Henry constant correlation function """ return [643.0, 933.0] @@ -664,7 +664,7 @@ def range(self) -> List[float]: class LeadCaesiumActivityCoefficient(PropertyInterface): """ - Liquid lead *Cs-Pb Caesium intermetallic compound activity coefficient* + Liquid lead *Cs-Pb Caesium intermetallic compound activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning @@ -717,7 +717,7 @@ def long_name(self) -> str: @property def description(self) -> str: """ - str : Cs-Pb Caesium intermetallic compound activity coefficient + str : Cs-Pb Caesium intermetallic compound activity coefficient description """ return f"{self.long_name} in liquid lead" @@ -725,7 +725,7 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Cs-Pb Caesium + List[float] : Temperature validity range of the Cs-Pb Caesium intermetallic compound activity coefficient correlation function """ return [T_m0, 1100.0] @@ -733,7 +733,7 @@ def range(self) -> List[float]: class LeadCaesiumVapourPressure(PropertyInterface): """ - Liquid lead *Cs-Pb Caesium intermetallic compound vapour pressure* + Liquid lead *Cs-Pb Caesium intermetallic compound vapour pressure* property class implementing the correlation by *lbh15*. """ @range_warning @@ -759,8 +759,8 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return LeadCaesiumHenryConstantYamshchikov2001().correlation(T, p)\ - / LeadCaesiumActivityCoefficient().correlation(T, p) + return LeadCaesiumHenryConstantYamshchikov2001().correlation(T, p) /\ + LeadCaesiumActivityCoefficient().correlation(T, p) @property def name(self) -> str: @@ -793,7 +793,7 @@ def description(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Cs-Pb Caesium + List[float] : Temperature validity range of the Cs-Pb Caesium intermetallic compound vapour pressure correlation function """ return [643.0, 933.0] From ae10ae2453ba9c6e2498ac33322f9c970be5c8bb Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 26 Jul 2024 18:25:46 +0200 Subject: [PATCH 35/52] [184_lead_contamination], issue #184, Reviewed code according to pylint. --- .../lead_thermochemical_properties/lead_contamination.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index e54117b..207db57 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -1,7 +1,7 @@ """Module with the definition of some coumpounds properties for contamination assessment""" -import numpy as np from typing import List +import numpy as np from scipy.constants import atm from ..interface import PropertyInterface from ..._decorators import range_warning From 8939eb45a92a3854497538a679d6a7e0dbe2fb9d Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 29 Jul 2024 09:21:48 +0200 Subject: [PATCH 36/52] [184_lead_contamination], issue #184, Creation of the abstract classes and deriving correlations from it. --- .../lead_contamination.py | 188 +++++++----------- 1 file changed, 72 insertions(+), 116 deletions(-) diff --git a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py index 207db57..c16e5c6 100644 --- a/lbh15/properties/lead_thermochemical_properties/lead_contamination.py +++ b/lbh15/properties/lead_thermochemical_properties/lead_contamination.py @@ -224,7 +224,41 @@ def range(self) -> List[float]: return [913.0, 1123.0] -class LeadIodineVapourPressureKonings1996(PropertyInterface): +class LeadIodineVapourPressureInterface(PropertyInterface): + """ + Liquid lead *PbI2 Iodine compound vapour pressure* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_PbI2" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbI2 Iodine vapour pressure long name + """ + return "Vapour pressure of PbI2 Iodine compound" + + @property + def description(self) -> str: + """ + str : PbI2 Iodine compound vapour pressure description + """ + return f"{self.long_name} in liquid lead" + + +class LeadIodineVapourPressureKonings1996(LeadIodineVapourPressureInterface): """ Liquid lead *PbI2 Iodine compound vapour pressure* property class implementing the correlation by *konings1996*. @@ -254,13 +288,6 @@ def correlation(self, T: float, p: float = atm, """ return np.power(10, - 8691 / T + 13.814) - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "P_PbI2_s" - @property def correlation_name(self) -> str: """ @@ -268,27 +295,6 @@ def correlation_name(self) -> str: """ return "konings1996" - @property - def units(self) -> str: - """ - str : Vapour pressure unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : PbI2 Iodine vapour pressure long name - """ - return "Vapour pressure of PbI2 Iodine compound" - - @property - def description(self) -> str: - """ - str : PbI2 Iodine compound vapour pressure description - """ - return f"{self.long_name} in liquid lead" - @property def range(self) -> List[float]: """ @@ -298,7 +304,7 @@ def range(self) -> List[float]: return [T_m0, 697.0] -class LeadIodineVapourPressureKnacke1991(PropertyInterface): +class LeadIodineVapourPressureKnacke1991(LeadIodineVapourPressureInterface): """ Liquid lead *PbI2 Iodine compound vapour pressure* property class implementing the correlation by *knacke1991*. @@ -328,13 +334,6 @@ def correlation(self, T: float, p: float = atm, """ return np.power(10, - 9087 / T - 6.16 * np.log(T) + 31.897) - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "P_PbI2_l" - @property def correlation_name(self) -> str: """ @@ -342,27 +341,6 @@ def correlation_name(self) -> str: """ return "knacke1991" - @property - def units(self) -> str: - """ - str : Vapour pressure unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : PbI2 Iodine compound vapour pressure long name - """ - return "Vapour pressure of PbI2 Iodine compound" - - @property - def description(self) -> str: - """ - str : PbI2 Iodine compound vapour pressure description - """ - return f"{self.long_name} in liquid lead" - @property def range(self) -> List[float]: """ @@ -439,7 +417,41 @@ def range(self) -> List[float]: return [T_m0, T_b0] -class LeadIodineHenryConstantKonings1996(PropertyInterface): +class LeadIodineHenryConstantInterface(PropertyInterface): + """ + Liquid lead *PbI2 Iodine compound Henry constant* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbI2" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbI2 Iodine compound Henry constant long name + """ + return "Henry constant of PbI2 Iodine compound" + + @property + def description(self) -> str: + """ + str : PbI2 Iodine compound Henry constant description + """ + return f"{self.long_name} in liquid lead" + + +class LeadIodineHenryConstantKonings1996(LeadIodineHenryConstantInterface): """ Liquid lead *PbI2 Iodine compound Henry constant* property class implementing the correlation by *konings1996*. @@ -469,13 +481,6 @@ def correlation(self, T: float, p: float = atm, """ return LeadIodineVapourPressureKonings1996().correlation(T, p) - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "K_PbI2_s" - @property def correlation_name(self) -> str: """ @@ -483,27 +488,6 @@ def correlation_name(self) -> str: """ return "konings1996" - @property - def units(self) -> str: - """ - str : Henry constant unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : PbI2 Iodine compound Henry constant long name - """ - return "Henry constant of PbI2 Iodine compound" - - @property - def description(self) -> str: - """ - str : PbI2 Iodine compound Henry constant description - """ - return f"{self.long_name} in liquid lead" - @property def range(self) -> List[float]: """ @@ -513,7 +497,7 @@ def range(self) -> List[float]: return [T_m0, 697.0] -class LeadIodineHenryConstantKnacke1991(PropertyInterface): +class LeadIodineHenryConstantKnacke1991(LeadIodineHenryConstantInterface): """ Liquid lead *PbI2 Iodine compound Henry constant* property class implementing the correlation by *knacke1991*. @@ -543,13 +527,6 @@ def correlation(self, T: float, p: float = atm, """ return LeadIodineVapourPressureKnacke1991().correlation(T, p) - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "K_PbI2_l" - @property def correlation_name(self) -> str: """ @@ -557,27 +534,6 @@ def correlation_name(self) -> str: """ return "knacke1991" - @property - def units(self) -> str: - """ - str : Henry constant unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : PbI2 Iodine compound Henry constant long name - """ - return "Henry constant of PbI2 Iodine compound" - - @property - def description(self) -> str: - """ - str : PbI2 iodine compound Henry constant description - """ - return f"{self.long_name} in liquid lead" - @property def range(self) -> List[float]: """ From 14727348cbedcdf12fda527ec7580e21b03f38ae Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 29 Jul 2024 11:58:56 +0200 Subject: [PATCH 37/52] [185_bismuth_contamination], issue #185, Modifications suggested for BismuthPoloniumActivityCoefficientJoy1963, BismuthPoloniumActivityCoefficient, BismuthIodineVapourPressureCubicciotti1959 and Caesium activity coefficient have been changed. --- .../bismuth_contamination.py | 172 ++++++++++++------ 1 file changed, 113 insertions(+), 59 deletions(-) diff --git a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py index f855510..d884e11 100644 --- a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py +++ b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py @@ -9,16 +9,51 @@ from ..._commons import BISMUTH_BOILING_TEMPERATURE as T_b0 -class BismuthPoloniumActivityCoefficientJoy1963(PropertyInterface): +class BismuthPoloniumActivityCoefficientInterface(PropertyInterface): """ - Liquid lead *Polonium compound activity coeffcient* property class + Liquid bismuth *dilute Polonium activity coefficient* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_BiPo" + + @property + def units(self) -> str: + """ + str : Activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : Polonium activity coefficient long name + """ + return "Activity coefficient of Polonium" + + @property + def description(self) -> str: + """ + str : Polonium activity coefficient description + """ + return f"{self.long_name} in liquid bismuth" + + +class BismuthPoloniumActivityCoefficientJoy1963\ + (BismuthPoloniumActivityCoefficientInterface): + """ + Liquid bismuth *dilute Polonium activity coeffcient* property class implementing the correlation by *joy1963*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound activity coefficient* by + Returns the value of the *dilute Polonium activity coefficient* by applying the property correlation. Parameters @@ -37,14 +72,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10,(- 2728.3 / T) + 1.1176) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "gamma_BiPo_a" + return np.power(10, - 2728.3 / T + 1.1176) @property def correlation_name(self) -> str: @@ -54,45 +82,64 @@ def correlation_name(self) -> str: return "joy1963" @property - def units(self) -> str: + def range(self) -> List[float]: """ - str : Activity coefficient unit + List[float] : Temperature validity range of the dilute Polonium + activity coefficient correlation function """ - return "[-]" + return [723.0, 1123.0] - @property - def long_name(self) -> str: - """ - str : Polonium activity coefficient long name - """ - return "Activity coefficient of Polonium" - @property - def description(self) -> str: +class BismuthPoloniumActivityCoefficient\ + (BismuthPoloniumActivityCoefficientInterface): + """ + Liquid bismuth *dilute Polonium activity coeffcient* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: """ - str : Polonium activity coefficient description + Returns the value of the *dilute Polonium activity coefficient* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` """ - return f"{self.long_name} in liquid bismuth" + return np.power(10, - 2272.7 / T + 0.1316) @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the activity coefficient - correlation function + List[float] : Temperature validity range of the dilute Polonium + activity coefficient correlation function """ - return [723.0, 1123.0] + return [923.0, 1038.0] -class BismuthPoloniumActivityCoefficient(PropertyInterface): +class BismuthIodineVapourPressureCubicciotti1959(PropertyInterface): """ - Liquid lead *Polonium compound activity coeffcient* property class - implementing the correlation by *lbh15*. + Liquid bismuth *BiI3 Iodide compound vapour pressure* property class + implementing the correlation by *cubicciotti1959*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound activity coefficient* by + Returns the value of the *BiI3 Iodide compound vapour pressure* by applying the property correlation. Parameters @@ -109,58 +156,65 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[-]` + pressure in :math:`[Pa]` """ - return np.power(10,(- 2272.7 / T) + 0.1316) + return np.power(10, - 4310 / T + 10.29) @property def name(self) -> str: """ str : Name of the property """ - return "gamma_BiPo_b" + return "P_BiI3" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "cubicciotti1959" @property def units(self) -> str: """ - str : Activity coefficient unit + str : Vapour pressure unit """ - return "[-]" + return "[Pa]" @property def long_name(self) -> str: """ - str : Polonium activity coefficient long name + str : BiI3 Iodide vapour pressure long name """ - return "Activity coefficient of Polonium" + return "Vapour pressure of BiI3 Iodide" @property def description(self) -> str: """ - str : Polonium activity coefficient description + str : BiI3 Iodide vapour pressure description """ return f"{self.long_name} in liquid bismuth" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the activity coefficient - correlation function + List[float] : Temperature validity range of the BiI3 Iodide + vapour pressure correlation function """ - return [923.0, 1038.0] + return [T_m0, T_b0] -class BismuthIodineVapourPressureCubicciotti1959(PropertyInterface): +class BismuthIodineActivityCoefficientGverdtsiteli1984(PropertyInterface): """ - Liquid bismuth *BiI3 Iodide compound vapour pressure* property class - implementing the correlation by *cubicciotti1959*. + Liquid bismuth *Caesium intermetallic compound activity coefficient* + property class implementing the correlation by *gverdtsiteli1984*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *BiI3 Iodide compound vapour pressure* by - applying the property correlation. + Returns the value of the *Caesium intermetallic compound + activity coefficient* by applying the property correlation. Parameters ---------- @@ -176,49 +230,49 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - pressure in :math:`[Pa]` + activity coefficient in :math:`[-]` """ - return np.power(10,(- 4310 / T) + 10.29) + return np.power(10, -2.5) @property def name(self) -> str: """ str : Name of the property """ - return "P_BiI3" + return "gamma_BiCs" @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "cubicciotti1959" + return "gverdtsiteli1984" @property def units(self) -> str: """ - str : Vapour pressure unit + str : Activity coefficient unit """ - return "[Pa]" + return "[-]" @property def long_name(self) -> str: """ - str : BiI3 Iodide vapour pressure long name + str : Caesium intermetallic compound activity coefficient long name """ - return "Vapour pressure of BiI3 Iodide" + return "Activity coefficient of Caesium intermetallic compound" @property def description(self) -> str: """ - str : BiI3 Iodide vapour pressure description + str : Caesium intermetallic compound activity coefficient description """ return f"{self.long_name} in liquid bismuth" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the BiI3 Iodide - vapour pressure correlation function + List[float] : Temperature validity range of the Caesium intermetallic + compound activity coefficient correlation function """ - return [T_m0, T_b0] + return [T_m0, 1000] From 9d493726ca34e744edeb3ebdf1e6f24ff16b8629 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 29 Jul 2024 12:01:03 +0200 Subject: [PATCH 38/52] [185_bismuth_contamination], issue #185, gamma_BiPo from the Handbook has been defined as the correlation to use. Path toward bismuth_contamination has been implemented in order to not interfere with the tests. --- lbh15/bismuth.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lbh15/bismuth.py b/lbh15/bismuth.py index 35133b8..0720e7b 100644 --- a/lbh15/bismuth.py +++ b/lbh15/bismuth.py @@ -61,7 +61,7 @@ class Bismuth(LiquidMetalInterface): _default_corr_to_use: Dict[str, str] = \ {'fe_sol': "gosse2014", 'ni_sol': "gosse2014", 'cr_sol': "gosse2014", 'o_dif': "fitzner1980", - 'o_pp': "isecke1979"} + 'o_pp': "isecke1979", 'gamma_BiPo': 'lbh15'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} _custom_properties_path: Dict[str, List[str]] = {} @@ -74,7 +74,9 @@ class Bismuth(LiquidMetalInterface): .diffusivity_in_bismuth', 'lbh15.properties.bismuth_thermochemical_properties\ .bismuth_thermochemical', - 'lbh15.properties.bismuth_properties'] + 'lbh15.properties.bismuth_properties', + 'lbh15.properties.bismuth_thermochemical_properties\ +.bismuth_contamination'] def __init__(self, p: float = atm, **kwargs): self._guess = BISMUTH_BOILING_TEMPERATURE / 2.0 From 15b14b9c5a93cd3f816e9763b52c139ee840476a Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 29 Jul 2024 12:14:28 +0200 Subject: [PATCH 39/52] [184_lead_contamination], issue #184, The P_PbI2 and K_PbI2 from knacke1991 have been defined as the correlations to use. The path properties.lead_thermochemical_properties.lead_contamination has been implemented in _properties_modules_list in order to not interfere with the tests. --- lbh15/lead.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lbh15/lead.py b/lbh15/lead.py index fbd9f70..9fc2839 100644 --- a/lbh15/lead.py +++ b/lbh15/lead.py @@ -92,7 +92,8 @@ class Lead(LiquidMetalInterface): _default_corr_to_use: Dict[str, str] = \ {'cp': 'sobolev2011', 'cr_sol': "gosse2014", 'o_pp': "alcock1964", 'o_dif': "gromov1996", - 'lim_cr': "gosse2014"} + 'lim_cr': "gosse2014", 'P_PbI2': 'knacke1991', + 'K_PbI2': 'knacke1991'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} _custom_properties_path: Dict[str, List[str]] = {} @@ -103,6 +104,7 @@ class Lead(LiquidMetalInterface): 'lbh15.properties.lead_thermochemical_properties.diffusivity_in_lead', 'lbh15.properties.lead_thermochemical_properties.lead_thermochemical', 'lbh15.properties.lead_thermochemical_properties.lead_oxygen_limits', + 'lbh15.properties.lead_thermochemical_properties.lead_contamination', 'lbh15.properties.lead_properties'] def __init__(self, p: float = atm, **kwargs): From 2ad6d9f0141984202ce61aec740a59b8ce9193f4 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 29 Jul 2024 12:56:46 +0200 Subject: [PATCH 40/52] [186_LBE_contamination], issue #186, Modification of whitespaces in correlation methods. Implementation of LBEPoloniumHenryConstantInterface and LBEPoloniumActivityCoefficientInterface, from which Henry constant classes and Activity coefficient classes of Polonium in LBE are derived. --- .../lbe_contamination.py | 238 ++++++++---------- 1 file changed, 101 insertions(+), 137 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 75f4cf8..cdb09d5 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -1,15 +1,49 @@ """Module with the definition of some coumpounds properties for contamination assessment""" -import numpy as np from typing import List +import numpy as np from scipy.constants import atm from ..interface import PropertyInterface from ..._decorators import range_warning -from..._commons import LBE_MELTING_TEMPERATURE as T_m0 +from ..._commons import LBE_MELTING_TEMPERATURE as T_m0 from ..._commons import LBE_BOILING_TEMPERATURE as T_b0 -class LBEPoloniumHenryConstantOhno2006(PropertyInterface): +class LBEPoloniumHenryConstantInterface(PropertyInterface): + """ + Liquid LBE *Polonium compound Henry constant* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_LBEPo" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Polonium Henry constant long name + """ + return "Henry constant of Polonium" + + @property + def description(self) -> str: + """ + str : Polonium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + +class LBEPoloniumHenryConstantOhno2006(LBEPoloniumHenryConstantInterface): """ Liquid LBE *Polonium compound Henry constant* property class implementing the correlation by *ohno2006*. @@ -37,14 +71,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10,(- 8348 / T) + 10.5357) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "K_LBEPo_a" + return np.power(10, - 8348 / T + 10.5357) @property def correlation_name(self) -> str: @@ -53,46 +80,26 @@ def correlation_name(self) -> str: """ return "ohno2006" - @property - def units(self) -> str: - """ - str : Henry constant unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : Polonium Henry constant long name - """ - return "Henry constant of Polonium" - - @property - def description(self) -> str: - """ - str : Polonium Henry constant description - """ - return f"{self.long_name} in liquid LBE" - @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium + List[float] : Temperature validity range of the Polonium Henry constant correlation function """ return [723.0, 1023.0] -class LBEPoloniumActivityCoefficientOhno2006(PropertyInterface): +class LBEPoloniumHenryConstantBuongiorno2003\ + (LBEPoloniumHenryConstantInterface): """ - Liquid LBE *Polonium compound activity coefficient* property class - implementing the correlation by *ohno2006*. + Liquid LBE *Polonium compound Henry constant* property class + implementing the correlation by *buongiorno2003*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound activity coefficient* by + Returns the value of the *Polonium compound Henry constant* by applying the property correlation. Parameters @@ -109,23 +116,37 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[-]` + Henry constant in :math:`[Pa]` """ - return np.power(10,(- 2908 / T) + 1.079) + return np.power(10, - 6790 / T + 1.26) @property - def name(self) -> str: + def correlation_name(self) -> str: """ - str : Name of the property + str : Name of the correlation """ - return "gamma_LBEPo_a" + return "buongiorno2003" @property - def correlation_name(self) -> str: + def range(self) -> List[float]: """ - str : Name of the correlation + List[float] : Temperature validity range of the Polonium + Henry constant correlation function """ - return "ohno2006" + return [665.0, 823.0] + + +class LBEPoloniumActivityCoefficientInterface(PropertyInterface): + """ + Liquid LBE *Polonium compound activity coefficient* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_LBEPo" @property def units(self) -> str: @@ -148,25 +169,18 @@ def description(self) -> str: """ return f"{self.long_name} in liquid LBE" - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the Polonium - activity coefficient correlation function - """ - return [723.0, 877.0] - -class LBEPoloniumHenryConstantBuongiorno2003(PropertyInterface): +class LBEPoloniumActivityCoefficientOhno2006\ + (LBEPoloniumActivityCoefficientInterface): """ - Liquid LBE *Polonium compound Henry constant* property class - implementing the correlation by *buongiorno2003*. + Liquid LBE *Polonium compound activity coefficient* property class + implementing the correlation by *ohno2006*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound Henry constant* by + Returns the value of the *Polonium compound activity coefficient* by applying the property correlation. Parameters @@ -183,55 +197,27 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - Henry constant in :math:`[Pa]` - """ - return np.power(10,(- 6790 / T) + 1.26) - - @property - def name(self) -> str: - """ - str : Name of the property + activity coefficient in :math:`[-]` """ - return "K_LBEPo_b" + return np.power(10, - 2908 / T + 1.079) @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "buongiorno2003" - - @property - def units(self) -> str: - """ - str : Henry constant unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : Polonium Henry constant long name - """ - return "Henry constant of Polonium" - - @property - def description(self) -> str: - """ - str : Polonium Henry constant description - """ - return f"{self.long_name} in liquid LBE" + return "ohno2006" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium - Henry constant correlation function + List[float] : Temperature validity range of the Polonium + activity coefficient correlation function """ - return [665.0, 823.0] + return [723.0, 877.0] -class LBEPoloniumActivityCoefficient(PropertyInterface): +class LBEPoloniumActivityCoefficient(LBEPoloniumActivityCoefficientInterface): """ Liquid LBE *Polonium compound activity coefficient* property class implementing the correlation by *lbh15*. @@ -259,40 +245,12 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10,(- 1830 / T) + 0.40) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "gamma_LBEPo_b" - - @property - def units(self) -> str: - """ - str : Activity coefficient unit - """ - return "[-]" - - @property - def long_name(self) -> str: - """ - str : Polonium activity coefficient long name - """ - return "activity coefficient of Polonium" - - @property - def description(self) -> str: - """ - str : Polonium activity coefficient description - """ - return f"{self.long_name} in liquid LBE" + return np.power(10, - 1830 / T + 0.40) @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium + List[float] : Temperature validity range of the Polonium activity coefficient correlation function """ return [913.0, 1123.0] @@ -326,7 +284,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10,(- 3332.7 / T) - 0.848 * np.log(T) + 12.6706) + return np.power(10, - 3332.7 / T - 0.848 * np.log(T) + 12.6706) @property def name(self) -> str: @@ -460,7 +418,8 @@ def correlation(self, T: float, p: float = atm, float: Vapour pressure in :math:`[Pa]` """ - return LBEMercuryHenryConstant().correlation(T,p) / LBEMercuryActivityCoefficient().correlation(T,p) + return LBEMercuryHenryConstant().correlation(T, p) /\ + LBEMercuryActivityCoefficient().correlation(T, p) @property def name(self) -> str: @@ -527,7 +486,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10,(- 5711 / T) - 1.0867 * np.log(T) + 14.38) + return np.power(10, - 5711 / T - 1.0867 * np.log(T) + 14.38) @property def name(self) -> str: @@ -661,7 +620,8 @@ def correlation(self, T: float, p: float = atm, float: vapour pressure in :math:`[Pa]` """ - return LBECadmiumHenryConstant().correlation(T,p) / LBECadmiumActivityCoefficient().correlation(T,p) + return LBECadmiumHenryConstant().correlation(T, p) /\ + LBECadmiumActivityCoefficient().correlation(T, p) @property def name(self) -> str: @@ -728,7 +688,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10,(- 9463 / T) - 0.892 * np.log(T) + 13.264) + return np.power(10, - 9463 / T - 0.892 * np.log(T) + 13.264) @property def name(self) -> str: @@ -862,7 +822,8 @@ def correlation(self, T: float, p: float = atm, float: vapour pressure in :math:`[Pa]` """ - return LBEThalliumHenryConstant().correlation(T,p) / LBEThalliumActivityCoefficient().correlation(T,p) + return LBEThalliumHenryConstant().correlation(T, p) /\ + LBEThalliumActivityCoefficient().correlation(T, p) @property def name(self) -> str: @@ -929,7 +890,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10,(- 10407 / T) + 14.56) + return np.power(10, - 10407 / T + 14.56) @property def name(self) -> str: @@ -984,8 +945,8 @@ class LBEIodineActivityCoefficientNeuhasen2005c(PropertyInterface): def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds activity coefficient* by - applying the property correlation. + Returns the value of the *PbI2 Iodine compounds activity coefficient* + by applying the property correlation. Parameters ---------- @@ -1077,7 +1038,8 @@ def correlation(self, T: float, p: float = atm, float: vapour pressure in :math:`[Pa]` """ - return LBEIodineHenryConstantNeuhausen2005().correlation(T,p) / LBEIodineActivityCoefficientNeuhasen2005c().correlation(T,p) + return LBEIodineHenryConstantNeuhausen2005().correlation(T, p) /\ + LBEIodineActivityCoefficientNeuhasen2005c().correlation(T, p) @property def name(self) -> str: @@ -1144,7 +1106,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10,(- 2677 / T) + 0.75) + return np.power(10, - 2677 / T + 0.75) @property def name(self) -> str: @@ -1188,7 +1150,7 @@ def range(self) -> List[float]: activity coefficient correlation function. """ return [723.0, 1023.0] - + class LBERubidiumVapourPressureInterfaceLandolt1960(PropertyInterface): """ @@ -1218,7 +1180,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return np.power(10,(- 4588 / T) - 1.45 * np.log(T) + 14.110) + return np.power(10, - 4588 / T - 1.45 * np.log(T) + 14.110) @property def name(self) -> str: @@ -1292,7 +1254,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10,-1.7) + return np.power(10, -1.7) @property def name(self) -> str: @@ -1359,7 +1321,9 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return LBERubidiumVapourPressureInterfaceLandolt1960().correlation(T,p) * LBERubidiumActivityCoefficient().correlation(T,p) + return LBERubidiumVapourPressureInterfaceLandolt1960()\ + .correlation(T, p) * LBERubidiumActivityCoefficient()\ + .correlation(T, p) @property def name(self) -> str: From d576b843635e7735ed996f21757788c39d48f0b5 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Mon, 29 Jul 2024 12:59:23 +0200 Subject: [PATCH 41/52] [186_LBE_contamination], issue #186, K_LBEPo and gamma_LBEPo from Ohno2006 have been defined as the correlation to use. The path properties.lbe_thermochemical_properties.lbe_contamination has been implemented in _properties_modules_list in order to not interfere with the tests. --- lbh15/lbe.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lbh15/lbe.py b/lbh15/lbe.py index a360831..aabc358 100644 --- a/lbh15/lbe.py +++ b/lbh15/lbe.py @@ -81,7 +81,8 @@ class LBE(LiquidMetalInterface): {'fe_sol': "gosse2014", 'ni_sol': "gosse2014", 'cr_sol': 'gosse2014', 'o_dif': "gromov1996", 'lim_cr': "gosse2014", 'lim_ni': "gosse2014", - 'lim_fe': "gosse2014"} + 'lim_fe': "gosse2014", 'K_LBEPo': 'ohno2006', + 'gamma_LBEPo': 'ohno2006'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} _custom_properties_path: Dict[str, List[str]] = {} @@ -92,6 +93,7 @@ class LBE(LiquidMetalInterface): 'lbh15.properties.lbe_thermochemical_properties.diffusivity_in_lbe', 'lbh15.properties.lbe_thermochemical_properties.lbe_thermochemical', 'lbh15.properties.lbe_thermochemical_properties.lbe_oxygen_limits', + 'lbh15.properties.lbe_thermochemical_properties.lbe_contamination', 'lbh15.properties.lbe_properties'] def __init__(self, p: float = atm, **kwargs): From 8925e500f9d6a873e47dba5052d4aa70755b46f6 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Tue, 30 Jul 2024 16:52:26 +0200 Subject: [PATCH 42/52] 185_bismuth_contamination], issue #185, Small modifications on docstrings and string values. --- .../bismuth_contamination.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py index d884e11..c060c50 100644 --- a/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py +++ b/lbh15/properties/bismuth_thermochemical_properties/bismuth_contamination.py @@ -19,7 +19,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_BiPo" + return "gamma_Po" @property def units(self) -> str: @@ -46,7 +46,7 @@ def description(self) -> str: class BismuthPoloniumActivityCoefficientJoy1963\ (BismuthPoloniumActivityCoefficientInterface): """ - Liquid bismuth *dilute Polonium activity coeffcient* property class + Liquid bismuth *dilute Polonium activity coefficient* property class implementing the correlation by *joy1963*. """ @range_warning @@ -93,7 +93,7 @@ def range(self) -> List[float]: class BismuthPoloniumActivityCoefficient\ (BismuthPoloniumActivityCoefficientInterface): """ - Liquid bismuth *dilute Polonium activity coeffcient* property class + Liquid bismuth *dilute Polonium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning @@ -201,19 +201,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the BiI3 Iodide vapour pressure correlation function """ - return [T_m0, T_b0] + return [682.0, T_b0] -class BismuthIodineActivityCoefficientGverdtsiteli1984(PropertyInterface): +class BismuthCaesiumActivityCoefficientGverdtsiteli1984(PropertyInterface): """ - Liquid bismuth *Caesium intermetallic compound activity coefficient* + Liquid bismuth *Caesium intermetallic compounds activity coefficient* property class implementing the correlation by *gverdtsiteli1984*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Caesium intermetallic compound + Returns the value of the *Caesium intermetallic compounds activity coefficient* by applying the property correlation. Parameters @@ -239,7 +239,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_BiCs" + return "gamma_Cs" @property def correlation_name(self) -> str: @@ -258,14 +258,14 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Caesium intermetallic compound activity coefficient long name + str : Caesium intermetallic compounds activity coefficient long name """ - return "Activity coefficient of Caesium intermetallic compound" + return "Activity coefficient of Caesium intermetallic compounds" @property def description(self) -> str: """ - str : Caesium intermetallic compound activity coefficient description + str : Caesium intermetallic compounds activity coefficient description """ return f"{self.long_name} in liquid bismuth" @@ -273,6 +273,6 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the Caesium intermetallic - compound activity coefficient correlation function + compounds activity coefficient correlation function """ return [T_m0, 1000] From 542edc986100aaf132a8b52d32b1bea04a2938bb Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Tue, 30 Jul 2024 16:55:39 +0200 Subject: [PATCH 43/52] [185_bismuth_contamination], issue #185, Update of the default correlation for gamma_Po. --- lbh15/bismuth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbh15/bismuth.py b/lbh15/bismuth.py index 0720e7b..0e3c4dd 100644 --- a/lbh15/bismuth.py +++ b/lbh15/bismuth.py @@ -61,7 +61,7 @@ class Bismuth(LiquidMetalInterface): _default_corr_to_use: Dict[str, str] = \ {'fe_sol': "gosse2014", 'ni_sol': "gosse2014", 'cr_sol': "gosse2014", 'o_dif': "fitzner1980", - 'o_pp': "isecke1979", 'gamma_BiPo': 'lbh15'} + 'o_pp': "isecke1979", 'gamma_Po': 'lbh15'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} _custom_properties_path: Dict[str, List[str]] = {} From c689f9d33bbf4254cb020499f45ba8aa33a364e7 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Tue, 30 Jul 2024 17:33:43 +0200 Subject: [PATCH 44/52] [186_lbe_contamination], issue #186, Modification on docstrings and string values. --- .../lbe_thermochemical_properties/lbe_contamination.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index cdb09d5..ce5dcaa 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -19,7 +19,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_LBEPo" + return "K_Po" @property def units(self) -> str: @@ -45,14 +45,14 @@ def description(self) -> str: class LBEPoloniumHenryConstantOhno2006(LBEPoloniumHenryConstantInterface): """ - Liquid LBE *Polonium compound Henry constant* property class + Liquid LBE *elemental Polonium Henry constant* property class implementing the correlation by *ohno2006*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound Henry constant* by + Returns the value of the *elemental Polonium Henry constant* by applying the property correlation. Parameters From 9976bab895d192ae008789eb1fdc2ce565969a25 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Tue, 30 Jul 2024 17:34:40 +0200 Subject: [PATCH 45/52] [186_lbe_contamination], issue #186, Modification of lbe.py according to last commit. --- lbh15/lbe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbh15/lbe.py b/lbh15/lbe.py index aabc358..1f9438f 100644 --- a/lbh15/lbe.py +++ b/lbh15/lbe.py @@ -81,7 +81,7 @@ class LBE(LiquidMetalInterface): {'fe_sol': "gosse2014", 'ni_sol': "gosse2014", 'cr_sol': 'gosse2014', 'o_dif': "gromov1996", 'lim_cr': "gosse2014", 'lim_ni': "gosse2014", - 'lim_fe': "gosse2014", 'K_LBEPo': 'ohno2006', + 'lim_fe': "gosse2014", 'K_Po': 'ohno2006', 'gamma_LBEPo': 'ohno2006'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} From 89ffbf5ce7aff7248008c7bdbff31cdb01a627ac Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Wed, 31 Jul 2024 10:06:57 +0200 Subject: [PATCH 46/52] [186_lbe_contamination], issue #186, Modification on docstrings and names. Verification and correction of temperature range. --- .../lbe_contamination.py | 175 +++++++++--------- 1 file changed, 91 insertions(+), 84 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index ce5dcaa..8061573 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -14,13 +14,6 @@ class LBEPoloniumHenryConstantInterface(PropertyInterface): Liquid LBE *Polonium compound Henry constant* abstract class. """ - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "K_Po" - @property def units(self) -> str: """ @@ -73,6 +66,13 @@ def correlation(self, T: float, p: float = atm, """ return np.power(10, - 8348 / T + 10.5357) + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_Po" + @property def correlation_name(self) -> str: """ @@ -120,6 +120,13 @@ def correlation(self, T: float, p: float = atm, """ return np.power(10, - 6790 / T + 1.26) + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbPo" + @property def correlation_name(self) -> str: """ @@ -146,7 +153,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBEPo" + return "gamma_Po" @property def units(self) -> str: @@ -258,14 +265,14 @@ def range(self) -> List[float]: class LBEMercuryHenryConstant(PropertyInterface): """ - Liquid LBE *Mercury compound Henry constant* property class + Liquid LBE *dilute Mercury Henry constant* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Mercury compounds Henry constant* by + Returns the value of the *dilute Mercury Henry constant* by applying the property correlation. Parameters @@ -320,19 +327,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury Henry constant correlation function """ - return [603.0, T_b0] + return [629.73, T_b0] class LBEMercuryActivityCoefficient(PropertyInterface): """ - Liquid LBE *Mercury compound activity coefficient* property class + Liquid LBE *dilute Mercury activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Mercury compounds activity coefficient* by + Returns the value of the *dilute Mercury activity coefficient* by applying the property correlation. Parameters @@ -358,7 +365,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBEHg" + return "gamma_Hg" @property def units(self) -> str: @@ -387,19 +394,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury activity coefficient correlation function """ - return [603.0, T_b0] + return [629.73, T_b0] class LBEMercuryVapourPressure(PropertyInterface): """ - Liquid LBE *Mercury compound vapour pressure* property class + Liquid LBE *dilute Mercury vapour pressure* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Mercury compounds vapour pressure* by + Returns the value of the *dilute Mercury vapour pressure* by applying the property correlation. Parameters @@ -426,7 +433,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBEHg" + return "P_Hg" @property def units(self) -> str: @@ -455,19 +462,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury vapour pressure correlation function """ - return [603.0, T_b0] + return [629.73, T_b0] class LBECadmiumHenryConstant(PropertyInterface): """ - Liquid LBE *Cadmium compound Henry constant* property class + Liquid LBE *dilute Cadmium Henry constant* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cadmium compound Henry constant* by + Returns the value of the *dilute Cadmium Henry constant* by applying the property correlation. Parameters @@ -493,7 +500,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_LBECd" + return "K_Cd" @property def units(self) -> str: @@ -527,14 +534,14 @@ def range(self) -> List[float]: class LBECadmiumActivityCoefficient(PropertyInterface): """ - Liquid LBE *Cadmium compound activity coefficient* property class + Liquid LBE *dilute Cadmium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cadmium compounds activity coefficient* by + Returns the value of the *dilute Cadmium activity coefficient* by applying the property correlation. Parameters @@ -560,7 +567,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBECd" + return "gamma_Cd" @property def units(self) -> str: @@ -594,14 +601,14 @@ def range(self) -> List[float]: class LBECadmiumVapourPressure(PropertyInterface): """ - Liquid LBE *Cadmium compound vapour pressure* property class + Liquid LBE *dilute Cadmium vapour pressure* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Cadmium compounds vapour pressure* by + Returns the value of the *dilute Cadmium vapour pressure* by applying the property correlation. Parameters @@ -628,7 +635,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBECd" + return "P_Cd" @property def units(self) -> str: @@ -662,14 +669,14 @@ def range(self) -> List[float]: class LBEThalliumHenryConstant(PropertyInterface): """ - Liquid LBE *Thallium compounds Henry constant* property class + Liquid LBE *dilute Thallium Henry constant* property class implementing the correltion by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Thallium compounds Henry constant* by + Returns the value of the *dilute Thallium Henry constant* by applying the property correlation. Parameters @@ -695,7 +702,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_LBETl" + return "K_Tl" @property def units(self) -> str: @@ -724,19 +731,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Thallium Henry constant correlation function. """ - return [T_m0, T_b0] + return [577.0, T_b0] class LBEThalliumActivityCoefficient(PropertyInterface): """ - Liquid LBE *Thallium compound activity coefficient* property class + Liquid LBE *dilute Thallium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Thallium compounds activity coefficient* by + Returns the value of the *dilute Thallium activity coefficient* by applying the property correlation. Parameters @@ -762,7 +769,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBETl" + return "gamma_Tl" @property def units(self) -> str: @@ -791,19 +798,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Thallium activity coefficient correlation function """ - return [T_m0, T_b0] + return [577.0, T_b0] class LBEThalliumVapourPressure(PropertyInterface): """ - Liquid LBE *Thallium compound vapour pressure* property class + Liquid LBE *dilute Thallium vapour pressure* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Thallium compounds vapour pressure* by + Returns the value of the *dilute Thallium vapour pressure* by applying the property correlation. Parameters @@ -830,7 +837,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBETl" + return "P_Tl" @property def units(self) -> str: @@ -859,19 +866,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Thallium vapour pressure correlation function """ - return [T_m0, T_b0] + return [577.0, T_b0] class LBEIodineHenryConstantNeuhausen2005(PropertyInterface): """ - Liquid LBE *PbI2 Iodine compounds Henry constant* property class + Liquid LBE *monoatomic Iodine Henry constant* property class implementing the correlation by *neuhausen2005*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds Henry constant* by + Returns the value of the *monoatomic Iodine Henry constant* by applying the property correlation. Parameters @@ -897,7 +904,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_LBEPbI2" + return "K_I" @property def correlation_name(self) -> str: @@ -916,36 +923,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : PbI2 Iodine Henry constant long name + str : monoatomic Iodine Henry constant long name """ - return "Henry constant of PbI2 Iodine" + return "Henry constant of monoatomic Iodine" @property def description(self) -> str: """ - str : PbI2 Iodine Henry constant description + str : monoatomic Iodine Henry constant description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbI2 Iodine + List[float] : Temperature validity range of the monoatomic Iodine Henry constant correlation function """ - return [T_m0, T_b0] + return [700, T_b0] class LBEIodineActivityCoefficientNeuhasen2005c(PropertyInterface): """ - Liquid LBE *PbI2 Iodine compound activity coefficient* property class + Liquid LBE *monoatomic Iodine activity coefficient* property class implementing the correlation by *neuhasen2005c*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds activity coefficient* + Returns the value of the *monoatomic Iodine activity coefficient* by applying the property correlation. Parameters @@ -971,7 +978,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBEPbI2" + return "gamma_I" @property def correlation_name(self) -> str: @@ -990,36 +997,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : PbI2 Iodine activity coefficient long name + str : monoatomic Iodine activity coefficient long name """ - return "Activity coefficient of PbI2 Iodine" + return "Activity coefficient of monoatomic Iodine" @property def description(self) -> str: """ - str : PbI2 Iodine activity coefficient description + str : monoatomic Iodine activity coefficient description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbI2 Iodine + List[float] : Temperature validity range of the monoatomic Iodine activity coefficient correlation function """ - return [T_m0, T_b0] + return [700, T_b0] class LBEIodineVapourPressure(PropertyInterface): """ - Liquid LBE *PbI2 Iodine compound vapour pressure* property class + Liquid LBE *monoatomic Iodine vapour pressure* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *PbI2 Iodine compounds vapour pressure* by + Returns the value of the *monoatomic Iodine vapour pressure* by applying the property correlation. Parameters @@ -1046,7 +1053,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBEPbI2" + return "P_I" @property def units(self) -> str: @@ -1058,36 +1065,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : PbI2 Iodine vapour pressure long name + str : monoatomic Iodine vapour pressure long name """ - return "Vapour pressure of PbI2 Iodine" + return "Vapour pressure of monoatomic Iodine" @property def description(self) -> str: """ - str : PbI2 Iodine vapour pressure description + str : monoatomic Iodine vapour pressure description """ return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the PbI2 Iodine + List[float] : Temperature validity range of the monoatomic Iodine vapour pressure correlation function """ - return [T_m0, T_b0] + return [700, T_b0] class LBECaesiumActivityCoefficientOhno2006(PropertyInterface): """ - Liquid LBE *Caesium compound activity coefficient* property class + Liquid LBE *Caesium intermetallic compounds activity coefficient* property class implementing the correlation by *ohno2006*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Caesium compound Henry constant* by + Returns the value of the *Caesium intermetallic compounds Henry constant* by applying the property correlation. Parameters @@ -1113,7 +1120,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBECs" + return "gamma_Cs" @property def correlation_name(self) -> str: @@ -1132,36 +1139,36 @@ def units(self) -> str: @property def long_name(self) -> str: """ - str : Caesium compound activity coefficient long name + str : Caesium intermetallic compounds activity coefficient long name """ - return "Activity coefficient of Caesium compound" + return "Activity coefficient of Caesium intermetallic compounds" @property def description(self) -> str: """ - str : Caesium compound activity coefficient description + str : Caesium intermetallic compounds activity coefficient description """ return f"{self.long_name} in liquid lead" @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Caesium compound - activity coefficient correlation function. + List[float] : Temperature validity range of the Caesium + intermetallic compounds activity coefficient correlation function. """ return [723.0, 1023.0] class LBERubidiumVapourPressureInterfaceLandolt1960(PropertyInterface): """ - Liquid LBE *Rubidium compounds vapour pressure* property class + Liquid LBE *Rubidium vapour pressure* property class implementing the correlation by *landolt1960*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Rubidium compounds vapour pressure* by + Returns the value of the *Rubidium vapour pressure* by applying the property correlation. Parameters @@ -1187,7 +1194,7 @@ def name(self) -> str: """ str : Name of the property """ - return "P_LBERb" + return "P_Rb" @property def correlation_name(self) -> str: @@ -1223,19 +1230,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium vapour pressure correlation function. """ - return [T_m0, T_b0] + return [800, T_b0] class LBERubidiumActivityCoefficient(PropertyInterface): """ - Liquid LBE *Rubidium compound activity coefficient* property class + Liquid LBE *Rubidium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Rubidium compounds activity coefficient* by + Returns the value of the *Rubidium activity coefficient* by applying the property correlation. Parameters @@ -1261,7 +1268,7 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_LBERb" + return "gamma_Rb" @property def units(self) -> str: @@ -1290,19 +1297,19 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium activity coefficient correlation function """ - return [T_m0, T_b0] + return [800, T_b0] class LBERubidiumHenryConstant(PropertyInterface): """ - Liquid LBE *Rubidium compounds Henry constant* property class + Liquid LBE *Rubidium Henry constant* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Rubidium compounds Henry constant* by + Returns the value of the *Rubidium Henry constant* by applying the property correlation. Parameters @@ -1330,7 +1337,7 @@ def name(self) -> str: """ str : Name of the property """ - return "K_LBERb" + return "K_Rb" @property def units(self) -> str: @@ -1359,4 +1366,4 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium Henry constant correlation function. """ - return [T_m0, T_b0] + return [800, T_b0] From edf0e90b56ab5abdf025f4d36913b40d405696b6 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Wed, 31 Jul 2024 10:20:03 +0200 Subject: [PATCH 47/52] [186_lbe_contamination], issue #186, Implementation of correlations 5.44 and 5.45 and the Henry constant that derive from it. --- .../lbe_contamination.py | 397 ++++++++++++++++-- 1 file changed, 351 insertions(+), 46 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 8061573..1606b4b 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -869,16 +869,50 @@ def range(self) -> List[float]: return [577.0, T_b0] -class LBEIodineHenryConstantNeuhausen2005(PropertyInterface): +class LBEIodineVapourPressureInterface(PropertyInterface): """ - Liquid LBE *monoatomic Iodine Henry constant* property class - implementing the correlation by *neuhausen2005*. + Liquid LBE *PbI2 Iodine compound vapour pressure* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_PbI2" + + @property + def units(self) -> str: + """ + str : Vapour pressure unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbI2 Iodine vapour pressure long name + """ + return "Vapour pressure of PbI2 Iodine compound" + + @property + def description(self) -> str: + """ + str : PbI2 Iodine compound vapour pressure description + """ + return f"{self.long_name} in liquid LBE" + + +class LBEIodineVapourPressureKonings1996(LBEIodineVapourPressureInterface): + """ + Liquid LBE *PbI2 Iodine compound vapour pressure* property class + implementing the correlation by *konings1996*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *monoatomic Iodine Henry constant* by + Returns the value of the *PbI2 Iodine compound vapour pressure* by applying the property correlation. Parameters @@ -895,42 +929,121 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - Henry constant in :math:`[Pa]` + pressure in :math:`[Pa]` """ - return np.power(10, - 10407 / T + 14.56) + return np.power(10, - 8691 / T + 13.814) @property - def name(self) -> str: + def correlation_name(self) -> str: """ - str : Name of the property + str : Name of the correlation """ - return "K_I" + return "konings1996" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbI2 + Iodine compound vapour pressure correlation function. + """ + return [T_m0, 697.0] + + +class LBEIodineVapourPressureKnacke1991(LBEIodineVapourPressureInterface): + """ + Liquid LBE *PbI2 Iodine compound vapour pressure* property class + implementing the correlation by *knacke1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbI2 Iodine compound vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + pressure in :math:`[Pa]` + """ + return np.power(10, - 9087 / T - 6.16 * np.log(T) + 31.897) @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "neuheusen2005" + return "knacke1991" @property - def units(self) -> str: + def range(self) -> List[float]: """ - str : Henry constant unit + List[float] : Temperature validity range of the PbI2 + Iodine compound vapour pressure correlation function. """ - return "[Pa]" + return [697.0, T_b0] + + +class LBEIodineVapourPressure(LBEIodineVapourPressureInterface): + """ + Liquid LBE *monoatomic Iodine vapour pressure* property class + implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *monoatomic Iodine vapour pressure* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + vapour pressure in :math:`[Pa]` + """ + return LBEIodineHenryConstantNeuhausen2005().correlation(T, p) /\ + LBEIodineActivityCoefficient().correlation(T, p) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "P_I" @property def long_name(self) -> str: """ - str : monoatomic Iodine Henry constant long name + str : monoatomic Iodine vapour pressure long name """ - return "Henry constant of monoatomic Iodine" + return "Vapour pressure of monoatomic Iodine" @property def description(self) -> str: """ - str : monoatomic Iodine Henry constant description + str : monoatomic Iodine vapour pressure description """ return f"{self.long_name} in liquid LBE" @@ -938,21 +1051,21 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the monoatomic Iodine - Henry constant correlation function + vapour pressure correlation function """ return [700, T_b0] -class LBEIodineActivityCoefficientNeuhasen2005c(PropertyInterface): +class LBEIodineActivityCoefficient(PropertyInterface): """ - Liquid LBE *monoatomic Iodine activity coefficient* property class - implementing the correlation by *neuhasen2005c*. + Liquid LBE *PbI2 Iodine compound activity coefficient* + property class implementing the suggestion by *handbook*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *monoatomic Iodine activity coefficient* + Returns the value of the *PbI2 Iodine compound activity coefficient* by applying the property correlation. Parameters @@ -978,33 +1091,219 @@ def name(self) -> str: """ str : Name of the property """ - return "gamma_I" + return "gamma_PbI2" + + @property + def units(self) -> str: + """ + str : activity coefficient unit + """ + return "[-]" + + @property + def long_name(self) -> str: + """ + str : PbI2 iodine compound activity coefficient long name + """ + return "Activity coefficient of PbI2 Iodine compound" + + @property + def description(self) -> str: + """ + str : PbI2 Iodine compound activity coefficient description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbI2 Iodine + compound activity coefficient correlation function + """ + return [T_m0, T_b0] + + +class LBEIodineHenryConstantInterface(PropertyInterface): + """ + Liquid LBE *PbI2 Iodine compound Henry constant* + abstract class. + """ + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_PbI2" + + @property + def units(self) -> str: + """ + str : Henry constant unit + """ + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : PbI2 Iodine compound Henry constant long name + """ + return "Henry constant of PbI2 Iodine compound" + + @property + def description(self) -> str: + """ + str : PbI2 Iodine compound Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + +class LBEIodineHenryConstantKonings1996(LBEIodineHenryConstantInterface): + """ + Liquid LBE *PbI2 Iodine compound Henry constant* + property class implementing the correlation by *konings1996*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbI2 Iodine compound Henry constant* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return LBEIodineVapourPressureKonings1996().correlation(T, p) @property def correlation_name(self) -> str: """ str : Name of the correlation """ - return "neuhasen2005c" + return "konings1996" @property - def units(self) -> str: + def range(self) -> List[float]: """ - str : activity coefficient unit + List[float] : Temperature validity range of the PbI2 Iodine + compound Henry constant correlation function """ - return "[-]" + return [T_m0, 697.0] + + +class LBEIodineHenryConstantKnacke1991(LBEIodineHenryConstantInterface): + """ + Liquid LBE *PbI2 Iodine compound Henry constant* + property class implementing the correlation by *knacke1991*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *PbI2 Iodine compound Henry constant* + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return LBEIodineVapourPressureKnacke1991().correlation(T, p) + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "knacke1991" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the PbI2 Iodine + compound Henry constant correlation function + """ + return [697.0, T_b0] + + +class LBEIodineHenryConstantNeuhausen2005(LBEIodineHenryConstantInterface): + """ + Liquid LBE *monoatomic Iodine Henry constant* property class + implementing the correlation by *neuhausen2005*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *monoatomic Iodine Henry constant* by + applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Henry constant in :math:`[Pa]` + """ + return np.power(10, - 10407 / T + 14.56) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "K_I" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "neuheusen2005" @property def long_name(self) -> str: """ - str : monoatomic Iodine activity coefficient long name + str : monoatomic Iodine Henry constant long name """ - return "Activity coefficient of monoatomic Iodine" + return "Henry constant of monoatomic Iodine" @property def description(self) -> str: """ - str : monoatomic Iodine activity coefficient description + str : monoatomic Iodine Henry constant description """ return f"{self.long_name} in liquid LBE" @@ -1012,22 +1311,22 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the monoatomic Iodine - activity coefficient correlation function + Henry constant correlation function """ return [700, T_b0] -class LBEIodineVapourPressure(PropertyInterface): + """ - Liquid LBE *monoatomic Iodine vapour pressure* property class - implementing the correlation by *lbh15*. + Liquid LBE *monoatomic Iodine activity coefficient* property class + implementing the correlation by *neuhasen2005c*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *monoatomic Iodine vapour pressure* by - applying the property correlation. + Returns the value of the *monoatomic Iodine activity coefficient* + by applying the property correlation. Parameters ---------- @@ -1043,36 +1342,42 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - vapour pressure in :math:`[Pa]` + activity coefficient in :math:`[-]` """ - return LBEIodineHenryConstantNeuhausen2005().correlation(T, p) /\ - LBEIodineActivityCoefficientNeuhasen2005c().correlation(T, p) + return 1 @property def name(self) -> str: """ str : Name of the property """ - return "P_I" + return "gamma_I" + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "neuhasen2005c" @property def units(self) -> str: """ - str : vapour pressure unit + str : activity coefficient unit """ - return "[Pa]" + return "[-]" @property def long_name(self) -> str: """ - str : monoatomic Iodine vapour pressure long name + str : monoatomic Iodine activity coefficient long name """ - return "Vapour pressure of monoatomic Iodine" + return "Activity coefficient of monoatomic Iodine" @property def description(self) -> str: """ - str : monoatomic Iodine vapour pressure description + str : monoatomic Iodine activity coefficient description """ return f"{self.long_name} in liquid LBE" @@ -1080,7 +1385,7 @@ def description(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the monoatomic Iodine - vapour pressure correlation function + activity coefficient correlation function """ return [700, T_b0] @@ -1148,7 +1453,7 @@ def description(self) -> str: """ str : Caesium intermetallic compounds activity coefficient description """ - return f"{self.long_name} in liquid lead" + return f"{self.long_name} in liquid LBE" @property def range(self) -> List[float]: From 42396c60ad7e753d8724fb8304be58c75940b712 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Wed, 31 Jul 2024 10:22:39 +0200 Subject: [PATCH 48/52] [186_lbe_contamination], issue #186, Modification of correlations to use in lbe.py, to manage the comflict that could happen for gamma_Po, P_PbI2 and K_PbI2. --- lbh15/lbe.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lbh15/lbe.py b/lbh15/lbe.py index 1f9438f..3b1aaaa 100644 --- a/lbh15/lbe.py +++ b/lbh15/lbe.py @@ -82,7 +82,8 @@ class LBE(LiquidMetalInterface): 'cr_sol': 'gosse2014', 'o_dif': "gromov1996", 'lim_cr': "gosse2014", 'lim_ni': "gosse2014", 'lim_fe': "gosse2014", 'K_Po': 'ohno2006', - 'gamma_LBEPo': 'ohno2006'} + 'gamma_Po': 'ohno2006', 'P_PbI2': 'knacke1991', + 'K_PbI2': 'knacke1991'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} _custom_properties_path: Dict[str, List[str]] = {} From 1c8fdcb409441136c4c846146f04815e3c93e198 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Thu, 1 Aug 2024 09:25:36 +0200 Subject: [PATCH 49/52] [186_lbe_contamination], issue #186, Modification of temperature ranges. Delete of one of the activity coefficient class of Iodine. Modification on doc strings. --- .../lbe_contamination.py | 106 +++--------------- 1 file changed, 16 insertions(+), 90 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index 1606b4b..de09efe 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -145,7 +145,7 @@ def range(self) -> List[float]: class LBEPoloniumActivityCoefficientInterface(PropertyInterface): """ - Liquid LBE *Polonium compound activity coefficient* + Liquid LBE *elemental Polonium activity coefficient* abstract class. """ @property @@ -167,7 +167,7 @@ def long_name(self) -> str: """ str : Polonium activity coefficient long name """ - return "activity coefficient of Polonium" + return "Activity coefficient of elemental Polonium" @property def description(self) -> str: @@ -180,14 +180,14 @@ def description(self) -> str: class LBEPoloniumActivityCoefficientOhno2006\ (LBEPoloniumActivityCoefficientInterface): """ - Liquid LBE *Polonium compound activity coefficient* property class + Liquid LBE *elemental Polonium activity coefficient* property class implementing the correlation by *ohno2006*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound activity coefficient* by + Returns the value of the *elemental Polonium activity coefficient* by applying the property correlation. Parameters @@ -218,22 +218,22 @@ def correlation_name(self) -> str: @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium - activity coefficient correlation function + List[float] : Temperature validity range of the elemental + Polonium activity coefficient correlation function """ return [723.0, 877.0] class LBEPoloniumActivityCoefficient(LBEPoloniumActivityCoefficientInterface): """ - Liquid LBE *Polonium compound activity coefficient* property class + Liquid LBE *elemental Polonium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Polonium compound activity coefficient* by + Returns the value of the *elemental Polonium activity coefficient* by applying the property correlation. Parameters @@ -257,8 +257,8 @@ def correlation(self, T: float, p: float = atm, @property def range(self) -> List[float]: """ - List[float] : Temperature validity range of the Polonium - activity coefficient correlation function + List[float] : Temperature validity range of the elemental + Polonium activity coefficient correlation function """ return [913.0, 1123.0] @@ -327,7 +327,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury Henry constant correlation function """ - return [629.73, T_b0] + return [603.0, T_b0] class LBEMercuryActivityCoefficient(PropertyInterface): @@ -394,7 +394,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury activity coefficient correlation function """ - return [629.73, T_b0] + return [603.0, T_b0] class LBEMercuryVapourPressure(PropertyInterface): @@ -462,7 +462,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury vapour pressure correlation function """ - return [629.73, T_b0] + return [603.0, T_b0] class LBECadmiumHenryConstant(PropertyInterface): @@ -1316,80 +1316,6 @@ def range(self) -> List[float]: return [700, T_b0] - - """ - Liquid LBE *monoatomic Iodine activity coefficient* property class - implementing the correlation by *neuhasen2005c*. - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *monoatomic Iodine activity coefficient* - by applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - activity coefficient in :math:`[-]` - """ - return 1 - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "gamma_I" - - @property - def correlation_name(self) -> str: - """ - str : Name of the correlation - """ - return "neuhasen2005c" - - @property - def units(self) -> str: - """ - str : activity coefficient unit - """ - return "[-]" - - @property - def long_name(self) -> str: - """ - str : monoatomic Iodine activity coefficient long name - """ - return "Activity coefficient of monoatomic Iodine" - - @property - def description(self) -> str: - """ - str : monoatomic Iodine activity coefficient description - """ - return f"{self.long_name} in liquid LBE" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the monoatomic Iodine - activity coefficient correlation function - """ - return [700, T_b0] - - class LBECaesiumActivityCoefficientOhno2006(PropertyInterface): """ Liquid LBE *Caesium intermetallic compounds activity coefficient* property class @@ -1535,7 +1461,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium vapour pressure correlation function. """ - return [800, T_b0] + return [T_m0, T_b0] class LBERubidiumActivityCoefficient(PropertyInterface): @@ -1602,7 +1528,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium activity coefficient correlation function """ - return [800, T_b0] + return [T_m0, T_b0] class LBERubidiumHenryConstant(PropertyInterface): @@ -1671,4 +1597,4 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium Henry constant correlation function. """ - return [800, T_b0] + return [T_m0, T_b0] From 5d455c7dbacb01ebf28f1de5a9deebb01f45dff6 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Thu, 1 Aug 2024 12:21:24 +0200 Subject: [PATCH 50/52] [186_lbe_contamination], issue #186, Modifications of Temperature range according to Table 5.2.4. Modification of correlations to use according to Table 5.2.4. Modification of docstrings according to new informations from Handbook. --- lbh15/lbe.py | 2 +- .../lbe_contamination.py | 481 +++++++----------- 2 files changed, 171 insertions(+), 312 deletions(-) diff --git a/lbh15/lbe.py b/lbh15/lbe.py index 3b1aaaa..f477d21 100644 --- a/lbh15/lbe.py +++ b/lbh15/lbe.py @@ -83,7 +83,7 @@ class LBE(LiquidMetalInterface): 'lim_cr': "gosse2014", 'lim_ni': "gosse2014", 'lim_fe': "gosse2014", 'K_Po': 'ohno2006', 'gamma_Po': 'ohno2006', 'P_PbI2': 'knacke1991', - 'K_PbI2': 'knacke1991'} + 'K_PbI2': 'knacke1991', 'gamma_Cs': 'lbh15'} _correlations_to_use: Dict[str, str] = copy.deepcopy(_default_corr_to_use) _roots_to_use: Dict[str, int] = {'cp': 0} _custom_properties_path: Dict[str, List[str]] = {} diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index de09efe..b2e6f21 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -118,7 +118,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10, - 6790 / T + 1.26) + return np.power(10, - 6790 / T + 8.46) @property def name(self) -> str: @@ -138,7 +138,7 @@ def correlation_name(self) -> str: def range(self) -> List[float]: """ List[float] : Temperature validity range of the Polonium - Henry constant correlation function + compound Henry constant correlation function """ return [665.0, 823.0] @@ -265,14 +265,14 @@ def range(self) -> List[float]: class LBEMercuryHenryConstant(PropertyInterface): """ - Liquid LBE *dilute Mercury Henry constant* property class + Liquid LBE *Mercury Henry constant* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *dilute Mercury Henry constant* by + Returns the value of the *Mercury Henry constant* by applying the property correlation. Parameters @@ -291,14 +291,14 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10, - 3332.7 / T - 0.848 * np.log(T) + 12.6706) + return np.power(10, - 3332.7 / T - 0.848 * np.log(T) + 12.9716) @property def name(self) -> str: """ str : Name of the property """ - return "K_LBEHg" + return "K_Hg" @property def units(self) -> str: @@ -327,19 +327,20 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury Henry constant correlation function """ - return [603.0, T_b0] + return [603 - 0.05 * (T_b0 - T_m0), + 603 + 0.05 * (T_b0 - T_m0)] class LBEMercuryActivityCoefficient(PropertyInterface): """ - Liquid LBE *dilute Mercury activity coefficient* property class + Liquid LBE *Mercury activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *dilute Mercury activity coefficient* by + Returns the value of the *Mercury activity coefficient* by applying the property correlation. Parameters @@ -394,87 +395,20 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Mercury activity coefficient correlation function """ - return [603.0, T_b0] - - -class LBEMercuryVapourPressure(PropertyInterface): - """ - Liquid LBE *dilute Mercury vapour pressure* property class - implementing the correlation by *lbh15*. - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *dilute Mercury vapour pressure* by - applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - Vapour pressure in :math:`[Pa]` - """ - return LBEMercuryHenryConstant().correlation(T, p) /\ - LBEMercuryActivityCoefficient().correlation(T, p) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "P_Hg" - - @property - def units(self) -> str: - """ - str : Vapour pressure unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : Mercury vapour pressure long name - """ - return "Vapour pressure of Mercury" - - @property - def description(self) -> str: - """ - str : Mercury vapour pressure description - """ - return f"{self.long_name} in liquid LBE" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the Mercury - vapour pressure correlation function - """ - return [603.0, T_b0] + return [603 - 0.05 * (T_b0 - T_m0), + 603 + 0.05 * (T_b0 - T_m0)] class LBECadmiumHenryConstant(PropertyInterface): """ - Liquid LBE *dilute Cadmium Henry constant* property class + Liquid LBE *Cadmium Henry constant* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *dilute Cadmium Henry constant* by + Returns the value of the *Cadmium Henry constant* by applying the property correlation. Parameters @@ -529,19 +463,20 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Cadmium Henry constant correlation function """ - return [T_m0, T_b0] + return [773 - 0.05 * (T_b0 - T_m0), + 773 + 0.05 * (T_b0 - T_m0)] class LBECadmiumActivityCoefficient(PropertyInterface): """ - Liquid LBE *dilute Cadmium activity coefficient* property class + Liquid LBE *Cadmium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *dilute Cadmium activity coefficient* by + Returns the value of the *Cadmium activity coefficient* by applying the property correlation. Parameters @@ -596,87 +531,20 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Cadmium activity coefficient correlation function """ - return [T_m0, T_b0] - - -class LBECadmiumVapourPressure(PropertyInterface): - """ - Liquid LBE *dilute Cadmium vapour pressure* property class - implementing the correlation by *lbh15*. - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *dilute Cadmium vapour pressure* by - applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - vapour pressure in :math:`[Pa]` - """ - return LBECadmiumHenryConstant().correlation(T, p) /\ - LBECadmiumActivityCoefficient().correlation(T, p) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "P_Cd" - - @property - def units(self) -> str: - """ - str : vapour pressure unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : Cadmium vapour pressure long name - """ - return "Vapour pressure of Cadmium" - - @property - def description(self) -> str: - """ - str : Cadmium vapour pressure description - """ - return f"{self.long_name} in liquid LBE" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the Cadmium - vapour pressure correlation function - """ - return [T_m0, T_b0] + return [773 - 0.05 * (T_b0 - T_m0), + 773 + 0.05 * (T_b0 - T_m0)] class LBEThalliumHenryConstant(PropertyInterface): """ - Liquid LBE *dilute Thallium Henry constant* property class - implementing the correltion by *lbh15*. + Liquid LBE *Thallium Henry constant* property class + implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *dilute Thallium Henry constant* by + Returns the value of the *Thallium Henry constant* by applying the property correlation. Parameters @@ -731,19 +599,20 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Thallium Henry constant correlation function. """ - return [577.0, T_b0] + return [773 - 0.05 * (T_b0 - T_m0), + 773 + 0.05 * (T_b0 - T_m0)] class LBEThalliumActivityCoefficient(PropertyInterface): """ - Liquid LBE *dilute Thallium activity coefficient* property class + Liquid LBE *Thallium activity coefficient* property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *dilute Thallium activity coefficient* by + Returns the value of the *Thallium activity coefficient* by applying the property correlation. Parameters @@ -798,80 +667,13 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Thallium activity coefficient correlation function """ - return [577.0, T_b0] - - -class LBEThalliumVapourPressure(PropertyInterface): - """ - Liquid LBE *dilute Thallium vapour pressure* property class - implementing the correlation by *lbh15*. - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *dilute Thallium vapour pressure* by - applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - vapour pressure in :math:`[Pa]` - """ - return LBEThalliumHenryConstant().correlation(T, p) /\ - LBEThalliumActivityCoefficient().correlation(T, p) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "P_Tl" - - @property - def units(self) -> str: - """ - str : vapour pressure unit - """ - return "[Pa]" - - @property - def long_name(self) -> str: - """ - str : Thallium vapour pressure long name - """ - return "Vapour pressure of Thallium" - - @property - def description(self) -> str: - """ - str : Thallium vapour pressure description - """ - return f"{self.long_name} in liquid LBE" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the Thallium - vapour pressure correlation function - """ - return [577.0, T_b0] + return [773 - 0.05 * (T_b0 - T_m0), + 773 + 0.05 * (T_b0 - T_m0)] class LBEIodineVapourPressureInterface(PropertyInterface): """ - Liquid LBE *PbI2 Iodine compound vapour pressure* + Liquid LBE *PbI2 Iodine compound vapour pressure* abstract class. """ @property @@ -946,7 +748,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound vapour pressure correlation function. """ - return [T_m0, 697.0] + return [580.0, 697.0] class LBEIodineVapourPressureKnacke1991(LBEIodineVapourPressureInterface): @@ -992,68 +794,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound vapour pressure correlation function. """ - return [697.0, T_b0] - - -class LBEIodineVapourPressure(LBEIodineVapourPressureInterface): - """ - Liquid LBE *monoatomic Iodine vapour pressure* property class - implementing the correlation by *lbh15*. - """ - @range_warning - def correlation(self, T: float, p: float = atm, - verbose: bool = False) -> float: - """ - Returns the value of the *monoatomic Iodine vapour pressure* by - applying the property correlation. - - Parameters - ---------- - T : float - Temperature in :math:`[K]` - p : float, optional - Pressure in :math:`[Pa]`, by default the atmospheric pressure - value, i.e., :math:`101325.0 Pa` - verbose : bool, optional - `True` to tell the decorator to print a warning message in case of - range check failing, `False` otherwise. By default, `False` - - Returns - ------- - float: - vapour pressure in :math:`[Pa]` - """ - return LBEIodineHenryConstantNeuhausen2005().correlation(T, p) /\ - LBEIodineActivityCoefficient().correlation(T, p) - - @property - def name(self) -> str: - """ - str : Name of the property - """ - return "P_I" - - @property - def long_name(self) -> str: - """ - str : monoatomic Iodine vapour pressure long name - """ - return "Vapour pressure of monoatomic Iodine" - - @property - def description(self) -> str: - """ - str : monoatomic Iodine vapour pressure description - """ - return f"{self.long_name} in liquid LBE" - - @property - def range(self) -> List[float]: - """ - List[float] : Temperature validity range of the monoatomic Iodine - vapour pressure correlation function - """ - return [700, T_b0] + return [697.0, 1120.0] class LBEIodineActivityCoefficient(PropertyInterface): @@ -1120,7 +861,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound activity coefficient correlation function """ - return [T_m0, T_b0] + return [580.0, 1120.0] class LBEIodineHenryConstantInterface(PropertyInterface): @@ -1200,7 +941,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound Henry constant correlation function """ - return [T_m0, 697.0] + return [580.0, 697.0] class LBEIodineHenryConstantKnacke1991(LBEIodineHenryConstantInterface): @@ -1246,7 +987,7 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the PbI2 Iodine compound Henry constant correlation function """ - return [697.0, T_b0] + return [697.0, 1120.0] class LBEIodineHenryConstantNeuhausen2005(LBEIodineHenryConstantInterface): @@ -1291,7 +1032,7 @@ def correlation_name(self) -> str: """ str : Name of the correlation """ - return "neuheusen2005" + return "neuhausen2005" @property def long_name(self) -> str: @@ -1313,20 +1054,20 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the monoatomic Iodine Henry constant correlation function """ - return [700, T_b0] + return [700, 1120.0] -class LBECaesiumActivityCoefficientOhno2006(PropertyInterface): +class LBECaesiumHenryConstant(PropertyInterface): """ - Liquid LBE *Caesium intermetallic compounds activity coefficient* property class - implementing the correlation by *ohno2006*. + Liquid LBE *Caesium intermetallic compounds Henry constant* + property class implementing the correlation by *lbh15*. """ @range_warning def correlation(self, T: float, p: float = atm, verbose: bool = False) -> float: """ - Returns the value of the *Caesium intermetallic compounds Henry constant* by - applying the property correlation. + Returns the value of the *Caesium intermetallic compounds + Henry constant* by applying the property correlation. Parameters ---------- @@ -1342,23 +1083,60 @@ def correlation(self, T: float, p: float = atm, Returns ------- float: - activity coefficient in :math:`[-]` + Henry constant in :math:`[Pa]` """ - return np.power(10, - 2677 / T + 0.75) + return np.power(10, - 4980 / T - 9.323 * np.log(T) + + 0.004473 * T - 8.684e-7 * T**2 + 33.07) @property def name(self) -> str: """ str : Name of the property """ - return "gamma_Cs" + return "K_Cs" @property - def correlation_name(self) -> str: + def units(self) -> str: """ - str : Name of the correlation + str : Henry constant unit """ - return "ohno2006" + return "[Pa]" + + @property + def long_name(self) -> str: + """ + str : Caesium Henry constant long name + """ + return "Henry constant of Caesium intermettalic compounds" + + @property + def description(self) -> str: + """ + str : Caesium Henry constant description + """ + return f"{self.long_name} in liquid LBE" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Caesium + intermettalic compounds Henry constant correlation function. + """ + return [643, 933] + + +class LBECaesiumActivityCoefficientInterface(PropertyInterface): + """ + Liquid LBE *Caesium intermetallic compounds activity coefficient* + property abstract class. + """ + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "gamma_Cs" @property def units(self) -> str: @@ -1381,6 +1159,84 @@ def description(self) -> str: """ return f"{self.long_name} in liquid LBE" + +class LBECaesiumActivityCoefficient(LBECaesiumActivityCoefficientInterface): + """ + Liquid LBE *Caesium intermetallic compounds activity coefficient* property + class implementing the correlation by *lbh15*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Caesium intermetallic compounds Henry + constant* by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` + """ + return np.power(10, -1.5) + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the Caesium + intermetallic compounds activity coefficient correlation function. + """ + return [643, 933] + + +class LBECaesiumActivityCoefficientOhno2006\ + (LBECaesiumActivityCoefficientInterface): + """ + Liquid LBE *Caesium intermetallic compounds activity coefficient* property + class implementing the correlation by *ohno2006*. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *Caesium intermetallic compounds Henry + constant* by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + activity coefficient in :math:`[-]` + """ + return np.power(10, - 2677 / T + 0.75) + + @property + def correlation_name(self) -> str: + """ + str : Name of the correlation + """ + return "ohno2006" + @property def range(self) -> List[float]: """ @@ -1461,7 +1317,8 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium vapour pressure correlation function. """ - return [T_m0, T_b0] + return [873 - 0.05 * (T_b0 - T_m0), + 873 + 0.05 * (T_b0 - T_m0)] class LBERubidiumActivityCoefficient(PropertyInterface): @@ -1492,7 +1349,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10, -1.7) + return 0.02 @property def name(self) -> str: @@ -1528,7 +1385,8 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium activity coefficient correlation function """ - return [T_m0, T_b0] + return [873 - 0.05 * (T_b0 - T_m0), + 873 + 0.05 * (T_b0 - T_m0)] class LBERubidiumHenryConstant(PropertyInterface): @@ -1597,4 +1455,5 @@ def range(self) -> List[float]: List[float] : Temperature validity range of the Rubidium Henry constant correlation function. """ - return [T_m0, T_b0] + return [873 - 0.05 * (T_b0 - T_m0), + 873 + 0.05 * (T_b0 - T_m0)] From 6d5e0ab7a35509e5d9942ad22fdfa79c4b159431 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Fri, 2 Aug 2024 16:11:13 +0200 Subject: [PATCH 51/52] [183_contamination_by_irradiated], issue #183, Modification of lbe_contamination.py, with import of iodine and caesium lead-related correlations. Implementation of Lead and Bismuth Henry constant in liquid LBE. --- .../lbe_contamination.py | 17 ++- .../lbe_thermochemical.py | 134 ++++++++++++++++++ 2 files changed, 146 insertions(+), 5 deletions(-) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py index b2e6f21..fb5657c 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_contamination.py @@ -7,6 +7,14 @@ from ..._decorators import range_warning from ..._commons import LBE_MELTING_TEMPERATURE as T_m0 from ..._commons import LBE_BOILING_TEMPERATURE as T_b0 +from ..lead_thermochemical_properties.lead_contamination \ + import LeadIodineVapourPressureKonings1996 +from ..lead_thermochemical_properties.lead_contamination \ + import LeadIodineVapourPressureKnacke1991 +from ..lead_thermochemical_properties.lead_contamination \ + import LeadCaesiumActivityCoefficient +from ..lead_thermochemical_properties.lead_contamination \ + import LeadCaesiumHenryConstantYamshchikov2001 class LBEPoloniumHenryConstantInterface(PropertyInterface): @@ -733,7 +741,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return np.power(10, - 8691 / T + 13.814) + return LeadIodineVapourPressureKonings1996().correlation(T, p) @property def correlation_name(self) -> str: @@ -779,7 +787,7 @@ def correlation(self, T: float, p: float = atm, float: pressure in :math:`[Pa]` """ - return np.power(10, - 9087 / T - 6.16 * np.log(T) + 31.897) + return LeadIodineVapourPressureKnacke1991().correlation(T, p) @property def correlation_name(self) -> str: @@ -1085,8 +1093,7 @@ def correlation(self, T: float, p: float = atm, float: Henry constant in :math:`[Pa]` """ - return np.power(10, - 4980 / T - 9.323 * np.log(T) - + 0.004473 * T - 8.684e-7 * T**2 + 33.07) + return LeadCaesiumHenryConstantYamshchikov2001().correlation(T, p) @property def name(self) -> str: @@ -1188,7 +1195,7 @@ def correlation(self, T: float, p: float = atm, float: activity coefficient in :math:`[-]` """ - return np.power(10, -1.5) + return LeadCaesiumActivityCoefficient().correlation(T, p) @property def range(self) -> List[float]: diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py b/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py index a2357c6..ac7cd35 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py @@ -164,6 +164,73 @@ def description(self) -> str: return f"{self.long_name} in liquid lbe" +class LeadHenryConstant(PropertyInterface): + """ + *Lead Henry constant* in liquid lbe property class. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *lead Henry constant* in liquid lbe + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Lead Henry constant in :math:`[Pa]` + """ + return np.power(10, - 10130 / T - 0.985 * np.log(T) + 12.8163) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "pb_Kh" + + @property + def units(self) -> str: + """ + str : Lead Henry constant unit + """ + return "[Pa]" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the lead Henry + constant correlation function + """ + return [700 - 0.05 * (T_b0 - T_m0), + 700 + 0.05 * (T_b0 - T_m0)] + + @property + def long_name(self) -> str: + """ + str : Lead Henry constant long name + """ + return "lead Henry constant" + + @property + def description(self) -> str: + """ + str : Lead Henry constant description + """ + return f"{self.long_name} in liquid lbe" + + class BismuthChemicalActivity(PropertyInterface): """ *Bismuth chemical activity* in liquid lbe property class. @@ -237,6 +304,73 @@ def description(self) -> str: return f"{self.long_name} in liquid lbe" +class BismuthHenryConstant(PropertyInterface): + """ + *Bismuth Henry constant* in liquid lbe property class. + """ + @range_warning + def correlation(self, T: float, p: float = atm, + verbose: bool = False) -> float: + """ + Returns the value of the *bismuth Henry constant* in liquid lbe + by applying the property correlation. + + Parameters + ---------- + T : float + Temperature in :math:`[K]` + p : float, optional + Pressure in :math:`[Pa]`, by default the atmospheric pressure + value, i.e., :math:`101325.0 Pa` + verbose : bool, optional + `True` to tell the decorator to print a warning message in case of + range check failing, `False` otherwise. By default, `False` + + Returns + ------- + float: + Bismuth Henry constant in :math:`[Pa]` + """ + return np.power(10, - 9656.4 / T + 9.9272) + + @property + def name(self) -> str: + """ + str : Name of the property + """ + return "bi_Kh" + + @property + def units(self) -> str: + """ + str : Bismuth Henry constant unit + """ + return "[Pa]" + + @property + def range(self) -> List[float]: + """ + List[float] : Temperature validity range of the bismuth Henry + constant correlation function + """ + return [700 - 0.05 * (T_b0 - T_m0), + 700 + 0.05 * (T_b0 - T_m0)] + + @property + def long_name(self) -> str: + """ + str : Bismuth Henry constant long name + """ + return "bismuth Henry constant" + + @property + def description(self) -> str: + """ + str : Bismuth Henry constant description + """ + return f"{self.long_name} in liquid lbe" + + class MolarEnthalpy(MolarEnthalpyInterface): """ Liquid lbe *molar enthalpy variation* property class. From a8323daa398db489b8ddbd6e46b6d85ec55100b7 Mon Sep 17 00:00:00 2001 From: Sami Amestas Date: Tue, 6 Aug 2024 09:07:18 +0200 Subject: [PATCH 52/52] [183_contamination_by_irradiated], issue #183, Implementation of initialization_helper methods for Lead and Bismuth Henry constant in liquid lbe to help pass the tests. Addition of boundary's values of Lead and Bismuth Henry constant in liquid LBE in properties_bounds.json. --- .../lbe_thermochemical.py | 38 +++++++++++++++++++ tests/properties_bounds.json | 12 ++++++ 2 files changed, 50 insertions(+) diff --git a/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py b/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py index ac7cd35..c1554a8 100644 --- a/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py +++ b/lbh15/properties/lbe_thermochemical_properties/lbe_thermochemical.py @@ -193,6 +193,25 @@ def correlation(self, T: float, p: float = atm, """ return np.power(10, - 10130 / T - 0.985 * np.log(T) + 12.8163) + def initialization_helper(self, + property_value: float) -> Union[None, float]: + """ + Returns the temperature guess value according to the value + of the Lead Henry constant passed as argument. + It is used by the root finder algorithm. + + Parameters + ---------- + property_value : float + Lead Henry constant in :math:`[Pa]` + + Returns + ------- + float + Temperature guess value in :math:`[K]` + """ + return 1500 + @property def name(self) -> str: """ @@ -333,6 +352,25 @@ def correlation(self, T: float, p: float = atm, """ return np.power(10, - 9656.4 / T + 9.9272) + def initialization_helper(self, + property_value: float) -> Union[None, float]: + """ + Returns the temperature guess value according to the value + of the Bismuth Henry constant passed as argument. + It is used by the root finder algorithm. + + Parameters + ---------- + property_value : float + Bismuth Henry constant in :math:`[Pa]` + + Returns + ------- + float + Temperature guess value in :math:`[K]` + """ + return 1500 + @property def name(self) -> str: """ diff --git a/tests/properties_bounds.json b/tests/properties_bounds.json index 5a4cd7a..769f15f 100644 --- a/tests/properties_bounds.json +++ b/tests/properties_bounds.json @@ -635,6 +635,12 @@ "max": 0.4858986607, "T_at_max": 1172.9999798861 }, + "bi_Kh_lbh15_bismuth_Henry_constant_in_liquid_lbe": { + "min": 0.0000027608, + "T_at_min": 623.5500154587, + "max": 0.0030945479, + "T_at_max": 776.4499805994 + }, "G_lbh15_Gibbs_free_energy_variation_in_liquid_lbe": { "min": -44.6276162032, "T_at_min": 1926.9999545753, @@ -647,6 +653,12 @@ "max": 0.3681810562, "T_at_max": 1172.9999798861 }, + "pb_Kh_lbh15_lead_Henry_constant_in_liquid_lbe": { + "min": 0.0000000002, + "T_at_min": 623.5500144393, + "max": 0.0000001640, + "T_at_max": 776.4499805994 + }, "H_lbh15_molar_enthalpy_variation_in_liquid_lbe": { "min": 0.0617067764, "T_at_min": 400.0000107974,