public new void Calculate() { string[] layerNames = PerviousPavements.Descriptions(); double[] voidSpaces = PerviousPavements.Values(); double[] thickness = getThicknesses(); double[] storage = new double[layerNames.Length]; double totalStorage = 0; for (int i = 0; i < layerNames.Count(); i++) { try { storage[i] = SurfaceArea * thickness[i] * voidSpaces[i] / 100 / 12; //ac-ft totalStorage += storage[i]; } catch { storage[i] = 0; } } Storage = AsString(storage, 2); TotalStorage = totalStorage; RetentionVolume = TotalStorage; // ac-ft ContributingArea = WatershedArea - SurfaceArea; //RetentionDepth = RetentionVolume / ContributingArea * 12.0; // RetentionDepth = RetentionVolume / WatershedArea * 12.0; base.Calculate(); }
public string PavementsAsHtml() { string s = "<table><tr><td>Pavement Type</td><td>Thickness (in)</td><td>Storage (in)</td><td>Storage (ac-ft)</td></tr>"; string[] layerNames = PerviousPavements.Descriptions(); double[] voidSpaces = PerviousPavements.Values(); double[] thickness = getThicknesses(); double[] storageIN = new double[layerNames.Length]; double[] storageCF = new double[layerNames.Length]; double totalStorageIN = 0; double totalStorageCF = 0; for (int i = 0; i < layerNames.Count(); i++) { try { storageIN[i] = thickness[i] * voidSpaces[i] / 100; storageCF[i] = SurfaceArea * storageIN[i] / 12; //ac-ft if (storageCF[i] != 0) { s += "<tr><td>" + PerviousPavements.getDescription(i) + "</td><td>"; s += AsString(thickness[i], 2) + "</td><td>"; s += AsString(thickness[i] * voidSpaces[i] / 100, 3) + "</td><td>"; s += AsString(storageCF[i], 3) + "</td></tr>"; } totalStorageIN += storageIN[i]; totalStorageCF += storageCF[i]; } catch { storageIN[i] = 0; storageCF[i] = 0; } } s += "<tr><td colspan='2'><b>Total</b></td><td>" + AsString(totalStorageIN, 3) + "</td><td>" + AsString(totalStorageCF, 3) + "</td></tr></table>"; return(s); }