Liana Wong

RoofHarvest

image
image
image

Overview (ReadMe):

RoofHarvest is a Generative Design optimization tool built in Dynamo that automatically generates, evaluates, and ranks rooftop layouts for mixed-use green roofs. It divides a building's roof into zones for PV panels, urban crops, and miscellaneous (labeled as “Other”) while meeting environmental and structural performance criteria. The tool calculates energy yield, food production, water retention, irrigation demand, and cost—all in real-time for design exploration. Below are the steps for using the tool. Before starting, ensure that you have your Revit model open, and the Dynamo script loaded with the correct packages. Packages and custom nodes necessary to run the tool (2units_LianaWong_Module9.dyn) include:

  • LunchBox for Dynamo
  • PanelNormals.AllPointOutward.dyf

Adjustable Inputs for Generative Design Study (all marked as Is Input)

These are directly used as inputs in the GD study and will vary across design options:

Form Dimensions (L-Shape)

  • Length_A – length of main rectangle
  • Width_A – width of main rectangle
  • Length_B – length of second rectangle
  • Width_B – width of second rectangle

Irrigation

  • Irrigation Type Index – selects between Drip (0), Spray (1), Manual (2)

Constant (But Adjustable) Inputs

These are typically fixed within a study, but can be changed before the study to simulate different climates, configurations, or priorities.

Sun Position and Solar Logic

  • Sun X, Sun Y, Sun Z – Cartesian coordinates of sun for directionality calculation
  • Boost – directionality multiplier to enhance solar value variation

Zone Allocation Cost ($/m²)

  • Cost per m² for Crop
  • Cost per m² for PV Panel
  • Cost per m² for Access

PV and Solar Constants

  • Solar Radiation (kWh/m²/day) – typically 4.5
  • PV Efficiency (%) – e.g., 0.17 (17%)

Crop Yield Constants

  • Crop Growth Rate (kg/m²/month)
  • Water Usage Rate (L/m²/day)

Stormwater Retention

  • Rainfall Depth (m) – average rainfall (converted from mm/month)
  • Retention Coefficient – e.g., 0.85

Thresholds and Limits

  • Min Panel Allocation (%) – minimum PV area required (fixed constraint)
  • Max Roof Area (m²) – structural/area constraint

Output Metrics for Generative Design (All marked as Is Output)

These are evaluated for every solution generated:

Performance Metrics

  • Crop Yield (kg/month)
  • PV Energy Output (kWh/year)
  • Stormwater Retained (L)
  • Irrigation Demand (L/day)
  • Total Cost ($)

Constraints (Pass/Fail Flags)

  • Check if under 3600 m² – ensures roof area is within limit
  • Check if min allocation passed – checks if PV area meets minimum
  • Check if structurally safe – based on max loading from zones

How-to-use

Step 1: Set range for dimensions to construct L-shaped building footprint

image

Note that all adjustable inputs that directly feed into the Generative Design study are in orange-colored groups. The minimum and maximum range on the number sliders may be adjusted accordingly for the following dimensions that construct the two rectangles that make up the L-shaped footprint:

  • Length_A
  • Width_A
  • Length_B
  • Width_B

The following node logic will construct the top and base profiles, which will be lofted into a solid.

Step 2: Extract roof surface, panelize the roof, and calculate total roof area

image

The roof surface (of each rectangle) are extracted and the total surface area is calculated. Using Panel.PanelQuad, a UV grid is created to panelize the roof surface for each rectangle.

Step 3: Calculate solar values based on directionality between sun position and each panel

image

The original intention was to use Solar Analysis to calculate the solar values over a start and end datetime, however upon reviewing this with the teaching team, Solar Analysis was not used as it would not function properly. Instead, a “psuedo solar analysis” was ran using directionality logic, where the directionality of each panel’s centerpoint with respect to a reference point (called the “sun”) was calculated.

To achieve this, each panel’s centroid and surface normal vector were computed using Surface.PointAtParameter and Surface.NormalAtParameter. These normals were then compared against a user-defined sun vector, which was generated from sliders representing the sun’s XYZ position. Note that this is fixed within a single study.

The vector from each panel center to the sun was calculated and normalized, and then a dot product was taken between this vector and the panel’s normal. This yielded a scalar value representing the angular alignment between the panel and the sun—higher values indicate stronger alignment and thus higher potential solar gain.

These raw directionality values were remapped to a 0–1 scale and used to color the panels by solar performance. An energy output estimate was also calculated for each panel using the formula:

energy = (directionality × boost) × solarRadiation × panelArea × pvEfficiency

In the formula, the boost term is a user-defined multiplier used to artificially amplify variation in directionality scores based on the distance between the panel centerpoint and the sun, ensuring clearer differentiation in panel performance when directionality values alone are too subtle or close together. This approximation enabled each panel’s solar contribution to be evaluated without relying on the Solar Analysis package, supporting further decisions such as photovoltaic (PV) zone allocation and optimization in the generative design study.

Step 4: Categorize panel zones by threshold values and extract total panel areas for each zone

image

Each panel is categorized as either “Panel”, “Crop”, or “Other” based on its zone label, which is based on its solar value with respect to low and high threshold levels. These classifications are used to assign different evaluation logic and color. The total surface area of each zone is then calculated and logical filtering is based on zone tags.

Step 5: Set constant values for PV panel allocation and Irrigation Type.

image

Note that in the Generative Design study, the irrigation type will be considered as an input, where an index is used to obtain the irrigation efficiency for the Irrigation Demand metric. While a slider is available for setting the minimum required percent area allocated to panels, this value is constant in the Generative Design study. All other constant parameters necessary for computing the evaluation metrics are defined in the other code blocks.

Step 6: Compute all evaluation metrics and run Generative Design Study

image

All results from these metrics are listed as “is Output” in the Generative Design study. Note that for constraints, Boolean logic was used to represent “pass/fail” (1/0) checks. The Generative Design study is set up as follows:

image
image

Example results are as follows:

image
image

When exported to an Excel sheet, I highlighted the best and worst-case values for each independent output, allowing me to identify which relationships were directly or inversely proportional to each other. On the right-hand side, there are some examples of parallel graphs of certain outputs prioritized. For example, if we were to prioritize getting the maximum solar energy output, notice how tradeoff with crop yield is of a larger difference than if we were to prioritize maximum crop yield. In this particular case, prioritizing a higher crop yield would perhaps be more beneficial as it also has a much lower total roof cost. Overall, the most optimal design depends on the outputs that the designer wants to prioritize in to achieve a certain outcome (i.e. sustainability vs cost-effective).

Demo Video: