Skip to content

Commit

Permalink
begin move of transport properties
Browse files Browse the repository at this point in the history
  • Loading branch information
drunsinn committed Jan 6, 2025
1 parent c186c91 commit 1bec4d2
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 37 deletions.
35 changes: 0 additions & 35 deletions pyXSteam/IAPWS_R5.py

This file was deleted.

53 changes: 53 additions & 0 deletions pyXSteam/TransportProperties_HW.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""functions for transport properties of heavy water"""

import logging

from .Constants import TRIPLE_POINT_TEMPERATURE, CRITICAL_TEMPERATURE_D20_1992
from .Constants import __REFERENCE_TEMPERATURE_D20_R17_R18__ as T_STAR
from .Constants import __REFERENCE_PREASSURE_D20_R17_R18__ as P_STAR
from .Constants import __REFERENCE_DENSITY_D20_R17_R18__ as RHO_STAR
from .Constants import __REFERENCE_VISCOSITY_D20_R17_R18__ as MY_STAR
from .Constants import __REFERENCE_THERMAL_CONDUCTIVITY_D20_R18__ as LAMBDA_STAR
from .Constants import __SPECIFIC_GAS_CONSTANT_D20_R17_R18__ as R
from .Constants import __TRIPLE_POINT_TEMPERATURE_D2O_RESHW_2018__ as P_t
from .Constants import __TRIPLE_POINT_PRESSURE_D20_RESHW_2018__ as T_t

logger = logging.getLogger(__name__)


def my_AllRegions_pT() -> float:
"""R17-20 calculate viscosity of all liquide states for heavy water, replaces IAPWS R4-84(2007)"""
# 0 < p ≤ pt pt ≤ p ≤ 100 MPa 100 MPa < p ≤ 200 MPa 200 MPa < p ≤ 960 MPa and and and and Tt ≤ T ≤ 775 K
# Tm(p) ≤ T ≤ 775 K
# Tm(p) ≤ T ≤ 473 K Tm(p) ≤ T ≤ 373 K
pass


def tc_() -> float:
"""R18-21 calculate thermal conductivity of heavy water, replaces IAPWS R4-84(2007)"""
pass


def surface_tension_T(T: float) -> float:
"""R5-85(1994) calculate surface tention as a function of temperature for heavy water
IAPWS Release on Surface Tension of Heavy Water Substance
http://www.iapws.org/relguide/surfd2o.pdf
:param T: temperature in Kelvin
:return: surface tension in mN/m
"""
B = 238.0 # N/m
bb = -0.639
my = 1.25

if TRIPLE_POINT_TEMPERATURE <= T <= CRITICAL_TEMPERATURE_D20_1992:
tau = 1 - T / CRITICAL_TEMPERATURE_D20_1992
sigma = B * tau**my * (1 + bb * tau)
return sigma

logger.warning("Temperature out of range of validity")
return float("NaN")
2 changes: 1 addition & 1 deletion pyXSteam/XSteam_HW.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
)
from .UnitConverter import UnitConverter
from .IAPWS_R4 import myHW_rhoT_R4, tcHW_rhoT_R4
from .IAPWS_R5 import surface_tension_T
from .TransportProperties_HW import surface_tension_T


class XSteam_HW:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_HeavyWater.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

from pyXSteam import XSteam_HW
from pyXSteam.Constants import TRIPLE_POINT_TEMPERATURE, CRITICAL_TEMPERATURE
from pyXSteam.IAPWS_R5 import surface_tension_T
from pyXSteam.TransportProperties_HW import surface_tension_T


class HWTester(unittest.TestCase):
Expand Down

0 comments on commit 1bec4d2

Please sign in to comment.