>>13220352Everything you mention can all be accounted for in nozzle design and be used advantageously.
Rocket nozzles exchange heat for velocity because hot gas is at higher pressure than the same amount of cooler gas for the same volume so it naturally tries expand and will cool off if it can expand due to the ideal gas law (even tho real life is not ideal). The expansion pressure is pushing against one end of the nozzle and makes thrust.
One possible design for making a mach 30 stream is heating up compressed air and allowing it to go through a nozzle to reach hyper hyper sonic speeds. The throat of the nozzle (narrowest point) will be the slowest point (should be the mach number for the particular gas used) and most compressed while the outlet will be least compressed and fasted velocity. These two points might be close to p1a1v1=p2a2v2, but not necessarily because density, p, does not have to be the same. It would be really hard to get the outlet temperature to exact atmospheric temp for a simulation.
You have to use a nozzle or else back pressure of the expanding gas will expand back into the throat and restrict flow btw.