Skip to content

Commit

Permalink
Update to PySAM v5.0 (#104)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jmaguire1 authored Mar 20, 2024
2 parents 4ebb84c + e19fa93 commit 3fcef6a
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 320 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

### Changes from PRs

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

Expand Down
2 changes: 0 additions & 2 deletions defaults/PV/sam_weather_header.csv

This file was deleted.

40 changes: 17 additions & 23 deletions docs/source/InputsAndArguments.rst
Original file line number Diff line number Diff line change
Expand Up @@ -555,29 +555,23 @@ Solar PV
OCHRE includes a solar PV model. The table below shows the required and
optional equipment-specific arguments for PV.

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

Gas Generator
~~~~~~~~~~~~~
Expand Down
8 changes: 4 additions & 4 deletions docs/source/ModelingApproach.rst
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ battery model.
Solar PV
--------

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

PV can be externally controlled through a direct setpoint for real and
reactive power. The user can define an inverter size and a minimum power
Expand Down
2 changes: 1 addition & 1 deletion ochre/Dwelling.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self, metrics_verbosity=6, save_schedule_columns=None, save_args_to
**house_args):
super().__init__(**house_args)
house_args.pop('name', None) # remove name from kwargs
house_args['main_sim_name'] = self.name

# Time parameters
if self.initialization_time is not None:
Expand Down Expand Up @@ -104,7 +105,6 @@ def __init__(self, metrics_verbosity=6, save_schedule_columns=None, save_args_to
'start_time': self.start_time, # updates time zone if necessary
'schedule': schedule,
'initial_schedule': schedule.loc[self.start_time].to_dict(),
'main_sim_name': self.name,
'output_path': self.output_path,
}

Expand Down
Loading

0 comments on commit 3fcef6a

Please sign in to comment.