thermofluids 2.0.2__tar.gz → 2.0.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- thermofluids-2.0.4/.gitlab-ci.yml +11 -0
- thermofluids-2.0.4/PKG-INFO +78 -0
- thermofluids-2.0.4/README.md +61 -0
- thermofluids-2.0.4/docs/Makefile +20 -0
- thermofluids-2.0.4/docs/build/doctrees/environment.pickle +0 -0
- thermofluids-2.0.4/docs/build/doctrees/index.doctree +0 -0
- thermofluids-2.0.4/docs/build/html/.buildinfo +4 -0
- thermofluids-2.0.4/docs/build/html/_sources/index.rst.txt +120 -0
- thermofluids-2.0.4/docs/build/html/_static/_sphinx_javascript_frameworks_compat.js +123 -0
- thermofluids-2.0.4/docs/build/html/_static/base-stemmer.js +476 -0
- thermofluids-2.0.4/docs/build/html/_static/basic.css +906 -0
- thermofluids-2.0.4/docs/build/html/_static/css/badge_only.css +1 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/fontawesome-webfont.svg +2671 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-bold.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-bold.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-normal.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/fonts/lato-normal.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/css/theme.css +4 -0
- thermofluids-2.0.4/docs/build/html/_static/doctools.js +150 -0
- thermofluids-2.0.4/docs/build/html/_static/documentation_options.js +13 -0
- thermofluids-2.0.4/docs/build/html/_static/english-stemmer.js +1066 -0
- thermofluids-2.0.4/docs/build/html/_static/file.png +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bold.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bold.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-italic.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-italic.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-regular.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-regular.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- thermofluids-2.0.4/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- thermofluids-2.0.4/docs/build/html/_static/jquery.js +2 -0
- thermofluids-2.0.4/docs/build/html/_static/js/badge_only.js +1 -0
- thermofluids-2.0.4/docs/build/html/_static/js/theme.js +1 -0
- thermofluids-2.0.4/docs/build/html/_static/js/versions.js +228 -0
- thermofluids-2.0.4/docs/build/html/_static/language_data.js +13 -0
- thermofluids-2.0.4/docs/build/html/_static/minus.png +0 -0
- thermofluids-2.0.4/docs/build/html/_static/plus.png +0 -0
- thermofluids-2.0.4/docs/build/html/_static/pygments.css +75 -0
- thermofluids-2.0.4/docs/build/html/_static/searchtools.js +693 -0
- thermofluids-2.0.4/docs/build/html/_static/sphinx_highlight.js +159 -0
- thermofluids-2.0.4/docs/build/html/genindex.html +477 -0
- thermofluids-2.0.4/docs/build/html/index.html +809 -0
- thermofluids-2.0.4/docs/build/html/objects.inv +0 -0
- thermofluids-2.0.4/docs/build/html/py-modindex.html +217 -0
- thermofluids-2.0.4/docs/build/html/search.html +117 -0
- thermofluids-2.0.4/docs/build/html/searchindex.js +1 -0
- thermofluids-2.0.4/docs/make.bat +35 -0
- thermofluids-2.0.4/docs/source/conf.py +34 -0
- thermofluids-2.0.4/docs/source/index.rst +120 -0
- thermofluids-2.0.4/poetry.lock +285 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/pyproject.toml +16 -4
- thermofluids-2.0.4/src/thermofluids/Base/Quantity.py +21 -0
- thermofluids-2.0.4/src/thermofluids/Base/__init__.py +0 -0
- thermofluids-2.0.4/src/thermofluids/Fluids/__init__.py +10 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Compressor.py +2 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Turbine.py +11 -7
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Valve.py +26 -0
- thermofluids-2.0.4/src/thermofluids/Properties/BrineProps.py +529 -0
- thermofluids-2.0.4/src/thermofluids/Properties/VLE_data.py +50 -0
- thermofluids-2.0.4/src/thermofluids/Properties/__init__.py +0 -0
- thermofluids-2.0.2/PKG-INFO +0 -31
- thermofluids-2.0.2/README.md +0 -14
- thermofluids-2.0.2/src/thermofluids/Base/Quantity.py +0 -16
- thermofluids-2.0.2/src/thermofluids/Fluids/__init__.py +0 -4
- {thermofluids-2.0.2 → thermofluids-2.0.4}/.idea/.gitignore +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/.idea/thermofluids.iml +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/.idea/workspace.xml +0 -0
- {thermofluids-2.0.2/src/thermofluids/Base → thermofluids-2.0.4/src}/__init__.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Base/Statepoint.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Base/ThermoExceptions.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Base/thermofluids_registry.txt +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Fluids/Drag.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Fluids/Moody.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Fluids/PressureDrop.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Fluids/Re.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/Gr.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/NTU.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/Nusselt.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/Ra.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/TwoPhase.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/__init__.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/HeatTransfer/lmtd.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Column.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Ejector.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/HeatExchanger.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/IsoCompressor.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Pipe.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/Pump.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/ProcessEquipment/__init__.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Utilities/FlowDiagram.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/Utilities/__init__.py +0 -0
- {thermofluids-2.0.2 → thermofluids-2.0.4}/src/thermofluids/__init__.py +0 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: thermofluids
|
|
3
|
+
Version: 2.0.4
|
|
4
|
+
Summary: Physically-consistent thermal and fluids modeling tools
|
|
5
|
+
Project-URL: Documentation, https://thermofluids-24bc0b.gitlab.io/
|
|
6
|
+
Project-URL: Repository, https://gitlab.com/ericksonla/thermofluids
|
|
7
|
+
Author: Luke Erickson, Russell Goldfarbmuren
|
|
8
|
+
Author-email: russell@rebound-tech.com
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Requires-Python: >3.11
|
|
13
|
+
Requires-Dist: coolprop
|
|
14
|
+
Requires-Dist: pint
|
|
15
|
+
Requires-Dist: scipy
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Thermofluids
|
|
19
|
+
|
|
20
|
+
Thermofluids makes modeling thermofluid systems easier. The essential element is the `statepoint`. `statepoint` objects work like physical statepoints: they have two independent variables, many dependent variables, and sometimes extensive variables. You can use them like this:
|
|
21
|
+
````python
|
|
22
|
+
sp = Statepoint(fluid='water', # define a fluid
|
|
23
|
+
t=25.0, # define one independent variable
|
|
24
|
+
p=1.0, # define a second independent variable
|
|
25
|
+
m=0.1) # define extensive varible
|
|
26
|
+
|
|
27
|
+
sp.rho, sp.h, sp.visc
|
|
28
|
+
# (<Quantity(997.047039, 'kilogram / meter ** 3')>, <Quantity(104.918893, 'kilojoule / kilogram')>, <Quantity(0.000890022674, 'kilogram / meter / second')>)
|
|
29
|
+
````
|
|
30
|
+
|
|
31
|
+
Representing statepoints this way makes it easy to model thermodynamic cycles. The module includes some common
|
|
32
|
+
thermodynamic unit processes to manipulate statepoints in physically meaningful ways. For example, we can model a
|
|
33
|
+
refrigeration cycle:
|
|
34
|
+
|
|
35
|
+
````python
|
|
36
|
+
from thermofluids import Statepoint, Quantity
|
|
37
|
+
from thermofluids.ProcessEquipment import Compressor
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
# Select a refrigerant
|
|
41
|
+
REFR = 'R134A'
|
|
42
|
+
|
|
43
|
+
# Find the saturation pressures of the refrigerant
|
|
44
|
+
ssp = Statepoint(fluid=REFR, t=-10, x=1.).p
|
|
45
|
+
scp = Statepoint(fluid=REFR, t=25., x=1.).p
|
|
46
|
+
|
|
47
|
+
# Define a statepoint representing the state between the evaporator and compressor
|
|
48
|
+
evap_to_comp = Statepoint(fluid=REFR, t=-5., p=ssp, m=0.1)
|
|
49
|
+
|
|
50
|
+
# Use the built in compressor object to calculate the statepoint at the compressor outlet
|
|
51
|
+
comp = Compressor(inlet=evap_to_comp,
|
|
52
|
+
eta=0.7,
|
|
53
|
+
Pout=scp)
|
|
54
|
+
comp_to_cond = comp.get_outlet()
|
|
55
|
+
print(f'Compressor work: {comp.work.to("kW")}')
|
|
56
|
+
|
|
57
|
+
# Derive the statepoint representing the condensed state between the condenser and expansion valve
|
|
58
|
+
cond_to_exp = Statepoint(fluid=REFR, t=20., p=scp, m=evap_to_comp.m)
|
|
59
|
+
q_cond = cond_to_exp.m * (comp_to_cond.h - cond_to_exp.h)
|
|
60
|
+
print(f'Condenser heat: {q_cond.to("kW")}')
|
|
61
|
+
|
|
62
|
+
# Derive the statepoint representing the isenthalpically expanded refrigerant
|
|
63
|
+
exp_to_evap = Statepoint(fluid=REFR, p=ssp, h=cond_to_exp.h, m=cond_to_exp.m)
|
|
64
|
+
q_evap = evap_to_comp.m * (evap_to_comp.h - exp_to_evap.h)
|
|
65
|
+
print(f'Evaporator heat: {q_evap.to("kW")}')
|
|
66
|
+
cop = q_evap / comp.work
|
|
67
|
+
print(f'Coefficient of performance: {cop.to("")}')
|
|
68
|
+
````
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
>>> Compressor work: 3.637 kW
|
|
72
|
+
>>> Condenser heat: 20.58 kW
|
|
73
|
+
>>> Evaporator heat: 16.95 kW
|
|
74
|
+
>>> Coefficient of performance: 4.659
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
# Documentation
|
|
78
|
+
Read the full documentation at https://thermofluids-24bc0b.gitlab.io/
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Thermofluids
|
|
2
|
+
|
|
3
|
+
Thermofluids makes modeling thermofluid systems easier. The essential element is the `statepoint`. `statepoint` objects work like physical statepoints: they have two independent variables, many dependent variables, and sometimes extensive variables. You can use them like this:
|
|
4
|
+
````python
|
|
5
|
+
sp = Statepoint(fluid='water', # define a fluid
|
|
6
|
+
t=25.0, # define one independent variable
|
|
7
|
+
p=1.0, # define a second independent variable
|
|
8
|
+
m=0.1) # define extensive varible
|
|
9
|
+
|
|
10
|
+
sp.rho, sp.h, sp.visc
|
|
11
|
+
# (<Quantity(997.047039, 'kilogram / meter ** 3')>, <Quantity(104.918893, 'kilojoule / kilogram')>, <Quantity(0.000890022674, 'kilogram / meter / second')>)
|
|
12
|
+
````
|
|
13
|
+
|
|
14
|
+
Representing statepoints this way makes it easy to model thermodynamic cycles. The module includes some common
|
|
15
|
+
thermodynamic unit processes to manipulate statepoints in physically meaningful ways. For example, we can model a
|
|
16
|
+
refrigeration cycle:
|
|
17
|
+
|
|
18
|
+
````python
|
|
19
|
+
from thermofluids import Statepoint, Quantity
|
|
20
|
+
from thermofluids.ProcessEquipment import Compressor
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Select a refrigerant
|
|
24
|
+
REFR = 'R134A'
|
|
25
|
+
|
|
26
|
+
# Find the saturation pressures of the refrigerant
|
|
27
|
+
ssp = Statepoint(fluid=REFR, t=-10, x=1.).p
|
|
28
|
+
scp = Statepoint(fluid=REFR, t=25., x=1.).p
|
|
29
|
+
|
|
30
|
+
# Define a statepoint representing the state between the evaporator and compressor
|
|
31
|
+
evap_to_comp = Statepoint(fluid=REFR, t=-5., p=ssp, m=0.1)
|
|
32
|
+
|
|
33
|
+
# Use the built in compressor object to calculate the statepoint at the compressor outlet
|
|
34
|
+
comp = Compressor(inlet=evap_to_comp,
|
|
35
|
+
eta=0.7,
|
|
36
|
+
Pout=scp)
|
|
37
|
+
comp_to_cond = comp.get_outlet()
|
|
38
|
+
print(f'Compressor work: {comp.work.to("kW")}')
|
|
39
|
+
|
|
40
|
+
# Derive the statepoint representing the condensed state between the condenser and expansion valve
|
|
41
|
+
cond_to_exp = Statepoint(fluid=REFR, t=20., p=scp, m=evap_to_comp.m)
|
|
42
|
+
q_cond = cond_to_exp.m * (comp_to_cond.h - cond_to_exp.h)
|
|
43
|
+
print(f'Condenser heat: {q_cond.to("kW")}')
|
|
44
|
+
|
|
45
|
+
# Derive the statepoint representing the isenthalpically expanded refrigerant
|
|
46
|
+
exp_to_evap = Statepoint(fluid=REFR, p=ssp, h=cond_to_exp.h, m=cond_to_exp.m)
|
|
47
|
+
q_evap = evap_to_comp.m * (evap_to_comp.h - exp_to_evap.h)
|
|
48
|
+
print(f'Evaporator heat: {q_evap.to("kW")}')
|
|
49
|
+
cop = q_evap / comp.work
|
|
50
|
+
print(f'Coefficient of performance: {cop.to("")}')
|
|
51
|
+
````
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
>>> Compressor work: 3.637 kW
|
|
55
|
+
>>> Condenser heat: 20.58 kW
|
|
56
|
+
>>> Evaporator heat: 16.95 kW
|
|
57
|
+
>>> Coefficient of performance: 4.659
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
# Documentation
|
|
61
|
+
Read the full documentation at https://thermofluids-24bc0b.gitlab.io/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Minimal makefile for Sphinx documentation
|
|
2
|
+
#
|
|
3
|
+
|
|
4
|
+
# You can set these variables from the command line, and also
|
|
5
|
+
# from the environment for the first two.
|
|
6
|
+
SPHINXOPTS ?=
|
|
7
|
+
SPHINXBUILD ?= sphinx-build
|
|
8
|
+
SOURCEDIR = source
|
|
9
|
+
BUILDDIR = build
|
|
10
|
+
|
|
11
|
+
# Put it first so that "make" without argument is like "make help".
|
|
12
|
+
help:
|
|
13
|
+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
14
|
+
|
|
15
|
+
.PHONY: help Makefile
|
|
16
|
+
|
|
17
|
+
# Catch-all target: route all unknown targets to Sphinx using the new
|
|
18
|
+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
|
19
|
+
%: Makefile
|
|
20
|
+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
.. Thermofluids documentation master file, created by
|
|
2
|
+
sphinx-quickstart on Thu Oct 8 13:47:07 2026.
|
|
3
|
+
You can adapt this file completely to your liking, but it should at least
|
|
4
|
+
contain the root `toctree` directive.
|
|
5
|
+
|
|
6
|
+
Thermofluids
|
|
7
|
+
============
|
|
8
|
+
Thermofluids makes modeling thermofluid systems easier. The essential element is the `statepoint`. `statepoint` objects work like physical statepoints: they have two independent variables, many dependent variables, and sometimes extensive variables. You can use them like this::
|
|
9
|
+
|
|
10
|
+
sp = Statepoint(fluid='water', # define a fluid
|
|
11
|
+
t=25.0, # define one independent variable
|
|
12
|
+
p=1.0, # define a second independent variable
|
|
13
|
+
m=0.1) # define extensive varible
|
|
14
|
+
|
|
15
|
+
sp.rho, sp.h, sp.visc
|
|
16
|
+
|
|
17
|
+
>>> (<Quantity(997.047039, 'kilogram / meter ** 3')>, <Quantity(104.918893, 'kilojoule / kilogram')>, <Quantity(0.000890022674, 'kilogram / meter / second')>)
|
|
18
|
+
|
|
19
|
+
Representing statepoints this way makes it easy to model thermodynamic cycles. The module includes some common
|
|
20
|
+
thermodynamic unit processes to manipulate statepoints in physically meaningful ways. For example, we can model a
|
|
21
|
+
refrigeration cycle::
|
|
22
|
+
|
|
23
|
+
from thermofluids import Statepoint, Quantity
|
|
24
|
+
from thermofluids.ProcessEquipment import Compressor
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
# Select a refrigerant
|
|
28
|
+
REFR = 'R134A'
|
|
29
|
+
|
|
30
|
+
# Find the saturation pressures of the refrigerant
|
|
31
|
+
ssp = Statepoint(fluid=REFR, t=-10, x=1.).p
|
|
32
|
+
scp = Statepoint(fluid=REFR, t=25., x=1.).p
|
|
33
|
+
|
|
34
|
+
# Define a statepoint representing the state between the evaporator and compressor
|
|
35
|
+
evap_to_comp = Statepoint(fluid=REFR, t=-5., p=ssp, m=0.1)
|
|
36
|
+
|
|
37
|
+
# Use the built in compressor object to calculate the statepoint at the compressor outlet
|
|
38
|
+
comp = Compressor(inlet=evap_to_comp,
|
|
39
|
+
eta=0.7,
|
|
40
|
+
Pout=scp)
|
|
41
|
+
comp_to_cond = comp.get_outlet()
|
|
42
|
+
print(f'Compressor work: {comp.work.to("kW")}')
|
|
43
|
+
|
|
44
|
+
# Derive the statepoint representing the condensed state between the condenser and expansion valve
|
|
45
|
+
cond_to_exp = Statepoint(fluid=REFR, t=20., p=scp, m=evap_to_comp.m)
|
|
46
|
+
q_cond = cond_to_exp.m * (comp_to_cond.h - cond_to_exp.h)
|
|
47
|
+
print(f'Condenser heat: {q_cond.to("kW")}')
|
|
48
|
+
|
|
49
|
+
# Derive the statepoint representing the isenthalpically expanded refrigerant
|
|
50
|
+
exp_to_evap = Statepoint(fluid=REFR, p=ssp, h=cond_to_exp.h, m=cond_to_exp.m)
|
|
51
|
+
q_evap = evap_to_comp.m * (evap_to_comp.h - exp_to_evap.h)
|
|
52
|
+
print(f'Evaporator heat: {q_evap.to("kW")}')
|
|
53
|
+
cop = q_evap / comp.work
|
|
54
|
+
print(f'Coefficient of performance: {cop.to("")}')
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
>>> Compressor work: 3.637 kW
|
|
58
|
+
>>> Condenser heat: 20.58 kW
|
|
59
|
+
>>> Evaporator heat: 16.95 kW
|
|
60
|
+
>>> Coefficient of performance: 4.659
|
|
61
|
+
|
|
62
|
+
.. toctree::
|
|
63
|
+
:maxdepth: 2
|
|
64
|
+
:caption: Contents:
|
|
65
|
+
|
|
66
|
+
Essential Functionality
|
|
67
|
+
_______________________
|
|
68
|
+
.. autoclass:: thermofluids.Base.Statepoint.Statepoint
|
|
69
|
+
:members: __add__, __div__
|
|
70
|
+
.. autoclass:: ...src.Base.Quantity
|
|
71
|
+
|
|
72
|
+
Fluids
|
|
73
|
+
______
|
|
74
|
+
.. automodule:: thermofluids.Fluids.Drag
|
|
75
|
+
:members: f_drag, settling_vel
|
|
76
|
+
.. automodule:: thermofluids.Fluids.Moody
|
|
77
|
+
:members: frictionfactor
|
|
78
|
+
.. automodule:: thermofluids.Fluids.Re
|
|
79
|
+
:members: Re, Re_ext
|
|
80
|
+
.. automodule:: thermofluids.Fluids.PressureDrop
|
|
81
|
+
:members: pressure_drop, pressure_drop_fitting, pressure_drop_packed_bed, pressure_drop_corrugated_plates, flow_at_dp
|
|
82
|
+
|
|
83
|
+
Heat Transfer
|
|
84
|
+
_____________
|
|
85
|
+
.. automodule:: thermofluids.HeatTransfer.lmtd
|
|
86
|
+
:members: lmtd
|
|
87
|
+
.. automodule:: thermofluids.HeatTransfer.Nusselt
|
|
88
|
+
:members: Nu, Nu_natural
|
|
89
|
+
.. automodule:: thermofluids.HeatTransfer.Ra
|
|
90
|
+
:members: Ra
|
|
91
|
+
.. automodule:: thermofluids.HeatTransfer.Gr
|
|
92
|
+
:members: Gr
|
|
93
|
+
.. automodule:: thermofluids.HeatTransfer.NTU
|
|
94
|
+
:members: NTU
|
|
95
|
+
.. automodule:: thermofluids.HeatTransfer.TwoPhase
|
|
96
|
+
:members: Co, Bo, Fr_le, crit_heat_flux, heat_flux_nucleate_boiling, htc_conv_boil
|
|
97
|
+
|
|
98
|
+
Special Properties
|
|
99
|
+
__________________
|
|
100
|
+
.. automodule:: thermofluids.Properties
|
|
101
|
+
.. automodule:: thermofluids.Properties.BrineProps
|
|
102
|
+
:members: get_c_freeze, get_T_liq_sat, get_T_vap_sat, get_P_liq_sat, get_P_vap_sat, get_h_mix, get_C_vap_sat, get_C_liq_sat
|
|
103
|
+
|
|
104
|
+
Process Equipment
|
|
105
|
+
_________________
|
|
106
|
+
.. automodule:: thermofluids.ProcessEquipment
|
|
107
|
+
.. automodule:: thermofluids.ProcessEquipment.Column
|
|
108
|
+
:members: Column
|
|
109
|
+
.. automodule:: thermofluids.ProcessEquipment.Compressor
|
|
110
|
+
:members: Compressor
|
|
111
|
+
.. automodule:: thermofluids.ProcessEquipment.HeatExchanger
|
|
112
|
+
:members: HX_Energy
|
|
113
|
+
.. automodule:: thermofluids.ProcessEquipment.IsoCompressor
|
|
114
|
+
:members: IsoCompressor
|
|
115
|
+
.. automodule:: thermofluids.ProcessEquipment.Pump
|
|
116
|
+
:members: Pump
|
|
117
|
+
.. automodule:: thermofluids.ProcessEquipment.Turbine
|
|
118
|
+
:members: Turbine
|
|
119
|
+
.. automodule:: thermofluids.ProcessEquipment.Valve
|
|
120
|
+
:members: get_valve_flow_rate, get_valve_dP, get_valve_C_v
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/* Compatability shim for jQuery and underscores.js.
|
|
2
|
+
*
|
|
3
|
+
* Copyright Sphinx contributors
|
|
4
|
+
* Released under the two clause BSD licence
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* small helper function to urldecode strings
|
|
9
|
+
*
|
|
10
|
+
* See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
|
|
11
|
+
*/
|
|
12
|
+
jQuery.urldecode = function(x) {
|
|
13
|
+
if (!x) {
|
|
14
|
+
return x
|
|
15
|
+
}
|
|
16
|
+
return decodeURIComponent(x.replace(/\+/g, ' '));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* small helper function to urlencode strings
|
|
21
|
+
*/
|
|
22
|
+
jQuery.urlencode = encodeURIComponent;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* This function returns the parsed url parameters of the
|
|
26
|
+
* current request. Multiple values per key are supported,
|
|
27
|
+
* it will always return arrays of strings for the value parts.
|
|
28
|
+
*/
|
|
29
|
+
jQuery.getQueryParameters = function(s) {
|
|
30
|
+
if (typeof s === 'undefined')
|
|
31
|
+
s = document.location.search;
|
|
32
|
+
var parts = s.substr(s.indexOf('?') + 1).split('&');
|
|
33
|
+
var result = {};
|
|
34
|
+
for (var i = 0; i < parts.length; i++) {
|
|
35
|
+
var tmp = parts[i].split('=', 2);
|
|
36
|
+
var key = jQuery.urldecode(tmp[0]);
|
|
37
|
+
var value = jQuery.urldecode(tmp[1]);
|
|
38
|
+
if (key in result)
|
|
39
|
+
result[key].push(value);
|
|
40
|
+
else
|
|
41
|
+
result[key] = [value];
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* highlight a given string on a jquery object by wrapping it in
|
|
48
|
+
* span elements with the given class name.
|
|
49
|
+
*/
|
|
50
|
+
jQuery.fn.highlightText = function(text, className) {
|
|
51
|
+
function highlight(node, addItems) {
|
|
52
|
+
if (node.nodeType === 3) {
|
|
53
|
+
var val = node.nodeValue;
|
|
54
|
+
var pos = val.toLowerCase().indexOf(text);
|
|
55
|
+
if (pos >= 0 &&
|
|
56
|
+
!jQuery(node.parentNode).hasClass(className) &&
|
|
57
|
+
!jQuery(node.parentNode).hasClass("nohighlight")) {
|
|
58
|
+
var span;
|
|
59
|
+
var isInSVG = jQuery(node).closest("body, svg, foreignObject").is("svg");
|
|
60
|
+
if (isInSVG) {
|
|
61
|
+
span = document.createElementNS("http://www.w3.org/2000/svg", "tspan");
|
|
62
|
+
} else {
|
|
63
|
+
span = document.createElement("span");
|
|
64
|
+
span.className = className;
|
|
65
|
+
}
|
|
66
|
+
span.appendChild(document.createTextNode(val.substr(pos, text.length)));
|
|
67
|
+
node.parentNode.insertBefore(span, node.parentNode.insertBefore(
|
|
68
|
+
document.createTextNode(val.substr(pos + text.length)),
|
|
69
|
+
node.nextSibling));
|
|
70
|
+
node.nodeValue = val.substr(0, pos);
|
|
71
|
+
if (isInSVG) {
|
|
72
|
+
var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
73
|
+
var bbox = node.parentElement.getBBox();
|
|
74
|
+
rect.x.baseVal.value = bbox.x;
|
|
75
|
+
rect.y.baseVal.value = bbox.y;
|
|
76
|
+
rect.width.baseVal.value = bbox.width;
|
|
77
|
+
rect.height.baseVal.value = bbox.height;
|
|
78
|
+
rect.setAttribute('class', className);
|
|
79
|
+
addItems.push({
|
|
80
|
+
"parent": node.parentNode,
|
|
81
|
+
"target": rect});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
else if (!jQuery(node).is("button, select, textarea")) {
|
|
86
|
+
jQuery.each(node.childNodes, function() {
|
|
87
|
+
highlight(this, addItems);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
var addItems = [];
|
|
92
|
+
var result = this.each(function() {
|
|
93
|
+
highlight(this, addItems);
|
|
94
|
+
});
|
|
95
|
+
for (var i = 0; i < addItems.length; ++i) {
|
|
96
|
+
jQuery(addItems[i].parent).before(addItems[i].target);
|
|
97
|
+
}
|
|
98
|
+
return result;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* backward compatibility for jQuery.browser
|
|
103
|
+
* This will be supported until firefox bug is fixed.
|
|
104
|
+
*/
|
|
105
|
+
if (!jQuery.browser) {
|
|
106
|
+
jQuery.uaMatch = function(ua) {
|
|
107
|
+
ua = ua.toLowerCase();
|
|
108
|
+
|
|
109
|
+
var match = /(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
|
110
|
+
/(webkit)[ \/]([\w.]+)/.exec(ua) ||
|
|
111
|
+
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) ||
|
|
112
|
+
/(msie) ([\w.]+)/.exec(ua) ||
|
|
113
|
+
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
|
114
|
+
[];
|
|
115
|
+
|
|
116
|
+
return {
|
|
117
|
+
browser: match[ 1 ] || "",
|
|
118
|
+
version: match[ 2 ] || "0"
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
jQuery.browser = {};
|
|
122
|
+
jQuery.browser[jQuery.uaMatch(navigator.userAgent).browser] = true;
|
|
123
|
+
}
|