The mathematical theory of thermal choking in nozzle flows