blockSunRiseSet

Next sunrise and sunset time

Information

This block outputs the next sunrise and sunset time. The sunrise time keeps constant until the model time reaches the next sunrise, at which time the output gets updated. Similarly, the output for the next sunset is updated at each sunset.

The time zone parameter is based on UTC time; for instance, Eastern Standard Time is -5h. Note that daylight savings time is not considered in this component.

Validation

A validation can be found at Buildings.Controls.OBC.CDL.Utilities.Validation.SunRiseSet.

Parameters

TypeNameDefaultDescription
ReallatLatitude
ReallonLongitude
RealtimZonTime zone

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.RealOutputnextSunRiseTime of next sunrise
Buildings.Controls.OBC.CDL.Interfaces.RealOutputnextSunSetTime of next sunset
Buildings.Controls.OBC.CDL.Interfaces.BooleanOutputsunUpOutput with true if the sun is up

Contents

NameDescription
nextHourAngleprotectedCalculate the hour angle when the sun rises or sets next time
computeSunRiseprotectedOutput the next sunrise time
computeSunSetprotectedOutput the next sunset time

Revisions

  • January 4, 2022, by Michael Wetter:
    Changed implementation to avoid NaN in OpenModelica.
    This is for Buildings, issue 2835.
  • November 12, 2020, by Michael Wetter:
    Reformulated to remove dependency to Modelica.Units.SI.
    This is for Buildings, issue 2243.
  • November 27, 2018, by Kun Zhang:
    First implementation. This is for issue 829.