Saturday, December 11, 2010

ARCH 653 Final Project

1.      INTRODUCTION

The Revit model for the Gallery Building with PV on the roof has been developed at the previous project, project 1. At the project 2, I added PV parametric model in the program using the Revit API (Application Programming Interface) so that the PV can track the sun path by the time changes.

Figure 1. Exterior view of the project building with PV on the roof

      ·         The goal of the project:
To create the sun tracking PV parametric model using the Revit API by entering three parameters into the pop-up dialog: month, day, and hour.

·         The objective of the project:
-          To create a CSVdatabase includes PV angles by the parameters: ith day of year (from month, and day), and hour.
-          To create the Revit API program to get PV angles from the CSV database.


2.      PROCESS

2.1.Install the ‘Revit 2011 SDK’ to use Add-In (External Tools) function of the Revit.

2.2.Modify ‘UserDefinedParameterReadWrite V4’ files provided from the ARCH 653 class using MS Visual C# program to create the PV parametric model.

2.2.1.      Assign the parameters
2.2.2.      Create pop-up dialog windows to enter the parameters


 Figure 2. Pop-up dialog windows for entering the parameters

      2.2.3.      Calculate the PV angle by the time changes in College Station, Texas, and create the CSV database.


Figure 3. The CSV database calculated PV angles by month, day, and hour
        
      2.2.4.      Link the CSV database to the Revit API.

      2.2.5.      Find the PV angle user entered and extract the PV angle from the CSV database.

2.3.Bring the modified ‘UserDefinedParameterReadWrite V4’ files from the Revit. User can enter the time (month, day, and hour) into the pop-up dialogs, and PV angle on the roof will be changed to face the sun.


3.      RESULTS

3.1.Open the project file.


Figure 4. The project building with the PV on the roof

3.2.Open the parametric model: External Tools in Add-In panel can bring the modified parametric file into the Revit program. Then, pop-up dialog appears after another.

3.2.1.      Select month


Figure 5. Select month from the pop-up dialog

3.2.2.      Select day

Figure 6. Select day from the pop-up dialog
3.2.3.      Select hour


Figure 7. Select day from the pop-up dialog

3.2.4.      PV angle extracted from the CSV database pop up


Figure 8. PV angle extracted from the CSV database

3.2.5.      The PV angle on the roof changes


Figure 9. The PV angle on the roof changes


 4.      ADDITIONAL RESULTS

Figure 10. May 5 (a) 10:00, (b) 12:00, (c) 14:00, (d) 16:00


5.      ADDITIONAL INFORMATION: C# source code

·         Default values for the variables (newday, newhour, pvelevation, newmonth, and newtotalday) are defined as below.  The values will be changed when user select the value through the pop-up dialogs.

public static int newday = 20;
                public static string newhour = "13";
                public static double pvelevation = 50;
                public static int newmonth = 1;
                public static int newtotalday = 30;


·         PV id (30679) in the Revid is defined as below. The id can be obtained from the Revit model by selecting the PV and selecing IDs of Selection, Manage panel.

#region Assigning variables
                ElementId id;
                id = new ElementId(30679);
                 FamilyInstance pv = doc.get_Element(id) as FamilyInstance;


·         Three pop-up dialogs will appear after another when user starts the Revit API. When user selects the month, day, and hour from the dialogs, user can get message box.

#region Get user input from a pop up dialog window
                Form4 form4 = new UserDefinedParameterReadWrite.CS.Form4();
                form4.ShowDialog();
                MessageBox.Show("Month = " + newmonth);
                Form2 form2 = new UserDefinedParameterReadWrite.CS.Form2();
                form2.ShowDialog();
                MessageBox.Show("Day = " + newday);
                Form3 form3 = new UserDefinedParameterReadWrite.CS.Form3();
                form3.ShowDialog();
                MessageBox.Show("Hour = " + newhour);


·         Since the CSV database includes only ith day of year and hour, I need to use IF statement to calculate ith day of year from the month, and day. The logic used here is same as the one used for the project 1 parametric model. The selected PV angle will be shown by the message box after calculating the ith day of year, and extracting the PV angle from the CSV databse.

#region Demonstration function of reading data from Csv
                 if (newmonth == 1)
                  {
                                 newtotalday = newday - 1;
                 }
                 else if (newmonth == 2)
                 {
                                 newtotalday = 31 + newday - 1;
                }
                else if (newmonth == 3)
                {
                                                newtotalday = 59 + newday - 1;
                 }
                else if (newmonth == 4)
                {
                                                newtotalday = 90 + newday - 1;
                }
                else if (newmonth == 5)
                {
                                                newtotalday = 120 + newday - 1;
                }
                else if (newmonth == 6)
                {
                                                newtotalday = 151 + newday - 1;
                }
                else if (newmonth == 7)
                {
                                                newtotalday = 181 + newday - 1;
                }
                else if (newmonth == 8)
                {
                                                newtotalday = 212 + newday - 1;
                }
                else if (newmonth == 9)
                {
                                                newtotalday = 243 + newday - 1;
                }
                else if (newmonth == 10)
                {
                                                newtotalday = 273 + newday - 1;
                }
                else if (newmonth == 11)
                {
                                                newtotalday = 304 + newday - 1;
                }
                else if (newmonth == 12)
                {
                                                newtotalday = 334 + newday - 1;
                }

                double pvelevation = CsvDB(newtotalday, newhour);
                MessageBox.Show("PV Angle is: " + pvelevation + " degree");

                #endregion

Tuesday, November 9, 2010

ARCH 653 Project 1

Project Building

Gallary Building

 

Parametric Modeling Description


Topic of parametric modeling

1)     PVs which trace the sun path  (changing PVs’ declination)
2)      PVs’ supports which change the length according to the PVs’ facing direction

Input parameters for the parametric modeling

There are two input parameters:
1)      Location of building: Latitude, and longitude (Location of the building)
For example, for College Station, “30.628”, and “96.334” need to be put for latitude and longitude respectively.
2)      Local time: Month, Day, Time, and Minute (Time for PVs’ facing direction)
For example, “7”, “20”, “13”, and “30”  need to be put for Month, Day, Time, and Minute respectively to calculate the PVs’ facing direction which will be shown by the model.

 Diagram for the parametric modeling

1.      Diagram for PVs (PV Elevation)


 

 

Formulas used for the parametric modeling

 

Formulas for PVs

[Step0] Inputs four parameters
  1. Latitude
  2. Longitude
  3. Month/Day
  4. Hour/Minute
[Step1] Calculate “Local time” to “Solar time”
  1. Calculate “ ith Day”:
N= if(Month = 1, Day, if(Month = 2, Day + 31, if(Month = 3, Day + 59, if(Month = 4, Day + 90, if(Month = 5, Day + 120, if(Month = 6, Day + 151, if(Month = 7, Day + 181, if(Month = 8, Day + 212, if(Month = 9, Day + 243, if(Month = 10, Day + 273, if(Month = 11, Day + 304, Day + 334)))))))))))
  1. Calculate “B” (and 2B):
B= (ith Day - 1) * 360 / 365
  1. Calculate “E”:
E= 229.2° * (0.000075 + 0.001868 * cos(B) - 0.032077 * sin(B) - 0.014615 * cos(2B) - 0.04089 * sin(2B))
  1. Calculate “Declination” (δ):
Declination= 23.45° * sin(360° * (284 + ith Day) / 365)
  1. Calculate “Solar Time” (Solar Time Hour, an Solar Time Minute)
Solar Time Hour= Hour
Solar Time Minute= Minute + (4 * (90 - Longitude No) + E No + Hour)
Solar Time= (Solar Time Hour) + (Solar Time Minute * 0.01)
[Step2] Calculate “PV Elevation”
  1. Calculate “Hour Angle” (ω):
Hour Angle = (Solar Time - 12) * 15°
  1. Calculate “PV Elevation”:
PV Elevation= 90° - (asin((cos(Latitude) * cos(Declination) * cos(Hour Angle)) + (sin(Latitude) * sin(Declination))))

Formulas for PVs’ supporters

[Step1] Calculate “Supporter Height”
1.      Calculate “Supporter Height”
Supporter Height=10’*tan(PV Elevation)

 

Screenshots of the parametric modeling


Figure 4 Screenshot 1 (July 20 10:30 at College Station)