Skip to content

Commit

Permalink
fix(4PipeFanCoil): support electic heating coil
Browse files Browse the repository at this point in the history
  • Loading branch information
MingboPeng committed Oct 6, 2022
1 parent 4591097 commit 7dd003a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public Ironbug_ZoneHVACFourPipeFanCoil()

protected override void RegisterInputParams(GH_InputParamManager pManager)
{
pManager.AddGenericParameter("HeatingCoil", "coilH_", "Heating coil to provide heating source. Must be CoilHeatingWater.", GH_ParamAccess.item);
pManager.AddGenericParameter("HeatingCoil", "coilH_", "Heating coil to provide heating source. Can be CoilHeatingWater or CoilHeatingElectric.", GH_ParamAccess.item);
pManager[0].Optional = true;
pManager.AddGenericParameter("CoolingCoil", "coilC_", "Cooling coil to provide cooling source. Must be CoilHeatingWater.", GH_ParamAccess.item);
pManager[1].Optional = true;
Expand All @@ -39,7 +39,7 @@ protected override void SolveInstance(IGH_DataAccess DA)


var fan = (IB_Fan)null;
var coilH = (IB_CoilHeatingWater)null;
var coilH = (IB_CoilHeatingBasic)null;
var coilC = (IB_CoilCoolingWater)null;

if (DA.GetData(0, ref coilH))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ private static ZoneHVACFourPipeFanCoil NewDefaultOpsObj(Model model)
=> new ZoneHVACFourPipeFanCoil(model, model.alwaysOnDiscreteSchedule(), new FanConstantVolume(model), new CoilCoolingWater(model), new CoilHeatingWater(model));

private IB_CoilCoolingWater CoolingCoil => this.GetChild<IB_CoilCoolingWater>();
private IB_CoilHeatingWater HeatingCoil => this.GetChild<IB_CoilHeatingWater>();
private IB_CoilHeatingBasic HeatingCoil => this.GetChild<IB_CoilHeatingBasic>();
private IB_Fan Fan => this.GetChild<IB_Fan>();

public IB_ZoneHVACFourPipeFanCoil() : base(NewDefaultOpsObj(new Model()))
Expand All @@ -27,7 +27,7 @@ public void SetFan(IB_Fan Fan)
this.SetChild(Fan);
}

public void SetHeatingCoil(IB_CoilHeatingWater Coil)
public void SetHeatingCoil(IB_CoilHeatingBasic Coil)
{
this.SetChild(Coil);
}
Expand Down
17 changes: 17 additions & 0 deletions src/Ironbug.HVAC_Tests/00_DummyTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,23 @@ public void DummyTest_OS_Coil_Heating_WaterFields()
Assert.True(true);
}

[Test]
public void DummyTest_FourPipeFanCoil()
{
var model = new OpenStudio.Model();
var zone = new ThermalZone(model);

var elecC = new CoilHeatingElectric(model);
var f = new ZoneHVACFourPipeFanCoil(model, model.alwaysOnDiscreteSchedule(), new FanConstantVolume(model), new CoilCoolingWater(model), elecC);
f.addToThermalZone(zone);

var hc = f.heatingCoil().OSType();
Assert.True(hc == "OS:Coil:Heating:Electric");
model.Save( System.IO.Path.Combine(System.IO.Path.GetTempPath(), "test.osm"));


}

[Test]
public void IB_TypeTest()
{
Expand Down

0 comments on commit 7dd003a

Please sign in to comment.