I want to calculate the pressure profile inside a cylinder whose initial pressure is less than the outside pressure and has a orifice on its surface to flow air through it. Air is a considered as compressible ideal gas and mass flow rate across a orifice is assumed isentropic. Also the temperature is assumed same initially in cylinder and surroundings. I am generating the pressure profile inside the cylinder as a function of time using matlab, the method i followed is I took a small delta_t and calculated the massflow rate using available compressed mass flow rate formula and find the net mass flown into the cylinder and I found the new temperature using the energy balance for open system and using ideal gas equation I found the new pressure. Now the problem is after some time the pressure inside the cylinder becomes more than the surrounding pressure, Is it possible to have that kind of situation or am I doing something wrong?