Skip to content

Commit 3fcef6a

Browse files
authored
Update to PySAM v5.0 (#104)
Addresses #1 - [x] Reference the issue your PR is fixing - [x] Assign at least 1 reviewer for your PR - [x] Test with run_dwelling.py or other script - [x] Update documentation as appropriate - [x] Update changelog as appropriate
2 parents 4ebb84c + e19fa93 commit 3fcef6a

File tree

13 files changed

+169
-320
lines changed

13 files changed

+169
-320
lines changed

changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
### Changes from PRs
44

5+
- Updated PV model to integrate with PVWatts using PySAM v5.0 (not backwards compatible)
6+
- Removed and renamed PV input arguments related to PySAM
57
- Fixed bug with accounting for HVAC delivered heat for standalone HVAC runs
68
- Fixed bug with ASHP backup heater units
9+
- PV model accepts tilt and azimuth angles from roof boundary in envelope
710
- Added OCHREException class to handle errors
811
- Fixed bug with state space model reduction algorithm
912

defaults/PV/sam_weather_header.csv

-2
This file was deleted.

docs/source/InputsAndArguments.rst

+17-23
Original file line numberDiff line numberDiff line change
@@ -555,29 +555,23 @@ Solar PV
555555
OCHRE includes a solar PV model. The table below shows the required and
556556
optional equipment-specific arguments for PV.
557557

558-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
559-
| Argument Name | Argument Type | Required? | Default Value | Description |
560-
+=========================+===============+========================================================+===============================================+======================================================================================+
561-
| ``capacity`` | number | Only if use_sam is True | | PV panel capacity, in kW |
562-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
563-
| ``use_sam`` | boolean | No | True if equipment_schedule_file not specified | If True, runs PySAM to generate PV power profile |
564-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
565-
| ``tilt`` | number | No | Taken from HPXML roof pitch | Tilt angle from horizontal, in degrees. Used for SAM |
566-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
567-
| ``orientation`` | number | No | Taken from HPXML building orientation | Orientation angle from south, in degrees. Used for SAM |
568-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
569-
| ``include_inverter`` | boolean | No | TRUE | If True, outputs AC power and incorporates inverter efficiency and power constraints |
570-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
571-
| ``inverter_efficiency`` | number | No | 1 | Efficiency of the inverter, unitless |
572-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
573-
| ``inverter_priority`` | string | No | "Var" | PV inverter priority. Options are "Var", "Watt", or "CPF" (constant power factor) |
574-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
575-
| ``inverter_capacity`` | number | No | PV.capacity | Inverter apparent power capacity, in kVA (i.e., kW) |
576-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
577-
| ``inverter_min_pf`` | number | No | 0.8 | Inverter minimum power factor, unitless |
578-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
579-
| ``sam_weather_file`` | string | Only if use_sam is True and running without a Dwelling | | Weather file in SAM format |
580-
+-------------------------+---------------+--------------------------------------------------------+-----------------------------------------------+--------------------------------------------------------------------------------------+
558+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
559+
| Argument Name | Argument Type | Required? | Default Value | Description |
560+
+=========================+===============+=======================+==========================================+====================================================================================+
561+
| ``capacity`` | number | Only when running SAM | | PV panel capacity, in kW |
562+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
563+
| ``tilt`` | number | No | Taken from HPXML roof pitch | Tilt angle from horizontal, in degrees. Used for SAM |
564+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
565+
| ``azimuth`` | number | No | Taken from HPXML, south-most facing roof | Azimuth angle from south, in degrees. Used for SAM |
566+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
567+
| ``inverter_capacity`` | number | No | PV.capacity | Inverter apparent power capacity, in kVA. Used for SAM |
568+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
569+
| ``inverter_efficiency`` | number | No | Use default from SAM | Efficiency of the inverter, unitless. Used for SAM |
570+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
571+
| ``inverter_priority`` | string | No | "Var" | PV inverter priority. Options are "Var", "Watt", or "CPF" (constant power factor) |
572+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
573+
| ``inverter_min_pf`` | number | No | 0.8 | Inverter minimum power factor, unitless |
574+
+-------------------------+---------------+-----------------------+------------------------------------------+------------------------------------------------------------------------------------+
581575

582576
Gas Generator
583577
~~~~~~~~~~~~~

docs/source/ModelingApproach.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -305,10 +305,10 @@ battery model.
305305
Solar PV
306306
--------
307307

308-
Solar photovoltaics (PV) is modeled using PySAM, a python wrapper for
309-
the System Advisory Model (SAM). Standard values are used for the PV
310-
model, although the user can select the PV system capacity, the tilt
311-
angle, and the orientation.
308+
Solar photovoltaics (PV) is modeled using PySAM, a python wrapper for the
309+
System Advisory Model (SAM), using the PVWatts module. SAM default values are
310+
used for the PV model, although the user must select the PV system capacity
311+
and can specify the tilt angle, azimuth, and inverter properties.
312312

313313
PV can be externally controlled through a direct setpoint for real and
314314
reactive power. The user can define an inverter size and a minimum power

ochre/Dwelling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def __init__(self, metrics_verbosity=6, save_schedule_columns=None, save_args_to
2727
**house_args):
2828
super().__init__(**house_args)
2929
house_args.pop('name', None) # remove name from kwargs
30+
house_args['main_sim_name'] = self.name
3031

3132
# Time parameters
3233
if self.initialization_time is not None:
@@ -104,7 +105,6 @@ def __init__(self, metrics_verbosity=6, save_schedule_columns=None, save_args_to
104105
'start_time': self.start_time, # updates time zone if necessary
105106
'schedule': schedule,
106107
'initial_schedule': schedule.loc[self.start_time].to_dict(),
107-
'main_sim_name': self.name,
108108
'output_path': self.output_path,
109109
}
110110

0 commit comments

Comments
 (0)