Skip to main content
engineering

First Law Solver

Solve Q - W = ΔU (closed) or Q - W = ΔH (open) with IAPWS-IF97 water and steam states and process type selection (adiabatic, isentropic, isothermal, isobaric, isochoric)

By Christopher FloiedPublished Updated

Solve Q - W = Delta U (closed) or Q - W = Delta H (open, SSSF) for water and steam, with every state evaluated from IAPWS-IF97. Fix each state with any two of T, P and quality x; the solver finds Q, W, or the unknown.

State 1 (Inlet / Initial)

Enter any two of T1, P1 and x1.

State 2 (Outlet / Final)

Enter any two of T2, P2 and x2.

State 1 Properties (Superheated Vapor)

T = 200.0°C
P = 1000.0 kPa
h = 2828.27 kJ/kg
u = 2622.26 kJ/kg
s = 6.6955 kJ/(kg·K)
v = 0.20600 m³/kg

State 2 Properties (Superheated Vapor)

T = 300.0°C
P = 1000.0 kPa
h = 3051.70 kJ/kg
u = 2793.72 kJ/kg
s = 7.1247 kJ/(kg·K)
v = 0.25798 m³/kg

Process Path on T-s Diagram

Specific entropy s vs temperature T with the IAPWS-IF97 saturation dome (f/g lines); the straight segment only joins the two end states.

Solution

Heat Transfer Q

221.46

kJ

Work W

50.00

kJ

Step-by-step solution

State 1: T = 200.0°C, P = 1000.0 kPa, Superheated Vapor

u1 = 2622.26 kJ/kg, v1 = 0.20600 m³/kg

State 2: T = 300.0°C, P = 1000.0 kPa, Superheated Vapor

u2 = 2793.72 kJ/kg, v2 = 0.25798 m³/kg

Delta U = m(u2 - u1) = 1(2793.72 - 2622.26) = 171.46 kJ

Q = Delta U + W = 171.46 + 50.00 = 221.46 kJ

How to Use This Calculator

1

Enter your input values

Fill in all required input fields for the First Law Solver. Follow the units and input format printed next to each field. Where a unit selector is available, choose the units that match your data.

2

Review your inputs

Double-check that all values are correct and match the units or format shown for each field. Incorrect units are the most common source of calculation errors and can produce results that are off by factors of 2, 10, or more.

3

Read the results

The First Law Solver computes the output in your browser and displays the results, with units clearly labeled, as soon as they are ready — no data sent to a server.

4

Explore parameter sensitivity

Try adjusting individual input values to see how the output changes. This is a quick and effective way to develop intuition about how different parameters influence the result and to identify which inputs have the largest effect.

When to Use This Calculator

  • •Use the First Law Solver to check your hand calculations on homework or exam problems — comparing its result with your own working helps identify arithmetic errors before they propagate.
  • •Use it during the early design phase to rapidly iterate on parameters and narrow down feasible configurations before committing time to detailed finite element simulations or full design packages.
  • •Use it when reviewing a colleague's calculation or checking a vendor's data sheet for plausibility — a quick sanity check can prevent costly downstream errors.
  • •Use it to generate reference data for a technical report or presentation without manual computation, ensuring consistent, reproducible numbers throughout the document.
  • •Use it in the field when a quick estimate is needed and a full engineering software package is not available.

About This Calculator

The First Law Solver is a precision engineering calculation tool designed for students, engineers, and technical professionals. Solve Q - W = ΔU (closed) or Q - W = ΔH (open) with IAPWS-IF97 water and steam states and process type selection (adiabatic, isentropic, isothermal, isobaric, isochoric) All calculations are performed using established engineering formulas from the relevant scientific literature and standards. Follow the units printed beside each field. Where a unit selector is provided, the selected unit is converted internally. Results are computed in your browser without sending data to a server, which keeps your inputs private. This calculator is intended as a supplementary tool for learning and design exploration; always verify results against authoritative references for safety-critical applications.

The Theory Behind It

The first law of thermodynamics for a closed system is Q − W = ΔU, where Q is heat added (positive in, negative out), W is work done BY the system (positive out, negative in), and ΔU is the change in internal energy of the contents. For an open system (control volume) with flow in and out, the steady-state form is Q − W = Δh + ΔKE + ΔPE (per unit mass), where Δh is the enthalpy change across the control volume, ΔKE is the kinetic energy change, and ΔPE is the potential energy change. Kinetic and potential energy terms are often negligible in power and refrigeration analysis and are commonly dropped: Q − W = Δh. The first law is conservation of energy applied to thermodynamic systems — it is always true and is one of the two fundamental laws of thermodynamics (along with the second law). Applying it to a problem requires: (1) identifying the system (closed or open, control mass or control volume), (2) identifying the heat and work interactions at the boundaries, (3) computing the changes in state properties between initial and final states (or inlet and outlet for steady-flow), and (4) solving for the unknown. Common problems include: heating water in a closed tank (ΔU = Q); work done by expanding gas (W = ∫pdv for a piston-cylinder); turbine and compressor work analysis (W_s = −Δh for adiabatic steady flow); heat exchanger energy balance (Q = ṁ·Δh). The calculator handles closed-system and open-system first-law problems for water and steam, evaluating each state with IAPWS-IF97 from any two of T, P and quality x. Isentropic processes fix s₂ = s₁, isochoric processes fix v₂ = v₁, and isothermal and isobaric processes fix T or P; given the states and one of Q or W (when the process does not fix it), it solves for the other.

Real-World Applications

  • •Closed-system heat addition: for water heated in a rigid sealed tank (choose Isochoric), enter the initial state and the final temperature; the calculator holds v₂ = v₁, finds the final pressure and returns Q = m·(u₂ − u₁).
  • •Boundary work in piston-cylinder processes: at constant pressure the boundary work is W = m·P·(v₂ − v₁), using the v₁ and v₂ the calculator reports; enter that W to get the heat transfer from Q = ΔU + W.
  • •Turbine steady-flow analysis: compute turbine work output W_s = h_inlet − h_outlet per unit mass flow, assuming adiabatic operation and negligible kinetic/potential energy changes.
  • •Heat exchanger energy balance: on each side of a heat exchanger, Q = ṁ·Δh. For a counter-flow heat exchanger transferring heat from hot to cold stream, the two energy balances are equal in magnitude and opposite in sign.
  • •Thermodynamic cycle analysis: apply the first law to each process in a cycle (compression, heat addition, expansion, heat rejection) to track the energy flow and compute cycle efficiency.

Frequently Asked Questions

What is the first law of thermodynamics?

The first law is conservation of energy applied to thermodynamic systems: Q − W = ΔU for a closed system (ΔU is internal energy change). For an open system steady flow: Q − W = Δh (plus optional KE and PE terms). Energy cannot be created or destroyed — it can only change form (internal energy, kinetic energy, potential energy) or transfer across boundaries (as heat Q or work W). The first law is always true and is one of the most fundamental laws of physics.

What's the sign convention for Q and W?

Standard thermodynamic convention: Q is POSITIVE when heat flows INTO the system, NEGATIVE when flowing out. W is POSITIVE when work is done BY the system (e.g., expansion work pushing on surroundings), NEGATIVE when work is done ON the system (e.g., compression work from a piston). With this convention, the first law is Q − W = ΔU, not Q + W. Some textbooks use the opposite convention for W; always check before applying formulas.

What's the difference between closed and open systems?

Closed system (control mass): fixed quantity of matter, no mass crosses the boundary, but energy (Q and W) can. Example: a sealed tank of gas being heated. First law: Q − W = ΔU. Open system (control volume): fixed region of space, mass can cross the boundary, and energy can too. Example: a turbine with fluid flowing through. First law: Q − W = Δh (per unit mass flow), assuming steady state and negligible KE/PE changes. Most practical engineering analysis uses open systems.

When can I ignore kinetic and potential energy?

Kinetic energy ½V² is typically negligible when V < 50 m/s because the energy scale is small compared to enthalpy changes. Potential energy gh is typically negligible for elevation changes less than ~100 m for the same reason. Both become important in high-speed flow (nozzles, jets, diffusers) and tall towers (distillation columns). For most power plant and refrigeration problems, dropping KE and PE is standard practice and introduces less than 1% error.

How do I apply the first law to a multi-step cycle?

Apply the first law to each process (compression, heat addition, expansion, heat rejection) separately, computing Q and W at each step. The sum of Q values is the net heat added to the cycle, and the sum of W values is the net work output. For a complete cycle, ΔU = 0 (state returns to start), so Q_net = W_net. The cycle efficiency is η = W_net / Q_in, where Q_in is the total heat added from high-temperature sources (not the net heat).

Related Calculators

References & Further Reading

Add the live First Law Solver to your site. Free to embed, with a link back to MegaCalc.