Link to a calculation Thermoprops addresses, for assistants and for people
A Worksheet's script lives in its address: a link opens it already solved, in the browser of whoever follows it. An assistant answering a thermodynamics question can write the script, link it, and the reader gets every state, value and chart, computed by CoolProp.
The address
https://luisbedoia.github.io/thermoprops/worksheet/?s=<script><script>is the script, encoded asencodeURIComponentdoes: spaces as%20, line breaks as%0A,+as%2B,#as%23.- The results are computed in the browser that opens the link (CoolProp in WebAssembly): the page's HTML does not hold them, so a reader without JavaScript sees only the script.
- Nothing is sent anywhere: the script stays in the link and in the reader's browser.
The script
One statement per line; # starts a comment.
fluid R134a | The fluid of every state. |
|---|---|
units celsius | How results are shown and bare numbers read: celsius (°C, kPa, kJ/kg), kelvin or imperial. |
reference ASHRAE | Where h and s are measured from: ASHRAE as in the textbooks' refrigerant tables, IIR, NBP or DEF (CoolProp's default). |
1: T = 25 °C, P = 1 bar | A state fixed by two properties. |
1: T = -10 °C, sat vapor | A saturated state: sat liquid (x = 0) or sat vapor (x = 1). |
2: from 1, compressed to P = 1.2 MPa, eta = 80% | A state reached from another by a process. |
3: P = P2, sat liquid | A property of another state, by name. |
COP = (h1 - h4) / (h2 - h1) | A value computed from states and other values: + - * / ^, sqrt, ln, exp, abs, min, max. |
print COP, T2 in °F | The results to show; in picks the unit. |
draw 1 -> 2 -> 3 -> 4 -> 1 | The processes drawn on the chart. |
- Properties
- T, P, h, s, x (quality), D (density), v, u, cp, cv, mu, k, Pr, Z, a (speed of sound), g; a state's are read as T2, h1, x4.
- Processes
- isentropic, compressed and expanded (with eta), throttled, isobaric, isothermal, isochoric, isenthalpic, polytropic (with n).
- Units
- °C, K, °F, °R, Pa, kPa, MPa, bar, atm, psi, kJ/kg, BTU/lb, kJ/(kg*K), kg/m^3, m^3/kg, kg/s, kg/h, kW, MW, W, hp, BTU/h, kJ, m/s, %. A number without a unit is read in the script's units.
- Fluids
- Air, Ammonia, Argon, CarbonDioxide, CarbonMonoxide, Ethanol, Helium, Hydrogen, IsoButane, Isopentane, Methane, n-Butane, n-Pentane, n-Propane, Nitrogen, Oxygen, R1234yf, R1234ze(E), R125, R134a, R143a, R152A, R22, R245fa, R32, R404A, R410A, R507A, Toluene, Water
Examples
# Vapor-compression refrigeration cycle
fluid R134a
units celsius
# h and s as in the textbooks' refrigerant tables
reference ASHRAE
# evaporator outlet
1: T = -10 °C, sat vapor
# compressor
2: from 1, compressed to P = 1.2 MPa, eta = 80%
# condenser outlet
3: P = P2, sat liquid
# expansion valve
4: from 3, throttled to P = P1
m = 0.05 kg/s
q_evap = h1 - h4
w_comp = h2 - h1
COP = q_evap / w_comp
Q_evap = m * q_evap
draw 1 -> 2 -> 3 -> 4 -> 1
print COP, Q_evap, T2Open it solved# Rankine cycle with a real turbine
fluid Water
units celsius
# condenser outlet
1: P = 10 kPa, sat liquid
# pump
2: from 1, isentropic to P = 8 MPa
# boiler outlet
3: P = P2, T = 480 °C
# turbine
4: from 3, expanded to P = P1, eta = 85%
w_pump = h2 - h1
w_turb = h3 - h4
q_in = h3 - h2
efficiency = (w_turb - w_pump) / q_in
draw 1 -> 2 -> 3 -> 4 -> 1
print efficiency in %, w_turb - w_pump, x4Open it solvedThe API, for agents
GET https://thermoprops-api.luisbedoia.workers.dev/solve?s=<script>- The same script, encoded the same way, solved on a server: the answer is JSON, with every state and its properties in the script's units, the computed values, the errors by line, and a short link that opens it solved in the Worksheet. A short link not opened for a year may expire; the address above never does.
- For an agent that computes before answering, instead of interpolating tables. Free, with no key. Its manual, as plain text: https://thermoprops-api.luisbedoia.workers.dev/.
- As an MCP server, for Claude, ChatGPT, Cursor or VS Code: add
https://thermoprops-api.luisbedoia.workers.dev/mcpas a connector. Its tools:fluid_state, a state from two properties, andsolve_worksheet, a whole script.
Other addresses
- A fluid's tables (saturation by temperature and by pressure, superheated vapor) and diagrams, as HTML:
https://luisbedoia.github.io/thermoprops/fluids/r134a/, in Spanishhttps://luisbedoia.github.io/thermoprops/es/fluidos/r134a/. All of them: fluids. - The State Explorer with a fluid chosen:
https://luisbedoia.github.io/thermoprops/explorer/?fluid=R134a&units=celsius(units: celsius, kelvin or imperial).