-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3490 from architecture-building-systems/3483-cea-…
…results-reader-analysis New Features: Result reader - summary & analysis
- Loading branch information
Showing
11 changed files
with
1,325 additions
and
11 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,34 @@ | |
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
def projected_lifetime_output( | ||
production_values, | ||
lifetime_years, | ||
max_performance=100, | ||
annual_factor=0.54, | ||
min_performance=80, | ||
): | ||
""" | ||
Model the projected lifetime output of a PV module using a linear derating system | ||
Authors: | ||
- Justin McCarty | ||
Args: | ||
production_values (np.array shape(n_time_steps,)): electricity produced during the first year | ||
lifetime_years (int): the expected lifetime of the module | ||
max_performance (int, optional): _description_. Defaults to 100. | ||
annual_factor (float, optional): _description_. Defaults to 0.54. | ||
min_performance (int, optional): _description_. Defaults to 80. | ||
Returns: | ||
np.array: array with shape (lifetime_years, n_time_steps) | ||
""" | ||
derate_factors = np.linspace( | ||
max_performance, max_performance - (lifetime_years * annual_factor), num=lifetime_years | ||
).reshape(-1, 1) | ||
derate_factors = np.clip(derate_factors, min_performance, None) / 100 | ||
lifetime_production = production_values * derate_factors | ||
return lifetime_production | ||
|
||
def calc_PV(locator, config, latitude, longitude, weather_data, datetime_local, building_name): | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,10 @@ | ||
""" | ||
Batch processing CEA commands over all scenarios in a project. | ||
This is a first exploration for the ETH MiBS IDP 2023. | ||
This was originally explored and created for the ETH MiBS IDP 2023. | ||
""" | ||
|
||
# TODO: change the hard-coded path; this is subject to a structural separation of project-based CEA Features from scenario-based CEA Features | ||
|
||
import os | ||
import subprocess | ||
import sys | ||
|
@@ -19,6 +21,10 @@ | |
__email__ = "[email protected]" | ||
__status__ = "Production" | ||
|
||
# adding CEA to the environment | ||
# Fix for running in PyCharm for users using micromamba | ||
my_env = os.environ.copy() | ||
my_env['PATH'] = f"{os.path.dirname(sys.executable)}:{my_env['PATH']}" | ||
|
||
def exec_cea_commands(config, cea_scenario): | ||
""" | ||
|
@@ -59,11 +65,6 @@ def exec_cea_commands(config, cea_scenario): | |
|
||
optimization = config.batch_process_workflow.optimization | ||
|
||
# adding CEA to the environment | ||
# Fix for running in PyCharm for users using micromamba | ||
my_env = os.environ.copy() | ||
my_env['PATH'] = f"{os.path.dirname(sys.executable)}:{my_env['PATH']}" | ||
|
||
# execute selected CEA commands | ||
if zone_csv_to_shp: | ||
zone_csv_path = os.path.join(cea_scenario, 'inputs/building-geometry/zone.csv') | ||
|
@@ -215,6 +216,15 @@ def main(config): | |
print(err_msg.decode()) | ||
raise e | ||
|
||
# Read and summarise project results | ||
project_result_summary = config.batch_process_workflow.result_summary | ||
if project_result_summary and project_boolean: | ||
subprocess.run(['cea', 'result-reader-summary', '--all-scenarios', 'true'], env=my_env, check=True, capture_output=True) | ||
elif project_result_summary and not project_boolean: | ||
subprocess.run(['cea', 'result-reader-summary', '--all-scenarios', 'false'], env=my_env, check=True, capture_output=True) | ||
|
||
|
||
|
||
# Print the time used for the entire processing | ||
time_elapsed = time.perf_counter() - t0 | ||
print('The entire batch processing sequence is now completed - time elapsed: %d.2 seconds' % time_elapsed) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.