Skip to content

Commit

Permalink
issue #198 - Merge branch '183_contamination_by_irradiated' into 198_…
Browse files Browse the repository at this point in the history
…lbe_documentation_chap5
  • Loading branch information
Sami Amestas committed Aug 30, 2024
2 parents b29fe2a + a8323da commit 2cf9309
Show file tree
Hide file tree
Showing 9 changed files with 2,194 additions and 248 deletions.
5 changes: 4 additions & 1 deletion lbh15/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
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 .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 .properties.lead_thermochemical_properties import lead_oxygen_limits
from .properties.lead_thermochemical_properties import lead_oxygen_limits
from .properties.lead_thermochemical_properties import lead_contamination
6 changes: 4 additions & 2 deletions lbh15/bismuth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_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]] = {}
Expand All @@ -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
Expand Down
5 changes: 4 additions & 1 deletion lbh15/lbe.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ 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_Po': 'ohno2006',
'gamma_Po': 'ohno2006', 'P_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]] = {}
Expand All @@ -92,6 +94,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):
Expand Down
4 changes: 3 additions & 1 deletion lbh15/lead.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]] = {}
Expand All @@ -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):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,278 @@
"""Module with the definition of some coumpounds properties
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 BismuthPoloniumActivityCoefficientInterface(PropertyInterface):
"""
Liquid bismuth *dilute Polonium activity coefficient*
abstract class.
"""
@property
def name(self) -> str:
"""
str : Name of the property
"""
return "gamma_Po"

@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 coefficient* 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 *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 np.power(10, - 2728.3 / T + 1.1176)

@property
def correlation_name(self) -> str:
"""
str : Name of the correlation
"""
return "joy1963"

@property
def range(self) -> List[float]:
"""
List[float] : Temperature validity range of the dilute Polonium
activity coefficient correlation function
"""
return [723.0, 1123.0]


class BismuthPoloniumActivityCoefficient\
(BismuthPoloniumActivityCoefficientInterface):
"""
Liquid bismuth *dilute 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 *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 np.power(10, - 2272.7 / T + 0.1316)

@property
def range(self) -> List[float]:
"""
List[float] : Temperature validity range of the dilute Polonium
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 *BiI3 Iodide 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, - 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 : BiI3 Iodide vapour pressure long name
"""
return "Vapour pressure of BiI3 Iodide"

@property
def description(self) -> str:
"""
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 BiI3 Iodide
vapour pressure correlation function
"""
return [682.0, T_b0]


class BismuthCaesiumActivityCoefficientGverdtsiteli1984(PropertyInterface):
"""
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 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 np.power(10, -2.5)

@property
def name(self) -> str:
"""
str : Name of the property
"""
return "gamma_Cs"

@property
def correlation_name(self) -> str:
"""
str : Name of the correlation
"""
return "gverdtsiteli1984"

@property
def units(self) -> str:
"""
str : Activity coefficient unit
"""
return "[-]"

@property
def long_name(self) -> str:
"""
str : Caesium intermetallic compounds activity coefficient long name
"""
return "Activity coefficient of Caesium intermetallic compounds"

@property
def description(self) -> str:
"""
str : Caesium intermetallic compounds activity coefficient description
"""
return f"{self.long_name} in liquid bismuth"

@property
def range(self) -> List[float]:
"""
List[float] : Temperature validity range of the Caesium intermetallic
compounds activity coefficient correlation function
"""
return [T_m0, 1000]
Loading

0 comments on commit 2cf9309

Please sign in to comment.