Example #1
0
        // Calculation method
        public void Calculate
        (
            double NDir              // normal direct irradiance [W/m2]
            , double HDif            // horizontal diffuse irradiance [W/m2]
            , double NExtra          // normal extraterrestrial irradiance [W/m2]
            , double SunZenith       // zenith angle of sun [radians]
            , double SunAzimuth      // azimuth angle of sun [radians]
            , double AirMass         // air mass [#]
            , int MonthNum           // The month number of the time stamp [1->12]
        )
        {
            // Calculate direct horizontal if direct normal is provided
            double HDir = NDir * Math.Cos(SunZenith);

            // call Perez et al. algorithm or Hay algorithm
            switch (itsTiltAlgorithm)
            {
            case TiltAlgorithm.PEREZ:
                TGlo = GetTiltCompIrradPerez(out TDir, out TDif, out TRef, HDir, HDif, NExtra, SunZenith, SunAzimuth, AirMass, MonthNum);
                break;

            case TiltAlgorithm.HAY:
                TGlo = GetTiltCompIrradHay(out TDir, out TDif, out TRef, HDir, HDif, NExtra, SunZenith, SunAzimuth, MonthNum);
                break;

            default:
                itsTiltAlgorithm = TiltAlgorithm.HAY;
                break;
            }

            // Compute the incidence angle from the Tilt class
            IncidenceAngle = Tilt.GetIncidenceAngle(SunZenith, SunAzimuth, itsSurfaceSlope, itsSurfaceAzimuth);
        }
Example #2
0
 // Constructor with definition variables
 public Tilter
 (
     TiltAlgorithm aTiltAlgorithm
 )
 {
     itsTiltAlgorithm = aTiltAlgorithm;
 }
Example #3
0
        // Calculation method
        public void Calculate
        (
            double NDir              // normal direct irradiance [W/m2]
            , double HDif            // horizontal diffuse irradiance [W/m2]
            , double NExtra          // normal extraterrestrial irradiance [W/m2]
            , double SunZenith       // zenith angle of sun [radians]
            , double SunAzimuth      // azimuth angle of sun [radians]
            , double AirMass         // air mass [#]
            , int MonthNum           // The month number of the time stamp [1->12]
            , double MeasAlbedo      // albedo read from climate file, if available (NaN otherwise)
        )
        {
            // Calculate albedo
            // Read from climate file
            if (ReadFarmSettings.GetAttribute("Albedo", "Frequency", ErrLevel.WARNING) == "From Climate File")
            {
                Albedo = MeasAlbedo;
            }
            // Otherwise, read from monthly array
            else
            {
                Albedo = itsMonthlyAlbedo[MonthNum];
            }

            // Calculate direct horizontal if direct normal is provided
            double HDir = NDir * Math.Cos(SunZenith);

            // call Perez et al. algorithm or Hay algorithm
            switch (itsTiltAlgorithm)
            {
            case TiltAlgorithm.PEREZ:
                TGlo = GetTiltCompIrradPerez(out TDir, out TDif, out TRef, HDir, HDif, NExtra, SunZenith, SunAzimuth, AirMass, MonthNum);
                break;

            case TiltAlgorithm.HAY:
                TGlo = GetTiltCompIrradHay(out TDir, out TDif, out TRef, HDir, HDif, NExtra, SunZenith, SunAzimuth, MonthNum);
                break;

            default:
                itsTiltAlgorithm = TiltAlgorithm.HAY;
                break;
            }

            // Compute the incidence angle from the Tilt class
            IncidenceAngle = Tilt.GetIncidenceAngle(SunZenith, SunAzimuth, itsSurfaceSlope, itsSurfaceAzimuth);
        }
Example #4
0
        // Config will assign parameter variables their values as obtained from the XML file
        public void Config()
        {
            // Getting the Tilt Algorithm for the Simulation
            if (ReadFarmSettings.GetInnerText("SiteDef", "TransEnum", ErrLevel.WARNING) == "0")
            {
                itsTiltAlgorithm = TiltAlgorithm.HAY;
            }
            else if (ReadFarmSettings.GetInnerText("SiteDef", "TransEnum", ErrLevel.WARNING) == "1")
            {
                itsTiltAlgorithm = TiltAlgorithm.PEREZ;
            }
            else
            {
                ErrorLogger.Log("Tilter: Invalid tilt algorithm chosen by User. CASSYS uses Hay as default.", ErrLevel.WARNING);
                itsTiltAlgorithm = TiltAlgorithm.HAY;
            }

            // Assign the albedo parameters from the .CSYX file
            ConfigAlbedo();
        }