/// <summary>気象状態計算の例</summary> private static void weatherTest() { //東京における太陽を作成 Sun sun = new Sun(Sun.City.Tokyo); //太陽位置を12月21日12時に調整 DateTime dTime = new DateTime(1983, 12, 21, 12, 0, 0); sun.Update(dTime); sun.GlobalHorizontalRadiation = 467; Console.WriteLine("東京の12月21日12時における"); Console.WriteLine("太陽高度=" + Sky.RadianToDegree(sun.Altitude).ToString("F1") + " 度"); Console.WriteLine("太陽方位=" + Sky.RadianToDegree(sun.Orientation).ToString("F1") + " 度"); Console.WriteLine("水平面全天日射=" + sun.GlobalHorizontalRadiation.ToString("F1") + " W/m2"); //傾斜面を作成(南西の垂直面と東の45°傾斜面) Incline seInc = new Incline(Incline.Orientation.SE, 0.5 * Math.PI); Incline wInc = new Incline(Incline.Orientation.W, 0.25 * Math.PI); //直散分離の手法を取得 Array methods = Enum.GetValues(typeof(Sun.DiffuseAndDirectNormalRadiationEstimatingMethod)); foreach (Sun.DiffuseAndDirectNormalRadiationEstimatingMethod method in methods) { //直散分離を実行して太陽に設定 sun.EstimateDiffuseAndDirectNormalRadiation(sun.GlobalHorizontalRadiation, method); //傾斜面へ入射する直達日射成分を計算する double cosThetaSE, cosThetaW; cosThetaSE = seInc.GetDirectSolarRadiationRate(sun); cosThetaW = wInc.GetDirectSolarRadiationRate(sun); Console.WriteLine(); Console.WriteLine("直散分離手法 : " + method.ToString()); Console.WriteLine("法線面直達日射=" + sun.DirectNormalRadiation.ToString("F1") + " W/m2"); Console.WriteLine("水平面直達日射=" + (sun.DirectNormalRadiation * Math.Sin(sun.Altitude)).ToString("F1") + " W/m2"); Console.WriteLine("天空日射=" + sun.DiffuseHorizontalRadiation.ToString("F1") + " W/m2"); Console.WriteLine("南西垂直面の直達日射=" + (sun.DirectNormalRadiation * cosThetaSE).ToString("F1") + " W/m2"); Console.WriteLine("東45度面の直達日射=" + (sun.DirectNormalRadiation * cosThetaW).ToString("F1") + " W/m2"); } Console.Read(); }
/// <summary>Sample program calculating weather state</summary> private static void weatherTest() { //Create an instance of the Sun class. (Location is Tokyo) Sun sun = new Sun(Sun.City.Tokyo); //Set date and time information(1983/12/21 12:00) DateTime dTime = new DateTime(1983, 12, 21, 12, 0, 0); sun.Update(dTime); //Create instances of the Incline class. Vertical south east surface and 45 degree west surface. Incline seInc = new Incline(Incline.Orientation.SE, 0.5 * Math.PI); Incline wInc = new Incline(Incline.Orientation.W, 0.25 * Math.PI); //Estimate direct normal and diffuse horizontal radiation from global horizontal radiation (467 W/m2) sun.EstimateDiffuseAndDirectNormalRadiation(467); //Calculate insolation rate on the inclined plane. double cosThetaSE, cosThetaW; cosThetaSE = seInc.GetDirectSolarRadiationRate(sun); cosThetaW = wInc.GetDirectSolarRadiationRate(sun); Console.WriteLine("Location:Tokyo, Date and time:12/21 12:00"); Console.WriteLine("Altitude of sun=" + Sky.RadianToDegree(sun.Altitude).ToString("F1") + " degree"); Console.WriteLine("Orientation of sun=" + Sky.RadianToDegree(sun.Orientation).ToString("F1") + " degree"); Console.WriteLine("Direct normal radiation=" + sun.DirectNormalRadiation.ToString("F1") + " W/m2"); Console.WriteLine("Diffuse horizontal radiation=" + sun.GlobalHorizontalRadiation.ToString("F1") + " W/m2"); Console.WriteLine("Direct normal radiation to SE surface=" + (sun.DirectNormalRadiation * cosThetaSE).ToString("F1") + " W/m2"); Console.WriteLine("Direct normal radiation to W surface=" + (sun.DirectNormalRadiation * cosThetaW).ToString("F1") + " W/m2"); Console.Read(); }