Thermofluids
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:
sp = Statepoint(fluid='water', # define a fluid
t=25.0, # define one independent variable
p=1.0, # define a second independent variable
m=0.1) # define extensive varible
sp.rho, sp.h, sp.visc
# (<Quantity(997.047039, 'kilogram / meter ** 3')>, <Quantity(104.918893, 'kilojoule / kilogram')>, <Quantity(0.000890022674, 'kilogram / meter / second')>)
Representing statepoints this way makes it easy to model thermodynamic cycles. The module includes some common thermodynamic unit processes to manipulate statepoints in physically meaningful ways. For example, we can model a refrigeration cycle:
from thermofluids import Statepoint, Quantity
from thermofluids.ProcessEquipment import Compressor
# Select a refrigerant
REFR = 'R134A'
# Find the saturation pressures of the refrigerant
ssp = Statepoint(fluid=REFR, t=-10, x=1.).p
scp = Statepoint(fluid=REFR, t=25., x=1.).p
# Define a statepoint representing the state between the evaporator and compressor
evap_to_comp = Statepoint(fluid=REFR, t=-5., p=ssp, m=0.1)
# Use the built in compressor object to calculate the statepoint at the compressor outlet
comp = Compressor(inlet=evap_to_comp,
eta=0.7,
Pout=scp)
comp_to_cond = comp.get_outlet()
print(f'Compressor work: {comp.work.to("kW")}')
# Derive the statepoint representing the condensed state between the condenser and expansion valve
cond_to_exp = Statepoint(fluid=REFR, t=20., p=scp, m=evap_to_comp.m)
q_cond = cond_to_exp.m * (comp_to_cond.h - cond_to_exp.h)
print(f'Condenser heat: {q_cond.to("kW")}')
# Derive the statepoint representing the isenthalpically expanded refrigerant
exp_to_evap = Statepoint(fluid=REFR, p=ssp, h=cond_to_exp.h, m=cond_to_exp.m)
q_evap = evap_to_comp.m * (evap_to_comp.h - exp_to_evap.h)
print(f'Evaporator heat: {q_evap.to("kW")}')
cop = q_evap / comp.work
print(f'Coefficient of performance: {cop.to("")}')
>>> Compressor work: 3.637 kW
>>> Condenser heat: 20.58 kW
>>> Evaporator heat: 16.95 kW
>>> Coefficient of performance: 4.659
Documentation
Read the full documentation at https://thermofluids-24bc0b.gitlab.io/
Metadata
Release files for thermofluids 2.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| thermofluids-2.0.5.tar.gz | 7.8 MB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| thermofluids-2.0.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 MB
Release files / thermofluids-2.0.5.tar.gz
| Download URL | thermofluids-2.0.5.tar.gz |
|---|---|
| Size | 7.8 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1d523e1431d76cf65f2abd910a92ede5fcf5351fa3dec3932f28e16d1ba50b72
|
|
BLAKE2b-256 checksum How to use checksums |
5a40c65831a0bf1887f63245adcc2cf7b0e1161bc62d5f814ff30be0c827af28
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / thermofluids-2.0.5-py3-none-any.whl
| Download URL | thermofluids-2.0.5-py3-none-any.whl |
|---|---|
| Size | 59.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e9b91186d937c55112da5c0fc97e84f2283626ff410e4f07419c78f8b106cba7
|
|
BLAKE2b-256 checksum How to use checksums |
c7bcaedb033751bd338d70f4ddf82b8fa06f1400218d935da4d32b326f4e8e45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for thermofluids 2.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.