NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
496 stars 190 forks source link

ISO Model translator incorrectly translates model #903

Open macumber opened 10 years ago

macumber commented 10 years ago

Get's bad parameters, some examples: buildingOccupancyFrom = 7 buildingOccupancyTo = -1 equivFullLoadOccupancyFrom = 0 equivFullLoadOccupancyTo = 1 buildingAirLeakage = 5.84734e-282 dhwDistributionSystem = 5.84734e-282 heatGainPerPerson = -1.#IND

macumber commented 10 years ago

Problem file is at:

https://github.com/NREL/OpenStudio-files/blob/master/Git%20Issue%20Files/Issue%20903.osm

@muehleisen

muehleisen commented 10 years ago

I’ll take a look when I can. I’m home sick today and not at full speed.

Ralph

Ralph T Muehleisen, Tel:630-252-2547, Cel: 708-655-9954, email: rmuehleisen@anl.govmailto:rmuehleisen@anl.gov

From: Dan Macumber [mailto:notifications@github.com] Sent: Tuesday, March 11, 2014 12:02 PM To: NREL/OpenStudio Cc: Muehleisen, Ralph T. Subject: Re: [OpenStudio] ISO Model translator incorrectly translates model (#903)

Problem file is at:

https://github.com/NREL/OpenStudio-files/blob/master/Git%20Issue%20Files/Issue%20903.osm

@muehleisenhttps://github.com/muehleisen

— Reply to this email directly or view it on GitHubhttps://github.com/NREL/OpenStudio/issues/903#issuecomment-37320727.

jmarrec commented 3 years ago

There are zero space types in the model...

https://github.com/NREL/OpenStudio/blob/7cec475621233fcd772de2c6715ef9252bcbb7a6/src/isomodel/ForwardTranslator.cpp#L629-L708

space_area_total is therefore zero.

And here you have a division by zero

https://github.com/NREL/OpenStudio/blob/7cec475621233fcd772de2c6715ef9252bcbb7a6/src/isomodel/ForwardTranslator.cpp#L691

Process 31776 stopped
* thread #1, name = 'openstudio', stop reason = step over
    frame #0: 0x000055555bc4310b openstudio`openstudio::isomodel::ForwardTranslator::translateModel(this=0x0000555567dd1640, t_model=0x0000555566d99930) at ForwardTranslator.cpp:692:59
   689        for (size_t day = 0; day <= 6; ++day) {
   690          for (size_t hour = 0; hour <= 23; ++hour) {
   691            occupancy_schedules_ave[day][hour] = occupancy_schedules_ave[day][hour] / space_area_total;
-> 692            occ_frac_sum[day] += occupancy_schedules_ave[day][hour];
   693          }
   694  
   695          if (occ_frac_sum[day] > threshold) {
(lldb) p occupancy_schedules_ave[day][hour]
(__gnu_cxx::__alloc_traits<std::allocator<double> >::value_type) $4 = NaN

I'm not sure what the intent was. Perhaps use something similar to this openstudio-standards method, except we only care about start/end and don't need to return a schedule.

https://github.com/NREL/openstudio-standards/blob/33a152d027558f7efdd9201a06e838cdd9a4a546/lib/openstudio-standards/standards/Standards.ThermalZone.rb#L212-L551

jmarrec commented 3 years ago

https://github.com/NREL/openstudio-standards/blob/33a152d027558f7efdd9201a06e838cdd9a4a546/lib/openstudio-standards/standards/Standards.Model.rb#L4676

  def model_infer_hours_of_operation_building(model, fraction_of_daily_occ_range: 0.25, invert_res: true, gen_occ_profile: false)