Skip to content

Commit

Permalink
feat(HeatPumpPlantLoopEIRHeating): add new plant side heat pumps
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed Oct 27, 2023
1 parent f037b95 commit d92670b
Show file tree
Hide file tree
Showing 10 changed files with 294 additions and 2 deletions.
Binary file not shown.
Binary file added doc/HVAC_GHTemplates/03_Other/GSHP.gh
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using Grasshopper.Kernel;
using Ironbug.HVAC;

namespace Ironbug.Grasshopper.Component
{
public class Ironbug_HeatPumpPlantLoopEIRCooling : Ironbug_HVACWithParamComponent
{
public Ironbug_HeatPumpPlantLoopEIRCooling()
: base("IB_HeatPumpPlantLoopEIRCooling", "ClnHP",
"Description",
"Ironbug", "02:LoopComponents",
typeof(HVAC.IB_HeatPumpPlantLoopEIRCooling_FieldSet))
{
}

public override GH_Exposure Exposure => GH_Exposure.quarternary | GH_Exposure.obscure;

protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddGenericParameter("CompanionHeatingHeatPump", "CompanionHtnHP", "CompanionHeatingHeatPump", GH_ParamAccess.item);
pManager[0].Optional = true;
}

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("HeatPumpPlantLoopEIRCooling", "ClnHP", "Connect to chilled water loop's supply side.", GH_ParamAccess.item);
pManager[pManager.AddGenericParameter("HeatPumpPlantLoopEIRCooling_ToCondenser", "ToCondenser", "Connect to condenser loop's demand side.", GH_ParamAccess.item)].DataMapping = GH_DataMapping.Graft;
}


protected override void SolveInstance(IGH_DataAccess DA)
{
IB_HeatPumpPlantLoopEIRHeating hp = null;
var obj = new HVAC.IB_HeatPumpPlantLoopEIRCooling();
if (DA.GetData(0, ref hp) && hp != null)
{
obj.SetCompanionHeatingHeatPump(hp);
}

this.SetObjParamsTo(obj);
var objs = this.SetObjDupParamsTo(obj);
DA.SetDataList(0, objs);
DA.SetDataList(1, objs);

}

protected override System.Drawing.Bitmap Icon => Properties.Resources.HeatPumpW2W_Cooling;

public override Guid ComponentGuid => new Guid("C75B7FF9-CD54-49A5-BBB7-228C64605DE4");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using Grasshopper.Kernel;
using Ironbug.HVAC;

namespace Ironbug.Grasshopper.Component
{
public class Ironbug_HeatPumpPlantLoopEIRCooling_Air : Ironbug_HVACWithParamComponent
{
public Ironbug_HeatPumpPlantLoopEIRCooling_Air()
: base("IB_HeatPumpPlantLoopEIRCooling_AirCooled", "ClnHP_AirCooled",
"Description",
"Ironbug", "02:LoopComponents",
typeof(HVAC.IB_HeatPumpPlantLoopEIRCooling_FieldSet))
{
}

public override GH_Exposure Exposure => GH_Exposure.quarternary | GH_Exposure.obscure;

protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddGenericParameter("CompanionHeatingHeatPump", "CompanionHtnHP", "CompanionHeatingHeatPump", GH_ParamAccess.item);
pManager[0].Optional = true;
}

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("HeatPumpPlantLoopEIRCooling", "ClnHP", "Connect to hot water loop's supply side.", GH_ParamAccess.item);
}


protected override void SolveInstance(IGH_DataAccess DA)
{
IB_HeatPumpPlantLoopEIRHeating hp = null;
var obj = new HVAC.IB_HeatPumpPlantLoopEIRCooling();
if (DA.GetData(0, ref hp) && hp != null)
{
obj.SetCompanionHeatingHeatPump(hp);
}

this.SetObjParamsTo(obj);
var objs = this.SetObjDupParamsTo(obj);
DA.SetDataList(0, objs);

}

protected override System.Drawing.Bitmap Icon => Properties.Resources.HeatPumpW2W_Cooling;

public override Guid ComponentGuid => new Guid("6A3C8716-5602-4D69-B515-F148B097A6FA");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System;
using Grasshopper.Kernel;
using Ironbug.HVAC;

namespace Ironbug.Grasshopper.Component
{
public class Ironbug_HeatPumpPlantLoopEIRHeating : Ironbug_HVACWithParamComponent
{
public Ironbug_HeatPumpPlantLoopEIRHeating()
: base("IB_HeatPumpPlantLoopEIRHeating", "HtnHP",
"Description",
"Ironbug", "02:LoopComponents",
typeof(HVAC.IB_HeatPumpPlantLoopEIRHeating_FieldSet))
{
}

public override GH_Exposure Exposure => GH_Exposure.quarternary | GH_Exposure.obscure;

protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddGenericParameter("CompanionCoolingHeatPump", "CompanionClnHP", "CompanionCoolingHeatPump", GH_ParamAccess.item);
pManager[0].Optional = true;
}

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("HeatPumpPlantLoopEIRHeating", "HtnHP", "Connect to hot water loop's supply side.", GH_ParamAccess.item);
pManager[pManager.AddGenericParameter("HeatPumpPlantLoopEIRHeating_ToCondenser", "ToCondenser", "Connect to condenser loop's demand side.", GH_ParamAccess.item)].DataMapping = GH_DataMapping.Graft;
}


protected override void SolveInstance(IGH_DataAccess DA)
{
IB_HeatPumpPlantLoopEIRCooling hp = null;
var obj = new HVAC.IB_HeatPumpPlantLoopEIRHeating();
if (DA.GetData(0, ref hp) && hp != null)
{
obj.SetCompanionCoolingHeatPump(hp);
}

this.SetObjParamsTo(obj);
var objs = this.SetObjDupParamsTo(obj);
DA.SetDataList(0, objs);
DA.SetDataList(1, objs);

}

protected override System.Drawing.Bitmap Icon => Properties.Resources.HeatPumpW2W_Heating;

public override Guid ComponentGuid => new Guid("19D26BF9-93BE-4939-9D6F-049A6B5222E7");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
using System;
using Grasshopper.Kernel;
using Ironbug.HVAC;

namespace Ironbug.Grasshopper.Component
{
public class Ironbug_HeatPumpPlantLoopEIRHeating_Air : Ironbug_HVACWithParamComponent
{
public Ironbug_HeatPumpPlantLoopEIRHeating_Air()
: base("IB_HeatPumpPlantLoopEIRHeating_AirCooled", "HtnHP_AirCooled",
"Description",
"Ironbug", "02:LoopComponents",
typeof(HVAC.IB_HeatPumpPlantLoopEIRHeating_FieldSet))
{
}

public override GH_Exposure Exposure => GH_Exposure.quarternary;

protected override void RegisterInputParams(GH_Component.GH_InputParamManager pManager)
{
pManager.AddGenericParameter("CompanionCoolingHeatPump", "CompanionClnHP", "CompanionCoolingHeatPump", GH_ParamAccess.item);
pManager[0].Optional = true;
}

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("HeatPumpPlantLoopEIRHeating_AirCooled", "HtnHP", "Connect to chilled water loop's supply side.", GH_ParamAccess.item);
}


protected override void SolveInstance(IGH_DataAccess DA)
{
IB_HeatPumpPlantLoopEIRCooling hp = null;
var obj = new HVAC.IB_HeatPumpPlantLoopEIRHeating();
if (DA.GetData(0, ref hp) && hp != null)
{
obj.SetCompanionCoolingHeatPump(hp);
}

this.SetObjParamsTo(obj);
var objs = this.SetObjDupParamsTo(obj);
DA.SetDataList(0, objs);

}

protected override System.Drawing.Bitmap Icon => Properties.Resources.HeatPumpW2W_Heating;

public override Guid ComponentGuid => new Guid("35363E35-0D83-4439-A9D2-F7B00543DE8C");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ protected override void RegisterInputParams(GH_Component.GH_InputParamManager pM
{
pManager.AddGenericParameter("HeatingCoil", "coil_", "Heating coil to provide reheat source. can be CoilHeatingWater, CoilHeatingElectirc, or CoilHeatingGas.", GH_ParamAccess.item);
pManager[0].Optional = true;
pManager.AddGenericParameter("Fan", "fan_", "Can be FanConstantVolume or FanVariableVolume.", GH_ParamAccess.item);
pManager.AddGenericParameter("Fan", "fan_", "FanConstantVolume.", GH_ParamAccess.item);
pManager[1].Optional = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ protected override void RegisterInputParams(GH_Component.GH_InputParamManager pM
{
pManager.AddGenericParameter("HeatingCoil", "coil_", "Heating coil to provide reheat source. can be CoilHeatingWater, CoilHeatingElectirc, or CoilHeatingGas.", GH_ParamAccess.item);
pManager[0].Optional = true;
pManager.AddGenericParameter("Fan", "fan_", "Can be FanConstantVolume or FanVariableVolume.", GH_ParamAccess.item);
pManager.AddGenericParameter("Fan", "fan_", "FanConstantVolume.", GH_ParamAccess.item);
pManager[1].Optional = true;
}

Expand Down
44 changes: 44 additions & 0 deletions src/Ironbug.HVAC/LoopObjs/IB_HeatPumpPlantLoopEIRCooling.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using Ironbug.HVAC.BaseClass;
using OpenStudio;

namespace Ironbug.HVAC
{

public class IB_HeatPumpPlantLoopEIRCooling : IB_HVACObject, IIB_PlantLoopObjects, IIB_DualLoopObj
{
protected override Func<IB_ModelObject> IB_InitSelf => () => new IB_HeatPumpPlantLoopEIRCooling();

private static HeatPumpPlantLoopEIRCooling NewDefaultOpsObj(Model model) => new HeatPumpPlantLoopEIRCooling(model);

private IB_HeatPumpPlantLoopEIRHeating _heatingHP => this.GetChild<IB_HeatPumpPlantLoopEIRHeating>(0);

public IB_HeatPumpPlantLoopEIRCooling() : base(NewDefaultOpsObj(new Model()))
{
}

public void SetCompanionHeatingHeatPump(IB_HeatPumpPlantLoopEIRHeating heatingHP)
{
this.SetChild(heatingHP);
}

public override HVACComponent ToOS(Model model)
{
var obj = base.OnNewOpsObj(NewDefaultOpsObj, model);
if (_heatingHP != null)
{
var hp = _heatingHP?.ToOS(model) as HeatPumpPlantLoopEIRHeating;
obj.setCompanionHeatingHeatPump(hp);
}
return obj;
}
}

public sealed class IB_HeatPumpPlantLoopEIRCooling_FieldSet
: IB_FieldSet<IB_HeatPumpPlantLoopEIRCooling_FieldSet, HeatPumpPlantLoopEIRCooling>
{

private IB_HeatPumpPlantLoopEIRCooling_FieldSet() { }

}
}
44 changes: 44 additions & 0 deletions src/Ironbug.HVAC/LoopObjs/IB_HeatPumpPlantLoopEIRHeating.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using System;
using Ironbug.HVAC.BaseClass;
using OpenStudio;

namespace Ironbug.HVAC
{
public class IB_HeatPumpPlantLoopEIRHeating : IB_HVACObject, IIB_PlantLoopObjects, IIB_DualLoopObj
{
protected override Func<IB_ModelObject> IB_InitSelf => () => new IB_HeatPumpPlantLoopEIRHeating();

private static HeatPumpPlantLoopEIRHeating NewDefaultOpsObj(Model model) => new HeatPumpPlantLoopEIRHeating(model);

private IB_HeatPumpPlantLoopEIRCooling _coolingHP => this.GetChild<IB_HeatPumpPlantLoopEIRCooling>(0);

public IB_HeatPumpPlantLoopEIRHeating() : base(NewDefaultOpsObj(new Model()))
{
}

public void SetCompanionCoolingHeatPump(IB_HeatPumpPlantLoopEIRCooling heatingHP)
{
this.SetChild(heatingHP);
}

public override HVACComponent ToOS(Model model)
{
var obj = base.OnNewOpsObj(NewDefaultOpsObj, model);
if (_coolingHP != null)
{
var hp = _coolingHP?.ToOS(model) as HeatPumpPlantLoopEIRCooling;
obj.setCompanionCoolingHeatPump(hp);
}

return obj;
}
}

public sealed class IB_HeatPumpPlantLoopEIRHeating_FieldSet
: IB_FieldSet<IB_HeatPumpPlantLoopEIRHeating_FieldSet, HeatPumpPlantLoopEIRHeating>
{

private IB_HeatPumpPlantLoopEIRHeating_FieldSet() { }

}
}

0 comments on commit d92670b

Please sign in to comment.