Fluids are categorized as two types.
Flow work will be done in a fluid that is both in liquids and gases. In order to observe flow work in liquids, it should have viscosity property. The liquids which has the viscosity property in that liquids flow work will be less and vice-versa. In order to observe flow work there should exists any solid body. Since viscosity property is high in liquids then the attraction forces between the atoms will be high that is why the flow work will be less.
Viscosity is totally depends on temperature in both liquids and solids. In liquids, if the temperature increases then viscosity will be less and vice-versa. That means temperature and viscosity is inversely proportional to each other in liquids. In gases, if temperature is increases then viscosity is also increased along with the temperature. That means here in gases atoms will be move very freely.
If the liquid is passes through hollow shaft then we should consider friction in addition to the viscosity and temperature. Friction will be depends on internal surface area of hollow shaft. When the liquid is moving through a hallow shaft the friction between the surface area and liquid will be zero but some friction will be developed in between liquid and internal surface area of the shaft. The liquid will move very fast in the hallow shaft because of its velocity, temperature, pressure and viscosity.
If the surface area of the hallow shaft is not uniform throughout its length, it will reduce the velocity of the liquid. So in the internal structure of the liquid the atoms will push the neighboring atoms to move forward. So the flowing liquid inside the hallow-shaft having some energy in the form of temperature, viscosity, pressure, mass.
When this hallow-shaft is connected to the engine some work will be done in the engine because of its liquid energy. Generally, flow work will be done in open systems.
For non-flow processes, mass should not be considered. I mean there is no mass interaction throughout the process with system boundaries and other remaining terms are varied. obviously, this will happen in closed systems You can take example as air-compressors.