From 54e964ffde461140216d763c4a8712d726bfdc63 Mon Sep 17 00:00:00 2001 From: Milan Hanajik Date: Thu, 25 Jun 2020 09:35:10 +0200 Subject: [PATCH] Flow calculation : TestRslt.FlowVolume is always the most accurate CTV flow (calculated from the measured mass in case of mass collection methods) --- Results/WMeterRsltItemSpec.cs | 32 +++++++++---------- .../TestMethods/Adjustment/AdjustmentSeq.cs | 25 ++++++++------- .../CombinedWithDetectionSeq.cs | 17 +++++----- .../TestMethods/FixedStart/FixedStartSeq.cs | 12 +++---- .../FixedStartDeferredEvalSeq.cs | 12 +++---- .../FixedStartMassCollDeferredEvalSeq.cs | 17 +++++----- .../FixedStartMassCollectionSeq.cs | 17 +++++----- .../FixedStartTankCollectionSeq.cs | 15 +++++---- .../TestMethods/FlyingStart/FlyingStartSeq.cs | 23 ++++++------- .../FlyingStartFirstRepetWithMassCollSeq.cs | 19 +++++------ .../FlyingStartMassCollComparativeSeq.cs | 17 +++++----- .../FlyingStartMassCollProlongedSeq.cs | 17 +++++----- .../FlyingStartMassCollectionSeq.cs | 17 +++++----- .../FlyingStartTankCollectionSeq.cs | 17 +++++----- TBF/BenchControl/Various/ErrorFlags/Errors.cs | 8 ++--- 15 files changed, 138 insertions(+), 127 deletions(-) diff --git a/Results/WMeterRsltItemSpec.cs b/Results/WMeterRsltItemSpec.cs index 229b3580a..97ac48222 100644 --- a/Results/WMeterRsltItemSpec.cs +++ b/Results/WMeterRsltItemSpec.cs @@ -210,22 +210,22 @@ namespace Results /// /// Flow /// - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom()))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto()))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", (w.GetMeterTestRslt(t).TestTime == 0 || w.GetTestRslt(t).PulsesMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetMeterTestRslt(t).TestTime * 3.6 * w.GetMeterTestRslt(t).PulsesMaster / w.GetTestRslt(t).PulsesMaster))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).VolumeMaster))); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : "")); - AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : "")); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_from, string.Format("{0} {1}", Strings.VName_Flow, Strings.from), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qfrom()))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_to, string.Format("{0} {1}", Strings.VName_Flow, Strings.to), Quantity.Flow, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).Qto()))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow, string.Format("{0} v r", Strings.VName_Flow), Strings.Tooltip_Q_v_r, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowVolume))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_mean, string.Format("{0} rim ()", Strings.VName_Flow), Strings.Tooltip_Q_rim, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMean))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_min, string.Format("{0} ref min ()", Strings.VName_Flow), Strings.Tooltip_Q_min, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMin))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Qc, string.Format("Qc"), "Calculated water meter flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V5", w.GetTestRslt(t).FlowVolume))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMin : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).FlowMean))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowMax : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).FlowMean))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowStart : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).FlowMean))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_end, string.Format("{0} ctv end ()", Strings.VName_Flow), "End flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).FlowMean == 0) ? w.GetTestRslt(t).FlowEnd : w.GetTestRslt(t).FlowVolume * w.GetTestRslt(t).FlowEnd / w.GetTestRslt(t).FlowMean))); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_rise, string.Format("{0} {1}", Strings.VName_Flow, Strings.rise), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : "")); + AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_fall, string.Format("{0} {1}", Strings.VName_Flow, Strings.fall), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QFall == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QFall)) : "")); AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_sensitivity, string.Format("{0} {1}", Strings.VName_Flow, Strings.sensitivity), Quantity.Flow, ItemCategory.MeterResult, (w, t, u, f, p) => (string.IsNullOrEmpty(t) || (w.GetTestRslt(t) != null)) ? ((w.QRise == 0) ? "-" : FormatDbl(u, f, p, "V3", w.QRise)) : "")); AllItems.Add(new WMeterRsltItemSpec(ItemID.ConstMaster, string.Format("k MID ()"), "Const. of the reference flow meter", Quantity.PulsePerLtr, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", ((w.GetTestRslt(t).ConstMaster < float.Epsilon) ? 0 : (1 / w.GetTestRslt(t).ConstMaster))))); diff --git a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs index 672e58416..a174ee6fe 100644 --- a/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs +++ b/TBF/BenchControl/TestMethods/Adjustment/AdjustmentSeq.cs @@ -411,20 +411,21 @@ namespace TBF.BenchControl.TestMethods.Adjustment tstRslt.MassEndRaw = 0; tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = Config.Formulas.Buoyancy(); - tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter - tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter - tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter - tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] - tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement + tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter + tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMaster = tstRslt.ConstMasterCorr; /// Corrected master pulses per liter + tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.ErrorMaster = 0.0f; /// Cannot be determined without the collected water mass measurement - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; diff --git a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs index d139b9d58..a5223e892 100644 --- a/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs +++ b/TBF/BenchControl/TestMethods/CombinedWithDetection/CombinedWithDetectionSeq.cs @@ -682,27 +682,28 @@ namespace TBF.BenchControl.TestMethods.CombinedWithDetection tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections); tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * cBrd.EtPulses(0) / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = Config.Formulas.Buoyancy(); tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon)) { - tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume); + tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow); tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection; tstRslt.VolumeCTV /= tstRslt.TestTime; } tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; diff --git a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs index d37cf0f7c..6ee6f09fb 100644 --- a/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStart/FixedStartSeq.cs @@ -814,7 +814,6 @@ namespace TBF.BenchControl.TestMethods.FixedStart tstRslt.MassEndRaw = 0; tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; - tstRslt.FlowVolume = flowVolume; /// [m3/h] tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.Buoyancy = Config.Formulas.Buoyancy(); tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient @@ -823,11 +822,12 @@ namespace TBF.BenchControl.TestMethods.FixedStart tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ErrorMaster = 0; - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; diff --git a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs index 07f5c69ee..3e73a621b 100644 --- a/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartDeferredEval/FixedStartDeferredEvalSeq.cs @@ -800,7 +800,6 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval tstRslt.MassEndRaw = 0; tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; - tstRslt.FlowVolume = flowVolume; /// [m3/h] tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.Buoyancy = Config.Formulas.Buoyancy(); tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3] @@ -810,11 +809,12 @@ namespace TBF.BenchControl.TestMethods.FixedStartDeferredEval /// Calculated master pulses per liter tstRslt.ErrorMaster = 0; - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs index 61693fccb..2ec877494 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollDeferredEval/FixedStartMassCollDeferredEvalSeq.cs @@ -945,21 +945,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollDeferredEval tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEnd = massEnd; tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] - tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.Buoyancy = buoyancy; tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; diff --git a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs index 5d4b12d9b..146337a6e 100644 --- a/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartMassCollection/FixedStartMassCollectionSeq.cs @@ -992,21 +992,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartMassCollection tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEnd = massEnd; tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] - tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.Buoyancy = buoyancy; tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; diff --git a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs index 7b2fe58f7..bafdbf9a1 100644 --- a/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FixedStartTankCollection/FixedStartTankCollectionSeq.cs @@ -723,21 +723,22 @@ namespace TBF.BenchControl.TestMethods.FixedStartTankCollection tstRslt.MassEndRaw = 0; tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.Buoyancy = 0; tstRslt.VolumeCTV = volumeCTV; /// [l] 1000.0f is because density is in [kg/m3] tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = switchTimeStart; tstRslt.DiverterEnd = switchTimeEnd; diff --git a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs index 72590364a..09b967f76 100644 --- a/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStart/FlyingStartSeq.cs @@ -477,20 +477,21 @@ namespace TBF.BenchControl.TestMethods.FlyingStart tstRslt.MassEndRaw = 0; tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = Config.Formulas.Buoyancy(); - tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter - tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter + tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = tstRslt.ConstMasterCorr; - tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] - tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement + tstRslt.VolumeCTV = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] 1000.0f is because density is in [kg/m3] + tstRslt.ErrorMaster = 0.0; /// Cannot be determined without a mass measurement - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = 0; tstRslt.DiverterEnd = 0; diff --git a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs index 4f19c90c0..45110db1f 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartFirstRepetWithMassColl/FlyingStartFirstRepetWithMassCollSeq.cs @@ -749,7 +749,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl tstRslt.TimeBtwnMassMsrmnts = tMass2 - tMass1; double massOfEvaporatedWater = tstRslt.TimeBtwnMassMsrmnts * outPath.Scale.EvaporationRate(tstRslt.TempDivMean); tstRslt.PulsesMaster = Convert.ToDouble(cBrd.EtPulses(0)); /// Pulses of the master flow meter (test total) - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] /// tstRslt.Buoyancy = Config.Formulas.Buoyancy(); if (repetitionNr == 1) @@ -762,13 +762,13 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon)) { - tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume); + tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow); tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection; tstRslt.VolumeCTV /= tstRslt.TestTime; } tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); @@ -798,7 +798,7 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = tstResRepet1.ConstMaster; /// Master constant ( pulses per liter) from the first repetition (=against the scale) tstRslt.VolumeMaster = tstRslt.ConstMaster * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.VolumeCTV = tstRslt.VolumeMaster; /// [l] 1000.0f is because density is in [kg/m3] @@ -818,11 +818,12 @@ namespace TBF.BenchControl.TestMethods.FlyingStartFirstRepetWithMassColl tstRslt.InfoFlags = infoFlags; } /// [kg/h] - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); if (compoundTestParams != null) diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs index ff9d3a3a8..327a404bf 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollComparative/FlyingStartMassCollComparativeSeq.cs @@ -871,27 +871,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollComparative tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEnd = EndMass.Val + (refMass - (measuredRefMass.Val - StartMass.Val)); tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = Config.Formulas.Buoyancy(); tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon)) { - tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume); + tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow); tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection; tstRslt.VolumeCTV /= tstRslt.TestTime; } tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = (float)RefFlowStat.Average; + tstRslt.FlowStart = (float)RefFlowStat.First; + tstRslt.FlowEnd = (float)RefFlowStat.Last; + tstRslt.FlowMin = (float)RefFlowStat.Min; + tstRslt.FlowMax = (float)RefFlowStat.Max; tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val; tstRslt.DivStart10 = 0; diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs index 4124d3bdd..79e0b774c 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollProlonged/FlyingStartMassCollProlongedSeq.cs @@ -818,26 +818,27 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollProlonged tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEnd = Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections); tstRslt.FlowMass = 3600 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) * totalPulses / (tstRslt.TestTime * massPulses); /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * totalPulses / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * totalPulses / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = Formulas.Buoyancy(); tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume of collected water if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon)) { - tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume); + tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow); tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection; tstRslt.VolumeCTV /= tstRslt.TestTime; } tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (massPulses == 0) ? tstRslt.ConstMasterCorr : (tstRslt.VolumeCTV / massPulses); tstRslt.VolumeMaster = LtrPerRefPulse * massPulses; /// [l] volume from the master flow meter tstRslt.ErrorMaster = Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * totalPulses * tstRslt.VolumeCTV / (massPulses * tstRslt.TestTime); + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val; tstRslt.DivStart10 = 0; diff --git a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs index 6bdd89336..b6c5fba5a 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartMassCollection/FlyingStartMassCollectionSeq.cs @@ -744,27 +744,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartMassCollection tstRslt.MassEndRaw = EndMass.Val; tstRslt.MassEnd = Config.Formulas.CorrectedValue(tstRslt.MassEndRaw, scale.Corrections); tstRslt.FlowMass = 3600.0 * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.TestTime; /// [kg/h] - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = Config.Formulas.Buoyancy(); tstRslt.VolumeCTV = 1000 * tstRslt.Buoyancy * (tstRslt.MassEnd - tstRslt.MassStart + massOfEvaporatedWater) / tstRslt.DensityLine; /// [l] commercially true volume if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon)) { - tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume); + tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow); tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection; tstRslt.VolumeCTV /= tstRslt.TestTime; } tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val; tstRslt.DivStart10 = 0; diff --git a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs index 95328f879..701c970e1 100644 --- a/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs +++ b/TBF/BenchControl/TestMethods/FlyingStartTankCollection/FlyingStartTankCollectionSeq.cs @@ -501,27 +501,28 @@ namespace TBF.BenchControl.TestMethods.FlyingStartTankCollection tstRslt.MassEndRaw = 0; tstRslt.MassEnd = 0; tstRslt.FlowMass = 0; - tstRslt.FlowVolume = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] + double flow = 3.6 * LtrPerRefPulse * tstRslt.PulsesMaster / tstRslt.TestTime; /// [m3/h] tstRslt.Buoyancy = 0; tstRslt.VolumeCTV = volumeBox.Val; /// [l] if ((outPath.Diverter != null) && (tstRslt.TestTime > float.Epsilon)) { - tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(tstRslt.FlowVolume); + tstRslt.TestTimeCorrection = outPath.Diverter.TestTimeCorrection(flow); tstRslt.VolumeCTV *= tstRslt.TestTime + tstRslt.TestTimeCorrection; tstRslt.VolumeCTV /= tstRslt.TestTime; } tstRslt.VolumeMaster = LtrPerRefPulse * tstRslt.PulsesMaster; /// [l] volume from the master flow meter tstRslt.ConstMasterRaw = outPath.FlowMeter.LtrPerPulse; /// Uncorrected master flowmeter coefficient - tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(tstRslt.FlowVolume, rangeIx); /// Corrected master pulses per liter + tstRslt.ConstMasterCorr = outPath.FlowMeter.LtrPerPulseCorrected(flow, rangeIx); /// Corrected master pulses per liter tstRslt.ConstMaster = (tstRslt.VolumeMaster == 0) ? tstRslt.ConstMasterCorr : (LtrPerRefPulse * tstRslt.VolumeCTV / tstRslt.VolumeMaster); /// Calculated master pulses per liter tstRslt.ErrorMaster = Config.Formulas.ErrorFromVolumes(tstRslt.VolumeMaster, tstRslt.VolumeCTV); - tstRslt.FlowMean = (float)RefFlowStat.Average; - tstRslt.FlowStart = (float)RefFlowStat.First; - tstRslt.FlowEnd = (float)RefFlowStat.Last; - tstRslt.FlowMin = (float)RefFlowStat.Min; - tstRslt.FlowMax = (float)RefFlowStat.Max; + tstRslt.FlowVolume = 3.6 * tstRslt.VolumeCTV / tstRslt.TestTime; + tstRslt.FlowMean = Convert.ToSingle(RefFlowStat.Average); + tstRslt.FlowStart = Convert.ToSingle(RefFlowStat.First); + tstRslt.FlowEnd = Convert.ToSingle(RefFlowStat.Last); + tstRslt.FlowMin = Convert.ToSingle(RefFlowStat.Min); + tstRslt.FlowMax = Convert.ToSingle(RefFlowStat.Max); tstRslt.DiverterStart = outPath.Diverter.SwitchTimeStart.Val; tstRslt.DivStart10 = 0; diff --git a/TBF/BenchControl/Various/ErrorFlags/Errors.cs b/TBF/BenchControl/Various/ErrorFlags/Errors.cs index b31f6e71c..5152d6e16 100644 --- a/TBF/BenchControl/Various/ErrorFlags/Errors.cs +++ b/TBF/BenchControl/Various/ErrorFlags/Errors.cs @@ -37,8 +37,7 @@ namespace TBF.BenchControl.Various.ErrorFlags /// Any E# is 'true' on error, 'false' when OK /// Average flow - double aveFlow = 3.6 * testRslt.VolumeCTV / testRslt.TestTime; - bool E1 = (aveFlow < testRslt.Qfrom()) || (aveFlow > testRslt.Qto()); + bool E1 = (testRslt.FlowVolume < testRslt.Qfrom()) || (testRslt.FlowVolume > testRslt.Qto()); /// Max. and min. up and down water temperature bool E2 = ProcessData.TempUpStat.Min < testRslt.TempLimLo() @@ -94,8 +93,9 @@ namespace TBF.BenchControl.Various.ErrorFlags || ProcessData.PressDownStat.Max > errorsCfg.TestParams.Pressure_max; /// Max. and min. flow - bool E21 = ProcessData.RefFlowStat.Min < testRslt.Qfrom() - || ProcessData.RefFlowStat.Max > testRslt.Qto(); + double rectifiedFlowMin = (testRslt.FlowMean == 0) ? testRslt.FlowMin : testRslt.FlowMin * testRslt.FlowVolume / testRslt.FlowMean; + double rectifiedFlowMax = (testRslt.FlowMean == 0) ? testRslt.FlowMax : testRslt.FlowMax * testRslt.FlowVolume / testRslt.FlowMean; + bool E21 = rectifiedFlowMin < testRslt.Qfrom() || rectifiedFlowMax > testRslt.Qto(); /// Electrical conductivity of water bool E36 = ProcessData.ConductStat.Min < errorsCfg.TestParams.Conductivity_min