public void MultiSpanRoofTest_Constructor_Success() { var building = BuildingImplementation.CreateBuilding(); var multiSpanRoof = new MultiSpanRoof(building, new MonopitchRoof(building, 45), new MonopitchRoof(building, 15)); Assert.IsNotNull(multiSpanRoof, "MultiSpanRoof should be created."); Assert.AreEqual(45, multiSpanRoof.LeftRoof.Slope, "Slope should be set at construction time."); Assert.AreEqual(15, multiSpanRoof.RightRoof.Slope, "Slope should be set at construction time."); }
public void MultiSpanRoofTest_CalculateSnowLoad_Success() { var building = BuildingImplementation.CreateBuilding(); var multiSpanRoof = new MultiSpanRoof(building, new MonopitchRoof(building, 45), new MonopitchRoof(building, 15)); multiSpanRoof.CalculateSnowLoad(); Assert.AreEqual(0.36, Math.Round(multiSpanRoof.LeftRoof.SnowLoadOnRoofValue, 3), "Snow load for left roof is not calculated properly."); Assert.AreEqual(0.72, Math.Round(multiSpanRoof.RightRoof.SnowLoadOnRoofValue, 3), "Snow load for right roof is not calculated properly."); Assert.AreEqual(1.44, Math.Round(multiSpanRoof.SnowLoadOnMiddleRoof, 3), "Snow load for middle roof is not calculated properly."); }
public IResult Calculate() { BuildingSite buildingSite = GetBuildingSite(); SnowLoad snowLoad = GetSnowLoad(buildingSite); Building building = GetBuilding(snowLoad); MultiSpanRoof multiSpanRoof = GetMultiSpanRoof(building); if (!ExposureCoefficient.HasValue) { buildingSite.CalculateExposureCoefficient(); } snowLoad.CalculateSnowLoad(); building.CalculateThermalCoefficient(); multiSpanRoof.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("μ_1_(α_1_)", multiSpanRoof.LeftRoof.ShapeCoefficient); result.Properties.Add("μ_1_(α_2_)", multiSpanRoof.RightRoof.ShapeCoefficient); result.Properties.Add("μ_2_(α)", multiSpanRoof.ShapeCoefficient); result.Properties.Add("s(α_1_)", multiSpanRoof.LeftRoof.SnowLoadOnRoofValue); result.Properties.Add("s(α_2_)", multiSpanRoof.RightRoof.SnowLoadOnRoofValue); result.Properties.Add("s_middle_", multiSpanRoof.SnowLoadOnMiddleRoof); return(result); }
public SnowLoadMultispanRoof() { BuildingData = new BuildingData(); MultiSpanRoof = new MultiSpanRoof(BuildingData.Building, 0, 0); }