Skip to content

Commit 9e9c3d0

Browse files
committed
update docstrings, add doc section for tabel data
1 parent 2b9ad6a commit 9e9c3d0

File tree

8 files changed

+170
-26
lines changed

8 files changed

+170
-26
lines changed

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
README.md
1010
pyXSteam
1111
pyXSteamDemo
12+
pyXSteamTables
1213

1314
.. automodule:: pyXSteam.XSteam
1415
:noindex:

docs/source/pyXSteam.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,22 @@ pyXSteam.IAPWS_R4 module
7373
:undoc-members:
7474
:show-inheritance:
7575

76+
pyXSteam.IAPWS_R6 module
77+
-----------------------------------
78+
79+
.. automodule:: pyXSteam.IAPWS_R6
80+
:members:
81+
:undoc-members:
82+
:show-inheritance:
83+
84+
pyXSteam.IAPWS_R12 module
85+
-----------------------------------
86+
87+
.. automodule:: pyXSteam.IAPWS_R12
88+
:members:
89+
:undoc-members:
90+
:show-inheritance:
91+
7692
pyXSteam.IAPWS_R14 module
7793
-----------------------------------
7894

@@ -81,6 +97,14 @@ pyXSteam.IAPWS_R14 module
8197
:undoc-members:
8298
:show-inheritance:
8399

100+
pyXSteam.IAPWS_R15 module
101+
-----------------------------------
102+
103+
.. automodule:: pyXSteam.IAPWS_R15
104+
:members:
105+
:undoc-members:
106+
:show-inheritance:
107+
84108
Module contents
85109
---------------
86110

docs/source/pyXSteamTables.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
IAWPS Tabels submodule
2+
======================
3+
4+
pyXSteam.tables module
5+
----------------------
6+
7+
.. automodule:: pyXSteam.tables
8+
:members: R1_76, R5_85, R6_95, R7_97, R12_08, R14_08, R15_11, SR1_86, SR2_01, SR3_03, SR4_04, SR5_05
9+
:undoc-members:
10+
:show-inheritance:

pyXSteam/IAPWS_R14.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def pmelt_T_iceIII(T: float) -> float:
4747

4848
def Tmelt_p_iceIII(p: float) -> float:
4949
"""inverse of `pmelt_T_iceIII`
50-
:param T: melting preasure in [MPa]
50+
51+
:param p: melting preasure in [MPa]
5152
5253
:return: temperature in [K]
5354
"""
@@ -74,7 +75,8 @@ def pmelt_T_iceV(T: float) -> float:
7475

7576
def Tmelt_p_iceV(p: float) -> float:
7677
"""inversee of `pmelt_T_iceV`
77-
:param T: melting preasure in [MPa]
78+
79+
:param p: melting preasure in [MPa]
7880
7981
:return: temperature in [K]
8082
"""
@@ -100,7 +102,8 @@ def pmelt_T_iceVI(T: float) -> float:
100102

101103
def Tmelt_p_iceVI(p: float) -> float:
102104
"""inversee of `pmelt_T_iceVI`
103-
:param T: melting preasure in [MPa]
105+
106+
:param p: melting preasure in [MPa]
104107
105108
:return: temperature in [K]
106109
"""

pyXSteam/Regions.py

Lines changed: 43 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,18 @@ def v2_pT(cls, p: float, T: float) -> float:
345345
return _R * T / p * Pi * (g0_pi + gr_pi) / 1000 # see table 12
346346

347347
@staticmethod
348-
def v2_pT_meta(p, T):
348+
def v2_pT_meta(p: float, T: float) -> float:
349349
"""
350350
6 Equations for Region 2, Section. 6.2 Supplementary Equation for the Metastable-Vapor Region
351351
352352
Table 16, Page 18
353353
354354
specific volume
355+
356+
:param p: preasure in [MPa]
357+
:param T: temperature in [K]
358+
359+
:return: specific volume in [m³ / kg]
355360
"""
356361
Pi = p # Eq 1
357362
tau = 540 / T # Eq 1
@@ -367,7 +372,7 @@ def v2_pT_meta(p, T):
367372
return _R * T / p * Pi * (g0_pi + gr_pi) / 1000 # see table 12
368373

369374
@staticmethod
370-
def h2_pT(p, T):
375+
def h2_pT(p: float, T: float) -> float:
371376
"""function h2_pT = h2_pT(p, T)
372377
373378
6 Equations for Region 2, Section. 6.1 Basic Equation
@@ -393,13 +398,18 @@ def h2_pT(p, T):
393398
return _R * T * tau * (g0_tau + gr_tau)
394399

395400
@staticmethod
396-
def h2_pT_meta(p, T):
401+
def h2_pT_meta(p: float, T: float) -> float:
397402
"""
398403
6 Equations for Region 2, Section. 6.2 Supplementary Equation for the Metastable-Vapor Region
399404
400405
Table 16, Page 18
401406
402407
specific volume
408+
409+
:param p: preasure in [MPa]
410+
:param T: temperature in [K]
411+
412+
:return: enthalpy in [kJ / kg]
403413
"""
404414
Pi = p # Eq 1
405415
tau = 540 / T # Eq 1
@@ -417,7 +427,7 @@ def h2_pT_meta(p, T):
417427
return _R * T * tau * (g0_tau + gr_tau) # h2_pT
418428

419429
@staticmethod
420-
def u2_pT(p, T):
430+
def u2_pT(p: float, T: float) -> float:
421431
"""function u2_pT = u2_pT(p, T)
422432
423433
6 Equations for Region 2, Section. 6.1 Basic Equation
@@ -426,6 +436,7 @@ def u2_pT(p, T):
426436
427437
:param p: preasure in [MPa]
428438
:param T: temperature in [K]
439+
429440
:return: specific internal energy in [kJ / kg]
430441
"""
431442
Pi = p
@@ -446,13 +457,18 @@ def u2_pT(p, T):
446457
return _R * T * (tau * (g0_tau + gr_tau) - Pi * (g0_pi + gr_pi))
447458

448459
@staticmethod
449-
def u2_pT_meta(p, T):
460+
def u2_pT_meta(p: float, T: float) -> float:
450461
"""
451462
6 Equations for Region 2, Section. 6.2 Supplementary Equation for the Metastable-Vapor Region
452463
453464
Table 16, Page 18
454465
455466
specific volume
467+
468+
:param p: preasure in [MPa]
469+
:param T: temperature in [K]
470+
471+
:return: specific internal energy in [kJ / kg]
456472
"""
457473
Pi = p # Eq 1
458474
tau = 540 / T # Eq 1
@@ -478,7 +494,7 @@ def u2_pT_meta(p, T):
478494
return _R * T * (tau * (g0_tau + gr_tau) - Pi * (g0_pi + gr_pi)) # u2_pT
479495

480496
@staticmethod
481-
def s2_pT(p, T):
497+
def s2_pT(p: float, T: float) -> float:
482498
"""function s2_pT = s2_pT(p, T)
483499
484500
6 Equations for Region 2, Section. 6.1 Basic Equation
@@ -508,13 +524,18 @@ def s2_pT(p, T):
508524
return _R * (tau * (g0_tau + gr_tau) - (g0 + gr))
509525

510526
@staticmethod
511-
def s2_pT_meta(p, T):
527+
def s2_pT_meta(p: float, T: float) -> float:
512528
"""
513529
6 Equations for Region 2, Section. 6.2 Supplementary Equation for the Metastable-Vapor Region
514530
515531
Table 16, Page 18
516532
517533
specific volume
534+
535+
:param p: preasure in [MPa]
536+
:param T: temperature in [K]
537+
538+
:return: specific entropy in [kJ / (kg K)]
518539
"""
519540
Pi = p # Eq 1
520541
tau = 540 / T # Eq 1
@@ -542,7 +563,7 @@ def s2_pT_meta(p, T):
542563
return _R * (tau * (g0_tau + gr_tau) - (g0 + gr)) # s2_pT
543564

544565
@staticmethod
545-
def Cp2_pT(p, T):
566+
def Cp2_pT(p: float, T: float) -> float:
546567
"""function Cp2_pT = Cp2_pT(p, T)
547568
548569
6 Equations for Region 2, Section. 6.1 Basic Equation
@@ -568,13 +589,18 @@ def Cp2_pT(p, T):
568589
return -_R * tau**2 * (g0_tautau + gr_tautau)
569590

570591
@staticmethod
571-
def Cp2_pT_meta(p, T):
592+
def Cp2_pT_meta(p: float, T: float) -> float:
572593
"""
573594
6 Equations for Region 2, Section. 6.2 Supplementary Equation for the Metastable-Vapor Region
574595
575596
Table 16, Page 18
576597
577598
specific volume
599+
600+
:param p: preasure in [MPa]
601+
:param T: temperature in [K]
602+
603+
:return: specific isobaric heat capacity in [kJ / (kg K)]
578604
"""
579605
Pi = p # Eq 1
580606
tau = 540 / T # Eq 1
@@ -592,7 +618,7 @@ def Cp2_pT_meta(p, T):
592618
return -_R * tau**2 * (g0_tautau + gr_tautau) # Cp2_pT
593619

594620
@staticmethod
595-
def Cv2_pT(p, T):
621+
def Cv2_pT(p: float, T: float) -> float:
596622
"""function Cv2_pT = Cv2_pT(p, T)
597623
598624
6 Equations for Region 2, Section. 6.1 Basic Equation
@@ -662,13 +688,18 @@ def w2_pT(cls, p: float, T: float) -> float:
662688
) ** 0.5
663689

664690
@staticmethod
665-
def w2_pT_meta(p, T):
691+
def w2_pT_meta(p: float, T: float) -> float:
666692
"""
667693
6 Equations for Region 2, Section. 6.2 Supplementary Equation for the Metastable-Vapor Region
668694
669695
Table 16, Page 18
670696
671697
specific volume
698+
699+
:param p: preasure in [MPa]
700+
:param T: temperature in [K]
701+
702+
:return: speed of sound in [m / s]
672703
"""
673704
Pi = p # Eq 1
674705
tau = 540 / T # Eq 1
@@ -710,7 +741,7 @@ def w2_pT_meta(p, T):
710741
return math.sqrt(1000 * _R * T * part_1 / (part_2_a + part_2_b / part_2_c))
711742

712743
@staticmethod
713-
def T2_ph(p, h):
744+
def T2_ph(p: float, h: float) -> float:
714745
"""function T2_ph = T2_ph(p, h)
715746
716747
6 Equations for Region 2, 6.3.1 The Backward Equations T(p, h) for

pyXSteam/TransportProperties.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ def my_AllRegions_pT(p: float, T: float) -> float:
1919
"""function my_AllRegions_pT = my_AllRegions_pT(p, T)
2020
2121
Section 5.1 Viscosity (IAPWS formulation 1985, Revised 2003)
22+
23+
:param p: preasure in [MPa]
24+
:param T: temperature in [K]
25+
26+
:return: dynamic viscosity in [Pa s]
2227
"""
2328
h0 = [0.5132047, 0.3205656, 0, 0, -0.7782567, 0.1885447]
2429
h1 = [0.2151778, 0.7317883, 1.241044, 1.476783, 0, 0]
@@ -81,6 +86,11 @@ def my_AllRegions_ph(p: float, h: float) -> float:
8186
"""function my_AllRegions_ph = my_AllRegions_ph(p, h)
8287
8388
Section 5.1 Viscosity (IAPWS formulation 1985, Revised 2003)
89+
90+
:param p: preasure in [MPa]
91+
:param h: enthalpy in [kJ / kg]
92+
93+
:return: dynamic viscosity in [Pa s]
8494
"""
8595
h0 = [0.5132047, 0.3205656, 0, 0, -0.7782567, 0.1885447]
8696
h1 = [0.2151778, 0.7317883, 1.241044, 1.476783, 0, 0]
@@ -161,6 +171,12 @@ def tc_ptrho(p: float, T: float, rho: float) -> float:
161171
Revised release on the IAPWS formulation 1985 for the Thermal Conductivity of ordinary water IAPWS, September 1998
162172
163173
Page 8
174+
175+
:param p: preasure in [MPa]
176+
:param T: temperature in [K]
177+
:param rho: density in [kg / m³]
178+
179+
:return: thermal conductivity in [W / (m K)]
164180
"""
165181

166182
# ver2.6 Start corrected bug
@@ -209,9 +225,9 @@ def surface_tension_T(T: float) -> float:
209225
IAPWS Revised Release on Surface Tension of Ordinary Water Substance, June 2014 R1-76(2014)
210226
http://www.iapws.org/relguide/Surf-H2O-2014.pdf
211227
212-
:param T: temperature in Kelvin
228+
:param T: temperature in [K]
213229
214-
:return: surface tension in mN/m
230+
:return: surface tension in [N / m]
215231
"""
216232
B = 235.8 # N/m
217233
bb = -0.625

pyXSteam/TransportProperties_HW.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,13 @@ def my_AllRegions_pT() -> float:
2323
# 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
2424
# Tm(p) ≤ T ≤ 775 K
2525
# Tm(p) ≤ T ≤ 473 K Tm(p) ≤ T ≤ 373 K
26+
raise NotImplementedError()
2627
return
2728

2829

2930
def tc_() -> float:
3031
"""R18-21 calculate thermal conductivity of heavy water, replaces IAPWS R4-84(2007)"""
32+
raise NotImplementedError()
3133
return
3234

3335

@@ -37,9 +39,9 @@ def surface_tension_T(T: float) -> float:
3739
IAPWS Release on Surface Tension of Heavy Water Substance
3840
http://www.iapws.org/relguide/surfd2o.pdf
3941
40-
:param T: temperature in Kelvin
42+
:param T: temperature in [K]
4143
42-
:return: surface tension in mN/m
44+
:return: surface tension in [N / m]
4345
"""
4446
B = 238.0 # N/m
4547
bb = -0.639

0 commit comments

Comments
 (0)