The loss would be viscous losses from, what is likely turbulent mixing. Flow does calculate this.
What's a spear valve exactly? Orifice with a post through it like in an oleo strut? It is suppose to be some sort of low loss valve at all flow rates or something?
From Google it appears that this is a variable geometry nozzle discharging into a different phase (liquid exitng the nozzle into a gas volume) typically used in a pelton wheel turbine. this has some complications in getting a good approximation. You might want to post an image of the domain and maybe a cross section through the mesh. I assume your equation goals are simple like total energy in minus energy out, which should be small (it could go either way as it would be a numerical error level quantity if there is no heat transfer to the surroundings.
What you've written is correct. It is used to vary the flow rate of a pelton wheel turbine. I'm aiming to find the total pressure at the inlet and outlet under different operating pressures and different spear positions.
As I mentioned about, under certain circumstances the total outlet pressure is greater than the inlet pressure. I think you're comment about there being a numerical error would be valid for very low flow rates but under high flow conditions a pressure loss of about 10% is more reasonable.
I've found so far that running a coarse mesh will give what looks like good result, I can then increase the refinement up to a point when outlet pressure will suddenly jump up to about 1% greater than inlet pressure. Using the spear position below and a pressure of 15bar a global mesh of 5 can be used and the results are as expected, however a mesh of 6 or 7 will give outlet pressures greater than the inlet. If the "channels" box is ticked within a local mesh the same happens (under most circumstances) and as the valve is closed (and the head of the spear begins to interfere with the outlet lid) this problem seems to occur more frequently.
Sorry my description is so vague. I have really struggled to find any reason/trend which seems to be causing this, any ideas on whats causing this would be much appreciated.
So it turns out that the problem was that the mesh was not refined enough around the spear head.
Annoyingly the results which were being produced from a fairly coarse mesh were very close to the values I had expected. As I increased the level of the mesh it appeared that the results were becoming less accurate. Increasing it to level 8 and 9 around the spear head then produced the results which I had expected again.