Skip to content

Commit

Permalink
Anzeige der Iterationen
Browse files Browse the repository at this point in the history
Interationen zur berechnung des saugseitigen Druckverlustet werden als Tooltip (lbl_SuctionPipePressureDrop) angezeigt.
  • Loading branch information
Elias Ruemmler committed Mar 8, 2019
1 parent de53246 commit ea77015
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 10 deletions.
6 changes: 6 additions & 0 deletions FlowCalc/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ public double SystemHead

public double SuctionPressureDrop { get; set; }

public int SuctionPressureDropCalcIterations { get; set; }

#endregion Properties

#region Constructor
Expand Down Expand Up @@ -110,6 +112,7 @@ public void CalcFlowRate(double pressure)

//Iterative Berechnung, da Volumenstrom auch vom suagseitigen Druckverlust abhängt

SuctionPressureDropCalcIterations = 0;
double lastFlowRate = 0;
double pressureDrop = 0;
double systemPressure = 0;
Expand All @@ -119,6 +122,8 @@ public void CalcFlowRate(double pressure)
systemPressure = pressure + pressureDrop;
lastFlowRate = systemFlowRate;
systemFlowRate = LinInterp.LinearInterpolation(Pump.GetPerformanceHeadValues(), Pump.GetPerformanceFlowValues(), systemPressure / 0.0980665);

SuctionPressureDropCalcIterations++;
}

if (SystemHead > Pump.MaxTotalHead || double.IsInfinity(systemPressure) || double.IsInfinity(systemFlowRate) || double.IsInfinity(pressureDrop))
Expand All @@ -137,6 +142,7 @@ public void ResetSystem()
SystemPressure = 0;
SystemFlowRate = 0;
SuctionPressureDrop = 0;
SuctionPressureDropCalcIterations = 0;
}

#endregion Services
Expand Down
20 changes: 10 additions & 10 deletions FlowCalc/MainView.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions FlowCalc/MainView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ private void btn_LoadPump_Click(object sender, EventArgs e)

private void btn_CalcFlowRate_Click(object sender, EventArgs e)
{
toolTip1.SetToolTip(lbl_PipeSuctionPressureDrop, string.Empty);
txt_SystemHead.ForeColor = Color.Black;

if (cbx_CalcSuctionPipe.Checked)
Expand Down Expand Up @@ -107,6 +108,7 @@ private void btn_CalcFlowRate_Click(object sender, EventArgs e)
if (cbx_CalcSuctionPipe.Checked)
{
txt_PipeSuctionPressureDrop.Text = m_Controller.SuctionPressureDrop.ToString("f3") + " bar";
toolTip1.SetToolTip(lbl_PipeSuctionPressureDrop, "Wert in " + m_Controller.SuctionPressureDropCalcIterations + " Iterationen ermittelt");
}

if (m_Controller.SystemFlowRate <= 0)
Expand Down Expand Up @@ -139,6 +141,9 @@ private void clearSystemOutput()
{
txt_SystemFlowRate.Clear();
txt_SystemHead.Clear();

txt_PipeSuctionPressureDrop.Clear();
toolTip1.SetToolTip(lbl_PipeSuctionPressureDrop, string.Empty);
}

private void lbl_PumpFileAuthor_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
Expand Down

0 comments on commit ea77015

Please sign in to comment.