/// <summary>コピーConstructor</summary> /// <param name="sun">コピーする太陽オブジェクト</param> public Sun(ImmutableSun sun) { this.latitude = sun.Latitude; this.xLongitude = sun.Longitude; this.sLongitude = sun.StandardLongitude; }
/// <summary>日影面積率[-]を計算する</summary> /// <param name="sun">太陽</param> /// <returns>日影面積率[-]</returns> public double GetShadowRate(ImmutableSun sun) { double sr = 0; if (ssShape == Shape.None) sr = 0; else { double tanGamma, tanPhi; if (incline.GetDirectSolarRadiationRate(sun) <= 0) return 1; incline.GetTanPhiAndGamma(sun, out tanPhi, out tanGamma); double da = overhang * tanGamma; double dp = overhang * tanPhi; switch (ssShape) { case Shape.Horizontal: sr =fnasdw1(da, dp, windowWidth, windowHeight, leftMargin, topMargin, rightMargin); break; case Shape.VerticalLeft: sr = fnasdw1(dp, da, windowHeight, windowWidth, topMargin, leftMargin, bottomMargin); break; case Shape.VerticalRight: da = -da; sr = fnasdw1(dp, da, windowHeight, windowWidth, topMargin, leftMargin, bottomMargin); break; case Shape.VerticalBoth: da = Math.Abs(da); sr = fnasdw1(dp, da, windowHeight, windowWidth, topMargin, leftMargin, bottomMargin); break; case Shape.LongHorizontal: sr = fnasdw2(dp, windowHeight, windowWidth, topMargin); break; case Shape.LongVerticalLeft: sr = fnasdw2(da, windowWidth, windowHeight, leftMargin); break; case Shape.LongVerticalRight: da = -da; sr = fnasdw2(da, windowWidth, windowHeight, rightMargin); break; case Shape.LongVerticalBoth: da = Math.Abs(da); sr = fnasdw2(da, windowWidth, windowHeight, leftMargin); //ここ、問題有り。左右非対称考慮できてない break; case Shape.Grid: sr = fnasdw3(da, dp, windowWidth, windowHeight, leftMargin, topMargin, rightMargin, bottomMargin); break; } sr = sr / (windowHeight * windowWidth); if (IsReverse) return 1 - sr; } if (isReverse) return 1 - sr; else return sr; }
/// <summary>傾斜面の法線に対する太陽光線入射角の余弦cosθ[-]を計算する</summary> /// <param name="sun">太陽</param> /// <returns>傾斜面の法線に対する太陽光線入射角の余弦cosθ[-]</returns> public double GetDirectSolarRadiationRate(ImmutableSun sun) { return Math.Max(0, GetDirectSolarRadiationRateToIncline(sun, this)); }
/// <summary>プロファイル角および傾斜面の法線を基準とした太陽方位角の正接を求める</summary> /// <param name="sun">太陽</param> /// <param name="tanPhi">プロファイル角の正接</param> /// <param name="tanGamma">傾斜面の法線を基準とした太陽方位角の正接</param> public void GetTanPhiAndGamma(ImmutableSun sun, out double tanPhi, out double tanGamma) { double cosTheta = Math.Max(this.GetDirectSolarRadiationRate(sun), 0.01); double sh = Math.Sin(sun.Altitude); double ch = Math.Cos(sun.Altitude); double ss = ch * Math.Cos(sun.Orientation); double sw = ch * Math.Sin(sun.Orientation); tanPhi = (sh * sinBeta - sw * (cosBeta * sinAlpha) - ss * (cosBeta * cosAlpha)) / cosTheta; tanGamma = (sw * cosAlpha - ss * sinAlpha) / cosTheta; }
/// <summary>傾斜面の法線に対する太陽光線入射角の余弦cosθ[-]を計算する</summary> /// <param name="sun">太陽</param> /// <param name="incline">傾斜面</param> /// <returns>傾斜面に対する太陽光線入射角の余弦cosθ[-]</returns> public static double GetDirectSolarRadiationRateToIncline(ImmutableSun sun, ImmutableIncline incline) { return GetDirectSolarRadiationRateToIncline(incline.DirectionCosineZ, incline.DirectionCosineSN, incline.DirectionCosineWE, sun.Altitude, sun.Orientation); }