public IResult Calculate() { BuildingSite buildingSite = GetBuildingSite(); SnowLoad snowLoad = GetSnowLoad(buildingSite); Building building = GetBuilding(snowLoad); DriftingAtProjectionsObstructions driftingAtProjectionsObstructions = GetDriftingAtProjectionsObstructions(building); if (!ExposureCoefficient.HasValue) { buildingSite.CalculateExposureCoefficient(); } snowLoad.CalculateSnowLoad(); building.CalculateThermalCoefficient(); driftingAtProjectionsObstructions.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_", driftingAtProjectionsObstructions.FirstShapeCoefficient); result.Properties.Add("μ_2_", driftingAtProjectionsObstructions.SecondShapeCoefficient); result.Properties.Add("l_s_", driftingAtProjectionsObstructions.DriftLength); result.Properties.Add("s_2_", driftingAtProjectionsObstructions.SnowLoadOnRoofValue); result.Properties.Add("s_1_", driftingAtProjectionsObstructions.SnowLoadOnRoofValueAtTheEnd); return(result); }
public SnowLoadDriftingAtProjectionsObstructions() { BuildingData = new BuildingData(); //BuildingSite = new BuildingSite(); //SnowLoad = new SnowLoad(BuildingSite); //Building = new Building(SnowLoad); DriftingAtProjectionsObstructions = new DriftingAtProjectionsObstructions(BuildingData.Building, 0); }
public void DriftingAtProjectionsObstructionsTest_CalculateDriftLength_Success() { var building = BuildingImplementation.CreateBuilding(); var driftingAtProjectionsObstructions = new DriftingAtProjectionsObstructions(building, 4); driftingAtProjectionsObstructions.CalculateDriftLength(); Assert.AreEqual(8, Math.Round(driftingAtProjectionsObstructions.DriftLength, 3), "Drift length for roof is not calculated properly."); }
public void DriftingAtProjectionsObstructionsTest_Constructor_Success() { var building = BuildingImplementation.CreateBuilding(); var driftingAtProjectionsObstructions = new DriftingAtProjectionsObstructions(building, 2); Assert.IsNotNull(driftingAtProjectionsObstructions, "DriftingAtProjectionsObstructions should be created."); Assert.AreEqual(2, driftingAtProjectionsObstructions.ObstructionHeight, "Height should be set at construction time."); }
public void DriftingAtProjectionsObstructionsTest_CalculateSnowLoad_Success() { var building = BuildingImplementation.CreateBuilding(); var driftingAtProjectionsObstructions = new DriftingAtProjectionsObstructions(building, 4); driftingAtProjectionsObstructions.CalculateSnowLoad(); Assert.AreEqual(1.8, Math.Round(driftingAtProjectionsObstructions.SnowLoadOnRoofValue, 3), "Snow load near the obstruction is not calculated properly."); Assert.AreEqual(0.72, Math.Round(driftingAtProjectionsObstructions.SnowLoadOnRoofValueAtTheEnd, 3), "Snow load at the end of drifting length is not calculated properly."); }