Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #106

Merged
merged 5 commits into from
Nov 7, 2023
Merged

Dev #106

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Ironbug_OutputParams : Ironbug_Component, IGH_VariableParameterComp

public Ironbug_OutputParams()
: base("IB_OutputParams", "OutputParams",
"Description",
"Use this component to list all EnergyPlus output variables of a connected downstream HVAC component, and set selected variables to true to request the EnergyPlus to collect data during the simulation.",
"Ironbug", "00:Ironbug")
{
}
Expand All @@ -31,7 +31,7 @@ protected override void RegisterInputParams(GH_Component.GH_InputParamManager pM

protected override void RegisterOutputParams(GH_Component.GH_OutputParamManager pManager)
{
pManager.AddGenericParameter("OutputVariables", "vars", "TODO...", GH_ParamAccess.item);
pManager.AddGenericParameter("OutputVariables", "vars", "Add EnergyPlus output variables to HVAC component's parameter inputs.", GH_ParamAccess.item);
}

protected override void SolveInstance(IGH_DataAccess DA)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ protected override void RegisterInputParams(GH_InputParamManager pManager)
pManager[2].Optional = true;
pManager.AddGenericParameter("SupplementalHeatingCoil", "spCoilH_", "SupplementalHeatingCoil. By default, no supplemental heating coil is included.", GH_ParamAccess.item);
pManager[3].Optional = true;
pManager.AddGenericParameter("ControllingZone", "ctrlZone_", "The controlling zone for thermostat location", GH_ParamAccess.item);
pManager.AddGenericParameter("ControllingZone", "ctrlZone_", "The controlling zone for thermostat location. It is required to set a valid when the unitary system is used within an air loop. When this unitary system is added as a zone equipment, the default zone is used for the controlling zone if it is unset.", GH_ParamAccess.item);
pManager[4].Optional = true;

}
Expand Down
16 changes: 8 additions & 8 deletions src/Ironbug.Grasshopper/Component/Ironbug/Ironbug_ThermalZone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ protected override void SolveInstance(IGH_DataAccess DA)
var zones = this.CreateZones(HBZones, airTerminals, sizing);


var zoneEquipsGoo = new List<GH_Goo<object>>();
var zoneEquipsGoo = new List<IIB_ZoneEquipment>();
DA.GetDataList(2, zoneEquipsGoo);

var zoneEquipObj = zoneEquipsGoo.Select(_ => _.Value);
var zoneEquipmentGroups = zoneEquipObj.Where(_ => _ is IB_ZoneEquipmentGroup).Select(_=>_ as IB_ZoneEquipmentGroup);
var zoneEquipments = zoneEquipObj.Where(_ => _ is IB_ZoneEquipment).Select(_ => _ as IB_ZoneEquipment);
var eqpGps = zoneEquipsGoo.GroupBy(_ => _ is IB_ZoneEquipmentGroup);


if (zoneEquipmentGroups.Any())
var zoneEquipments = eqpGps.FirstOrDefault(_ => _.Key == false)?.OfType<IIB_ZoneEquipment>();
var zoneEquipmentGroups = eqpGps.FirstOrDefault(_=>_.Key == true)?.OfType<IB_ZoneEquipmentGroup>();

if (zoneEquipmentGroups != null && zoneEquipmentGroups.Any())
{
this.AddZoneEquipmentGroups(zones, zoneEquipmentGroups.ToList());
}
else if (zoneEquipments.Any())
else if (zoneEquipments != null && zoneEquipments.Any())
{
this.AddZoneEquipments(zones, zoneEquipments.ToList());
}
Expand Down Expand Up @@ -176,7 +176,7 @@ private void AddZoneEquipmentGroups(List<IB_ThermalZone> Zones, List<IB_ZoneEqu
}

}
private void AddZoneEquipments(List<IB_ThermalZone> Zones, List<IB_ZoneEquipment> ZoneEquipments)
private void AddZoneEquipments(List<IB_ThermalZone> Zones, List<IIB_ZoneEquipment> ZoneEquipments)
{
var OSZones = Zones;
var zEquips = ZoneEquipments;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class Ironbug_SetpointManagerSingleZoneHeating : Ironbug_HVACWithParamCom

private static HVAC.IB_SetpointManagerSingleZoneHeating_FieldSet _fieldSet = HVAC.IB_SetpointManagerSingleZoneHeating_FieldSet.Value;
public Ironbug_SetpointManagerSingleZoneHeating()
: base("IB_SetpointManagerSingleZoneHeating", "SPM_SZCooling",
: base("IB_SetpointManagerSingleZoneHeating", "SPM_SZHeating",
"Description",
"Ironbug", "05:SetpointManager & AvailabilityManager",
typeof(HVAC.IB_SetpointManagerSingleZoneHeating_FieldSet))
Expand Down
9 changes: 9 additions & 0 deletions src/Ironbug.HVAC/LoopObjs/IB_ThermalZone.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,15 @@ public ThermalZone ToOS_NoAirLoop(Model model)
{
var eqp = (ZoneHVACComponent)item.ToOS(model);
eqp.addToThermalZone(newZone);

if (eqp is AirLoopHVACUnitarySystem usys)
{
if (usys.controllingZoneorThermostatLocation().isNull())
{
usys.setControllingZoneorThermostatLocation(newZone);
}

}
}

return newZone;
Expand Down
46 changes: 45 additions & 1 deletion src/Ironbug.HVAC/ZoneEquipments/IB_ZoneEquipmentGroup.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
using Ironbug.HVAC.BaseClass;
using OpenStudio;
using System.Collections.Generic;

namespace Ironbug.HVAC
{
public class IB_ZoneEquipmentGroup
public class IB_ZoneEquipmentGroup: IIB_ZoneEquipment
{
public List<IB_ZoneEquipment> ZoneEquipments { get; private set; }

public IB_FieldArgumentSet CustomAttributes => throw new System.NotImplementedException();

public IB_ZoneEquipmentGroup()
{
this.ZoneEquipments = new List<IB_ZoneEquipment>();
Expand All @@ -26,5 +29,46 @@ public override string ToString()
{
return $"Zone Equipment Group with {this.ZoneEquipments.Count} obj(s) inside";
}


public HVACComponent ToOS(Model model)
{
throw new System.NotImplementedException();
}

public bool AddToNode(Node node)
{
throw new System.NotImplementedException();
}

public IB_ModelObject Duplicate()
{
throw new System.NotImplementedException();
}

public string GetTrackingID()
{
throw new System.NotImplementedException();
}

public bool IsInModel(Model model)
{
throw new System.NotImplementedException();
}

public void SetFieldValue(IB_Field dataField, object value)
{
throw new System.NotImplementedException();
}

public void SetFieldValues(Dictionary<IB_Field, object> DataFields)
{
throw new System.NotImplementedException();
}

public string SetTrackingID(string id = null)
{
throw new System.NotImplementedException();
}
}
}
Loading