Modeling Thermodynamic System in MTK

The failure is due to the inappropriate initial condition mdot=0.0. The system is initialized at the exact point where abs(ṁ)'s derivative is not defined. Writing

ODESystem(Equation[], t, [p, mdot, ρ], [], name=name, defaults=[p=>1e5, mdot => -0.1])

solves the problem.

2 Likes