Closed carlesRT closed 7 years ago
@carlesRT , is it possible to rename the branch to pipe_issue26_precalculate_dp
instead, to keep in line with the issue tracker :)
This functionality would be mostly useful for simulation of existing systems with known pipe diameters. I think this goes together well with the proposed changes in #24, representing one of the two options. The other option is setting a desired pressure drop (~100 Pa/m) and mass flow rate, leaving the diameter open.
Maybe also check Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow
, it seems that this function is already available and also handles laminar flow (although we will not normally encounter that).
I renamed the branch :+1:
Yep, functions needs a diameter. If the pipe model has a diameter, we might use the function's output as a default value (for the user it is easier to have as a default value the function's output and if needed it, change it for a specific value in Pa/m rather than the other way round).
I guess I could use some function from Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed...
to calculate the friction factor but at the end I just need a line code to do it (No need to call a much detailed function with dummy values). We are interested in a single value at the turbulent region in order to set dp_nominal
.
I opened pull request #30 to solve this issue. @carlesRT , could you check if this is okay?
Essentially, there was already a nominal pressure drop calculation at 20°C, but it was repeated in all layers. Now for the detailed model, dh is used by default to calculate the pressure drop at nominal mass flow and it is only calculated at the PipeAdiabaticPlugFlow
level.
@bramvdh91 and @carlesRT :
I was wondering what the status on this issue is. On the one hand the issue is still open, but the code is already merged to issue264_pipe
. Do you experience advantages from this implementation? In one of my applications, it seems like this implementation leads to larger deviations from reference results than the previous pressure drop calculation.
I have been checking the pipe models, regarding calculation of pressure drop.
I did added the function Annex60.Experimental.Pipe.BaseClasses.dPpre
to precalculate the nominal pressure drop for a nominal mass flow rate and choosen operating (nominal) temperature (medium with fluid dependet properties is declared within the function).
@bramvdh91 used the already existing function of the MSL Modelica.Fluid.Pipes.BaseClasses.WallFriction.Detailed.pressureLoss_m_flow
to do the same. In this case but the fluid properties are calculated at some default values.
In both cases there is the advantadge of having a precalculated nominal pressure drop which you can edit if necessary. Furthermore calculating the nominal pressure drop at the "expected" operating temperature should reduce the error introduced by the simplified approach -> dp = f (nominal conditions & m_flow).
@marcusfuchs I compared the results for simple cases. There were some deviations when calculating nominal pressure drop with 'dPpre' in comparison with the results obtained with the MSL pipe. I took me a while find the "problem". It was solved by setting from_dp = false..... Regarding differences between 'pipeAdiabaticPlugFlow' and the 'MSL-pipe' I guess there are mainly due to the use of different value for the fluid properties.
We can discuss in the next TelCo what we do next.
I updated pipe_issue26_...
with the current status of issue264_pipe
.
I propose to close this issue as the pressure drop component in the IBPSA library has been changed in the meantime, We should see how we can access the density, viscosity etc. for fluids with non-standard temperature.
We discussed about the possibility to precalculate the pressure drop based on nominal conditions. I add a function
dpPre
in branch _pipe_issue26_precalculatedp to do that.There is also an example
/Comparisons/Precalculated_dp.mo
with a.mos
file.If you agree in have such function we can discuss which changes should be done.