Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pv tilt update #578

Merged
merged 6 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ Classify the change according to the following categories:
##### Removed
### Patches

## Develop - 2024-04-19
### Minor Updates
#### Changed
- In `core/pv.jl` a change was made to make sure we are using the same assumptions as PVWatts guidelines, the default `tilt` angle for a fixed array should be 20 degrees, irrespective of it being a rooftop `(0)` or ground-mounted (open-rack)`(1)` system. By default the `tilt` will be set to 20 degrees for fixed ground-mount and rooftop, and 0 degrees for axis-tracking (`array_type = (2), (3), or (4)`)

## v3.7.0
### Minor Updates
#### Changed
Expand Down
19 changes: 19 additions & 0 deletions reoptjl/migrations/0057_alter_pvinputs_tilt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Generated by Django 4.0.7 on 2024-04-23 17:45

import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('reoptjl', '0056_alter_electricloadinputs_annual_kwh_and_more'),
]

operations = [
migrations.AlterField(
model_name='pvinputs',
name='tilt',
field=models.FloatField(blank=True, help_text='PV system tilt: Set tilt angle to 20 degrees for fixed arrays (rooftop or ground-mounted). Set tilt angle to 0 degrees for axis-tracking systems.', null=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(90)]),
),
]
2 changes: 1 addition & 1 deletion reoptjl/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2790,7 +2790,7 @@ class PV_LOCATION_CHOICES(models.TextChoices):
],
blank=True,
null=True,
help_text="PV system tilt. If PV system type is rooftop-fixed, then tilt=10 degrees, else tilt=20 degrees"
help_text="PV system tilt: Set tilt angle to 20 degrees for fixed arrays (rooftop or ground-mounted). Set tilt angle to 0 degrees for axis-tracking systems."
)
location = models.TextField(
default=PV_LOCATION_CHOICES.BOTH,
Expand Down
7 changes: 3 additions & 4 deletions reoptjl/test/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,15 @@ def test_pv_tilt_defaults(self):
validator.clean_fields()
validator.clean()
validator.cross_clean()
self.assertEquals(validator.models["PV"].tilt, 10)
self.assertEquals(validator.models["PV"].tilt, 20)

post["APIMeta"]["run_uuid"] = uuid.uuid4()
post["PV"]["array_type"] = 0
post["PV"]["array_type"] = 2
validator = InputValidator(post)
validator.clean_fields()
validator.clean()
validator.cross_clean()
self.assertAlmostEquals(validator.models["PV"].tilt, 20)

self.assertAlmostEquals(validator.models["PV"].tilt, 0)

def boiler_validation(self):
"""
Expand Down
12 changes: 7 additions & 5 deletions reoptjl/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ def cross_clean(self):
"""
PV validation
"""
def cross_clean_pv(pvmodel):
if pvmodel.__getattribute__("tilt") == None:
if pvmodel.__getattribute__("array_type") == pvmodel.ARRAY_TYPE_CHOICES.ROOFTOP_FIXED:
pvmodel.__setattr__("tilt", 10)
else:
def cross_clean_pv(pvmodel):
if pvmodel.__getattribute__("tilt") is None:
if pvmodel.__getattribute__("array_type") in (pvmodel.ARRAY_TYPE_CHOICES.GROUND_MOUNT_FIXED_OPEN_RACK,
pvmodel.ARRAY_TYPE_CHOICES.ROOFTOP_FIXED):
pvmodel.__setattr__("tilt", 20)
else:
pvmodel.__setattr__("tilt", 0)


if pvmodel.__getattribute__("azimuth") == None:
if self.models["Site"].__getattribute__("latitude") >= 0:
Expand Down