Mechanical Engineering
3 tutorials in thermodynamics
Free
No Login
Thermodynamics Introduction
Thermodynamics is the branch of physics that deals with heat, work, and temperature, and their relation to energy, entropy, and properties of matter.
Key concepts include system, boundary, surroundings, and state variables (pressure, volume, temperature).
Example
// Thermodynamic System Types
// 1. Open System: Mass and energy transfer
// 2. Closed System: Only energy transfer
// 3. Isolated System: No transfer
// Example: Closed System
class ClosedSystem {
private double mass = 1.0; // kg
private double temperature = 300; // K
private double pressure = 101325; // Pa
public double getInternalEnergy() {
// U = m * cv * T (for ideal gas)
double cv = 718; // J/kg.K (air)
return mass * cv * temperature;
}
public void addHeat(double Q) {
// Q = m * cp * dT
double cp = 1005; // J/kg.K
double dT = Q / (mass * cp);
temperature += dT;
}
}Free to use