First law of thermodynamics
The first law of thermodynamics states that:
The algebraic sum of net heat and work interactions between a system and its surrounding in a thermodynamic cycle is zero
Mathematically
For a cyclic process
ΣQ = ΣW
Where:
Q = Heat interaction
W = Work interaction
For a finite noncyclic process
Q_{12 }= W_{12 }+ ΔE
Where:
E = Internal energy
In general
E = U + KE + PE + any other kind of stored energy
Where:
U = Intermolecular energy
KE = Kinetic energy
PE = Potential energy
For a closed system in equilibrium KE, PE and other kinds of stored energy are zero.
Which means
E = U
Hence for a finite noncyclic process first law of thermodynamics becomes
Q_{12 }= W_{12 }+ ΔU
If we consider only P*ΔV work, above equation becomes
Q_{12 }= P*ΔV + ΔU
Note: Conventionally work done by the system and the heat given to the system are always taken positive.
Internal energy
A property of a system whose change in a process executed by the system equal to the difference between the heat and work interactions by the system with its surrounding.
Enthalpy
Enthalpy is a thermodynamic quantity which is equal to total heat content in a system.
Mathematically
H = U + PV
According to the first law of the thermodynamics
Q_{12 }= P*ΔV + ΔU
Q_{12 }= P(V_{2}V_{1}) + U_{2} – U_{1}
Rearranging the above equation
Q_{12 }= U_{2} + P_{2}V_{2} – (U_{1} + P_{1}V_{1})
From the equation of enthalpy, it implies
Q_{12 }= H_{2} – H_{1}
Specific heat
Specific heat is the quantity of heat which is required to raise the temperature of unit mass by one degree Celsius.
There are two types of specific heat

Specific heat at constant volume
C_{v} = ( ∂u/ ∂T)_{v=constant}

Specific heat at constant pressure
C_{p} = ( ∂h/ ∂T)_{p=constant}
First law applied to the open system (or control volume)
Unlike a closed system mass flows in and out of an open system. Here we have to take conservation of mass into account.
Conservation of mass
(dm1/dt) – (dm2/dt) = dm_{cv}/dt
Where
dm1/dt = Rate of mass entering to the system
dm2/dt = Rate of mass leaving from the system
dm_{cv}/dt = Rate of mass stored in the system
Conservation of energy
e = u + p*v + g*z + (V^{2}/2)
Where
e = stored energy in the stream of fluid
u = internal energy stored in the stream of fluid
V^{2}/2 = kinetic energy of the stream of fluid
g*z = potential energy stored in the stream of fluid
p*v = pressure work
Mathematical expression of first law for open system
(dm1/dt)*e1 + (∂Q/∂t) – (dm2/dt)*e2 – (∂W/∂t) = dE_{cv}/dt
At steady state
m1 = m2 = m
dE_{cv}/dt = 0
Hence the equation becomes
(dm/dt)*e1 + (∂Q/∂t) – (dm/dt)*e2 – (∂W/∂t) = 0
Above equation is also known as steady flow energy equation.
Also read:
What is a thermodynamic state?
Macroscopic approach to study thermodynamics