Buildings.BoundaryConditions.SolarGeometry.BaseClasses

Package with base classes for Buildings.BoundaryConditions.SolarGeometry

Information

This package contains base classes that are used to construct the models in Buildings.BoundaryConditions.SolarGeometry.

Extends from Modelica.Icons.BasesPackage (Icon for packages containing base classes).

Package Content

Name Description
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.AltitudeAngle AltitudeAngle Solar altitude angle
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Declination Declination Declination angle
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.IncidenceAngle IncidenceAngle The solar incidence angle on a tilted surface
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarAzimuth SolarAzimuth Solar azimuth
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarHourAngle SolarHourAngle Solar hour angle
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.WallSolarAzimuth WallSolarAzimuth Angle measured in a horizontal plane between the projection of the sun's rays and the normal to a vertical surface
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.ZenithAngle ZenithAngle Zenith angle
Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Examples Examples Collection of models that illustrate model use and test models

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.AltitudeAngle Buildings.BoundaryConditions.SolarGeometry.BaseClasses.AltitudeAngle

Solar altitude angle

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.AltitudeAngle

Information

This block computes the altitude angle of the sun with respect to a horizontal surface. The altitude angle is the angle between the sun ray and the projection of the ray on a horizontal surface. It is the complementory angle to the zenith angle.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputzenZenith angle [rad]
output RealOutputaltSolar altitude angle [rad]

Modelica definition

block AltitudeAngle "Solar altitude angle" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput zen(quantity="Angle", unit="rad") "Zenith angle"; Modelica.Blocks.Interfaces.RealOutput alt( final quantity="Angle", final unit="rad", displayUnit="deg") "Solar altitude angle"; equation alt = (Modelica.Constants.pi/2) - zen; end AltitudeAngle;

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Declination Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Declination

Declination angle

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Declination

Information

This component computes the solar declination, which is the angle between the equatorial plane and the solar beam. The input signal nDay is the one-based number of the day, but in seconds. Hence, during January 1, we should have nDay = 86400 seconds. Since the effect of using a continuous number rather than an integer is small, we approximate this so that nDay = 0 at the start of January 1, and nDay = 86400 at the end of January 1.

Validation

A validation with a more detailed calculation can be found at Buildings.BoundaryConditions.SolarGeometry.BaseClasses.Examples.Declination.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputnDayDay number with units of seconds [s]
output RealOutputdecAngSolar declination angle [rad]

Modelica definition

block Declination "Declination angle" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput nDay(quantity="Time", unit="s") "Day number with units of seconds"; Modelica.Blocks.Interfaces.RealOutput decAng( final quantity="Angle", final unit="rad", displayUnit="deg") "Solar declination angle"; protected constant Real k1 = sin(23.45*2*Modelica.Constants.pi/360) "Constant"; constant Real k2 = 2*Modelica.Constants.pi/365.25 "Constant"; equation decAng = Modelica.Math.asin(-k1 * Modelica.Math.cos((nDay/86400 + 10)*k2)) "(A4.5)"; end Declination;

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.IncidenceAngle Buildings.BoundaryConditions.SolarGeometry.BaseClasses.IncidenceAngle

The solar incidence angle on a tilted surface

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.IncidenceAngle

Information

This component computes the solar incidence angle on a tilted surface using the solar hour angle and the declination angle as input.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Anglelat Latitude [rad]
Angleaziazi( ...Surface azimuth. azi=-90 degree if surface outward unit normal points toward east; azi=0 if it points toward south [rad]
Angletiltil( ...Surface tilt. til=90 degree for walls; til=0 for ceilings; til=180 for roof [rad]

Connectors

TypeNameDescription
input RealInputsolHouAngSolar hour angle [rad]
input RealInputdecAngDeclination [rad]
output RealOutputincAngIncidence angle on a tilted surface [rad]

Modelica definition

block IncidenceAngle "The solar incidence angle on a tilted surface" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Angle lat "Latitude"; parameter Modelica.SIunits.Angle azi(displayUnit="deg") "Surface azimuth. azi=-90 degree if surface outward unit normal points toward east; azi=0 if it points toward south"; parameter Modelica.SIunits.Angle til(displayUnit="deg") "Surface tilt. til=90 degree for walls; til=0 for ceilings; til=180 for roof"; Modelica.Blocks.Interfaces.RealInput solHouAng(quantity="Angle", unit="rad") "Solar hour angle"; Modelica.Blocks.Interfaces.RealInput decAng(quantity="Angle", unit="rad") "Declination"; Modelica.Blocks.Interfaces.RealOutput incAng( final quantity="Angle", final unit="rad", displayUnit="deg") "Incidence angle on a tilted surface"; protected Real dec_c=Modelica.Math.cos(decAng) "Cosine of declination angle"; Real dec_s=Modelica.Math.sin(decAng) "Sine of declination angle"; Real sol_c=Modelica.Math.cos(solHouAng) "Cosine of solar hour angle"; Real sol_s=Modelica.Math.sin(solHouAng) "Sine of solar hour angle"; Real lat_c=Modelica.Math.cos(lat) "Cosine of latitude"; Real lat_s=Modelica.Math.sin(lat) "Sine of latitude"; equation incAng = Modelica.Math.acos(Modelica.Math.cos(til)*(dec_c*sol_c*lat_c + dec_s *lat_s) + Modelica.Math.sin(til)*(Modelica.Math.sin(azi)*dec_c*sol_s + Modelica.Math.cos(azi)*(dec_c*sol_c*lat_s - dec_s*lat_c))) "(A.4.13)"; end IncidenceAngle;

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarAzimuth Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarAzimuth

Solar azimuth

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarAzimuth

Information

This component computes the solar azimuth angle.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Anglelat Latitude [rad]

Connectors

TypeNameDescription
input RealInputzenZenith angle [rad]
input RealInputsolTimSolar time [s]
output RealOutputsolAziSolar Azimuth [rad]
input RealInputdecAngDeclination angle [rad]

Modelica definition

block SolarAzimuth "Solar azimuth" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Angle lat "Latitude"; Modelica.Blocks.Interfaces.RealInput zen(quantity="Angle", unit="rad") "Zenith angle"; Modelica.Blocks.Interfaces.RealInput solTim(quantity="Time", unit="s") "Solar time"; Modelica.Blocks.Interfaces.RealOutput solAzi( final quantity="Angle", final unit="rad", displayUnit="deg") "Solar Azimuth"; Modelica.Blocks.Interfaces.RealInput decAng(quantity="Angle", unit="rad") "Declination angle"; protected Real arg "cos(solAzi) after data validity check"; Real tmp "cos(solAzi) before data validity check"; Real solAziTem "Temporary variable for solar azimuth"; constant Modelica.SIunits.Time day=86400 "Number of seconds in a day"; constant Modelica.SIunits.Angle polarCircle = 1.1617 "Latitude of polar circle (66 degree 33 min 44 sec)"; final parameter Boolean outsidePolarCircle = lat < polarCircle and lat > -polarCircle "Flag, true if latitude is outside polar region"; equation tmp = (Modelica.Math.sin(lat)*Modelica.Math.cos(zen) - Modelica.Math.sin( decAng))/(Modelica.Math.cos(lat)*Modelica.Math.sin(zen)); arg = min(1.0, max(-1.0, tmp)); solAziTem = Modelica.Math.acos(arg); // Solar azimuth (A4.9a and b) as a positive number if outsidePolarCircle then // Outside the polar circle, the only non-differentiability is at night when the sun is set. // Hence, we use noEvent. if noEvent(solTim - integer(solTim/day)*day < 43200) then solAzi =-solAziTem; else solAzi = solAziTem; end if; else // Inside the polar circle, there is a jump at (solar-)midnight when the sun can // be above the horizon. Hence, we do not use noEvent(...) if solTim - integer(solTim/day)*day < 43200 then solAzi =-solAziTem; else solAzi = solAziTem; end if; end if; end SolarAzimuth;

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarHourAngle Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarHourAngle

Solar hour angle

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.SolarHourAngle

Information

This component computes the solar hour angle, which is defined as the angle between the circle that passes through an observer, the north pole and the south pole, and the circle that passes through the sun, the north and the south pole.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputsolTimSolar time [s]
output RealOutputsolHouAngSolar hour angle [rad]

Modelica definition

block SolarHourAngle "Solar hour angle" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput solTim(quantity="Time", unit="s") "Solar time"; Modelica.Blocks.Interfaces.RealOutput solHouAng( final quantity="Angle", final unit="rad", displayUnit="deg") "Solar hour angle"; equation solHouAng = (solTim/3600 - 12)*2*Modelica.Constants.pi/24 "Our unit is s instead of h in (A4.6)"; end SolarHourAngle;

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.WallSolarAzimuth Buildings.BoundaryConditions.SolarGeometry.BaseClasses.WallSolarAzimuth

Angle measured in a horizontal plane between the projection of the sun's rays and the normal to a vertical surface

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.WallSolarAzimuth

Information

This block computes the wall solar azimuth angle. It is the angle between the projection of the sun ray on a horizontal surface and the line perpendicular to the wall. The value of this angle varies from 0 to 180 degrees. In the northern hemisphere at solar noon, the value of the wall solar azimuth angle is zero if the wall is facing south.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Connectors

TypeNameDescription
input RealInputincAngSolar incidence angle [rad]
input RealInputaltSolar altitude angle (angle between sun ray and horizontal surface) [rad]
output RealOutputverAziAngle between projection of sun's rays and normal to vertical surface [rad]

Modelica definition

block WallSolarAzimuth "Angle measured in a horizontal plane between the projection of the sun's rays and the normal to a vertical surface" extends Modelica.Blocks.Icons.Block; Modelica.Blocks.Interfaces.RealInput incAng(quantity="Angle", unit="rad", displayUnit="rad") "Solar incidence angle"; Modelica.Blocks.Interfaces.RealInput alt(quantity="Angle", unit="rad", displayUnit="rad") "Solar altitude angle (angle between sun ray and horizontal surface)"; Modelica.Blocks.Interfaces.RealOutput verAzi( final quantity="Angle", final unit="rad", displayUnit="deg") "Angle between projection of sun's rays and normal to vertical surface"; protected constant Modelica.SIunits.Angle delta = 1*Modelica.Constants.pi/180 "Small angle"; constant Modelica.SIunits.Angle ninety= Modelica.Constants.pi/2-delta "+89 degree"; constant Real deltaX = 1E-4 "Small number used for smoothing"; Real alt_c "Cosine of altitude, bounded away from zero"; Real rat "Ratio of cosines"; equation alt_c=Modelica.Math.cos(Buildings.Utilities.Math.Functions.smoothLimit( x=alt, l=-ninety, u=ninety, deltaX=delta)); rat = Modelica.Math.cos(incAng)/alt_c; // Due to the smoothLimit, rat can be about 1E-3 greater than 1 or smaller than -1. // Hence, below we use another call to smoothLimit to ensure that the argument of // acos(.) is inside the interval [-1, 1]. verAzi=Modelica.Math.acos( Buildings.Utilities.Math.Functions.smoothLimit(x=rat, l=-1+deltaX, u=1-deltaX, deltaX=deltaX/10)); end WallSolarAzimuth;

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.ZenithAngle Buildings.BoundaryConditions.SolarGeometry.BaseClasses.ZenithAngle

Zenith angle

Buildings.BoundaryConditions.SolarGeometry.BaseClasses.ZenithAngle

Information

This component computes the zenith angle, which is the angle between the earth surface normal and the sun's beam. Input are the solar hour angle and the declination angle.

Extends from Modelica.Blocks.Icons.Block (Basic graphical layout of input/output block).

Parameters

TypeNameDefaultDescription
Anglelat Latitude [rad]

Connectors

TypeNameDescription
input RealInputsolHouAngSolar hour angle [rad]
input RealInputdecAngSolar declination angle [rad]
output RealOutputzenZenith angle [rad]

Modelica definition

block ZenithAngle "Zenith angle" extends Modelica.Blocks.Icons.Block; parameter Modelica.SIunits.Angle lat "Latitude"; Modelica.Blocks.Interfaces.RealInput solHouAng(quantity="Angle", unit="rad") "Solar hour angle"; Modelica.Blocks.Interfaces.RealInput decAng(quantity="Angle", unit="rad") "Solar declination angle"; Modelica.Blocks.Interfaces.RealOutput zen( final quantity="Angle", final unit="rad", displayUnit="deg") "Zenith angle"; equation zen = Modelica.Math.acos(Modelica.Math.cos(lat)*Modelica.Math.cos(decAng)* Modelica.Math.cos(solHouAng) + Modelica.Math.sin(lat)*Modelica.Math.sin( decAng)) "(A4.8)"; end ZenithAngle;