Ejemplo n.º 1
0
        /// <summary>
        /// Updates the model to a new timestep
        /// </summary>
        public void DoTimestepUpdate(IntervalValues interval, double sunFraction = 0, double shadeFraction = 0)
        {
            Canopy.DoTimestepAdjustment(Radiation);

            var totalHeat  = Canopy.CalcBoundaryHeatConductance();
            var sunlitHeat = Canopy.CalcSunlitBoundaryHeatConductance();

            var shadedHeat = (totalHeat == sunlitHeat) ? double.Epsilon : totalHeat - sunlitHeat;

            PerformPhotosynthesis(Canopy.Sunlit, sunlitHeat, sunFraction);
            interval.Sunlit = Canopy.Sunlit.GetAreaValues();

            PerformPhotosynthesis(Canopy.Shaded, shadedHeat, shadeFraction);
            interval.Shaded = Canopy.Shaded.GetAreaValues();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Attempt to initialise models based on the current time, and test if they are sensible
        /// </summary>
        private bool TryInitiliase(IntervalValues I)
        {
            Temperature.UpdateAirTemperature(I.Time);
            Radiation.UpdateRadiationValues(I.Time);
            var sunAngle = Solar.SunAngle(I.Time);

            Canopy.DoSolarAdjustment(sunAngle);

            if (IsSensible())
            {
                return(true);
            }
            else
            {
                I.Sunlit = new AreaValues();
                I.Shaded = new AreaValues();

                return(false);
            }
        }