Skip to content

Commit

Permalink
Merge pull request #405 from NREL/develop
Browse files Browse the repository at this point in the history
Change Redis memory setting, add Heating input
  • Loading branch information
Bill-Becker authored Jan 13, 2023
2 parents 04a2bf1 + 75c2dc8 commit 1141ff5
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .helm/templates/redis-stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
containers:
- name: {{ .Chart.Name }}-redis
image: redis:6.0.8-alpine
args: ["sh", "-c", "redis-server --requirepass $$REDIS_PASSWORD --save 900 1 --save 300 10 --save 60 10000 --appendonly yes --maxmemory 2048mb --maxmemory-policy volatile-lru"]
args: ["sh", "-c", "redis-server --requirepass $$REDIS_PASSWORD --save 900 1 --save 300 10 --save 60 10000 --appendonly yes --maxmemory 2048mb --maxmemory-policy allkeys-lru"]
# volumeMounts:
# - name: {{ .Chart.Name }}-redis-data-volume
# mountPath: /data
Expand Down
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ Classify the change according to the following categories:
##### Removed
### Patches

## Develop - 2022-01-11
## Develop
### Minor Updates
### Added
- In job/ app (v3): Added **addressable_load_fraction** to SpaceHeatingLoad and DomesticHotWaterLoad inputs.
### Changed
- Changed redis service memory settings to mitigate "out of memory" OOM issue we've been getting on production

## v2.7.0
### Minor Updates
### Changed
- In job/ app (v3): Name changes for many outputs/results. Generally, changes are for energy outputs (not costs) that include "year_one", and are changed to annual_ for scalars and to production_to_, thermal_to_ etc. for time series.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Generated by Django 4.0.7 on 2022-12-29 05:39

import django.contrib.postgres.fields
import django.core.validators
from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('job', '0016_coldthermalstorageinputs_coldthermalstorageoutputs_and_more'),
]

operations = [
migrations.AddField(
model_name='domestichotwaterloadinputs',
name='addressable_load_fraction',
field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1.0)]), blank=True, default=list, help_text='Fraction of input fuel load which is addressable by heating technologies (default is 1.0).Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.', size=None),
),
migrations.AddField(
model_name='spaceheatingloadinputs',
name='addressable_load_fraction',
field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(1.0)]), blank=True, default=list, help_text='Fraction of input fuel load which is addressable by heating technologies (default is 1.0).Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.', size=None),
),
migrations.AlterField(
model_name='chpinputs',
name='fuel_cost_per_mmbtu',
field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True, validators=[django.core.validators.MinValueValidator(0)]), blank=True, default=list, help_text='The `fuel_cost_per_mmbtu` is a required input and can be a scalar, a list of 12 monthly values, or a time series of values for every time step.', size=None),
),
migrations.AlterField(
model_name='spaceheatingloadinputs',
name='fuel_loads_mmbtu_per_hour',
field=django.contrib.postgres.fields.ArrayField(base_field=models.FloatField(blank=True), blank=True, default=list, help_text='Vector of space heating fuel loads [mmbtu/hr] over one year. Must be hourly (8,760 samples), 30 minute (17,520 samples), or 15 minute (35,040 samples). All non-net load values must be greater than or equal to zero. ', size=None),
),
]
14 changes: 14 additions & 0 deletions job/migrations/0021_merge_20230112_1748.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Generated by Django 4.0.7 on 2023-01-12 17:48

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('job', '0017_domestichotwaterloadinputs_addressable_load_fraction_and_more'),
('job', '0020_chpoutputs_thermal_production_series_mmbtu_per_hour'),
]

operations = [
]
41 changes: 36 additions & 5 deletions job/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -3318,10 +3318,7 @@ class CHPInputs(BaseModel, models.Model):
null=False,
blank=True,
help_text=(
"The CHP system fuel cost is a required input when the CHP system is included as an option."
"The `fuel_cost_per_mmbtu` can be a scalar, a list of 12 monthly values, or a time series of values for every time step."
"If a scalar or a vector of 12 values are provided, then the value is scaled up to 8760 values."
"If a vector of 8760, 17520, or 35040 values is provided, it is adjusted to match timesteps per hour in the optimization."
"The `fuel_cost_per_mmbtu` is a required input and can be a scalar, a list of 12 monthly values, or a time series of values for every time step."
)
)

Expand Down Expand Up @@ -5015,7 +5012,7 @@ class SpaceHeatingLoadInputs(BaseModel, models.Model):
),
default=list,
blank=True,
help_text=("Typical load over all hours in one year. Must be hourly (8,760 samples), 30 minute (17,"
help_text=("Vector of space heating fuel loads [mmbtu/hr] over one year. Must be hourly (8,760 samples), 30 minute (17,"
"520 samples), or 15 minute (35,040 samples). All non-net load values must be greater than or "
"equal to zero. "
)
Expand Down Expand Up @@ -5047,6 +5044,20 @@ class SpaceHeatingLoadInputs(BaseModel, models.Model):
"DoE Commercial Reference Buildings. Must sum to 1.0.")
)

addressable_load_fraction = ArrayField(
models.FloatField(
validators=[
MinValueValidator(0),
MaxValueValidator(1.0)
],
blank=True
),
default=list,
blank=True,
help_text=( "Fraction of input fuel load which is addressable by heating technologies (default is 1.0)."
"Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.")
)

'''
Latitude and longitude are passed on to SpaceHeating struct using the Site struct.
City is not used as an input here because it is found using find_ashrae_zone_city() when needed.
Expand All @@ -5070,6 +5081,9 @@ def clean(self):
if self.doe_reference_name != "" or \
len(self.blended_doe_reference_names) > 0:
self.year = 2017 # the validator provides an "info" message regarding this)

if self.addressable_load_fraction == None:
self.addressable_load_fraction = list([1.0]) # should not convert to timeseries, in case it is to be used with monthly_mmbtu or annual_mmbtu

if error_messages:
raise ValidationError(error_messages)
Expand Down Expand Up @@ -5191,6 +5205,20 @@ class DomesticHotWaterLoadInputs(BaseModel, models.Model):
"DoE Commercial Reference Buildings to simulate buildings/campuses. Must sum to 1.0.")
)

addressable_load_fraction = ArrayField(
models.FloatField(
validators=[
MinValueValidator(0),
MaxValueValidator(1.0)
],
blank=True
),
default=list,
blank=True,
help_text=( "Fraction of input fuel load which is addressable by heating technologies (default is 1.0)."
"Can be a scalar or vector with length aligned with use of monthly_mmbtu (12) or fuel_loads_mmbtu_per_hour.")
)

'''
Latitude and longitude are passed on to DomesticHotWater struct using the Site struct.
City is not used as an input here because it is found using find_ashrae_zone_city() when needed.
Expand All @@ -5215,6 +5243,9 @@ def clean(self):
if self.doe_reference_name != "" or \
len(self.blended_doe_reference_names) > 0:
self.year = 2017 # the validator provides an "info" message regarding this)

if self.addressable_load_fraction == None:
self.addressable_load_fraction = list([1.0]) # should not convert to timeseries, in case it is to be used with monthly_mmbtu or annual_mmbtu

class HeatingLoadOutputs(BaseModel, models.Model):

Expand Down

0 comments on commit 1141ff5

Please sign in to comment.