Skip to content

Commit

Permalink
feat(map): Add functions for dynamic apertures in the simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Mar 8, 2022
1 parent 7dcb945 commit 26278be
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 2 deletions.
73 changes: 72 additions & 1 deletion pollination/ladybug_comfort/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,67 @@ def run_utci_map(self):
)


@dataclass
class IrradianceContribMap(Function):
"""Get .ill files with maps of irradiance contributions from dynamic windows."""

result_sql = Inputs.file(
description='A SQLite file that was generated by EnergyPlus and contains '
'hourly or sub-hourly thermal comfort results.',
path='result.sql', extensions=['sql', 'db', 'sqlite']
)

direct_specular = Inputs.file(
description='A Radiance .ill file containing direct irradiance for the '
'specular version of the aperture group.',
path='direct_spec.ill', extensions=['ill', 'irr']
)

indirect_specular = Inputs.file(
description='An Radiance .ill file containing indirect irradiance for the '
'specular version of the aperture group.',
path='indirect_spec.ill', extensions=['ill', 'irr']
)

ref_specular = Inputs.file(
description='A Radiance .ill containing ground-reflected irradiance for the '
'specular version of the aperture group.',
path='ref_spec.ill', extensions=['ill', 'irr']
)

indirect_diffuse = Inputs.file(
description='An Radiance .ill file containing indirect irradiance for the '
'diffuse version of the aperture group.',
path='indirect_diff.ill', extensions=['ill', 'irr']
)

ref_diffuse = Inputs.file(
description='A Radiance .ill containing ground-reflected irradiance for the '
'diffuse version of the aperture group.',
path='ref_diff.ill', extensions=['ill', 'irr']
)

sun_up_hours = Inputs.file(
description='A sun-up-hours.txt file output by Radiance and aligns with the '
'input irradiance files.', path='sun-up-hours.txt'
)

aperture_id = Inputs.str(
description='Text string for the identifier of the aperture associated '
'with the irradiance.'
)

@command
def run_irradiance_contrib(self):
return 'ladybug-comfort map irradiance-contrib result.sql direct_spec.ill ' \
'indirect_spec.ill ref_spec.ill indirect_diff.ill ref_diff.ill ' \
'sun-up-hours.txt --aperture-id "{{self.aperture_id}}" --folder output'

result_folder = Outputs.folder(
description='Folder containing all of the output .ill files.', path='output'
)


@dataclass
class ShortwaveMrtMap(Function):
"""Get CSV files with maps of shortwave MRT Deltas from Radiance results."""
Expand Down Expand Up @@ -358,6 +419,15 @@ class ShortwaveMrtMap(Function):
'input irradiance files.', path='sun-up-hours.txt'
)

contributions = Inputs.folder(
description='An optional folder containing sub-folders of irradiance '
'contributions from dynamic aperture groups. There should be one sub-folder '
'per window groups and each one should contain three .ill files named '
'direct.ill, indirect.ill and reflected.ill. If specified, these will be '
'added to the irradiance inputs before computing shortwave MRT deltas.',
path='dynamic', optional=True
)

solarcal_par = Inputs.str(
description='A SolarCalParameter string to customize the assumptions of '
'the SolarCal model.', default='--posture seated --sharp 135 '
Expand All @@ -380,7 +450,8 @@ class ShortwaveMrtMap(Function):
@command
def run_shortwave_map(self):
return 'ladybug-comfort map shortwave-mrt weather.epw indirect.ill direct.ill ' \
'ref.ill sun-up-hours.txt --solarcal-par "{{self.solarcal_par}}" ' \
'ref.ill sun-up-hours.txt --contributions dynamic ' \
'--solarcal-par "{{self.solarcal_par}}" ' \
'--run-period "{{self.run_period}}" --{{self.indirect_is_total}} ' \
'--output-file shortwave.csv'

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pollination-dsl==0.12.5
pollination-dsl==0.13.0
ladybug-comfort==0.15.0

0 comments on commit 26278be

Please sign in to comment.