private void calculateUltimateTopOil() { double topOilUltimate = 0; for (int i = 0; i < topOilTemp.Length; i++) { if (i == 0) { // We must calculate top oil temperature using KRMS; // Define Top Oil Ultimate topOilUltimate = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((kRMS * kRMS * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Console.WriteLine("This should be 26.8 : " +topOilUltimate); ultimateTopOil[i] = Math.Round(topOilUltimate, 2); continue; } // Calculate top Oil Ultimate first then calculate TOP oil topOilUltimate = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((perUnitValues[i - 1] * perUnitValues[i - 1] * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); ultimateTopOil[i] = Math.Round(topOilUltimate, 2); } }
//**************************************************************METHODS*************************************************************** private void calculateInfo() { // We have Krms, so we can calculate the following for the FIRST iteration double TOInitial = 0; double TOUlt = 0; for (int i = 0; i < topOilTemp.Length; i++) { // If we are at the first iteration We must calculate the Tau at this iteration if (i == 0) { // Initial TO before iterations TOInitial = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((kRMS * kRMS * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Now that we have this, we can find the current iteration value TOUlt = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((perUnitValues[i] * perUnitValues[i] * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Calculate Tau calculateTauTO(TOUlt, TOInitial, i); // Use Top Oil Initial for Krms as First TO Value topOilTemp[i] = TOInitial; // Next find HotSpot Temperature hotSpotTemp[i] = xfrmr.getdeltaThetaHS_R() * Math.Pow(perUnitValues[i], 2 * xfrmr.getM()); // Get Hottest Spot Temperautre hottestSpotTemp[i] = topOilTemp[i] + hotSpotTemp[i] + xfrmr.getAmbientTemp(); // Continue the rest of the loop continue; } // Initial TO before iterations TOInitial = topOilTemp[i - 1]; // Now that we have this, we can find the current iteration value TOUlt = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((perUnitValues[i] * perUnitValues[i] * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Calculate Tau calculateTauTO(TOUlt, TOInitial, i); // Use Top Oil Initial for Krms as First TO Value topOilTemp[i] = (TOUlt * (1 - Math.Exp(-t / tauTO[i]))) + (TOInitial * Math.Exp(-t / tauTO[i])); // Next find HotSpot Temperature hotSpotTemp[i] = xfrmr.getdeltaThetaHS_R() * Math.Pow(perUnitValues[i], 2 * xfrmr.getM()); // Get Hottest Spot Temperautre hottestSpotTemp[i] = topOilTemp[i] + hotSpotTemp[i] + xfrmr.getAmbientTemp(); // Check threshold if (hottestSpotTemp[i] > threshold) { perUnitValues[i] = perUnitValues[i] - 0.01; i--; } // Check if max is below threshold. If so increase it, until it is below threshold // Make sure to stop increasing it at a certain point or else infinite loop! } this.maxPerUnit = perUnitValues.Max(); }
//**************************************************************METHODS*************************************************************** private void calculateInfo() { // We have Krms, so we can calculate the following for the FIRST iteration double TOInitial = 0; double TOUlt = 0; for (int i = 0; i < topOilTemp.Length; i++) { // If we are at the first iteration We must calculate the Tau at this iteration if (i == 0) { // Initial TO before iterations TOInitial = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((kRMS * kRMS * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Now that we have this, we can find the current iteration value TOUlt = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((perUnitValues[i] * perUnitValues[i] * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Calculate Tau calculateTauTO(TOUlt, TOInitial, i); // Use Top Oil Initial for Krms as First TO Value topOilTemp[i] = TOInitial; // Next find HotSpot Temperature hotSpotTemp[i] = xfrmr.getdeltaThetaHS_R() * Math.Pow(perUnitValues[i], 2 * xfrmr.getM()); // Get Hottest Spot Temperautre hottestSpotTemp[i] = topOilTemp[i] + hotSpotTemp[i] + xfrmr.getAmbientTemp(); // Continue the rest of the loop continue; } // Initial TO before iterations TOInitial = topOilTemp[i - 1]; // Now that we have this, we can find the current iteration value TOUlt = (xfrmr.getdeltaThetaTO_R()) * Math.Pow(((perUnitValues[i] * perUnitValues[i] * xfrmr.getR()) + 1) / (xfrmr.getR() + 1), xfrmr.getN()); // Calculate Tau calculateTauTO(TOUlt, TOInitial, i); // Use Top Oil Initial for Krms as First TO Value topOilTemp[i] = (TOUlt * (1 - Math.Exp(-t / tauTO[i]))) + (TOInitial * Math.Exp(-t / tauTO[i])); // Next find HotSpot Temperature hotSpotTemp[i] = xfrmr.getdeltaThetaHS_R() * Math.Pow(perUnitValues[i], 2 * xfrmr.getM()); // Get Hottest Spot Temperautre hottestSpotTemp[i] = topOilTemp[i] + hotSpotTemp[i] + xfrmr.getAmbientTemp(); } }