private double SurfaceAreaAtDepth(double depthIn)
{
switch (this.Type)
{
case FacilityType.PlanterFlat:
return _bottomAreaSqFt;
case FacilityType.Basin:
switch (this.Shape)
{
case FacilityShape.Rectangle:
{
double l = _bottomAreaSqFt / _bottomWidthFt;
double w = _bottomWidthFt;
double sideArea;
double cornerArea;
double spread = _sideSlopeRatio * (depthIn) / 12;
sideArea = 2 * spread * (l + w);
cornerArea = Math.PI * Math.Pow(spread, 2);
return (_bottomAreaSqFt + sideArea + cornerArea);
}
case FacilityShape.Amoeba:
{
return (_bottomAreaSqFt + _bottomPerimeterLengthFt * (depthIn) / 12 * _sideSlopeRatio);
}
case FacilityShape.UserDefined:
{
if (depthIn <= _storageDepth1In)
{
// Area at depth, linear interpolation
return _bottomAreaSqFt + (_surfaceAreaAtStorageDepth1SqFt - _bottomAreaSqFt) * (depthIn / _storageDepth1In);
}
else
{
// Area at depth, linear interpolation up to Surface Area At Storage Depth 2
return _surfaceAreaAtStorageDepth1SqFt + (_surfaceAreaAtStorageDepth2SqFt - _surfaceAreaAtStorageDepth1SqFt)
* ((depthIn - _storageDepth1In) / (_storageDepth2In - _storageDepth1In));
}
}
default:
throw new NotImplementedException();
}
case FacilityType.PlanterSloped:
throw new NotImplementedException();
case FacilityType.Swale:
throw new NotImplementedException();
default:
throw new NotImplementedException();
}
}