/// <summary> /// Calculates the radiation absorbed by the canopy, based on the position of the sun /// </summary> private void CalcAbsorbedRadiations(ISolarRadiation radiation) { // Set parameters Absorbed.DiffuseExtinction = Canopy.DiffuseExtCoeff; Absorbed.LeafScattering = Canopy.LeafScatteringCoeff; Absorbed.DiffuseReflection = Canopy.DiffuseReflectionCoeff; // Photon calculations (used by photosynthesis) var photons = Absorbed.CalcTotalRadiation(radiation.DirectPAR, radiation.DiffusePAR); Sunlit.PhotonCount = Absorbed.CalcSunlitRadiation(radiation.DirectPAR, radiation.DiffusePAR); Shaded.PhotonCount = photons - Sunlit.PhotonCount; // Energy calculations (used by water interaction) var PARDirect = radiation.Direct * 0.5 * 1000000; var PARDiffuse = radiation.Diffuse * 0.5 * 1000000; var NIRDirect = radiation.Direct * 0.5 * 1000000; var NIRDiffuse = radiation.Diffuse * 0.5 * 1000000; var PARTotalIrradiance = Absorbed.CalcTotalRadiation(PARDirect, PARDiffuse); var SunlitPARTotalIrradiance = Absorbed.CalcSunlitRadiation(PARDirect, PARDiffuse); var ShadedPARTotalIrradiance = PARTotalIrradiance - SunlitPARTotalIrradiance; // Adjust parameters for NIR calculations Absorbed.DiffuseExtinction = Canopy.DiffuseExtCoeffNIR; Absorbed.LeafScattering = Canopy.LeafScatteringCoeffNIR; Absorbed.DiffuseReflection = Canopy.DiffuseReflectionCoeffNIR; var NIRTotalIrradiance = Absorbed.CalcTotalRadiation(NIRDirect, NIRDiffuse); var SunlitNIRTotalIrradiance = Absorbed.CalcSunlitRadiation(NIRDirect, NIRDiffuse); var ShadedNIRTotalIrradiance = NIRTotalIrradiance - SunlitNIRTotalIrradiance; Sunlit.AbsorbedRadiation = SunlitPARTotalIrradiance + SunlitNIRTotalIrradiance; Shaded.AbsorbedRadiation = ShadedPARTotalIrradiance + ShadedNIRTotalIrradiance; }
/// <summary> /// Models a maximum rate calculation /// </summary> private double CalcMaximumRate(double psi, double coefficient) { var factor = LAI * (LeafNTopCanopy - Canopy.MinimumN) * psi; var exp = Absorbed.CalcExp(coefficient / LAI); return(factor * exp / coefficient); }
/// <summary> /// Calculates the radiation intercepted by the current layer of the canopy /// </summary> public double GetInterceptedRadiation() { // Intercepted radiation return(Absorbed.CalcInterceptedRadiation()); // TODO: Make this work with multiple layers // (by subtracting the accumulated intercepted radiation of the previous layers) e.g: // InterceptedRadiation_1 = Absorbed.CalcInterceptedRadiation() - InterceptedRadiation_0; }
/// <summary> /// Calculates the LAI for the sunlit/shaded areas of the canopy, based on the position of the sun /// </summary> private void CalcLAI() { Sunlit.LAI = Absorbed.CalculateSunlitLAI(); Shaded.LAI = LAI - Sunlit.LAI; }