public void ExampleTest3_CalculateSnowLoad_Success() { var buildingSite = new BuildingSite(Zones.FirstZone, Topographies.Normal, 127); buildingSite.CalculateExposureCoefficient(); var snowLoad = new SnowLoad(buildingSite, DesignSituation.B2, true); snowLoad.CalculateSnowLoad(); var building = new Building(snowLoad); building.CalculateThermalCoefficient(); var roofAbuttingToTallerConstruction5Degrees = new ExceptionalRoofAbuttingToTallerConstruction(building, 12, 14.6, 4.5, 5); roofAbuttingToTallerConstruction5Degrees.CalculateDriftLength(); roofAbuttingToTallerConstruction5Degrees.CalculateSnowLoad(); var roofAbuttingToTallerConstruction35Degrees = new ExceptionalRoofAbuttingToTallerConstruction(building, 12, 14.6, 4.5, 35); roofAbuttingToTallerConstruction35Degrees.CalculateDriftLength(); roofAbuttingToTallerConstruction35Degrees.CalculateSnowLoad(); Assert.AreEqual(14.6, Math.Round(roofAbuttingToTallerConstruction5Degrees.DriftLength, 3), "Drift length is not calculated properly."); Assert.AreEqual(1.4, Math.Round(roofAbuttingToTallerConstruction5Degrees.SnowLoadNearTheTop, 3), "Snow load for roof is not calculated properly."); Assert.AreEqual(1.4, Math.Round(roofAbuttingToTallerConstruction5Degrees.SnowLoadNearTheEdge, 3), "Snow load for roof is not calculated properly."); Assert.AreEqual(0, Math.Round(roofAbuttingToTallerConstruction35Degrees.SnowLoadNearTheTop, 3), "Snow load for roof is not calculated properly."); Assert.AreEqual(1.167, Math.Round(roofAbuttingToTallerConstruction35Degrees.SnowLoadNearTheEdge, 3), "Snow load for roof is not calculated properly."); }
public void ExceptionalRoofAbuttingToTallerConstructionTest_CalculateDriftLength_Success() { var building = BuildingImplementation.CreateBuilding(); var exceptionalRoofAbuttingToTallerConstruction = new ExceptionalRoofAbuttingToTallerConstruction(building, 20, 10, 3, 15); exceptionalRoofAbuttingToTallerConstruction.CalculateDriftLength(); Assert.AreEqual(10, Math.Round(exceptionalRoofAbuttingToTallerConstruction.DriftLength, 3), "Drift length for roof is not calculated properly."); }
public IResult Calculate() { BuildingSite buildingSite = GetBuildingSite(); SnowLoad snowLoad = GetSnowLoad(buildingSite); Building building = GetBuilding(snowLoad); ExceptionalRoofAbuttingToTallerConstruction exceptionalRoofAbuttingToTallerConstruction = GetExceptionalRoofAbuttingToTallerConstruction(building); if (!ExposureCoefficient.HasValue) { buildingSite.CalculateExposureCoefficient(); } snowLoad.CalculateSnowLoad(); building.CalculateThermalCoefficient(); exceptionalRoofAbuttingToTallerConstruction.CalculateDriftLength(); exceptionalRoofAbuttingToTallerConstruction.CalculateSnowLoad(); var result = new Result(); result.Properties.Add("C_e_", buildingSite.ExposureCoefficient); result.Properties.Add("s_k_", snowLoad.DefaultCharacteristicSnowLoad); result.Properties.Add("V", snowLoad.VariationCoefficient); result.Properties.Add("C_esl_", snowLoad.ExceptionalSnowLoadCoefficient); result.Properties.Add("s_n_", snowLoad.SnowLoadForSpecificReturnPeriod); result.Properties.Add("s_Ad_", snowLoad.DesignExceptionalSnowLoadForSpecificReturnPeriod); result.Properties.Add("t_i_", building.InternalTemperature); result.Properties.Add("∆_t_", building.TempreatureDifference); result.Properties.Add("U", building.OverallHeatTransferCoefficient); result.Properties.Add("C_t_", building.ThermalCoefficient); result.Properties.Add("l_s_", exceptionalRoofAbuttingToTallerConstruction.DriftLength); result.Properties.Add("μ_3_", exceptionalRoofAbuttingToTallerConstruction.ShapeCoefficient3); result.Properties.Add("μ_1_", exceptionalRoofAbuttingToTallerConstruction.ShapeCoefficient1); result.Properties.Add("μ_2_", exceptionalRoofAbuttingToTallerConstruction.ShapeCoefficient2); result.Properties.Add("s_1_", exceptionalRoofAbuttingToTallerConstruction.SnowLoadNearTheTop); result.Properties.Add("s_2_", exceptionalRoofAbuttingToTallerConstruction.SnowLoadNearTheEdge); return(result); }