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).
Name | Description |
---|---|
Declination | Declination angle |
IncidenceAngle | The solar incidence angle on a tilted surface |
SolarAzimuth | Solar azimuth |
SolarHourAngle | Solar hour angle |
ZenithAngle | Zenith angle |
AltitudeAngle | Solar altitude angle |
WallSolarAzimuth | Angle measured in a horizontal plane between the projection of the sun's rays and the normal to a vertical surface |
Examples | Collection of models that illustrate model use and test models |
This component computes the angle between the equatorial plane and the solar beam.
Extends from Modelica.Blocks.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Description |
---|---|---|
input RealInput | nDay | One-based day number in seconds [s] |
output RealOutput | decAng | Declination angle [rad] |
block Declination "Declination angle" extends Modelica.Blocks.Interfaces.BlockIcon;public Modelica.Blocks.Interfaces.RealInput nDay(quantity="Time", unit="s") "One-based day number in seconds"; Modelica.Blocks.Interfaces.RealOutput decAng( final quantity="Angle", final unit="rad", displayUnit="deg") "Declination angle"; equation decAng = Modelica.Math.asin(-sin(23.45*2*Modelica.Constants.pi/360)* Modelica.Math.cos((nDay/86400 + 10)*2*Modelica.Constants.pi/365.25)) "(A4.5)";end Declination;
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.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Default | Description |
---|---|---|---|
Angle | lat | Latitude [rad] | |
Angle | azi | Surface azimuth. azi=-90 degree if surface outward unit normal points toward east; azi=0 if it points toward south [rad] | |
Angle | til | Surface tilt. til=90 degree for walls; til=0 for ceilings; til=180 for roof [rad] |
Type | Name | Description |
---|---|---|
input RealInput | solHouAng | Solar hour angle [rad] |
input RealInput | decAng | Declination [rad] |
output RealOutput | incAng | Incidence angle on a tilted surfce [rad] |
block IncidenceAngle "The solar incidence angle on a tilted surface" extends Modelica.Blocks.Interfaces.BlockIcon; public parameter Modelica.SIunits.Angle lat "Latitude"; parameter Modelica.SIunits.Angle azi(displayUnit="degree") "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="degree") "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 surfce"; protected Real dec_c=Modelica.Math.cos(decAng); Real dec_s=Modelica.Math.sin(decAng); Real sol_c=Modelica.Math.cos(solHouAng); Real sol_s=Modelica.Math.sin(solHouAng); Real lat_c=Modelica.Math.cos(lat); Real lat_s=Modelica.Math.sin(lat); 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;
This component computes the solar azimuth angle.
Extends from Modelica.Blocks.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Default | Description |
---|---|---|---|
Angle | lat | Latitude [rad] |
Type | Name | Description |
---|---|---|
input RealInput | zen | Zenith angle [rad] |
input RealInput | solTim | Solar time [s] |
output RealOutput | solAzi | Solar Azimuth [rad] |
input RealInput | decAng | Decline angle [rad] |
block SolarAzimuth "Solar azimuth" extends Modelica.Blocks.Interfaces.BlockIcon; public 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") "Decline angle"; protected Real arg "cos(solAzi) after data validity check"; Real tmp "cos(solAzi) before data validity check"; 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"; algorithm 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)); solAzi := 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 :=-solAzi; 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 :=-solAzi; end if; end if;end SolarAzimuth;
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.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Description |
---|---|---|
input RealInput | solTim | Solar time [s] |
output RealOutput | solHouAng | Solar hour angle [rad] |
block SolarHourAngle "Solar hour angle" extends Modelica.Blocks.Interfaces.BlockIcon;public 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;
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.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Default | Description |
---|---|---|---|
Angle | lat | Latitude [rad] |
Type | Name | Description |
---|---|---|
input RealInput | solHouAng | Solar hour angle [rad] |
input RealInput | decAng | Declination [rad] |
output RealOutput | zen | Zenith angle [rad] |
block ZenithAngle "Zenith angle" extends Modelica.Blocks.Interfaces.BlockIcon; public 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") "Declination"; 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;
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.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Description |
---|---|---|
input RealInput | zen | Zenith angle [rad] |
output RealOutput | alt | Altitude angle [rad] |
block AltitudeAngle "Solar altitude angle" extends Modelica.Blocks.Interfaces.BlockIcon;public Modelica.Blocks.Interfaces.RealInput zen(quantity="Angle", unit="rad") "Zenith angle"; Modelica.Blocks.Interfaces.RealOutput alt( final quantity="Angle", final unit="rad", displayUnit="deg") "Altitude angle"; equation alt = (Modelica.Constants.pi/2) - zen;end AltitudeAngle;
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.Interfaces.BlockIcon (Basic graphical layout of input/output block).
Type | Name | Description |
---|---|---|
input RealInput | incAng | Solar incidence angle [rad] |
input RealInput | alt | Solar altitude angle (angle between sun ray and horizontal surface) [rad] |
output RealOutput | verAzi | Angle between projection of sun's rays and normal to vertical surface [rad] |
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.Interfaces.BlockIcon;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;