The nozzle converts the thermal energy of the hot chamber gases into kinetic energy, and directs that energy along nozzle axis. The nozzle gradually increases in cross-sectional area allowing gases to expand and push against walls creating thrust. The ultimate purpose of the nozzle is to expand gases as efficiently as possible so as to maximize exit velocity.
Thrust of a rocket can be calculated by
MV
e+(P
e-P
a)A
e
Where
M = engine mass flow rate
V
e = gas velocity at nozzle exit
P
e = exhaust gas pressure at nozzle exit
A
e = cross-sectional area of nozzle exhaust exit
P
a = external ambient pressure, (free stream pressure)
A nozzle is designed to operate at one particular static pressure, and any deviation will see losses in the form of over or under expansion of the exhaust plume. Where the exhaust plume is perfectly expanded (ie at the nozzle design point) thrust = MV
equivalent (or effective) exhaust gas velocity at nozzle exit
Basics of Space Flight: Rocket Propulsion