Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

andrea.botti's profile - activity

2021-04-18 13:57:28 -0500 received badge  Popular Question (source)
2017-09-29 04:20:30 -0500 commented answer Severe errors when "migrating" jeplus job from energyplus 8.5 to 8.7

@Chandan Sharma thanks, that solved it. I am now encountering issues with custom EMS code calculating comfort metrics, w

2017-09-29 04:04:54 -0500 marked best answer Severe errors when "migrating" jeplus job from energyplus 8.5 to 8.7

Hello, upon upgrading energyplus from 8.5 to 8.7 and running a jeplus project, I received the following error.

   ** Severe  ** ZoneCapacitanceMultiplier:ResearchSpecial="1.0" invalid Zone or ZoneList Name="1.0" not found.
   ** Severe  ** GetStagedDualSetpoint: Errors with invalid names in ZoneControl:Thermostat:StagedDualSetpoint objects.
   **   ~~~   ** ...These will not be read in.  Other errors may occur.
   **  Fatal  ** Errors getting Zone Control input data.  Preceding condition(s) cause termination.

I never crerated Zone="1" and not sure whether ZoneCapacitanceMultiplier is a feature of version 8.7. Any advice?

2017-09-27 12:22:18 -0500 asked a question Severe errors when "migrating" jeplus job from energyplus 8.5 to 8.7

Severe errors when "migrating" jeplus job from energyplus 8.5 to 8.7 Hello, upon upgrading energyplus from 8.5 to 8.7 an

2017-03-21 11:08:26 -0500 asked a question E+ code for CIBSE TM52 comfort assessment

Hello, I am trying to integrate CIBSE TM52 adaptive criteria.

My idf files are generated through a combination of jeplus parameters and epmacro scripts that collect input from separated idf files. As I cannot copy the whole idf files in a post, I have tried to extract the objects that are relevant for the CIBSE TM52 assessment (done via an EMS program). The schedules referenced by B1_People are all existing (although not copied here).

!- SCHEDULES
Schedule:Compact,
    Always On,               !- Name
    Fraction,                !- Schedule Type Limits Name
    Through: 12/31,          !- Field 1
    For: AllDays,            !- Field 2
    Until: 24:00,            !- Field 3
    1.0;                     !- Field 4

Schedule:Compact,
    Dwell_DomBed_Occ_B1_TM52,       !- Name
    Fraction,                       !- Schedule Type Limits Name
    Through: 12/31,                 !- Field 1
    For: AllDays,                   !- Field 2
    Until: 24:00,                   !- Field 3
    1;                              !- Field 4

!- PEOPLE
People,
    B1_People,                      !- Name
    B1_Zone,                                !- Zone or ZoneList Name
    1_Bd-People 24hr Modified,      !- Number of People Schedule Name
    People,                         !- Number of People Calculation Method
    2,                              !- Number of People
    ,                               !- People per Zone Floor Area
    ,                               !- Zone Floor Area per Person
    0.3,                                !- Fraction Radiant
    AutoCalculate,                  !- Sensible Heat Fraction
    Activity Schedule 78,           !- Activity Level Schedule Name
    3.82e-08,                       !- Carbon Dioxide Generation Rate
    No,                             !- Enable ASHRAE 55 Comfort Warnings
    ZoneAveraged,                   !- Mean Radiant Temperature Calculation Type
    ,                               !- Surface NameAngle Factor List Name
    Work efficiency,                !- Work Efficiency Schedule Name
    ClothingInsulationSchedule,     !- Clothing Insulation Calculation Method
    ,                               !- Clothing Insulation Calculation Method Schedule Name
    ,                               !- Clothing Insulation Schedule Name
    AirVelocitySchedule;            !- Air Velocity Schedule Name

and then:

! EMS SENSORS
EnergyManagementSystem:Sensor,
    Adaptive_Model_Temperature,             !- Name
    B1_People,                          !- Output:Variable or Output:Meter Index Key Name
    Zone Thermal Comfort CEN 15251 Adaptive Model Temperature;  !- Output:Variable or Output:Meter Name 


! EMS ACTUATOR
EnergyManagementSystem:Actuator,
    B1_EMS_Actuator_TM52_OCC,   !- Name
    Dwell_DomBed_Occ_B1_TM52,   !- Actuated Component Unique Name
    Schedule:Constant,          !- Actuated Component Type
    Schedule Value;             !- Actuated Component Control Type

and:

! OUTPUT VARIABLES
Output:Variable,
    B1_People,
    Zone Thermal Comfort CEN 15251 Adaptive Model Temperature,
    daily,
    Always On;

Output:Variable,
    B1_People,
    Zone Thermal Comfort CEN 15251 Adaptive Model Running Average Outdoor Air Temperature,
    runperiod,
    Always On;

Output:Variable,
    B1_People,
    Zone Thermal Comfort CEN 15251 Adaptive Model Running Average Outdoor Air Temperature,
    runperiod,
    Always On;

I receive the following error:

   ** Severe  ** Invalid Output:Variable or Output:Meter Name =ZONE THERMAL COMFORT CEN 15251 ADAPTIVE MODEL RUNNING AVERAGE OUTDOOR AIR TEMPERATURE
   **   ~~~   ** Entered in EnergyManagementSystem:Sensor=RUNNING_AVERAGE_OUTDOOR_AIR_TEMPERATURE
   **   ~~~   ** Output:Variable Name not found
   ** Severe  ** Invalid Output:Variable or Output:Meter Name =ZONE THERMAL COMFORT CEN 15251 ADAPTIVE MODEL TEMPERATURE
   **   ~~~   ** Entered in EnergyManagementSystem:Sensor=ADAPTIVE_MODEL_TEMPERATURE
   **   ~~~   ** Output:Variable Name not found
   ** Severe  ** Invalid Actuated Component Unique Name =DWELL_DOMBED_OCC_B1_TM52
   **   ~~~   ** Entered in EnergyManagementSystem:Actuator=B1_EMS_ACTUATOR_TM52_OCC
   **   ~~~   ** Component Unique key name not found 
   **   ~~~   ** Use Output:EnergyManagementSystem object to create .edd file for valid component names.
   ** Severe  ** Invalid Actuated Component Control Type =SCHEDULE VALUE
   **   ~~~   ** Entered in EnergyManagementSystem:Actuator=B1_EMS_ACTUATOR_TM52_OCC
   **   ~~~   ** Control Type not found
   **   ~~~   ** Use Output:EnergyManagementSystem object to create .edd file for valid component control types.
   **  Fatal  ** Errors found in processing Energy Management System input. Preceding condition causes termination.

I am struggling to understand why each of those 3 severe errors occur. Thanks, Andrea

2017-03-08 10:05:04 -0500 answered a question Using eppy + jeplus to make selected external surfaces adiabatic

Ok, I may have come to a solution:

import os
from eppy.modeleditor import IDF
import sys
import math
from geomeppy import IDF

def make_adiabatic(c):
        print('converting %s into adiabatic' %c)
        c.Outside_Boundary_Condition = 'Adiabatic'
        c.Sun_Exposure = 'NoSun'
        c.Wind_Exposure = 'NoWind'
        print('done\n')


# path to E+ idd file (required by eppy)
iddfile = os.path.join(sys.argv[4], 'Energy+.idd')
IDF.setiddname(iddfile)

# path to energyplus input file within each simulated folder
idf = os.path.join(sys.argv[2], 'in.idf')

# assigns reads parameter from jeplus
jeplus_floor = str(sys.argv[3])

# read idf file to eppy
idf = IDF(idf)

# Convert horizontal surfaces to adiabatic depending on the value of the jeplus parameter 
floors = idf_New.getsurfaces('Floor')
ceilings = idf_New.getsurfaces('Ceiling')
roofs = idf_New.getsurfaces('Roof')

if jeplus_floor == 'Ground_Floor':
    adiab_ceilings = make_adiabatic((c) for c in ceilings)
    adiab_roofs = make_adiabatic((c) for c in roofs)
elif jeplus_floor == 'Top_Floor':
    adiab_floors = make_adiabatic((c) for c in floors)
else:
    adiab_floors = make_adiabatic((c) for c in floors)
    adiab_ceilings = make_adiabatic((c) for c in ceilings)
    adiab_roofs = make_adiabatic((c) for c in roofs)

I look forward to receive your feedback on this!

2017-03-04 12:30:27 -0500 commented answer Using eppy + jeplus to make selected external surfaces adiabatic

eheheheheh I felt incredibly daft for about half an hour trying to figure out how to run variable attributions in python with ep-macro if statements...and within python for cycles!

2017-03-04 10:42:12 -0500 commented answer Using eppy + jeplus to make selected external surfaces adiabatic

@Jamie Bull thanks very much for your reply! I am trying to figure out how I can make your suggested snippet work, given that # would make eppy ignore the code line.

2017-03-03 10:25:55 -0500 asked a question Using eppy + jeplus to make selected external surfaces adiabatic

Hi, I am setting up parametric simulations for residential buildings to be done with jeplus. For a given plan form (say a single-aspect 1bedroom flat) representing one unit, I am willing to create 2 'branches' in a parameter tree, representing: - 3 scenarios with regards to the location of the 1bed flat in a building, i.e. ground, mid-floor or top-floor. - 2 scenarios with regards to the location of the 1bed flat on a floorplate (middle or end of the floorplate).

In energy-plus terms, this could be done 'manually' in Open Studio, by creating standard external constructions (SU plugin) and setting them to be adiabatic. However, this would result in a high number or IDF file to be fed into jeplus for further parametric sims.

Hence, I would to do this using eppy - amending one IDF file containing baseline external constructions to replace external surfaces to adiabatic depending on the combination of two jeplus parameters (which could be @@layout@@ and @@floor@@). The latter approach is more elegant, but also more complicated to achieve. I wrote some eppy code (https://codeshare.io/2EB8ew), which: - replaces all floors and ceilings with adiabatic surfaces loops through

  • loops through walls to sub-select those which do not host windows (party walls or walls to corridors) - and who may thus be changed to adiabatic.

Could you advise on how this eppy code could be used in conjuction jeplus?

2017-02-18 08:57:21 -0500 received badge  Teacher (source)
2017-02-17 11:10:41 -0500 answered a question Using Eppy to extract fenestration from IDF and replace with WWR-derived formulas

Hello again, I am commenting on this (old) topic as I am having trouble bringing the 2 suggested scripts together, that is:

  • Jamie's script allows to create a new WINDOW object on each surface to replace the corresponding FENESTRATIONSURFACE:DETAILED (to create a vertically-centred strip window),

  • Ivan's script applies WWR to each and every WINDOW object present in an IDF file taken from a @@wwr@@ jeplus parameter (as per jeplus 1.7 example file).

    My question is: how to I bring the two together? In other words, how should I amend Ivan's script to look for FENESTRATIONSURFACE:DETAILED objects, rather that WINDOW objects?

Is it just a matter of replacing the line:

window_objects = idf.idfobjects['Window'.upper()]

with:

window_objects = idf.idfobjects['Fenestration:Detailed'.upper()]

?

2017-01-27 08:56:41 -0500 asked a question Best approach to combine jEplus + EPMacro to ##include sets of blocks of model definitions

Hello there, I am trying to set up a workflow for performing parametric simulations for residential buildings, based on a discrete number of plan forms (aka flat archetypes).

So far (and thanks to the help I received on this forum), I have managed to set up a flow that includes:

  1. building geometry in SU
  2. naming zones and surfaces in OS (through SU plugin + OS stand-alone)
  3. exporting an IDF file (file_os.idf)
  4. use python + eppy to extract objects in classes: zones and buildingsurfaces:detailed from the file_os.idf and copy them into a new idf file
  5. use python + eppy to populate the newly created idf file with data on everything else (schedules, constructions, output, EMS etc.)
  6. save as file_je.imf
  7. open file_je.imfin jeplus and run simulations. The above flow will be repeated for each input (unique plan form)

One of the issues I am encountering is setting up of ##include commands in order to pick classes definitions. Some of these are invariable for the whole 'project' (i.e. VERSION, SIMULATIONCONTROL, RUNPERIOD, SITE:LOCATION etc.) and are embedded into the new idf file using python (using crude text prepending - during step 5). Some others depend on the type of input: for instance if the input corresponds to 10 plan forms, I could have:

  • no2 1B2P (1bedroom, 2 people),
  • no3 2B3P
  • no3 2B4P
  • no2 3B5P.

All these plan forms will have one or more type of rooms (thermal zones) in common but not all of them.

I am envisioning 2 approaches:

  1. Manual approach (safe and tedious): create one subfolder per each type, where the number and name of zones is tailored for each .idf file to be called. This would then mean calling: ##fileprefix mainfolder/subfolder_1B2P, then ##include all relevant classes/objects
  2. Smart approach (more elegant and harder to set up): setting up one subfolder like a project database ( ##fileprefix mainfolder/subfolder_for_all_types) , with all classes/objects (including all possible redundancies) using eppy to iterate through all zones (at step 4) to create a sub-selection list of rooms/thermal zones to pick up, based on a naming structure that will be used to cherry pick from all classes/object those relevant for the particular plan form.

What would you recommend? Thanks

PS Apologies for the long message, I just can't be brief!!

2016-10-11 08:20:10 -0500 commented answer Using Eppy to extract fenestration from IDF and replace with WWR-derived formulas

@Jamie Bull, I have updated the question to include another issue I came across

2016-09-05 16:56:16 -0500 marked best answer Using Eppy to extract fenestration from IDF and replace with WWR-derived formulas

Hello, I am trying to write a piece of Eppy code to:

  1. open an IDF (created with designbuilder or openstudio)
  2. list all windows in the idf file (under FenestrationSurface:Detailed)
  3. extract the Building Surface Name parameter from these windows
  4. create “Window” objects for each surface in the list generated by the previous step
  5. apply fields Construction_Name and Building_Surface_Name to the newly created windows
  6. assign:

    • Starting_X_Coordinate (x0) = host wall's XCOORDINATE (X0) + WWR formula [could it be x0 = (X2-X0)/2*sqrt(WWR) ?]

    • Starting_Z_Coordinate (z0) = host wall's ZCOORDINATE (Z0) + WWR formula

    • window length (x2-x0) = sqrt(WWR)*(X2-X0)

    • window height (z2-z0) = sqrt(WWR)*(Z2-Z0)

There is some guidance on that on the jeplus manual

My code looks show a tentative attempt to create a loop but I could not get far. Can anyone help?

## DELETES FENESTRATION SURFACES AND CREATES WINDOWS WITH SAME HOSTS, SAME MATERIALS AND WWR @@LABEL@@
old_fen = idf1.idfobjects['FENESTRATIONSURFACE:DETAILED']
new_win = idf1.idfobjects['WINDOW']

#for w in new_win:
    #print w.objls      # useful to understand what IDF fields can be called

for w in old_fen:
    #print w.objls
    old_fen_name = w.Name
    new_win1 = idf1.newidfobject('window'.upper())      # the key for the object type has to be in upper case
    new_win1.Construction_Name = w.Construction_Name
    new_win1.Building_Surface_Name = w.Building_Surface_Name
    print new_win1.Building_Surface_Name
    # find "new_win1.Building_Surface_Name" (the surface hosting the window) among surfaces
    # gather XCOORDINATE and ZCOORDINATE of those host surfaces
    # new_win1.Starting_X_Coordinate = XCOORDINATE (host)
    # new_win1.Starting_Z_Coordinate = ZCOORDINATE (host)

EDIT: Combining the script suggested by Jamie Bull:

for f in old_fen:
    base_wall = idf1.getobject('BUILDINGSURFACE:DETAILED', f.Building_Surface_Name)
    w = idf1.newidfobject('WINDOW', f.Name,
        Building_Surface_Name=f.Building_Surface_Name,
        Construction_Name=f.Construction_Name,
        Starting_X_Coordinate=0,
        Length=base_wall.width,
        Starting_Z_Coordinate="#[%s * #[1 - #[@@wwr@@ / 2.0]]]" % base_wall.height,
        Height="#[%s * @@wwr@@]" % base_wall.height,
        )
    idf1.removeidfobject(f)

with another, aimed at replacing a given ceiling height with a jeplus-compatible label @@ch@@, (also suggested by Jamie Bull) :

## PRE-PROCESSING FOR JEPLUS - REPLACES ZCOORDINATE WITH CEILING HEIGHT @@LABEL@@
ceiling_height = '@@ch@@'
walls_and_roofs = [s for s in surfaces if s.Surface_Type in ['Wall', 'Roof']]
for s in surfaces:
    max_z = max(pt[2] for pt in s.coords)
    for field in s.objls:  # or "for field in s.objls:" if using version <= 0.5.2
        if 'ZCOORDINATE' in field.upper() and s[field] == max_z:
            s[field] = ceiling_height

Then the Starting_Z_Coordinate and Height of the parametric windows refer to the original wall heigth - which does not account for the @@ch@@ parameter. This results in windows created with the wwr parameter being too big and going outsite the existing walls. Any idea on how to fix this Jamie? :P

2016-08-19 04:36:36 -0500 commented answer Using Eppy to replace recurring strings in an IDF file

now we have peanut butter everywhere! I love it. Santos, that does indeed answer my question!

2016-08-18 04:10:30 -0500 marked best answer Using Eppy to export IDF objects

I am trying to pre-process an IDF file (exported from DesignBuilder or OpenStudio) to use it with jEPlus. Thanks to the help I received on this forum I have managed to replace selected parameters with jEPlus variables, which is great.

My next step is to 'assemble' an IDF file, by:

  • extracting objects from an IDF files
  • saving them as a separate IDF files (or INP input file) to be subsequently called by EP-macro, within jEPlus.

For instance, I would like to use the geometry built with DesignBuilder - by extracting idf.idfobjects['BUILDINGSURFACE:DETAILED'] - and copy this in a new file where all other objects are called through EP-macro (i.e. schedules, materials, output variables etc).

Also, could these objets be exported in a different format, (i.e. CSV) in order to visualise them? I have tried to use the commands .saveas() and .to_csv in eppy but neither of those seem to work.

2016-08-18 04:09:14 -0500 marked best answer Using Eppy to replace recurring strings in an IDF file

Hello, I am trying to pre-process an IDF file (exported from DesignBuilder or OpenStudio) to use it with jEPlus.

As I am trying to 'assemble' a custom IDF file, using bits and pieces from different sources, I would like to manipulate an IDF, exported from DB, to combine it with objects that have customised names.

For surfaces, I managed to replace each surface name with a simpler name, the latter including the name of the zone, the type of surface and its azimuth.

The code:

s_names_azm = [(sf.Name, sf.azimuth) for sf in surfaces]
for name, azimuth in s_names_azm[:5]:
    print '\n', name, azimuth
    name = name.split(':',1)[1]
    name = name.split('_',2)[0] + '_' + name.split('_',2)[1] + '_' + str(azimuth)
    print name

returns:

Block1:B1_GroundFloor_0_0_0 0.0
B1_GroundFloor_0.0

Block1:B1_Roof_1_0_0 0.0
B1_Roof_0.0

Block1:B1_Partition_2_0_0 90.0
B1_Partition_90.0

Block2:LR_Partition_4_0_10000 270.0
LR_Partition_270.0

Block1:B1_Wall_3_0_0 0.0
B1_Wall_0.0

which is what I wanted.

However, you all know that names are always cross referenced in a IDF file, thus what I am after is really a script capable of running a find and replace function throughout the IDF file.

Is there a way to run the string.replace(old_name, new_name) for an entire IDF file? My aim is that every string 'Block*:' is replaced with '' (so effectively deleted).

Thanks, Andrea

EDIT: The code:

surfaces = idf1.idfobjects['BUILDINGSURFACE:DETAILED']
s_names_azm = [(sf.Name, sf.azimuth) for sf in surfaces]
for name, azimuth in s_names_azm:
    name = name.split(':',1)[1]
    name = name.split('_',2)[0] + '_' + name.split('_',2)[1] + '_' + str(azimuth)

does achieve the renaming I am after (where the input happens before Jamie Bull's substitution function).

However it does not seem to modify any object in the idf file (even though a saveas command is included at the end of the script). Why??