[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EnergyPlus_Support] Re: Post processing on number of hours when room air temperature was more than 25[C]





Dear Waseem,

Jeramiah and Jean already gave you a good way to get what you want. I was recently involved in a study between De Montfort University, Salford University and ENSIMS which faced the same issue; how to calculate number of overheating hours (in addition to other overheating criteria outputs such as CEN15251) during occupied period from. I needed a code which can be applied to a large number of simulations and I decided to try to do it in EMS. You can see the piece of code which worked for me.

Regards,

Ivan

Dr Ivan Korolija
IESD, De Montfort University, Leicester, UK


! EMS code to calculate overheating hours
! EP Macro command to set threshold temperature (you can place it at the top of the imf file)
##set1 OHTempBed 25

! Get the operative temperature from the E+ output variables (This can be dry-bulb temperature too))
  EnergyManagementSystem:Sensor,
    BedOpTemp,      !- Name
    Bedroom,                !- Output:Variable or Output:Meter Index Key Name
    Zone Operative Temperature;  !- Output:Variable or Output:Meter Name

! Get the occupancy schedule value to use as a reference when the room is occupied
  EnergyManagementSystem:Sensor,
    BedOcc, !- Name
    Occupancy_Bedroom Sch,           !- Output:Variable or Output:Meter Index Key Name
    Schedule Value;  !- Output:Variable or Output:Meter Name
! EMS programm
  EnergyManagementSystem:ProgramCallingManager,
    Overheating,  !- Name
    EndOfZoneTimestepBeforeZoneReporting,  !- EnergyPlus Model Calling Point
    OverheatingProg;     !- Program Name 1
! If zone is occupied and temperature is above threshold, count for overheating hours
  EnergyManagementSystem:Program,
    OverheatingProg,     !- Name
IF BedOcc > 0 && BedOpTemp > OHTempBed[],
SET BedOH = ZoneTimeStep, ! ZoneTimeStep is built in variable which is fraction of hour specified elswhere in the model (default value is 4 which is equal to 0.25 overheating hours)
ELSE,
SET BedOH = 0,
ENDIF;
  EnergyManagementSystem:GlobalVariable,
    BedOH;
  EnergyManagementSystem:OutputVariable,
    Bedroom Zones Overheating While Occupied,  !- Name
    BedOH,         !- EMS Variable Name
    Summed,                  !- Type of Data in Variable
    ZoneTimestep;            !- Update Frequency

  Output:Variable,*,Bedroom Zones Overheating While Occupied,Annual;



On Thursday, December 4, 2014 6:52 AM, "Jeremiah Crossett jcrossett@xxxxxxxxxxxxxxx [EnergyPlus_Support]" <EnergyPlus_Support@xxxxxxxxxxxxxxx> wrote:


 
Yes, 

What I do is generate an SQlite file, then setup your sql queries and use them with a python script in jE+ to process the queried data. 

 Below is an example script that I use in my projects, and you can find out more about using jE+ with SQlite here: http://www.jeplus.org/wiki/doku.php?id=docs:videos:3_sqlite



{

"notes" : "Some notes about this RVX",

"rvis" : [ 
"fileName" : "null.rvi",
"tableName" : "SimResults"
}
],
"sqls" : [
"tableName" : "TotalEnergy",
"columnHeaders" : "Total Energy [kWh]",
"sqlcommand" : "SELECT Value FROM TabularDataWithStrings WHERE (ReportName= 'AnnualBuildingUtilityPerformanceSummary' AND TableName='Site and Source Energy' AND RowName= 'Total Site Energy' AND ColumnName= 'Total Energy')"
},
"tableName" : "IdealHeatingEnergy",
"columnHeaders" : "Ideal Heating Energy [kWh]",
"sqlcommand" : "SELECT Value FROM TabularDataWithStrings WHERE (ReportName= 'AnnualBuildingUtilityPerformanceSummary' AND TableName ='End Uses' AND RowName ='Heating' AND ColumnName = 'District Heating')"
},
"tableName" : "IdealCoolingEnergy",
"columnHeaders" : "Ideal Cooling Energy [kWh]",
"sqlcommand" : "SELECT Value FROM TabularDataWithStrings WHERE (ReportName= 'AnnualBuildingUtilityPerformanceSummary' AND TableName ='End Uses' AND RowName ='Cooling' AND ColumnName = 'District Cooling')"
},
"tableName" : "TotalCoolingLoad",
"columnHeaders" : "Calculated Design Cooling Load [W]",
"sqlcommand" : "SELECT SUM(DesLoad) FROM ZoneSizes WHERE LoadType='Cooling'"
},
"tableName" : "TotalHeatingLoad",
"columnHeaders" : "Calculated Design Heating Load [W]",
"sqlcommand" : "SELECT SUM(DesLoad) FROM ZoneSizes WHERE LoadType='Heating'"
},
"tableName" : "AdaptiveComfortReport",
"columnHeaders" : "Time Outside ASHRAE55 80% Acceptability Limits []",
"sqlcommand" : "SELECT SUM (Value) FROM TabularDataWithStrings WHERE (ReportName= 'AdaptiveComfortReport' AND TableName ='People Summary' AND ColumnName= 'ASHRAE55 80% Acceptability Limits')"
},
"tableName" : "ConsCost",
"columnHeaders" : "Construction Cost [$]",
"sqlcommand" : "Select Value from TabularDataWithStrings WHERE (RowName ='Line Item SubTotal' AND ColumnName = 'SubTotal ~~$~~')"
}
],
"userVars" : [
{
"identifier" : "v1",
"formula" : "c1",
"caption" : "Heating Energy Demand [kWh]",
"report" : true
},
{
"identifier" : "v2",
"formula" : "c2",
"caption" : "Cooling Energy Demand [kWh]",
"report" : true
},
{
"identifier" : "v3",
"formula" : "c1*0.60",
"caption" : "Heating Energy [kWh]",
"report" : true
},
{
"identifier" : "v4",
"formula" : "c2*0.76",
"caption" : "Cooling Energy [kWh]",
"report" : true
}
],
"constraints" : [
{
"identifier" : "s1",
"formula" : "v1/1000",
"caption" : "This is an example [kW]",
"scaling" : true,
"lb" : 0,
"ub" : 200,
"min" : 0,
"max" : 300,
"weight" : 1.0
}
],

"objectives" : [
{
"identifier" : "t1",
"formula" : "v3+v4",
"caption" : "HVAC Energy [kWh]",
"scaling" : false,
"min" : 0,
"max" : 100000,
"weight" : 1.0
},
{
"identifier" : "t2",
"formula" : "c3/1000",
"caption" : "Cooling Load [kW]",
"scaling" : false,
"min" : 0,
"max" : 100000,
"weight" : 1.0
},
{
"identifier" : "t3",
"formula" : "c4/1000",
"caption" : "Heating Load [kW]",
"scaling" : false,
"min" : 0,
"max" : 100000,
"weight" : 1.0
},
{
"identifier" : "t4",
"formula" : "c5",
"caption" : "Discomfort Hours [hr]",
"scaling" : false,
"min" : 0,
"max" : 100000,
"weight" : 1.0
},
{
"identifier" : "t5",
"formula" : "c6",
"caption" : "Construction Cost [$]",
"scaling" : false,
"min" : 0,
"max" : 100000,
"weight" : 1.0
}
]
}






â??â??
Jeremiah D. Crossett  | Applications Engineer  LEED Green Associate 
â??â??
7411 SW Capitol Highway | Portland, OR 97219 
â??â??
 | Direct 503-688-8951
  




On Wed, Dec 3, 2014 at 10:39 PM, m.waseemahmad@xxxxxxxxxxx [EnergyPlus_Support] <EnergyPlus_Support@xxxxxxxxxxxxxxx> wrote:
 
Hello Jeremiah and Jean,
Thanks for your help. But, this gives results in HTML format? I want something so that I can easily read that data into a computer program where I have to do other things with it. e.g. getting this data and then running some control algorithm based on percentage of people dissatisfied etc.
An Excel output may be easy for me to handle, any ideas?

Thanks

Kindest Regards
Waseem





__._,_.___

Posted by: Ivan Korolija <ivankorolija@xxxxxxxxx>


Primary EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The primary EnergyPlus web site is found at:
http://www.energyplus.gov

The group web site is:
http://groups.yahoo.com/group/EnergyPlus_Support/

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the "search" button.





__,_._,___