/// <summary> /// Handles the calculation. /// </summary> /// <param name="wallMaterial">The material that the wall is made out of.</param> /// <param name="radius">The radius of the pool.</param> /// <param name="outputUnitOfMeasure">The unit of measure that the output value should be formatted in.</param> /// <returns></returns> public static decimal CalculateMaximumWaterDepth(IWallMaterial wallMaterial, Length radius, Quantities.Length outputUnitOfMeasure = Quantities.Length.Meter) { var maximumInternalPressureWallCanWithstand = GetMaximumInternalPressureWallCanWithstand(wallMaterial); var internalPressure = GetInternalPressure(radius); var maximumWaterDepthInMeters = maximumInternalPressureWallCanWithstand / internalPressure; var convertedMaximumWaterDepth = MeterConverter.FromMetersTo(maximumWaterDepthInMeters, outputUnitOfMeasure); return(convertedMaximumWaterDepth); }
/// <summary> /// Gets the expected water depth /// </summary> /// <returns></returns> private static decimal GetExpectedMaximumWaterDepthInInches(IWallMaterial wallMaterial, Length unitOfMeasure) { var maximumWaterDepthInInches = Calculator.CalculateMaximumWaterDepth( wallMaterial, GetPoolRadiusTestFixture(), unitOfMeasure ); return(maximumWaterDepthInInches); }
/// <summary> /// Multiplies the wall's thickness by its tensile strength to find the maximum /// internal pressure that it can withstand, measured in Kilograms per second square. /// </summary> /// <param name="wallMaterial">The material that the wall is made of.</param> /// <returns></returns> private static decimal GetMaximumInternalPressureWallCanWithstand(IWallMaterial wallMaterial) { var wallMaterialThicknessInMeters = MeterConverter.ToMetersFrom( wallMaterial.Thickness.Value, wallMaterial.Thickness.UnitOfMeasure ); var wallMaterialTensileStrengthInPascals = PascalConverter.ToPascalFrom( wallMaterial.TensileStrength.Value, wallMaterial.TensileStrength.UnitOfMeasure ); var result = wallMaterialThicknessInMeters * wallMaterialTensileStrengthInPascals; return(result); }