public EEICalculationResult CalculateEEI(PackagedSolution package) { _package = package; _packageData = new PackageDataManager(_package); //setting starting AFUE value _results.PrimaryHeatingUnitAFUE = _packageData.PrimaryUnit.AFUE; //finding effect of temperatur regulator _results.EffectOfTemperatureRegulatorClass = _packageData.TempControllerBonus; //Calculating effect of secondary boiler _results.SecondaryBoilerAFUE = _packageData.SupplementaryBoiler?.AFUE ?? 0; _results.EffectOfSecondaryBoiler = SecBoilerEffect(); //Calculating effect of solarcollector _results.SolarHeatContribution = SolarContribution(); //finalizing the EEI Calculation _results.EEI = (float)Math.Round(_results.PrimaryHeatingUnitAFUE + _results.EffectOfTemperatureRegulatorClass - _results.EffectOfSecondaryBoiler + _results.SolarHeatContribution); _results.EEICharacters = EEICharLabelChooser.EEIChar(PrimaryUnitType, _results.EEI, 1)[0]; _results.ToNextLabel = EEICharLabelChooser.EEIChar(PrimaryUnitType, _results.EEI, 1)[1]; _results.ProceedingEEICharacter = EEICharLabelChooser.EEIChar(PrimaryUnitType, _results.EEI, 1)[2]; //Calculating for colder and warmer climates if (PrimaryUnitType != ApplianceTypes.CHP) { _results.PackagedSolutionAtColdTemperaturesAFUE = _results.EEI - (_packageData.PrimaryUnit.AFUE - _packageData.PrimaryUnit.AFUEColdClima); _results.PackagedSolutionAtWarmTemperaturesAFUE = _results.EEI + (_packageData.PrimaryUnit.AFUEWarmClima - _packageData.PrimaryUnit.AFUE); } _results.CalculationType = _packageData.CalculationStrategyType(_package, _results); return(_results); }
/// <summary> /// EEI Calculation for packaged solution with a boiler as primary heating unit /// </summary> /// <param name="package"></param> /// <returns>EEICalculationResult which are the EEI and all the varibales in between</returns> public EEICalculationResult CalculateEEI(PackagedSolution package) { _package = package; _packageData = new PackageDataManager(_package); if (PrimaryBoiler == null) { return(null); } _result.PrimaryHeatingUnitAFUE = PrimaryBoiler.AFUE; _result.SecondaryBoilerAFUE = _packageData.SupplementaryBoiler?.AFUE ?? 0; _result.EffectOfTemperatureRegulatorClass = _packageData.TempControllerBonus; _result.EffectOfSecondaryBoiler = (_packageData.SupplementaryBoiler?.AFUE - _result.PrimaryHeatingUnitAFUE) * 0.1f ?? 0; _result.SolarHeatContribution = SolarContribution(); _result.SecondaryHeatPumpAFUE = _packageData.SupplementaryHeatPump?.AFUE ?? 0; _result.EffectOfSecondaryHeatPump = -HeatpumpContribution(_packageData.HasNonSolarContainer()); _result.AdjustedContribution = Math.Abs(Math.Abs(_result.EffectOfSecondaryHeatPump)) > 0 && Math.Abs(_result.SolarHeatContribution) > 0 ? AdjustedContribution(_result.EffectOfSecondaryHeatPump, _result.SolarHeatContribution) : default(float); _result.EEI = (float)Math.Round(_result.PrimaryHeatingUnitAFUE + _result.EffectOfTemperatureRegulatorClass - _result.EffectOfSecondaryBoiler + _result.SolarHeatContribution - _result.EffectOfSecondaryHeatPump - _result.AdjustedContribution); _result.PackagedSolutionAtColdTemperaturesAFUE = Math.Abs(_ii - default(float)) > 0 ? _result.EEI + (50 * _ii) : 0; _result.EEICharacters = EEICharLabelChooser.EEIChar(ApplianceTypes.Boiler, _result.EEI, 1)[0]; _result.ToNextLabel = EEICharLabelChooser.EEIChar(ApplianceTypes.Boiler, _result.EEI, 1)[1]; _result.ProceedingEEICharacter = EEICharLabelChooser.EEIChar(ApplianceTypes.Boiler, _result.EEI, 1)[2]; _result.CalculationType = _packageData.CalculationStrategyType(_package, _result); return(_result); }
/// <summary> /// Calculation method for Water heating with a primary Boiler /// </summary> /// <param name="package"></param> /// <returns>EEICalculationResult which contains the variables used for the calculation, /// the energy effiency index and the calculation method used </returns> public EEICalculationResult CalculateEEI(PackagedSolution package) { _package = package; _packageData = new PackageDataManager(_package); if (PrimaryData == null) { return(null); } var data = WaterHeater ?? PrimaryData; _result.WaterHeatingEffciency = data.WaterHeatingEffiency; _result.WaterHeatingUseProfile = data.UseProfile; var qref = _qref[_result.WaterHeatingUseProfile]; var qaux = SolCalMethodQaux(); var qnonsol = SolCalMethodQnonsol(); var I = _result.WaterHeatingEffciency; var II = Math.Abs(qnonsol) > 0 ? (220 * qref) / qnonsol : 0; var III = Math.Abs(qaux) > 0 ? (float)(((qaux * 2.5) / (220 * qref)) * 100) : 0; _result.SolarHeatContribution = qaux.Equals(0) || qnonsol.Equals(0) ? 0 : (1.1f * I - 10) * II - III - I; _result.EEI = (float)Math.Round(_result.SolarHeatContribution + I); _result.PackagedSolutionAtColdTemperaturesAFUE = _result.EEI - 0.2f * _result.SolarHeatContribution; _result.PackagedSolutionAtWarmTemperaturesAFUE = _result.EEI + 0.4f * _result.SolarHeatContribution; _result.CalculationType = _packageData.CalculationStrategyType(_package, _result); _result.EEICharacters = EEICharLabelChooser.EEIChar(_result.WaterHeatingUseProfile, _result.EEI, 1.5f)[0]; _result.ToNextLabel = EEICharLabelChooser.EEIChar(_result.WaterHeatingUseProfile, _result.EEI, 1.5f)[1]; _result.ProceedingEEICharacter = EEICharLabelChooser.EEIChar(_result.WaterHeatingUseProfile, _result.EEI, 1.5f)[2]; return(_result); }
private void SetupLabelTwo(IReadOnlyList <EEICalculationResult> result) { LabelTwo = "Visible"; var arrowData = SelectArrowValue(EEICharLabelChooser.EEIChar(ApplianceTypes.Boiler, result[1].PrimaryHeatingUnitAFUE)[0]); AnnualEfficiencyLetter = arrowData.Letter; AnnualEfficiencyPlus = arrowData.Plus; arrowData = SelectArrowValue(EEICharLabelChooser.EEIChar(ApplianceTypes.Boiler, result[0].PrimaryHeatingUnitAFUE)[0]); WaterHeatingModeLetter = arrowData.Letter; WaterHeatingModePlus = arrowData.Plus; TapValue = result[1].WaterHeatingUseProfile.ToString(); arrowData = SelectArrowValue(result[0].EEICharacters); TabelOneArrow = arrowData.Location; TabelOneArrowLetter = arrowData.Letter; TabelOneArrowPlus = arrowData.Plus; arrowData = SelectArrowValue(result[1].EEICharacters); TabelTwoArrow = arrowData.Location; TabelTwoArrowLetter = arrowData.Letter; TabelTwoArrowPlus = arrowData.Plus; }
private void SetupLabelOne(EEICalculationResult result) { LabelOne = "Visible"; var arrowData = SelectArrowValue(EEICharLabelChooser.EEIChar(ApplianceTypes.Boiler, result.PrimaryHeatingUnitAFUE)[0]); AnnualEfficiencyLetter = arrowData.Letter; AnnualEfficiencyPlus = arrowData.Plus; arrowData = SelectArrowValue(result.EEICharacters); LabelTwoTabeOneArrow = arrowData.Location; LabelTwoTabeOneArrowLetter = arrowData.Letter; LabelTwoTabeOneArrowPlus = arrowData.Plus; }
public void LabelChooserWaterReturnscCorrectLabel_true(UseProfileType Type, float calcEEI, string expected) { Assert.AreEqual(EEICharLabelChooser.EEIChar(Type, calcEEI)[0], expected); }
public void LabelChooserRegularReturnscCorrectLabel_true(ApplianceTypes Type, float calcEEI, string expected) { Assert.AreEqual(EEICharLabelChooser.EEIChar(Type, calcEEI)[0], expected); }