When the static ports are blocked, pilots use the alternative static soure and it measures the static pressure inside the cockpit. And it is said that the static pressure inside is lower than the outside static pressure. I wonder why does this happen? Because you know cockpit is blocked from outside and how does the venturi effect applied inside the cockpit and static pressure inside?
You're referring to this statement in the Pilots Handbook of Aeronautical Knowledge, Page 8-11:
Some aircraft are equipped with an alternate static source in the flight deck. In the case of a blocked static source, opening the alternate static source introduces static pressure from the flight deck back into the system. Flight deck static pressure is lower than outside static pressure.
The reason for this error with alternate static source is that the air flowing around the airframe creates a slight vacuum inside the airframe, thereby lowering the barometric pressure and generating erroneous readings in the pitot-static system.
The physical effect that causes this drop is call the Bernoulli Effect. To compute anything reasonable, you would need to use the Compressible flow equation. From this point of view, it would be easier to measure the difference and put it in the instrument failure manual.
In short for the effect: gas with the same density presses against a non-moving object less than against a moving one.