BuildSysPro.BoundaryConditions.Solar.Utilities.CosDirSunVectorHeightAz

# .BuildSysPro.BoundaryConditions.Solar.Utilities.CosDirSunVectorHeightAz

Compute the sun's direction cosine, the solar elevation and azimuth angle

## Information

Function returning the sun's direction cosine, the solar elevation and azimuth angle

Hypothesis and equations

Function computing the sun's direction cosine (CosDir[3]), the solar elevation and azimuth angle (Haut and Az) à (t0+t) according to latitude and longitude.

- CosDir[1]=sin(phi)*sin(delta)+cos(phi)*cos(delta)*cos(HA) (=sinh)
- CosDir[2]=cos(delta)*sin(HA)
- CosDir[3]=cos(delta)*sin(phi)*cos(HA)-sin(delta)*cos(phi)
- Height=asin(CosDir[1])*180/pi in degrees
- Az is determined by its sine and cosine:

- sinAz=CosDir[2]/cosh
- cosAz=CosDir[3]/cosh

Where:

- phi : latitude converted in radians
- delta : Sun's declination in radians
- HA : hour angle in radians

The year is supposed to be not bisextile.

Bibliography

H. BOUIA, "Amélioration du temps de calcul dans BuildSysPro par traitements numériques optimisés de la conduction et des calculs solaires", Note H-E14-2013-00715-FR, 03/2013.

Instructions for use

none

Known limits / Use precautions

none

Validations

Validated function - Hassan BOUIA 03/2013.

--------------------------------------------------------------
Licensed by EDF under a 3-clause BSD-license
Copyright © EDF 2009 - 2023
BuildSysPro version 3.6.0
Author : Hassan BOUIA, EDF (2013)
--------------------------------------------------------------

#### Interface

>     function CosDirSunVectorHeightAz
>       input Real t0 = 0 "Time in seconds at t=0";
>       input Modelica.Units.SI.Time t "Universal time in seconds";
>       input Modelica.Units.NonSI.Angle_deg longitude "Longitude in degrees";
>       input Modelica.Units.NonSI.Angle_deg latitude "Latitude in degrees";
>       output Real CosDir[3] "Sun's direction cosine";
>       output Real Az "Solar azimuth angle";
>       output Real Haut "Solar elevation angle";
>     end CosDirSunVectorHeightAz;

## Revisions

Aurélie Kaemmerlen 11/2013 : Modification du calcul (cosAz*0.999) pour éviter une discontinuité dûe au calcul de l'arcosinus de Modelica

Benoît Charrier 01/2016 : Correction d'une erreur dans le calcul du quantième : remplacement de la ligne `Real d=mod((t+t0)/86400,365);` par `Real d=mod((t+t0)/86400,365)+1;`.

Generated at 2026-05-09T18:18:56Z by OpenModelicaOpenModelica 1.26.7 using GenerateDoc.mos