openstudio-geb 0.0.3 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 347d9430484e0647ed589317e8c8324f250e08d4d6f95bcd17e3a66fa84237cd
4
- data.tar.gz: bd0f0c3f362792e18e8bddba9dea2c4d2cf8310cf6759fa91b4f50af864d914a
3
+ metadata.gz: 1f5c6ce73d5eeff3672c2dded24ac1b0ee7f3444a622e8504f8fa4fd92fd257a
4
+ data.tar.gz: 4a67b1901225ede4ace75c4b7e1a99efb7af844582d8956cf11ebc4f9a860265
5
5
  SHA512:
6
- metadata.gz: 01a593ed9e93044ee79e09dd8b98d697b7a609def6ba532cd37603e06dfef767b519730e443f946f52cffa2b357a0784dbf9ead1a47f5a00c665b5b61b6f9925
7
- data.tar.gz: c2e3606e8c44287fe02e60caac0e6c57b4d0bdd82aa266d1701d47125bfeae7f869e55f89b0a8c65b88d530e634cc102118b38f6a32afe2e914d89d431d73ddb
6
+ metadata.gz: 907d8d052909600300259a16e78aeab672e89e17fe484ff1af3d3f1943ac24ed0a6fe5a629ab75638c06158e2da9df3682b87535741c8c82b302d60d8f9dcb42
7
+ data.tar.gz: 731d919ced3ef43ab5cc79bd52a6fdf2dbfe8aad71b3ef07a850ab809e96c789588f823462fc68af9031170c1954a0519d36e988ff5ce5034bbfdf6136d7993f
@@ -673,7 +673,7 @@ class AdjustThermostatSetpointsByDegreesForPeakHours < OpenStudio::Measure::Mode
673
673
  elsif vec_time[i]>time_begin && vec_time[i]<=time_end && count==1
674
674
  sch_day.addValue(vec_time[i], vec_value[i])
675
675
  elsif vec_time[i]>time_end && count == 1
676
- sch_day.addValue(time_end, target_temp_si)
676
+ sch_day.addValue(time_end, target_temp_si.value)
677
677
  sch_day.addValue(vec_time[i], vec_value[i])
678
678
  count = 2
679
679
  else
@@ -49,7 +49,7 @@ class AddChilledWaterStorageTank < OpenStudio::Measure::ModelMeasure
49
49
  loop_choices << loop.name.to_s
50
50
  end
51
51
  end
52
-
52
+ loop_choices << ""
53
53
  # Make choice argument for primary loop selection
54
54
  selected_primary_loop_name = OpenStudio::Measure::OSArgument.makeChoiceArgument('selected_primary_loop_name', loop_choices, false)
55
55
  selected_primary_loop_name.setDisplayName('Select Primary Loop:')
@@ -62,6 +62,7 @@ class AddChilledWaterStorageTank < OpenStudio::Measure::ModelMeasure
62
62
  selected_primary_loop_name.setDefaultValue(pri_loop_name)
63
63
  else
64
64
  selected_primary_loop_name.setDescription('Error: No Cooling Loop Found')
65
+ selected_primary_loop_name.setDefaultValue("")
65
66
  end
66
67
  args << selected_primary_loop_name
67
68
 
@@ -188,7 +189,9 @@ class AddChilledWaterStorageTank < OpenStudio::Measure::ModelMeasure
188
189
  # assign the user inputs to variables
189
190
  objective = runner.getStringArgumentValue('objective', user_arguments)
190
191
  selected_primary_loop_name = runner.getStringArgumentValue('selected_primary_loop_name', user_arguments)
191
- if selected_primary_loop_name
192
+ # if user_arguments['selected_primary_loop_name'].hasValue
193
+ # selected_primary_loop_name = runner.getStringArgumentValue('selected_primary_loop_name', user_arguments)
194
+ if !selected_primary_loop_name.empty?
192
195
  # get the primary cooling loop
193
196
  selected_primary_loop = model.getModelObjectByName(selected_primary_loop_name)
194
197
  if selected_primary_loop.is_initialized
@@ -533,8 +536,6 @@ class AddChilledWaterStorageTank < OpenStudio::Measure::ModelMeasure
533
536
  sizing_pri_plant.setDesignLoopExitTemperature(primary_loop_sp)
534
537
  sizing_pri_plant.setLoopDesignTemperatureDifference(primary_delta_t)
535
538
 
536
-
537
-
538
539
  # add chilled water tank to the primary loop as demand and secondary loop as supply
539
540
  chw_storage_tank = OpenStudio::Model::ThermalStorageChilledWaterStratified.new(model)
540
541
  tank_temp_sch = OpenStudio::Model::ScheduleRuleset.new(model)
@@ -543,6 +544,16 @@ class AddChilledWaterStorageTank < OpenStudio::Measure::ModelMeasure
543
544
  chw_storage_tank.setSetpointTemperatureSchedule(tank_temp_sch)
544
545
  sec_loop.addSupplyBranchForComponent(chw_storage_tank)
545
546
  selected_primary_loop.addDemandBranchForComponent(chw_storage_tank)
547
+
548
+ # create discharging and charging schedule and apply to chilled water tank and primary loop
549
+ discharge_sch = create_sch(model, 'Chilled water tank discharge schedule', discharge_start, discharge_end, thermal_storage_season, wknds)
550
+ charge_sch = create_sch(model, 'Chilled water tank charge schedule', charge_start, charge_end, thermal_storage_season, wknds)
551
+ chw_storage_tank.setUseSideAvailabilitySchedule(discharge_sch)
552
+ chw_storage_tank.setSourceSideAvailabilitySchedule(charge_sch)
553
+ avm_sch = OpenStudio::Model::AvailabilityManagerScheduled.new(model)
554
+ avm_sch.setSchedule(charge_sch)
555
+ selected_primary_loop.addAvailabilityManager(avm_sch)
556
+
546
557
  if objective == "Partial Storage"
547
558
  sec_chiller = OpenStudio::Model::ChillerElectricEIR.new(model) # use default curves
548
559
  sec_chiller.setName("CoolSysSecondary Chiller")
@@ -555,27 +566,29 @@ class AddChilledWaterStorageTank < OpenStudio::Measure::ModelMeasure
555
566
  end
556
567
 
557
568
  # add plant equipment operation schema if partial storage
558
- clg_op_scheme = OpenStudio::Model::PlantEquipmentOperationCoolingLoad.new(model)
559
- tank_supply_watt = 2.0 * (4182 * tank_vol * 1000 * secondary_delta_t / (3600 * lasting_hrs)) # double the cooling cap in case thermal storage is not used at larger cooling load.
560
- # the sequence of addEquipment and addLoadRange can't be switched
561
- clg_op_scheme.addEquipment(sec_chiller)
562
- clg_op_scheme.addLoadRange(tank_supply_watt, [chw_storage_tank])
563
- sec_loop.setPlantEquipmentOperationCoolingLoad(clg_op_scheme)
569
+ clg_op_scheme_tank = OpenStudio::Model::PlantEquipmentOperationCoolingLoad.new(model)
570
+ clg_op_scheme_tank.addEquipment(chw_storage_tank)
571
+ clg_op_scheme_sec_chiller = OpenStudio::Model::PlantEquipmentOperationCoolingLoad.new(model)
572
+ clg_op_scheme_sec_chiller.addEquipment(sec_chiller)
573
+ undischarge_sch = create_sch(model, 'Chilled water tank not discharge schedule', discharge_end, discharge_start, thermal_storage_season, wknds)
574
+ # in this way, sequence in E+ will be tank first then chiller. In fact the sequence here doesn't matter as each schema is coupled with schedule
575
+ sec_loop.setPlantEquipmentOperationCoolingLoad(clg_op_scheme_tank)
576
+ sec_loop.setPlantEquipmentOperationCoolingLoadSchedule(discharge_sch)
577
+ sec_loop.setPrimaryPlantEquipmentOperationScheme(clg_op_scheme_sec_chiller)
578
+ sec_loop.setPrimaryPlantEquipmentOperationSchemeSchedule(undischarge_sch)
579
+
580
+ # clg_op_scheme = OpenStudio::Model::PlantEquipmentOperationCoolingLoad.new(model)
581
+ # tank_supply_watt = 2.0 * (4182 * tank_vol * 1000 * secondary_delta_t / (3600 * lasting_hrs)) # double the cooling cap in case thermal storage is not used at larger cooling load.
582
+ # # the sequence of addEquipment and addLoadRange can't be switched
583
+ # clg_op_scheme.addEquipment(sec_chiller)
584
+ # clg_op_scheme.addLoadRange(tank_supply_watt, [chw_storage_tank])
585
+ # sec_loop.setPlantEquipmentOperationCoolingLoad(clg_op_scheme)
564
586
  end
565
587
  # add secondary loop bypass pipe
566
588
  sec_supply_bypass = OpenStudio::Model::PipeAdiabatic.new(model)
567
589
  sec_supply_bypass.setName("Chilled Water Secondary Loop Supply Bypass Pipe")
568
590
  sec_loop.addSupplyBranchForComponent(sec_supply_bypass)
569
591
 
570
- # create discharging and charging schedule and apply to chilled water tank and primary loop
571
- discharge_sch = create_sch(model, 'Chilled water tank discharge schedule', discharge_start, discharge_end, thermal_storage_season, wknds)
572
- charge_sch = create_sch(model, 'Chilled water tank charge schedule', charge_start, charge_end, thermal_storage_season, wknds)
573
- chw_storage_tank.setUseSideAvailabilitySchedule(discharge_sch)
574
- chw_storage_tank.setSourceSideAvailabilitySchedule(charge_sch)
575
- avm_sch = OpenStudio::Model::AvailabilityManagerScheduled.new(model)
576
- avm_sch.setSchedule(charge_sch)
577
- selected_primary_loop.addAvailabilityManager(avm_sch)
578
-
579
592
  # move all primary loop demand components (except inlet and outlet pipes) to the secondary loop
580
593
  selected_primary_loop.demandComponents(selected_primary_loop.demandSplitter, selected_primary_loop.demandMixer).each do |demand_comp|
581
594
  if demand_comp.to_StraightComponent.is_initialized