top of page

Interactive Apps for Membrane Modeling and Educational Thermodynamics

01

Piston–Cylinder Expansion and Entropy Generation

images_large_ed-2015-00361w_0002.jpeg

Piston–cylinder systems provide a useful way to connect thermodynamics with mechanical motion. In these apps, an ideal gas drives a vertical piston against a constant external pressure while the effects of gravity and piston–cylinder friction are explicitly considered.
By comparing isothermal and adiabatic processes and changing the thermodynamic system boundary, users can examine how work, heat transfer, internal energy, piston kinetic and potential energy, frictional dissipation, and entropy generation are related.

Isothermal Piston Expansion

This app simulates the isothermal expansion of 100 mol of an ideal gas maintained at 298 K. The gas initially occupies 1 m³ and expands against an external pressure of 1 bar through a cylinder with a cross-sectional area of 0.01 m².

The piston mass and friction coefficient can be varied to examine their effects on piston motion, gas volume, work, heat transfer, frictional dissipation, and entropy generation. Energy and entropy balances are evaluated using different system boundaries.

Adiabatic Piston Expansion — System Includes Piston

This app simulates adiabatic expansion with the thermodynamic system defined to include both the gas and the piston. The gas consists of 100 mol of an ideal gas with a constant heat capacity of Cv=1.5R, initially at 298 K and 1 m³.
Because the piston is included within the system boundary, piston kinetic and potential energy are incorporated directly into the energy balance. Friction represents an internal irreversible process and therefore contributes to entropy generation.
The app illustrates how mechanical motion, gas cooling, frictional dissipation, and entropy generation are connected during an adiabatic expansion.

Adiabatic Piston Expansion — Gas-Only System Boundary

This app considers the same adiabatic piston–cylinder process but defines the thermodynamic system around the gas rather than around the combined gas–piston system.
The alternative system boundary changes how work, heat, piston energy, and entropy terms appear in the energy and entropy balances, even though the underlying physical process is the same.
Comparing this app with the gas–piston version provides a direct demonstration of why the choice of system boundary is fundamental in thermodynamic analysis.

02

Ideal-Gas and Real-Fluid Thermodynamic Properties

These apps provide interactive calculations of thermodynamic properties for ideal gases and real fluids. They are designed to complement analytical derivations by allowing users to vary temperature, pressure, and fluid properties and immediately examine the resulting thermodynamic behavior.
The real-fluid calculations use the Peng–Robinson equation of state, including compressibility-factor roots, fugacity coefficients, departure enthalpy and entropy, and vapor–liquid equilibrium.

Figure_2-new.png

Ideal-Gas Enthalpy and Entropy

This app calculates ideal-gas enthalpy and entropy changes between a reference state and a specified target state.
The temperature-dependent heat capacity is represented by
Cp=A+B*T+C*T^2+D*T^3.

Users can select a predefined gas or enter their own heat-capacity coefficients, reference temperature and pressure, and target temperature and pressure. The app then evaluates the corresponding ideal-gas enthalpy and entropy changes.

Vapor–Liquid Equilibrium with the Peng–Robinson Equation

This app calculates the vapor–liquid equilibrium pressure of a pure fluid at a specified temperature using the Peng–Robinson equation of state.
Users can select a predefined fluid or specify its critical temperature, critical pressure, and acentric factor. The app searches for the pressure at which the liquid and vapor phases satisfy the fugacity-equilibrium condition and reports the corresponding liquid and vapor properties.
The calculated equilibrium states are also displayed on pressure–volume diagrams.

Real-Fluid Properties with the Peng–Robinson Equation

This app evaluates the thermodynamic state of a real fluid at a specified temperature and pressure using the Peng–Robinson equation of state.
For the available equation-of-state roots, the app calculates molar volume, departure enthalpy, departure entropy, and fugacity coefficient. When multiple roots exist, comparison of the fugacities provides information about liquid and vapor stability.
Pressure–volume diagrams are displayed together with the calculated states to provide a graphical interpretation of the equation of state.

Acknowledgment

These applications were developed primarily for educational use in thermodynamics and transport-related courses.
I gratefully acknowledge Prof. Shiang-Tai Lin at National Taiwan University for many valuable discussions on thermodynamics during my early academic career. These discussions contributed substantially to the development of several of the educational problems represented by these apps.

Share this webpage if you find it useful.

NTU_transparent_edited_edited_edited.png
bottom of page