Free Ebook cover Thermodynamics for Makers: Heat, Work, and Efficiency in Real Machines

Thermodynamics for Makers: Heat, Work, and Efficiency in Real Machines

New course

16 pages

Gases in Practice: Ideal vs Real Behavior and When Approximations Break

Capítulo 6

Estimated reading time: 0 minutes

+ Exercise

Why “Ideal Gas” Is a Useful Lie

In maker projects, gases show up everywhere: compressed air tools, pneumatic actuators, CO2 cartridges, vacuum pumps, refrigeration service lines, propane torches, and even the air trapped in a syringe used as a force sensor. The “ideal gas” model is the default because it is simple and often accurate enough: it links pressure, volume, and temperature with one equation and lets you estimate mass, density, and flow quickly.

The ideal gas equation is Pv = RT (specific form) or PV = nRT (molar form). Here P is absolute pressure, v is specific volume (m3/kg), V is volume, n is moles, R is the gas constant (specific or universal), and T is absolute temperature. The model assumes gas molecules have negligible volume and do not attract each other. Real molecules do have size and attractions, so the ideal model breaks down in predictable ways.

For makers, the key skill is not memorizing exotic equations; it’s knowing when the ideal approximation is safe, when it is risky, and how to correct it with minimal effort.

Real Gas Behavior: What Changes and Why You Care

Two physical effects behind “non-ideal”

  • Molecular volume (repulsion at short range): At high density (high pressure or low temperature), molecules take up a non-negligible fraction of the container volume. This tends to make the pressure higher than ideal at the same T and V because there is less “free” volume to move in.
  • Intermolecular attraction: At moderate densities, attractions pull molecules together and reduce the force on the walls. This tends to make the pressure lower than ideal at the same T and V.

Which effect dominates depends on the gas and the state. That’s why some gases look “more ideal” than others under the same conditions.

Compressibility factor Z: the maker-friendly correction

A practical way to quantify real-gas behavior is the compressibility factor:

Continue in our app.

You can listen to the audiobook with the screen off, receive a free certificate for this course, and also have access to 5,000 other free online courses.

Or continue reading below...
Download App

Download the app

Z = PV/(nRT) = Pv/(RT)

For an ideal gas, Z = 1. For real gases, Z deviates from 1. You can rewrite the gas law as:

PV = ZnRT

This is powerful because it keeps the same structure as the ideal equation. If you can estimate Z, you can correct density, mass, and other calculations without switching to a complicated model.

How Z affects common maker calculations:

  • Density: Ideal: ρ = P/(RT). Real: ρ = P/(ZRT). If Z > 1, real density is lower than ideal at the same P and T. If Z < 1, real density is higher than ideal.
  • Mass in a tank: m = PV/(ZRT) (using specific R). Ignoring Z at high pressure can misestimate how much gas you actually have.
  • Flow through restrictions: Many flow equations depend on density. If density is off, predicted flow and regulator sizing can be off.

When the Ideal Gas Approximation Breaks (Rules of Thumb)

You typically get into trouble when the gas is dense or near phase change. Makers encounter this with CO2 cartridges, propane cylinders, high-pressure air tanks, and refrigerants in service work.

Practical “safe zone” heuristics

  • Low pressure: If the gas is near atmospheric pressure (say 0.8–2 bar absolute) and not extremely cold, ideal gas is usually fine for air, nitrogen, oxygen, helium, etc.
  • Moderate pressure air systems: Shop air at ~7–10 bar gauge (8–11 bar absolute) is often still “close enough” to ideal for rough sizing, but errors can be noticeable depending on temperature and required accuracy.
  • High pressure storage: SCUBA tanks, paintball tanks, and high-pressure cylinders (200–300 bar) are not ideal-gas territory if you care about accurate mass, fill calculations, or temperature rise during filling.
  • CO2 and hydrocarbons: These gases deviate more strongly from ideal at moderate pressures because they are closer to condensation at room temperature. CO2 in particular is often stored as a two-phase mixture; ideal gas is the wrong model for “how much is in the cartridge.”
  • Near saturation/condensation: If you are close to where the gas would start condensing at your temperature, real-gas effects become large and you may cross into two-phase behavior (gas + liquid). At that point, a single gas equation is not enough.

Reduced pressure/temperature (conceptual, not a history lesson)

Real-gas deviation correlates with how close you are to the gas’s critical point. A practical takeaway: gases at room temperature that have a critical temperature near room temperature (like CO2, propane, many refrigerants) will show non-ideal behavior sooner than “permanent gases” like nitrogen or helium.

Step-by-Step: Decide Whether to Use Ideal Gas or Add Z

Use this workflow whenever you’re about to compute mass, density, or tank capacity.

Step 1: Use absolute units

Convert gauge pressure to absolute: Pabs = Pgauge + Patm. Use kelvin for temperature.

Step 2: Identify the gas and the operating range

Air/nitrogen at a few bar? Likely ideal enough. CO2 at 50–70 bar? Not ideal. Propane at room temperature in a cylinder? Likely two-phase, not a single gas.

Step 3: Quick “density sanity check”

Compute ideal density ρideal = P/(RT). Ask: does this imply an extremely high density (approaching liquid-like)? If yes, ideal is suspicious.

Step 4: If accuracy matters, apply Z

Get Z from a compressibility chart, an online calculator, or a property table for your gas. Then use ρ = P/(ZRT) or m = PV/(ZRT). If you can’t get Z, treat your ideal result as an estimate and add margin.

Step 5: Check for two-phase possibility

If the gas is stored near its saturation pressure at that temperature (common for CO2, propane, butane, many refrigerants), you may have liquid present. In that case, tank pressure is governed mainly by temperature (vapor pressure), not by “how much gas” you think you have. Ideal gas calculations for mass in the tank become misleading.

Example 1 (Step-by-Step): How Much Air Is in a Small Tank?

Suppose you have a 10 L tank (0.010 m3) at 10 bar gauge, 20°C. You want the mass of air inside for a runtime estimate.

Step 1: Convert units

  • Pabs = 10 bar(g) + 1 bar ≈ 11 bar = 1.1×106 Pa
  • T = 20°C = 293 K
  • R (air) ≈ 287 J/(kg·K)

Step 2: Ideal estimate

m_ideal = PV/(RT) = (1.1e6 * 0.010)/(287 * 293) ≈ 0.131 kg

So about 131 g of air.

Step 3: Decide if Z matters

At ~11 bar absolute and room temperature, air is only mildly non-ideal. Z might be around 0.98–1.02 depending on conditions. If you use Z = 1, the error is a few percent—often acceptable for runtime estimates. If you need better accuracy, apply Z:

m_real = PV/(ZRT)

If Z = 0.99, mass is ~1% higher than ideal; if Z = 1.02, mass is ~2% lower.

Practical maker takeaway: for shop-air tanks under ~12 bar absolute, ideal gas is usually a fine first pass, but don’t expect lab-grade accuracy.

Example 2: Why CO2 Cartridges Break the Ideal Model

CO2 cartridges are popular for inflators and small pneumatic experiments. A common mistake is to treat the cartridge as “a tank of gas” and compute m = PV/(RT). But CO2 at room temperature is often stored with liquid CO2 present. That changes everything.

What you observe in practice

  • The cartridge pressure stays roughly near the vapor pressure as long as liquid remains.
  • As you draw gas, liquid boils to replace it, cooling the cartridge.
  • Pressure drops mainly because temperature drops, not because “the gas is running out” (until the liquid is gone).

How to handle it as a maker

Step-by-step approach for practical planning:

  • Step 1: Assume two-phase behavior unless you know it’s all gas (for many small cartridges at room temperature, it’s two-phase).
  • Step 2: Use the labeled mass (e.g., 16 g, 25 g) as your “fuel gauge,” not PV/RT.
  • Step 3: Expect strong cooling during discharge; design for pressure sag and possible icing at the valve.
  • Step 4: If you must estimate pressure during use, you need vapor-pressure data vs temperature (not the ideal gas law).

Practical maker takeaway: CO2 cartridges are not a clean ideal-gas tank problem; they are a temperature-dependent phase equilibrium problem during most of their discharge.

Real-Gas Equations You Might Actually Use

If you want more than Z but still want something implementable in a spreadsheet or microcontroller, there are a few common real-gas equations of state (EOS). You don’t need to memorize them; you need to know what they are good for.

Van der Waals (conceptual and simple)

(P + a/v^2)(v - b) = RT

a accounts for attractions, b for molecular volume. It captures the two main non-ideal effects qualitatively. Quantitatively, it’s often not accurate enough for serious work, but it’s useful for understanding why Z can be above or below 1.

Peng–Robinson / Soave–Redlich–Kwong (engineering workhorses)

These EOS are more accurate across wider ranges and are used in industry for hydrocarbons and refrigerants. They require gas-specific parameters and iterative solving. For maker use, they are most practical when embedded in a library or when you use a property calculator that already implements them.

Why Z is still the best “maker interface”

Even if a calculator uses a complex EOS internally, it often outputs Z. That lets you keep your calculations simple: compute with ideal gas, then correct with Z.

Step-by-Step: Correcting a Tank Mass Estimate Using Z

Suppose you have a high-pressure nitrogen cylinder and you want a better estimate of remaining gas than the ideal law gives.

Inputs you can measure

  • Tank internal volume V (from datasheet or water volume marking)
  • Pressure P (absolute, from a gauge plus atmospheric)
  • Temperature T (tank wall temperature is a decent proxy if equilibrated)
  • Gas type (nitrogen, air, argon, etc.)

Procedure

  • 1) Compute ideal mass: mideal = PV/(RT)
  • 2) Obtain Z: Use a Z chart/calculator for your gas at the measured P and T
  • 3) Correct mass: m = mideal/Z
  • 4) Convert to “free air” volume if needed: If you want equivalent volume at 1 bar and ambient temperature, use m and the ideal law at those reference conditions (or include Z≈1 at 1 bar).

Practical note: at very high pressures, Z can deviate enough that ignoring it leads to noticeable errors in remaining-gas estimates and in fill planning.

Approximations That Fail in Real Builds (and What to Do Instead)

1) Assuming pressure is proportional to mass in a cylinder

For an ideal gas at constant T and V, P ∝ m. Makers often assume “half the pressure means half the gas.” This is only approximately true when Z is near constant and temperature is stable. In real use:

  • During fast discharge, temperature drops, so pressure drops faster than mass.
  • At high pressure, Z changes with pressure, so P is not perfectly proportional to m.

What to do: if you need a better “fuel gauge,” let the tank equilibrate to ambient temperature before reading pressure, and apply Z if operating at high pressure.

2) Treating regulator outlet flow as independent of inlet pressure

Many regulators maintain outlet pressure, but their ability to supply flow depends on inlet pressure, temperature, and internal restrictions. Real-gas density affects mass flow through small orifices. If you size a system using ideal density at high pressure, you may mispredict flow and response.

What to do: use manufacturer flow curves when available. If you must estimate, correct density with Z at the relevant pressure and temperature.

3) Using ideal gas for “hot compressed air” without checking temperature

Compressing air heats it; expanding it cools it. If you compute density using ambient temperature while the gas is actually hot (after a compressor) or cold (after expansion), your results can be wrong even if the gas is ideal. This is not a “real gas” issue; it’s a “wrong T” issue that often gets blamed on non-ideality.

What to do: measure temperature where it matters (aftercooler outlet, tank after fill settles, downstream of expansion), then decide whether Z is needed.

4) Confusing gauge pressure with absolute pressure

Real-gas corrections won’t save a calculation that uses gauge pressure in PV = nRT. This error is especially common at low pressures (vacuum work) where the difference between gauge and absolute is a big fraction of the total.

What to do: always convert to absolute pressure before using any gas equation (ideal or real).

Vacuum and Low-Pressure Systems: Usually Ideal, But Watch Water Vapor

At low pressures, most gases behave more ideally (Z approaches 1). Vacuum systems for degassing resin, vacuum forming, or pick-and-place suction cups often operate in a region where ideal gas is fine for air.

The practical complication is often water vapor and other condensables:

  • As pressure drops, water can evaporate strongly, adding vapor load and changing pump-down behavior.
  • Cold surfaces can cause condensation, changing the gas composition and effective pressure behavior.

What to do: if pump-down is slower than expected, consider moisture and leaks before blaming real-gas effects. Use a cold trap or drying if needed.

Quick Reference: Common Maker Scenarios

Shop compressor + receiver tank (6–12 bar abs)

  • Ideal gas: usually acceptable for rough mass/volume estimates
  • Add Z: if you want better than a few percent accuracy
  • Bigger issue: temperature after compression and during use

SCUBA/paintball/high-pressure cylinders (200–300 bar)

  • Ideal gas: can be noticeably wrong for mass and “free air” calculations
  • Add Z: recommended
  • Bigger issue: temperature rise during filling; wait for equilibrium before final pressure check

CO2 cartridges and cylinders

  • Ideal gas: often wrong because of two-phase storage
  • Add Z: not enough if liquid is present
  • Use: mass-based tracking and vapor-pressure vs temperature behavior

Propane/butane cylinders for burners

  • Often two-phase at ambient conditions
  • Pressure depends strongly on temperature
  • Flow limits can be set by boiling rate and cooling of the cylinder

Practical Checklist Before You Trust PV = nRT

  • Are you using absolute pressure and kelvin temperature?
  • Is the gas likely single-phase at your conditions, or could there be liquid present?
  • Is the pressure high enough that density is large (tens to hundreds of bar)? If yes, consider Z.
  • Is the gas type known to be non-ideal at moderate pressures (CO2, hydrocarbons, refrigerants)?
  • Is the temperature actually what you think it is (after compression/expansion)?
  • Do you need 5% accuracy or 0.5% accuracy? Choose effort accordingly.

Now answer the exercise about the content:

In which situation is using PV = nRT most likely to give a misleading estimate of how much gas is in the container?

You are right! Congratulations, now go to the next page

You missed! Try again.

PV = nRT assumes a single-phase gas. In many CO2 cartridges at room temperature, liquid CO2 is present, so pressure stays near vapor pressure and depends strongly on temperature. In that case, PV/RT does not track the remaining mass reliably.

Next chapter

Pressure–Volume Diagrams and Quasi-Static Processes You Can Plot

Arrow Right Icon
Download the app to earn free Certification and listen to the courses in the background, even with the screen off.