Skip to content

Commit

Permalink
Merge pull request #643 from architecture-building-systems/516-variab…
Browse files Browse the repository at this point in the history
…le-tau

516 variable tau
  • Loading branch information
christophwaibel authored Aug 8, 2021
2 parents 239c44c + 86729ed commit 857c479
Show file tree
Hide file tree
Showing 28 changed files with 1,777 additions and 1,032 deletions.
Binary file modified GrasshopperExamples/LectureExercises/EaCS3_E04_Hive_Template.gh
Binary file not shown.
Binary file modified GrasshopperExamples/Testing/Hive_Demand_Hourly.gh
Binary file not shown.
Binary file modified GrasshopperExamples/Testing/Hive_Form_Building_Test.gh
Binary file not shown.
Binary file modified setup/Setup_Hive.exe
Binary file not shown.
4 changes: 2 additions & 2 deletions src/Hive.Core/build-all.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ REM use honey-badger to build all the Hive.Core components and install them to L

REM set up some environment variables to make this easier
REM (this assumes the IronPython installation folder and also the path to honey-badger.py)
SET IPY=C:\Program Files\IronPython 2.7\ipy.exe
SET HB=%USERPROFILE%\Documents\GitHub\honey-badger\honey-badger.py
SET IPY=%PROGRAMFILES%\IronPython 2.7.8\ipy.exe
SET HB=%USERPROFILE%\Documents\_ETH\2_Jobs\_Hive\honey-badger\honey-badger.py

"%IPY%" "%HB%" -i epw_reader\Hive.Core.epw_reader.json
"%IPY%" "%HB%" -i sia380\Hive.Core.sia380.json
Expand Down
1 change: 1 addition & 0 deletions src/Hive.Core/sia380/Hive.Core.sia380.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
{"type": "float", "name": "G value with sunscreen", "nick-name": "gValueTotal", "description": "G value total including sunscreen ('Sonnenschutz') of windows", "access": "item"},
{"type": "float", "name": "Setpoint sunscreen", "nick-name": "SetpointSunscreen", "description": "Shading setpoint for activating sunscreen of windows, in W/m^2", "access": "item"},
{"type": "boolean", "name": "Run obstructed solar simulation?", "nick-name": "RunObstructed?", "description": "Boolean to indicate if an obstructed solar simulation is conducted. True if yes.", "access": "item"},
{"type": "boolean", "name": "Run hourly?", "nick-name": "RunHourly?", "description": "Boolean to indicate if to run monthly or hourly simulations. True if hourly.", "access": "item"},
{"type": "boolean", "name": "Use adaptive comfort?", "nick-name": "UseAdaptiveComfort?", "description": "Boolean to indicate if adaptive comfort should be used instead of fixed setpoints. True if yes. Defaults to yes if setpoints_ub and setpoints_lb are null.", "access": "item"},
{"type": "boolean", "name": "Use natural ventilation?", "nick-name": "UseNaturalVentilation?", "description": "Boolean to indicate if natural ventilation should be considered (True) or not (False).", "access": "item"}
],
Expand Down
180 changes: 115 additions & 65 deletions src/Hive.Core/sia380/sia380.py

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/Hive.IO/Hive.IO/Building/Building.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System;
using System.Linq;

namespace Hive.IO.Building
{
Expand Down Expand Up @@ -111,3 +112,4 @@ public enum BuildingType
Undefined
}
}

28 changes: 9 additions & 19 deletions src/Hive.IO/Hive.IO/Building/Components.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public abstract class Component
/// Flag for external, i.e. access to solar radiation and ambient environment
/// </summary>
[JsonProperty]
public bool IsExternal { get; private set; }
public bool IsExternal { get; internal set; }
/// <summary>
/// Total Cost in [Currency]
/// </summary>
Expand Down Expand Up @@ -134,7 +134,8 @@ public virtual void ApplySia2024Construction(Sia2024Record siaRoom)

OpaqueConstruction opaqueConstruction = new OpaqueConstruction("SIA2024_Opaque")
{
UValue = siaRoom.UValueOpaque
UValue = siaRoom.UValueOpaque,
Capacitance = siaRoom.CapacitancePerFloorArea
};
this.SpecificCo2 = siaRoom.OpaqueEmissions;
this.SpecificCost = siaRoom.OpaqueCost;
Expand Down Expand Up @@ -194,7 +195,8 @@ public override void ApplySia2024Construction(Sia2024Record siaRoom)

OpaqueConstruction opaqueConstruction = new OpaqueConstruction("SIA2024_Opaque")
{
UValue = siaRoom.UValueWalls
UValue = siaRoom.UValueWalls,
Capacitance = siaRoom.CapacityWalls
};
this.SpecificCo2 = siaRoom.EmissionsWalls;
this.SpecificCost = siaRoom.CostWalls;
Expand Down Expand Up @@ -222,7 +224,8 @@ public override void ApplySia2024Construction(Sia2024Record siaRoom)

OpaqueConstruction opaqueConstruction = new OpaqueConstruction("SIA2024_Opaque")
{
UValue = siaRoom.UValueRoofs
UValue = siaRoom.UValueRoofs,
Capacitance = siaRoom.CapacityRoofs
};
this.SpecificCo2 = siaRoom.EmissionsRoofs;
this.SpecificCost = siaRoom.CostRoofs;
Expand All @@ -232,20 +235,6 @@ public override void ApplySia2024Construction(Sia2024Record siaRoom)
}


/// <summary>
/// Ceiling, i.e. internal surface
/// </summary>
[JsonObject(MemberSerialization.OptIn)]
public class Ceiling : Component
{
public Ceiling(rg.BrepFace surfaceGeometry) : base(surfaceGeometry)
{

}
[JsonConstructor]
protected Ceiling() { }
}


/// <summary>
/// Floor, i.e. internal surface
Expand All @@ -265,7 +254,8 @@ public override void ApplySia2024Construction(Sia2024Record siaRoom)

OpaqueConstruction opaqueConstruction = new OpaqueConstruction("SIA2024_Opaque")
{
UValue = siaRoom.UValueFloors
UValue = siaRoom.UValueFloors,
Capacitance = siaRoom.CapacityFloors
};
this.SpecificCo2 = siaRoom.EmissionsFloors;
this.SpecificCost = siaRoom.CostFloors;
Expand Down
97 changes: 49 additions & 48 deletions src/Hive.IO/Hive.IO/Building/Construction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,63 @@

namespace Hive.IO.Building
{

public abstract class Construction
{
/// <summary>
/// Name of construction element, e.g. 'concrete30mm'
/// </summary>
public string Name { get; internal set; }
/// <summary>
/// Layers of various materials, e.g. 'concrete', 'insulation', 'render'. From outside to inside
/// </summary>
public Material [] Layers { get; set; }
/// <summary>
/// Thickness of each material layer in [mm]
/// </summary>
public double [] Thickness { get; set; }
public abstract class Construction
{
/// <summary>
/// Name of construction element, e.g. 'concrete30mm'
/// </summary>
public string Name { get; internal set; }
/// <summary>
/// Layers of various materials, e.g. 'concrete', 'insulation', 'render'. From outside to inside
/// </summary>
public Material[] Layers { get; set; }
/// <summary>
/// Thickness of each material layer in [mm]
/// </summary>
public double[] Thickness { get; set; }


#region High level physical properties
/// <summary>
/// U-Value of this component
/// </summary>
public double UValue { get; set; }
/// <summary>
/// Absorptivity
/// </summary>
public double Absorbtivity { get; set; }
/// <summary>
/// Reflectivity
/// </summary>
public double Reflectivity { get; set; }
/// <summary>
/// Transmissivity
/// </summary>
public double Transmissivity { get; set; }
#endregion
}
#region High level physical properties
/// <summary>
/// U-Value of this component
/// </summary>
public double UValue { get; set; }
/// <summary>
/// Absorptivity
/// </summary>
public double Absorbtivity { get; set; }
/// <summary>
/// Reflectivity
/// </summary>
public double Reflectivity { get; set; }
/// <summary>
/// Transmissivity
/// </summary>
public double Transmissivity { get; set; }

/// <summary>
/// Opaque construction element
/// Transmissivity
/// </summary>
public class OpaqueConstruction : Construction
{
public OpaqueConstruction(string name)
{
this.Name = name;
}
public double Capacitance { get; set; }
#endregion
}


/// <summary>
/// Opaque construction element
/// </summary>
public class OpaqueConstruction : Construction
{
public OpaqueConstruction(string name)
{
this.Name = name;
}
}

public class TransparentConstruction : Construction
public class TransparentConstruction : Construction
{
public TransparentConstruction(string name)
{
public TransparentConstruction(string name)
{
this.Name = name;
}
this.Name = name;
}

}
}
14 changes: 14 additions & 0 deletions src/Hive.IO/Hive.IO/Building/ConstructionAssembly.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace Hive.IO.Building
{
/// <summary>
/// Assembly of different constructions to represent a zone or room. Only construction / material properties, geometry information should be stored per Zone.
/// </summary>
public abstract class ConstructionAssembly
{
internal string Name { get; set; }
internal OpaqueConstruction WallsConstruction { get; set; }
internal OpaqueConstruction FloorsConstruction { get; set; }
internal OpaqueConstruction RoofsConstruction { get; set; }
internal TransparentConstruction WindowsConstruction { get; set; }
}
}
39 changes: 38 additions & 1 deletion src/Hive.IO/Hive.IO/Building/Sia2024Record.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ public class Sia2024RecordEx : Sia2024Record
{
public string BuildingUseType;
public string Quality;
public string Construction;

public string WallsConstruction;
public string FloorsConstruction;
public string RoofsConstruction;


public Sia2024RecordEx()
{
Expand All @@ -26,9 +32,11 @@ public Sia2024RecordEx(Sia2024Record room)
{
Quality = "<Custom>";
BuildingUseType = "<Custom>";
Construction = "<Custom>";

RoomType = room.RoomType;
RoomConstant = room.RoomConstant;
CapacitancePerFloorArea = room.CapacitancePerFloorArea;
CoolingSetpoint = room.CoolingSetpoint;
HeatingSetpoint = room.HeatingSetpoint;
CoolingSetback = room.CoolingSetback;
Expand Down Expand Up @@ -101,6 +109,7 @@ public class Sia2024Record
public double OpaqueCost; // Kosten opake Bauteile
public double OpaqueEmissions; // Emissionen opake Bauteile
public double RoomConstant; // Zeitkonstante
public double CapacitancePerFloorArea; // Waermespeicherfaehigkeit des Raumes
public string RoomType; // description, e.g. "1.1 Wohnen Mehrfamilienhaus"
public double TransparentCost; // Kosten transparente Bauteile
public double TransparentEmissions; // Emissionen transparente Bauteile
Expand All @@ -114,14 +123,17 @@ public class Sia2024Record

// as per #466, allow Sia2024Record to have separate values for walls, floors, roofs. Fall back to the Opaque values
private double? _uValueFloors = null;
private double? _capacityFloors = null;
private double? _costFloors = null;
private double? _emissionsFloors = null;

private double? _uValueRoofs = null;
private double? _capacityRoofs = null;
private double? _costRoofs = null;
private double? _emissionsRoofs = null;

private double? _uValueWalls = null;
private double? _capacityWalls = null;
private double? _costWalls = null;
private double? _emissionsWalls = null;

Expand All @@ -130,6 +142,11 @@ public double UValueFloors
get => _uValueFloors ?? UValueOpaque;
set => _uValueFloors = value;
}
public double CapacityFloors
{
get => _capacityFloors ?? CapacitancePerFloorArea;
set => _capacityFloors = value;
}

public double CostFloors
{
Expand All @@ -148,6 +165,11 @@ public double UValueRoofs
get => _uValueRoofs ?? UValueOpaque;
set => _uValueRoofs = value;
}
public double CapacityRoofs
{
get => _capacityRoofs ?? CapacitancePerFloorArea;
set => _capacityRoofs = value;
}

public double CostRoofs
{
Expand All @@ -167,6 +189,12 @@ public double UValueWalls
set => _uValueWalls = value;
}

public double CapacityWalls
{
get => _capacityWalls ?? CapacitancePerFloorArea;
set => _capacityWalls = value;
}

public double CostWalls
{
get => _costWalls ?? OpaqueCost;
Expand All @@ -189,6 +217,7 @@ public string ToJson()
{
{"description", RoomType},
{"Zeitkonstante", RoomConstant},
{"Waermespeicherfaehigkeit des Raumes", CapacitancePerFloorArea},
{"Raumlufttemperatur Auslegung Kuehlung (Sommer)", CoolingSetpoint},
{"Raumlufttemperatur Auslegung Heizen (Winter)", HeatingSetpoint},
{"Raumlufttemperatur Auslegung Kuehlung (Sommer) - Absenktemperatur", CoolingSetback},
Expand Down Expand Up @@ -218,7 +247,10 @@ public string ToJson()

{"U-Wert Boeden", UValueFloors },
{"U-Wert Daecher", UValueRoofs },
{"U-Wert Walls", UValueWalls },
{"U-Wert Waende", UValueWalls },
{"Waermespeicherfaehigkeit Boeden", CapacityFloors },
{"Waermespeicherfaehigkeit Daecher", CapacityRoofs },
{"Waermespeicherfaehigkeit Waende", CapacityWalls },
{"Kosten Boeden", CostFloors},
{"Kosten Daecher", CostRoofs },
{"Kosten Waende", CostWalls },
Expand All @@ -242,6 +274,7 @@ public static Sia2024Record FromJson(string json)
{
RoomType = d["description"] as string,
RoomConstant = (double) d["Zeitkonstante"],
CapacitancePerFloorArea = (double)d["Waermespeicherfaehigkeit des Raumes"],
CoolingSetpoint = (double) d["Raumlufttemperatur Auslegung Kuehlung (Sommer)"],
HeatingSetpoint = (double) d["Raumlufttemperatur Auslegung Heizen (Winter)"],
CoolingSetback = (double)d["Raumlufttemperatur Auslegung Kuehlung (Sommer) - Absenktemperatur"],
Expand Down Expand Up @@ -273,6 +306,10 @@ public static Sia2024Record FromJson(string json)
_uValueRoofs = readValueOrNull("U-Wert Daecher"),
_uValueWalls = readValueOrNull("U-Wert Waende"),

_capacityFloors = readValueOrNull("Waermespeicherfaehigkeit Boeden"),
_capacityRoofs = readValueOrNull("Waermespeicherfaehigkeit Daecher"),
_capacityWalls = readValueOrNull("Waermespeicherfaehigkeit Waende"),

_costFloors = readValueOrNull("Kosten Boeden"),
_costRoofs = readValueOrNull("Kosten Daecher"),
_costWalls = readValueOrNull("Kosten Waende"),
Expand Down
Loading

0 comments on commit 857c479

Please sign in to comment.