Skip to content

Commit

Permalink
Merge pull request #731 from architecture-building-systems/update-hea…
Browse files Browse the repository at this point in the history
…tpump-COP

new option to take min of ASHP COP calculation
  • Loading branch information
christophwaibel authored May 16, 2022
2 parents 42c0b85 + ffb99f5 commit 7a6ed23
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 10 deletions.
Binary file modified GrasshopperExamples/Templates/Hive_FullTemplate.gh
Binary file not shown.
Binary file modified GrasshopperExamples/Templates/Hive_FullTemplate_Parametric.gh
Binary file not shown.
Binary file modified setup/Setup_Hive.exe
Binary file not shown.
31 changes: 24 additions & 7 deletions src/Hive.IO/Hive.IO/EnergySystems/HeatPump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ public void SetInputOutputSimple(Electricity electricityIn, Air ambientAir, doub

for (int t = 0; t < horizon; t++)
{
double COP = this.EtaRef * ((tempWarmHorizon[t] + Misc.Kelvin) / ((tempWarmHorizon[t] + Misc.Kelvin) - (tempColdHorizon[t] + Misc.Kelvin)));
base.COP[t] = COP;
elecConsumed[t] = heatingGenerated[t] / COP;
double COPSimple = CopSimple(tempWarmHorizon[t], tempColdHorizon[t]); //this.EtaRef * ((tempWarmHorizon[t] + Misc.Kelvin) / ((tempWarmHorizon[t] + Misc.Kelvin) - (tempColdHorizon[t] + Misc.Kelvin)));
base.COP[t] = COPSimple;
elecConsumed[t] = heatingGenerated[t] / COPSimple;
if (elecConsumed[t] < 0.0) elecConsumed[t] = 0.0;
}

Expand All @@ -189,6 +189,10 @@ public void SetInputOutputSimple(Electricity electricityIn, Air ambientAir, doub

}

private double CopSimple(double warmFluid, double coldFluid)
{
return this.EtaRef * ((warmFluid + Misc.Kelvin) / ((warmFluid + Misc.Kelvin) - (coldFluid + Misc.Kelvin)));
}

/// <summary>
/// Ashouri et al 2013. Optimal design and operation of building services using mixed-integer linear programming techniques
Expand All @@ -199,7 +203,8 @@ public void SetInputOutputSimple(Electricity electricityIn, Air ambientAir, doub
/// <param name="airIn"></param>
/// <param name="heatingGenerated"></param>
/// <param name="supplyTemp"></param>
public void SetInputOutput(Electricity electricityIn, Air airIn, double[] heatingGenerated, double[] supplyTemp,
public void SetInputOutput(Electricity electricityIn, Air airIn, double[] heatingGenerated, double[] supplyTemp,
bool pessimisticCOP = false,
double pi1 = 13.39, double pi2 = -0.047, double pi3 = 1.109, double pi4 = 0.012)
{
int horizon = heatingGenerated.Length;
Expand All @@ -209,28 +214,40 @@ public void SetInputOutput(Electricity electricityIn, Air airIn, double[] heatin
var elecPrice = new double[horizon];
var elecEmissionsFactor = new double[horizon];
var airTemp = new double[horizon];
var supTemp = new double[horizon];

if (horizon == Misc.MonthsPerYear)
{
elecPrice = Misc.GetAverageMonthlyValue(electricityIn.SpecificCost);
elecEmissionsFactor = Misc.GetAverageMonthlyValue(electricityIn.SpecificEmissions);
airTemp = airIn.TemperatureMonthly;
supTemp = Misc.GetAverageMonthlyValue(supplyTemp); // supplyTemp should always be 8760
}
else
{
elecPrice = electricityIn.SpecificCost;
elecEmissionsFactor = electricityIn.SpecificEmissions;
airTemp = airIn.Temperature;
supplyTemp.CopyTo(supTemp,0);
}

for (int t = 0; t < horizon; t++)
{
double COP = pi1 * Math.Exp(pi2 * ((supplyTemp[t] + Misc.Kelvin) - (airTemp[t] + Misc.Kelvin))) + pi3 * Math.Exp(pi4 * ((supplyTemp[t] + Misc.Kelvin) - (airTemp[t] + Misc.Kelvin)));
base.COP[t] = COP;
elecConsumed[t] = heatingGenerated[t] / COP;
double COPAshouri = pi1 * Math.Exp(pi2 * ((supTemp[t] + Misc.Kelvin) - (airTemp[t] + Misc.Kelvin))) + pi3 * Math.Exp(pi4 * ((supTemp[t] + Misc.Kelvin) - (airTemp[t] + Misc.Kelvin)));
base.COP[t] = COPAshouri;
if (pessimisticCOP)
{
double COPSimple = CopSimple(supTemp[t], airTemp[t]);
base.COP[t] = Math.Min(base.COP[t], COPSimple); // always taking the worse COP. The Simple COP calculation leads to extremely high COPs in summer, whereas Ashouri's model doesn't result in COPs < 3.
}

elecConsumed[t] = heatingGenerated[t] / COP[t];
if (elecConsumed[t] < 0.0) elecConsumed[t] = 0.0;
}




Electricity electricityConsumedCarrier = new Electricity(horizon, elecConsumed, elecPrice, elecEmissionsFactor, electricityIn.PrimaryEnergyFactor);
base.InputCarrier = electricityConsumedCarrier;

Expand Down
11 changes: 9 additions & 2 deletions src/Hive.IO/Hive.IO/GhMergers/GhHeatPump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ protected override void RegisterInputParams(GH_Component.GH_InputParamManager pM
pManager.AddNumberParameter("Heating Generated", "heatGenerated", "Generated heating energy time series (kWh). Either annual hourly( 8760), or monthly (12) time series.", GH_ParamAccess.list);
pManager.AddNumberParameter("Supply Temperature", "suppTemp", "Supply temperature time series of the heated water at the ASHP outlet. Used to calculate COP (Coefficient of Performance) of the ASHP.", GH_ParamAccess.list);
pManager.AddBooleanParameter("SimpleMode?", "simpleMode?", "Compute simple efficiency? If 'False', Eqt. (8c) from Ashouri et al (2013) is used (10.1016/j.energy.2013.06.053).", GH_ParamAccess.item, true);
pManager.AddBooleanParameter("PessimisticCOP?", "PessimisticCOP?",
"If simplemode=false, with this boolean you can decide to take the min COP between the simple and the Ashouri COP calculation. \n " +
"Ashouri's COP seems sometimes very high, with COP in Zurich not going below 3, while the simple equation leads to extremely high COP at high ambient temperatires.",
GH_ParamAccess.item, false);

pManager.AddGenericParameter("Hive Air Source Heat Pump", "ASHP", "Hive Air Source Heat Pump (ASHP) (<Hive.IO.EnergySystems.AirSourceHeatPump>) that will be infused with information from above inputs.", GH_ParamAccess.item);
}
Expand Down Expand Up @@ -67,14 +71,17 @@ protected override void SolveInstance(IGH_DataAccess DA)
bool simple = true;
DA.GetData(4, ref simple);

bool pessimisticCop = false;
DA.GetData(5, ref pessimisticCop);

AirSourceHeatPump ashp = null;
DA.GetData(5, ref ashp);
DA.GetData(6, ref ashp);


if (simple)
ashp.SetInputOutputSimple(electricity, air, energyGenerated.ToArray(), supplyTemp.ToArray());
else
ashp.SetInputOutput(electricity, air, energyGenerated.ToArray(), supplyTemp.ToArray());
ashp.SetInputOutput(electricity, air, energyGenerated.ToArray(), supplyTemp.ToArray(), pessimisticCop);

DA.SetData(0, ashp);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Hive.IO/Hive.IO/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.14.1")]
[assembly: AssemblyInformationalVersion("1.15.0")]

0 comments on commit 7a6ed23

Please sign in to comment.