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.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| thermofluids-2.0.4.tar.gz | 7.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| thermofluids-2.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.8 MB
Release files / thermofluids-2.0.4.tar.gz
| Download URL | thermofluids-2.0.4.tar.gz |
|---|---|
| Size | 7.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa1a4bb144dc3b621cb4678473e57fca8c94298d37ca48de5a49ffdb419fce12
|
|
BLAKE2b-256 checksum How to use checksums |
f2629e705f4cc0f17dcd8c616920e5ac269a765d0bd030b97b0875a7f96ec50e
|
| 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.4-py3-none-any.whl
| Download URL | thermofluids-2.0.4-py3-none-any.whl |
|---|---|
| Size | 59.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1b5e7b5f4c8452cca5d2fda7ba2f1501cdad49cb892d82f760acc5ab20255af
|
|
BLAKE2b-256 checksum How to use checksums |
3ee8ce7381d11233a5fea5f730b4836b3661ed843cb7ad3ec26d08e95e1c28f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|