What is the relationship between flow work and velocity of gas? As we know that for open systems, we have energy conservation equation as
$$h+\frac{v^2}{2}+zg=const.$$
$$h=u+pV$$
$$u+pV+\frac{v^2}{2}+zg=const.$$
Here $pV$ is flow energy. We know that all these different types of energies (internal energy, flow energy, kinetic energy and potential energy) are interchangeable.
My friend asked that when gas expands isothermally then the $pV$ (magnitude of flow work) remains the same before and after the expansion of gas (due to constant temperature the internal energy also remains constant and for horizontal flow, change in potential energy is zero).
When $pV$ is the same before and after the expansion, then from where the energy comes for the velocity of gas due to expansion.
I asked that first of all if the process is isothermal then it should be very slow and if the process is rapid then there must be a drop in the temperature of the gas. But it means a drop in internal energy provides energy for velocity. I want to know is there any relationship between flow work and velocity. Are these two energies (flow work and velocity) interchangeable?
 A: The equation you wrote applies to the steady state operation of the system, only if no shaft work is done and no heat is exchanged with the system.  So, if the inlet is at the same elevation as the outlet and the change in kinetic energy of the gas is negligible (such as in flow through a porous plug), the change in enthalpy per unit mass of the gas is zero.  For an ideal gas, this means that the change in temperature and internal energy per unit mass is zero.  For a real gas, this would not be the case, and you might have to either add heat or remove heat to maintain the exit temperature equal to the inlet temperature.  Even then, for a real gas, PV would not be constant. 
In a case where the kinetic energy changes significantly, the enthalpy of the gas also changes in passing through the system.  So, if the kinetic energy increases, the enthalpy decreases (cooling for an ideal gas), and, if the kinetic energy decreases, the enthalpy increases (heating for an ideal gas).  Mechanistically, the gas does P-V expansion/compression work to accelerate or decelerate the gas, and if there is irreversibility present (very rapid deformation), some of the available P-V energy is also dissipated viscously to produce an additional increase in internal energy.
