Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/100prznt/FlowCalc
Browse files Browse the repository at this point in the history
  • Loading branch information
Elias Ruemmler committed Jun 5, 2021
2 parents 029fff4 + fa6a1e3 commit 052b586
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 92 deletions.
39 changes: 0 additions & 39 deletions FlowCalc/Filter.cs

This file was deleted.

2 changes: 1 addition & 1 deletion FlowCalc/FilterSpeedCalcView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace FlowCalc
{
public partial class FilterSpeedCalcView : Form
{
public Pipe Filter { get; set; }
public PipeBase Filter { get; set; }

public Units CurrentFlowRateUnit { get; set; }
public Units CurrentFlowVelocityUnit { get; set; }
Expand Down
3 changes: 2 additions & 1 deletion FlowCalc/FlowCalc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<Compile Include="EnterReportDataView.Designer.cs">
<DependentUpon>EnterReportDataView.cs</DependentUpon>
</Compile>
<Compile Include="Filter.cs" />
<Compile Include="PoolSystem\Filter.cs" />
<Compile Include="IppCollectionEditor.cs" />
<Compile Include="MainView.cs">
<SubType>Form</SubType>
Expand Down Expand Up @@ -131,6 +131,7 @@
<Compile Include="PipeSelectView.Designer.cs">
<DependentUpon>PipeSelectView.cs</DependentUpon>
</Compile>
<Compile Include="PoolSystem\PipeBase.cs" />
<Compile Include="PumpDynamicPerformanceCurve.cs" />
<Compile Include="Report\BarlowFontResolver.cs" />
<Compile Include="VolumeCalcView.cs">
Expand Down
42 changes: 42 additions & 0 deletions FlowCalc/PoolSystem/Filter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using FlowCalc.PoolSystem;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlowCalc.PoolSystem
{
public class Filter : PipeBase
{
#region Properties

#endregion Properties

#region Services

/// <summary>
/// Druckverlust berechnen
/// </summary>
/// <param name="medium">Stoffdaten</param>
/// <param name="flowRate">Volumenstrom in [m^3/h]</param>
/// <returns>Druckverlust in [bar]</returns>
public double CalcPressureDrop(Medium medium, double flowRate)
{
var pd = double.NaN; //Druckverlust
var zeta = double.NaN; //Widerstandsbeiwert
var rho = medium.Density; //Dichte
var w = double.NaN; //mittlere effektive Fluidgeschwindigkeit
var h = double.NaN; //Höhe der Schicht
var dh = double.NaN; //hydraulischer Durchmesser



pd = zeta * (rho / 2) * Math.Pow(w, 2) * (h / dh);

return pd;
}

#endregion Services
}
}
52 changes: 1 addition & 51 deletions FlowCalc/PoolSystem/Pipe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,20 @@

namespace FlowCalc.PoolSystem
{
public class Pipe
public class Pipe : PipeBase
{
#region Member


#endregion Member

#region Properties
/// <summary>
/// Innerer Rohrdurchmesser
/// in [mm]
/// </summary>
public double Diameter { get; set; }

/// <summary>
/// Rohrlänge
/// in [m]
/// </summary>
public double Length { get; set; }

/// <summary>
/// Rohrrauheit
/// in [mm]
/// </summary>
public double Roughness { get; set; }

/// <summary>
/// Rohrquerschnitt
/// in mm^2
/// </summary>
public double CrossArea
{
get
{
return Math.PI * Math.Pow(Diameter, 2) / 4;
}
}

#endregion Properties

#region Constructor
Expand Down Expand Up @@ -71,32 +47,6 @@ public Pipe(double l, double di, double k)
#endregion Constructor

#region Services
/// <summary>
/// Strömungsgeschwindigkeit berechnen
/// </summary>
/// <param name="flowRate">Volumenstrom in [m^3/h]</param>
/// <returns>Strömungsgeschwindigkeit in [m/s]</returns>
public double CalcFlowVelocity(double flowRate)
{
double q = flowRate / 3600; // [m^3/s]
double a = CrossArea / 1E6; // [m^2]

return q / a;
}

/// <summary>
/// Volumenstrom berechnen
/// </summary>
/// <param name="flowVelocity">Strömungsgeschwindigkeit in [m/s]</param>
/// <returns>Volumenstrom in [m^3/h]</returns>
public double CalcFlowRate(double flowVelocity)
{
double a = CrossArea / 1E6; // [m^2]
double q = flowVelocity * a; // [m^3/s]

return q * 3600;
}

/// <summary>
/// Druckverlust berechnen
/// (es wird von einer turbulenten Strömung ausgegangen)
Expand Down
89 changes: 89 additions & 0 deletions FlowCalc/PoolSystem/PipeBase.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FlowCalc.PoolSystem
{
public class PipeBase
{
#region Properties
/// <summary>
/// Innerer Rohrdurchmesser
/// in [mm]
/// </summary>
public double Diameter { get; set; }

/// <summary>
/// Rohrlänge
/// in [m]
/// </summary>
public double Length { get; set; }

/// <summary>
/// Rohrquerschnitt
/// in mm^2
/// </summary>
public double CrossArea
{
get
{
return Math.PI * Math.Pow(Diameter, 2) / 4;
}
}

#endregion Properties

#region Constructor
/// <summary>
/// Konstruktor
/// </summary>
public PipeBase()
{

}

/// <summary>
/// Konstruktor
/// </summary>
/// <param name="l">Rohrlänge in [m]</param>
/// <param name="di">Innerer Rohrdurchmesser in [mm]</param>
public PipeBase(double l, double di)
{
Length = l;
Diameter = di;
}

#endregion Constructor

#region Services
/// <summary>
/// Strömungsgeschwindigkeit berechnen
/// </summary>
/// <param name="flowRate">Volumenstrom in [m^3/h]</param>
/// <returns>Strömungsgeschwindigkeit in [m/s]</returns>
public double CalcFlowVelocity(double flowRate)
{
double q = flowRate / 3600; // [m^3/s]
double a = CrossArea / 1E6; // [m^2]

return q / a;
}

/// <summary>
/// Volumenstrom berechnen
/// </summary>
/// <param name="flowVelocity">Strömungsgeschwindigkeit in [m/s]</param>
/// <returns>Volumenstrom in [m^3/h]</returns>
public double CalcFlowRate(double flowVelocity)
{
double a = CrossArea / 1E6; // [m^2]
double q = flowVelocity * a; // [m^3/s]

return q * 3600;
}

#endregion Services
}
}

0 comments on commit 052b586

Please sign in to comment.