Dear Sir,
I have built-up an application in vb.net, framework 4, that calculates the pressure drop in a single piping system for a given speed. From here all is fine and results compare really well with published litterature.
The next step for me is to draw a graph of the pressure drops for each flow speed from 0 to 6m/s. A typical example can be found here:
Résultats Google Recherche d'images correspondant à http://www.gouldspumps.com/download_files/pump_fundamentals/sect_a9_01.gif
The code below shows the routine calculations performed prior to draw the graph where I get the pressure drops for each speed. I want to plot Flow speed on th X-axis and pressure drops on the Y-axis.
Once the loop is done and that the pressure drop for the 7 flow speeds is calculated (from 0 to 6m/s), how do I isolate the figure for each one of these so that I can plot them?
Drawing the graph will be the next issue but let's take it step by step...
Thanks by advance to show me how to get the pressure drop figures for each speed.
Plase feel free to ask if you have any questions. All the best. Vincent
Public Class Graph
Sub CodepourGraph()
Dim FlowSpeedGraph As Integer 'Flow speed
Dim ReynoldsGraph As Double 'Reynolds number
Dim FrictionFactorGraph As Double 'Friction factor
Dim AGraph As Double 'A for Serghide's equation
Dim BGraph As Double 'B for Serghide's equation
Dim CGraph As Double 'C for Serghide's equation
'Variables raccords
Dim PipeLossesGraph As Double
Dim Losses9015Graph As Double
Dim Losses4515Graph As Double
Dim LossesGateGraph As Double
Dim LossesGlobeGraph As Double
Dim LossesButtGraph As Double
Dim LossesBallGraph As Double
Dim LossesCheckGraph As Double
Dim LossesFilterGraph As Double
Dim LossesTeeThroughGraph As Double
Dim LossesTeesideGraph As Double
Dim LossesOutletGraph As Double
Dim LossesInletGraph As Double
Dim FittingLossesGraph As Double
Dim PressureDropGraph As Double 'Total pressure losses or pressure required
For FlowSpeedGraph = 0 To 6 Step 1
'Reynolds number calculation
ReynoldsGraph = ((Form1.Diameter * FlowSpeedGraph * Form1.MediaDensity) / (Form1.MediaDensity * Form1.MediaViscosity)) * 1000
'Frcition factor calculation
If ReynoldsGraph < 2300 Then
FrictionFactorGraph = 64 / ReynoldsGraph
Else
'Serghide’s Solution for Colebrook Equation
AGraph = -2 * Math.Log10((Form1.RelativeRoughness / 3.7) + (12 / ReynoldsGraph))
BGraph = -2 * Math.Log10((Form1.RelativeRoughness / 3.7) + (2.51 * AGraph / ReynoldsGraph))
CGraph = -2 * Math.Log10((Form1.RelativeRoughness / 3.7) + (2.51 * BGraph / ReynoldsGraph))
FrictionFactorGraph = ((AGraph - (BGraph - AGraph) ^ 2 / (CGraph - (2 * BGraph) + AGraph)) ^ -2)
End If
'Pipe friction losses
PipeLossesGraph = (FrictionFactorGraph * (Form1.TxtLength.Text / (Form1.Diameter / 1000)) * (FlowSpeedGraph ^ 2 / (2 * 9.81)))
'Fittings losses 90°1.5D
Losses9015Graph = ((Form1.K9015 * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.Num9015.Value
'Fittings losses 45°1.5D
Losses4515Graph = ((Form1.K4515 * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.Num4515.Value
'Fittings losses Gate valve
LossesGateGraph = ((Form1.KGate * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumGate.Value
'Fittings losses Globe valve
LossesGlobeGraph = ((Form1.KGlobe * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumGlobe.Value
'Fittings losses Butterfly valve
LossesButtGraph = ((Form1.KButt * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumButt.Value
'Fittings losses Ball valve
LossesBallGraph = ((Form1.KBall * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumBall.Value
'Fittings losses Check valve
LossesCheckGraph = ((Form1.KCheck * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumCheck.Value
'Fittings losses Y-strainer
LossesFilterGraph = ((Form1.KFilter * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumFilter.Value
'Fittings losses Tee through
LossesTeeThroughGraph = ((Form1.KTeeThrough * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumTeeStraight.Value
'Fittings losses Tee side
LossesTeesideGraph = ((Form1.KTeeSide * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumTeeSide.Value
'Fittings losses Pipe outlet
LossesOutletGraph = ((Form1.KOutlet * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumOutlet.Value
'Fittings losses Pipe inlet
LossesInletGraph = ((Form1.KInlet * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumInlet.Value
'Fittings losses due to fittings
FittingLossesGraph = Losses9015Graph + Losses4515Graph + LossesGateGraph + LossesGlobeGraph + LossesButtGraph + LossesBallGraph + LossesCheckGraph + LossesFilterGraph + LossesTeeThroughGraph + LossesTeesideGraph + LossesOutletGraph + LossesInletGraph
'Total Pressure drop or required
PressureDropGraph = PipeLossesGraph + Form1.Elevation + FittingLossesGraph + Form1.OutletPressureMLC
Next FlowSpeedGraph
'Here are the values I need to isolate to draw a graph
'FlowSpeedGraph 0 -> PressureDropGraph = ??
'FlowSpeedGraph 1 -> PressureDropGraph = ??
'FlowSpeedGraph 2 -> PressureDropGraph = ??
'FlowSpeedGraph 3 -> PressureDropGraph = ??
'FlowSpeedGraph 4 -> PressureDropGraph = ??
'FlowSpeedGraph 5 -> PressureDropGraph = ??
'FlowSpeedGraph 6 -> PressureDropGraph = ??
End Sub
End Class
I have built-up an application in vb.net, framework 4, that calculates the pressure drop in a single piping system for a given speed. From here all is fine and results compare really well with published litterature.
The next step for me is to draw a graph of the pressure drops for each flow speed from 0 to 6m/s. A typical example can be found here:
Résultats Google Recherche d'images correspondant à http://www.gouldspumps.com/download_files/pump_fundamentals/sect_a9_01.gif
The code below shows the routine calculations performed prior to draw the graph where I get the pressure drops for each speed. I want to plot Flow speed on th X-axis and pressure drops on the Y-axis.
Once the loop is done and that the pressure drop for the 7 flow speeds is calculated (from 0 to 6m/s), how do I isolate the figure for each one of these so that I can plot them?
Drawing the graph will be the next issue but let's take it step by step...
Thanks by advance to show me how to get the pressure drop figures for each speed.
Plase feel free to ask if you have any questions. All the best. Vincent
Public Class Graph
Sub CodepourGraph()
Dim FlowSpeedGraph As Integer 'Flow speed
Dim ReynoldsGraph As Double 'Reynolds number
Dim FrictionFactorGraph As Double 'Friction factor
Dim AGraph As Double 'A for Serghide's equation
Dim BGraph As Double 'B for Serghide's equation
Dim CGraph As Double 'C for Serghide's equation
'Variables raccords
Dim PipeLossesGraph As Double
Dim Losses9015Graph As Double
Dim Losses4515Graph As Double
Dim LossesGateGraph As Double
Dim LossesGlobeGraph As Double
Dim LossesButtGraph As Double
Dim LossesBallGraph As Double
Dim LossesCheckGraph As Double
Dim LossesFilterGraph As Double
Dim LossesTeeThroughGraph As Double
Dim LossesTeesideGraph As Double
Dim LossesOutletGraph As Double
Dim LossesInletGraph As Double
Dim FittingLossesGraph As Double
Dim PressureDropGraph As Double 'Total pressure losses or pressure required
For FlowSpeedGraph = 0 To 6 Step 1
'Reynolds number calculation
ReynoldsGraph = ((Form1.Diameter * FlowSpeedGraph * Form1.MediaDensity) / (Form1.MediaDensity * Form1.MediaViscosity)) * 1000
'Frcition factor calculation
If ReynoldsGraph < 2300 Then
FrictionFactorGraph = 64 / ReynoldsGraph
Else
'Serghide’s Solution for Colebrook Equation
AGraph = -2 * Math.Log10((Form1.RelativeRoughness / 3.7) + (12 / ReynoldsGraph))
BGraph = -2 * Math.Log10((Form1.RelativeRoughness / 3.7) + (2.51 * AGraph / ReynoldsGraph))
CGraph = -2 * Math.Log10((Form1.RelativeRoughness / 3.7) + (2.51 * BGraph / ReynoldsGraph))
FrictionFactorGraph = ((AGraph - (BGraph - AGraph) ^ 2 / (CGraph - (2 * BGraph) + AGraph)) ^ -2)
End If
'Pipe friction losses
PipeLossesGraph = (FrictionFactorGraph * (Form1.TxtLength.Text / (Form1.Diameter / 1000)) * (FlowSpeedGraph ^ 2 / (2 * 9.81)))
'Fittings losses 90°1.5D
Losses9015Graph = ((Form1.K9015 * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.Num9015.Value
'Fittings losses 45°1.5D
Losses4515Graph = ((Form1.K4515 * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.Num4515.Value
'Fittings losses Gate valve
LossesGateGraph = ((Form1.KGate * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumGate.Value
'Fittings losses Globe valve
LossesGlobeGraph = ((Form1.KGlobe * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumGlobe.Value
'Fittings losses Butterfly valve
LossesButtGraph = ((Form1.KButt * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumButt.Value
'Fittings losses Ball valve
LossesBallGraph = ((Form1.KBall * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumBall.Value
'Fittings losses Check valve
LossesCheckGraph = ((Form1.KCheck * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumCheck.Value
'Fittings losses Y-strainer
LossesFilterGraph = ((Form1.KFilter * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumFilter.Value
'Fittings losses Tee through
LossesTeeThroughGraph = ((Form1.KTeeThrough * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumTeeStraight.Value
'Fittings losses Tee side
LossesTeesideGraph = ((Form1.KTeeSide * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumTeeSide.Value
'Fittings losses Pipe outlet
LossesOutletGraph = ((Form1.KOutlet * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumOutlet.Value
'Fittings losses Pipe inlet
LossesInletGraph = ((Form1.KInlet * (FlowSpeedGraph ^ 2)) / (2 * 9.81)) * Form2.NumInlet.Value
'Fittings losses due to fittings
FittingLossesGraph = Losses9015Graph + Losses4515Graph + LossesGateGraph + LossesGlobeGraph + LossesButtGraph + LossesBallGraph + LossesCheckGraph + LossesFilterGraph + LossesTeeThroughGraph + LossesTeesideGraph + LossesOutletGraph + LossesInletGraph
'Total Pressure drop or required
PressureDropGraph = PipeLossesGraph + Form1.Elevation + FittingLossesGraph + Form1.OutletPressureMLC
Next FlowSpeedGraph
'Here are the values I need to isolate to draw a graph
'FlowSpeedGraph 0 -> PressureDropGraph = ??
'FlowSpeedGraph 1 -> PressureDropGraph = ??
'FlowSpeedGraph 2 -> PressureDropGraph = ??
'FlowSpeedGraph 3 -> PressureDropGraph = ??
'FlowSpeedGraph 4 -> PressureDropGraph = ??
'FlowSpeedGraph 5 -> PressureDropGraph = ??
'FlowSpeedGraph 6 -> PressureDropGraph = ??
End Sub
End Class