public void GetTipSpeed_Test()
        {
            Continuum thisInst = new Continuum("");

            string fileName = testingFolder + "\\Ice throw\\Ice throw testing.cfm";

            thisInst.Open(fileName);

            TurbineCollection.PowerCurve powerCurve = thisInst.turbineList.powerCurves[0];
            double thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 2);

            Assert.AreEqual(thisSpeed, 0, 0.01, "Wrong Tip Speed Test 1");

            thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 4);
            Assert.AreEqual(thisSpeed, 3.767647, 0.01, "Wrong Tip Speed Test 2");

            thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 6);
            Assert.AreEqual(thisSpeed, 17.89632, 0.01, "Wrong Tip Speed Test 3");

            thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 8);
            Assert.AreEqual(thisSpeed, 44.62307, 0.01, "Wrong Tip Speed Test 4");

            thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 10);
            Assert.AreEqual(thisSpeed, 78.8262, 0.01, "Wrong Tip Speed Test 5");

            thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 12);
            Assert.AreEqual(thisSpeed, 103.7869, 0.01, "Wrong Tip Speed Test 6");

            thisSpeed = thisInst.siteSuitability.GetTipSpeed(powerCurve, 14);
            Assert.AreEqual(thisSpeed, 108.9085, 0.01, "Wrong Tip Speed Test 7");

            thisInst.Close();
        }
Example #2
0
        public void GenerateAvgWSTimeSeries_Test()
        {
            Continuum thisInst = new Continuum("");
            string    fileName = testingFolder + "\\Turbine TS testing.cfm";

            thisInst.Open(fileName);

            Turbine        thisTurb   = thisInst.turbineList.turbineEsts[0];
            NodeCollection nodeList   = new NodeCollection();
            Nodes          targetNode = nodeList.GetTurbNode(thisTurb);
            string         MCP_Method = thisInst.Get_MCP_Method();

            TurbineCollection.PowerCurve powerCurve = new TurbineCollection.PowerCurve();
            Wake_Model wakeModel = new Wake_Model();

            ModelCollection.TimeSeries[] thisTS = thisInst.modelList.GenerateTimeSeries(thisInst, thisInst.metList.GetMetsUsed(), targetNode, powerCurve, wakeModel, null, MCP_Method);
            thisTurb.GenerateAvgWSTimeSeries(thisTS, thisInst, wakeModel, false, MCP_Method, false, powerCurve);

            Assert.AreEqual(thisTurb.avgWS_Est[0].freeStream.WS, 5.81393758, 0.01, "Wrong WS Test 1");
            Assert.AreEqual(thisTurb.avgWS_Est[0].freeStream.sectorWS[8], 4.78742580, 0.02, "Wrong WS Test 2");
            Assert.AreEqual(thisTurb.avgWS_Est[0].freeStream.sectorWS[10], 5.43308824, 0.02, "Wrong WS Test 3");
            Assert.AreEqual(thisTurb.avgWS_Est[0].freeStream.sectorWS[15], 5.9455375, 0.02, "Wrong WS Test 4");

            thisInst.Close();
        }
        public void GetRandomRadius_Test()
        {
            SiteSuitability siteSuitability = new SiteSuitability();

            TurbineCollection.PowerCurve powerCurve = new TurbineCollection.PowerCurve();
            powerCurve.RD = 87;

            double thisRad = siteSuitability.GetRandomRadius(0, powerCurve);

            Assert.AreEqual(thisRad, 1, 0.1, "Wrong rotor radius Test 1");

            thisRad = siteSuitability.GetRandomRadius(0.2, powerCurve);
            Assert.AreEqual(thisRad, 9.7, 0.1, "Wrong rotor radius Test 2");

            thisRad = siteSuitability.GetRandomRadius(0.4, powerCurve);
            Assert.AreEqual(thisRad, 18.4, 0.1, "Wrong rotor radius Test 3");

            thisRad = siteSuitability.GetRandomRadius(0.6, powerCurve);
            Assert.AreEqual(thisRad, 27.1, 0.1, "Wrong rotor radius Test 4");

            thisRad = siteSuitability.GetRandomRadius(0.8, powerCurve);
            Assert.AreEqual(thisRad, 35.8, 0.1, "Wrong rotor radius Test 5");

            thisRad = siteSuitability.GetRandomRadius(1, powerCurve);
            Assert.AreEqual(thisRad, 44.5, 0.1, "Wrong rotor radius Test 6");
        }
Example #4
0
        public void CalcMonthlyWS_Values_Test()
        {
            Continuum thisInst = new Continuum("");

            string fileName = testingFolder + "\\Turbine TS testing.cfm";

            thisInst.Open(fileName);

            Turbine        thisTurb   = thisInst.turbineList.turbineEsts[0];
            NodeCollection nodeList   = new NodeCollection();
            Nodes          targetNode = nodeList.GetTurbNode(thisTurb);
            string         MCP_Method = thisInst.Get_MCP_Method();

            TurbineCollection.PowerCurve powerCurve = thisInst.turbineList.powerCurves[0];;
            Wake_Model wakeModel = new Wake_Model();

            ModelCollection.TimeSeries[] thisTS = thisInst.modelList.GenerateTimeSeries(thisInst, thisInst.metList.GetMetsUsed(), targetNode, powerCurve, wakeModel, null, MCP_Method);

            Turbine.MonthlyWS_Vals[] monthlyWS = thisTurb.CalcMonthlyWS_Values(thisTS, thisInst, "Freestream");

            Assert.AreEqual(monthlyWS[0].avgWS, 6.489662634, 0.01, "Wrong monthly WS Jan 2005 Test 1");
            Assert.AreEqual(monthlyWS[15].avgWS, 6.580793056, 0.01, "Wrong monthly WS Apr 2006 Test 2");
            Assert.AreEqual(monthlyWS[45].avgWS, 6.133737903, 0.01, "Wrong monthly WS Oct 2008 Test 3");
            Assert.AreEqual(monthlyWS[71].avgWS, 6.169447581, 0.01, "Wrong monthly WS Dec 2010 Test 4");

            thisInst.Close();
        }
Example #5
0
        /// <summary> Calculates gross energy production at referenced mapNode. </summary>
        public void CalcGrossAEP_AtMapNode(ref MapNode thisMapNode, MetCollection metList, TurbineCollection turbineList)
        {
            int numWS = metList.numWS;
            int numWD = metList.numWD;

            thisMapNode.sectorGross = new double[numWD];

            TurbineCollection.PowerCurve thisPowerCurve = turbineList.GetPowerCurve(powerCurve);

            thisMapNode.grossAEP = 0;

            for (int k = 0; k < numWS; k++)
            {
                double thisWS    = metList.GetWS_atWS_Ind(k);
                double thisPower = turbineList.GetInterpPowerOrThrust(thisWS, thisPowerCurve, "Power");
                thisMapNode.grossAEP = thisMapNode.grossAEP + thisMapNode.WS_Dist[k] * thisPower;
                for (int WD_Ind = 0; WD_Ind < numWD; WD_Ind++)
                {
                    thisMapNode.sectorGross[WD_Ind] = thisMapNode.sectorGross[WD_Ind] + thisMapNode.sectDist[WD_Ind, k] * thisPower;
                }
            }

            thisMapNode.grossAEP = thisMapNode.grossAEP * 365 * 24 / 1000;
            for (int WD_Ind = 0; WD_Ind < numWD; WD_Ind++)
            {
                thisMapNode.sectorGross[WD_Ind] = thisMapNode.sectorGross[WD_Ind] * 365 * 24 / 1000 * thisMapNode.windRose[WD_Ind];
            }
        }
Example #6
0
        /// <summary> Reads selected turbine power curve from form and gets power curve object. </summary>
        public TurbineCollection.PowerCurve GetPowerCurve()
        {
            TurbineCollection.PowerCurve thisPowerCurve = new TurbineCollection.PowerCurve();
            string powerCurve = "";

            try {
                if (cboPowerCrvs.SelectedItem.ToString() == "No power Curves Imported")
                {
                    MessageBox.Show("Import a power curve to calculate wake losses. On Gross Energy Estimates tab, click Import power Curve", "Continuum 3");
                    return(thisPowerCurve);
                }
                powerCurve = cboPowerCrvs.SelectedItem.ToString();
            }
            catch {
                return(thisPowerCurve);
            }

            for (int i = 0; i < thisInst.turbineList.PowerCurveCount; i++)
            {
                if (thisInst.turbineList.powerCurves[i].name == powerCurve)
                {
                    thisPowerCurve = thisInst.turbineList.powerCurves[i];
                }
            }

            return(thisPowerCurve);
        }
Example #7
0
        public void CalcNetEnergyTimeSeries_Test()
        {
            Continuum thisInst = new Continuum("");
            string    fileName = testingFolder + "\\WakeCollection TS testing.cfm";

            thisInst.Open(fileName);

            Turbine        thisTurb   = thisInst.turbineList.turbineEsts[0];
            NodeCollection nodeList   = new NodeCollection();
            Nodes          targetNode = nodeList.GetTurbNode(thisTurb);
            string         MCP_Method = thisInst.Get_MCP_Method();

            TurbineCollection.PowerCurve powerCurve = thisInst.turbineList.powerCurves[0];;
            Wake_Model wakeModel = thisInst.wakeModelList.wakeModels[0];

            // Find wake loss coeffs
            WakeCollection.WakeLossCoeffs[] wakeCoeffs = null;
            int minDistance = 10000000;
            int maxDistance = 0;

            for (int i = 0; i < thisInst.turbineList.TurbineCount; i++)
            {
                int[] Min_Max_Dist = thisInst.turbineList.CalcMinMaxDistanceToTurbines(thisInst.turbineList.turbineEsts[i].UTMX, thisInst.turbineList.turbineEsts[i].UTMY);
                if (Min_Max_Dist[0] < minDistance)
                {
                    minDistance = Min_Max_Dist[0];                                // this is min distance to turbine but when WD is at a different angle (not in line with turbines) the X dist is less than this value so making this always equal to 2*RD
                }
                if (Min_Max_Dist[1] > maxDistance)
                {
                    maxDistance = Min_Max_Dist[1];
                }
            }

            minDistance = (int)(2 * wakeModel.powerCurve.RD);
            if (maxDistance == 0)
            {
                maxDistance = 15000;                   // maxDistance will be zero when there is only one turbine. Might be good to make this value constant
            }
            wakeCoeffs = thisInst.wakeModelList.GetWakeLossesCoeffs(minDistance, maxDistance, wakeModel, thisInst.metList);

            Turbine wakedTurb = thisInst.turbineList.turbineEsts[2];

            double[] netEsts = thisInst.wakeModelList.CalcNetEnergyTimeSeries(wakeCoeffs, wakedTurb.UTMX, wakedTurb.UTMY, 6, thisInst, wakeModel, 270, 3000, 1);
            Assert.AreEqual(netEsts[0], 4.75284, 0.001, "Wrong waked WS Test 1");

            thisInst.Close();
        }
Example #8
0
        private void cboWhatToMap_SelectedIndexChanged(object sender, EventArgs e)
        {
            // if ( a Gross AEP map is selected from dropbown, the power curve dropdown is updated
            int selectedInd = 0;

            try {
                selectedInd = cboWhatToMap.SelectedIndex;
            }
            catch  {
                return;
            }

            if (selectedInd == 3)   // fill power curves
            {
                int numPowerCurves = thisInst.turbineList.PowerCurveCount;

                if (numPowerCurves == 0)
                {
                    cboPowerCrvs.Items.Clear();
                }
                else
                {
                    for (int i = 0; i < numPowerCurves; i++)
                    {
                        TurbineCollection.PowerCurve This_Pwr_Crv = thisInst.turbineList.powerCurves[i];
                        cboPowerCrvs.Items.Add(This_Pwr_Crv.name);
                    }
                }

                try {
                    cboPowerCrvs.SelectedIndex = 0;
                }
                catch  {
                    return;
                }
            }
            else
            {
                cboPowerCrvs.Text = "";
                cboPowerCrvs.Items.Clear();
            }
        }
        public void GetIceSpeed_Test()
        {
            SiteSuitability siteSuitability = new SiteSuitability();

            TurbineCollection.PowerCurve powerCurve = new TurbineCollection.PowerCurve();
            powerCurve.RD = 87;

            double iceSpeed = siteSuitability.GetIceSpeed(45, 18, powerCurve);

            Assert.AreEqual(iceSpeed, 18.62069, 0.001, "Wrong ice speed Test 1");

            iceSpeed = siteSuitability.GetIceSpeed(90, 18, powerCurve);
            Assert.AreEqual(iceSpeed, 37.24138, 0.001, "Wrong ice speed Test 2");

            iceSpeed = siteSuitability.GetIceSpeed(90, 45, powerCurve);
            Assert.AreEqual(iceSpeed, 93.10345, 0.001, "Wrong ice speed Test 3");

            iceSpeed = siteSuitability.GetIceSpeed(70, 30, powerCurve);
            Assert.AreEqual(iceSpeed, 48.27586, 0.001, "Wrong ice speed Test 4");
        }
Example #10
0
        public void Calc_CF_Test()
        {
            Continuum thisInst = new Continuum("");

            string Filename = testingFolder + "\\MERRA_Testing.cfm";

            thisInst.Open(Filename);

            Met thisMet = thisInst.metList.metItem[0];

            UTM_conversion.Lat_Long theseLL = thisInst.UTM_conversions.UTMtoLL(thisInst.metList.metItem[0].UTMX, thisInst.metList.metItem[0].UTMY);
            MERRA merra = thisInst.merraList.GetMERRA(theseLL.latitude, theseLL.longitude);

            TurbineCollection.PowerCurve powerCurve = thisInst.turbineList.powerCurves[0];

            Assert.AreEqual(0.338060246, merra.Calc_CF(456, 1, 2000, powerCurve), 0.001, "Wrong CF 31 days");
            Assert.AreEqual(0.361374746, merra.Calc_CF(456, 2, 2000, powerCurve), 0.001, "Wrong CF 29 days");
            Assert.AreEqual(0.374280987, merra.Calc_CF(456, 2, 2001, powerCurve), 0.001, "Wrong CF 28 days");
            Assert.AreEqual(0.349328921, merra.Calc_CF(456, 4, 2010, powerCurve), 0.001, "Wrong CF 30 days");
            Assert.AreEqual(0.287119661, merra.Calc_CF(4560, 100, 2001, powerCurve), 0.001, "Wrong CF normal year");
            Assert.AreEqual(0.286335181, merra.Calc_CF(4560, 100, 2010, powerCurve), 0.001, "Wrong CF leap year");

            thisInst.Close();
        }
        public void GetFlickerAngles_Test()
        {
            Continuum thisInst = new Continuum("");

            string fileName = testingFolder + "\\Shadow Flicker\\Flicker testing.cfm";

            thisInst.Open(fileName);

            Turbine thisTurb = thisInst.turbineList.turbineEsts[0]; // turbine W1

            TurbineCollection.PowerCurve powerCurve = thisInst.GetSelectedPowerCurve("Site Suitability");
            SiteSuitability.Zone[]       zones      = thisInst.siteSuitability.zones;
            double delta = 0.1;

            // Test 1
            SiteSuitability.FlickerAngles flickerAngles = thisInst.siteSuitability.GetFlickerAngles(thisInst, thisTurb, zones[0].latitude,
                                                                                                    zones[0].longitude, zones[0].xSize, zones[0].ySize, zones[0].elev, thisInst.modeledHeight, powerCurve);

            Assert.AreEqual(flickerAngles.targetAzimuthAngle, 63.08305, delta, "Wrong Azimuth Angle 1");
            Assert.AreEqual(flickerAngles.targetAltitudeAngle, 10.312314, delta, "Wrong Altitude Angle 1");
            Assert.AreEqual(flickerAngles.angleVariance, 11.98010, delta, "Wrong Angle Variance Angle 1");

            // Test 2
            flickerAngles = thisInst.siteSuitability.GetFlickerAngles(thisInst, thisTurb, zones[13].latitude,
                                                                      zones[13].longitude, zones[13].xSize, zones[13].ySize, zones[13].elev, thisInst.modeledHeight, powerCurve);

            Assert.AreEqual(flickerAngles.targetAzimuthAngle, -45.82536, delta, "Wrong Azimuth Angle 2");
            Assert.AreEqual(flickerAngles.targetAltitudeAngle, 2.0928330, delta, "Wrong Altitude Angle 2");
            Assert.AreEqual(flickerAngles.angleVariance, 2.3516538, delta, "Wrong Angle Variance Angle 2");

            // Test 3
            thisTurb      = thisInst.turbineList.turbineEsts[1];
            flickerAngles = thisInst.siteSuitability.GetFlickerAngles(thisInst, thisTurb, zones[7].latitude,
                                                                      zones[7].longitude, zones[7].xSize, zones[7].ySize, zones[7].elev, thisInst.modeledHeight, powerCurve);

            Assert.AreEqual(flickerAngles.targetAzimuthAngle, -76.17705, delta, "Wrong Azimuth Angle 3");
            Assert.AreEqual(flickerAngles.targetAltitudeAngle, 4.5205311, delta, "Wrong Altitude Angle 3");
            Assert.AreEqual(flickerAngles.angleVariance, 4.425766, delta, "Wrong Angle Variance Angle 3");

            // Test 4
            thisTurb      = thisInst.turbineList.turbineEsts[9];
            flickerAngles = thisInst.siteSuitability.GetFlickerAngles(thisInst, thisTurb, zones[19].latitude,
                                                                      zones[19].longitude, zones[19].xSize, zones[19].ySize, zones[19].elev, thisInst.modeledHeight, powerCurve);

            Assert.AreEqual(flickerAngles.targetAzimuthAngle, -142.61909, delta, "Wrong Azimuth Angle 4");
            Assert.AreEqual(flickerAngles.targetAltitudeAngle, 9.6506959, delta, "Wrong Altitude Angle 4");
            Assert.AreEqual(flickerAngles.angleVariance, 9.9490992, delta, "Wrong Angle Variance Angle 4");

            // Test 5
            thisTurb      = thisInst.turbineList.turbineEsts[5];
            flickerAngles = thisInst.siteSuitability.GetFlickerAngles(thisInst, thisTurb, zones[19].latitude,
                                                                      zones[19].longitude, zones[19].xSize, zones[19].ySize, zones[19].elev, thisInst.modeledHeight, powerCurve);

            Assert.AreEqual(flickerAngles.targetAzimuthAngle, 29.920478, delta, "Wrong Azimuth Angle 5");
            Assert.AreEqual(flickerAngles.targetAltitudeAngle, 7.4365520, delta, "Wrong Altitude Angle 5");
            Assert.AreEqual(flickerAngles.angleVariance, 7.6212801, delta, "Wrong Angle Variance Angle 5");

            // Test 6
            thisTurb      = thisInst.turbineList.turbineEsts[7];
            flickerAngles = thisInst.siteSuitability.GetFlickerAngles(thisInst, thisTurb, zones[17].latitude,
                                                                      zones[17].longitude, zones[17].xSize, zones[17].ySize, zones[17].elev, thisInst.modeledHeight, powerCurve);

            Assert.AreEqual(flickerAngles.targetAzimuthAngle, 105.7185, delta, "Wrong Azimuth Angle 5");
            Assert.AreEqual(flickerAngles.targetAltitudeAngle, 29.4846112, delta, "Wrong Altitude Angle 5");
            Assert.AreEqual(flickerAngles.angleVariance, 24.1787613, delta, "Wrong Angle Variance Angle 5");


            thisInst.Close();
        }
        public void WakeModelTypeAndSettings_Test()
        {
            Continuum thisInst = new Continuum("");
            string    fileName = "C:\\Users\\liz_w\\Desktop\\Continuum 3 GUI Testing\\SaveFolder\\OneMetTABAndGrossNet_1";

            thisInst.Open(fileName + ".cfm");
            thisInst.isTest = true;
            Wake_Model wakeModel = thisInst.wakeModelList.wakeModels[0];

            thisInst.wakeModelList.RemoveWakeModel(thisInst.turbineList, thisInst.mapList, wakeModel);
            thisInst.turbineList.ClearAllTurbines();

            string turbineFile = testingFolder + "\\Turbine sites\\Findlay\\Three rows.csv"; // 12 turbine sites, 3 rows

            thisInst.LoadTurbines(turbineFile);

            // Test wake model type and settings

            Gen_WakeModel thisWake   = new Gen_WakeModel(thisInst);
            double        horizExp   = 5;
            double        ambTI      = 10;
            double        DW_Spacing = 0;
            double        CW_Spacing = 0;
            double        ambRough   = 0;
            string        crvName    = thisInst.turbineList.powerCurves[0].name;

            TurbineCollection.PowerCurve crvObject = thisInst.turbineList.powerCurves[0];
            double wakeRecharge = 0;

            Turbine.Avg_Est thisEst = new Turbine.Avg_Est();

            string outputFile = testingFolder + "\\Calc WS.csv";

            double[] wakedEsts    = new double[0];
            int      wakeModelInd = 0;

            for (int modelInd = 0; modelInd < 3; modelInd++)
            {
                for (int comboInd = 0; comboInd < 5; comboInd++)
                {
                    for (int horizInd = 0; horizInd < 2; horizInd++)
                    {
                        if (horizInd == 0)
                        {
                            horizExp = 5;
                        }
                        else if (horizInd == 1)
                        {
                            horizExp = 6;
                        }

                        thisWake.cboWakeCombo.SelectedIndex = comboInd;
                        thisWake.cboWakeModel.SelectedIndex = modelInd;
                        thisWake.cboPowerCrvs.SelectedIndex = 0;
                        thisWake.txtHorizWakeExp.Text       = horizExp.ToString();
                        thisWake.txtAmbTI.Text = ambTI.ToString();

                        if (modelInd == 1) // Deep-array model
                        {
                            DW_Spacing = 5;
                            CW_Spacing = 2;
                            ambRough   = 0.005;
                            thisWake.txtDownSpace.Text  = DW_Spacing.ToString();
                            thisWake.txtCrossSpace.Text = CW_Spacing.ToString();
                            thisWake.txtAmbRough.Text   = ambRough.ToString();
                        }
                        else
                        {
                            DW_Spacing = 0;
                            CW_Spacing = 0;
                            ambRough   = 0;
                        }

                        thisWake.GenWakeModel();

                        while (thisInst.BW_worker.DoWorkDone == false && thisInst.BW_worker.WasReturned == false)
                        {
                            Thread.Sleep(100);
                        }

                        string comboName = thisWake.cboWakeCombo.SelectedItem.ToString();
                        wakeModel = thisInst.wakeModelList.GetWakeModel(modelInd, horizExp, ambTI, DW_Spacing, CW_Spacing, ambRough, crvName, comboName);
                        thisEst   = thisInst.turbineList.turbineEsts[10].GetAvgWS_Est(wakeModel);

                        for (int i = 0; i < wakeModelInd; i++)
                        {
                            Assert.AreNotEqual(thisEst.waked.WS, wakedEsts[i], "Same estimate calculated. ModelInd:" + modelInd + ", ComboInd:" + comboInd + ", HorizInd: " + horizInd);
                        }

                        wakeModelInd++;
                        Array.Resize(ref wakedEsts, wakeModelInd);
                        wakedEsts[wakeModelInd - 1] = thisEst.waked.WS;

                        thisInst.updateThe.AllTABs(thisInst);
                        thisInst.BW_worker.Close();
                    }
                }
            }


            thisInst.Close();
        }
Example #13
0
        /// <summary> Reads wake loss model settings from form and adds wake model to list and calls background_worker to conduct turbine calcs. </summary>
        public void GenWakeModel()
        {
            int    wakeModelType = ReadWakeModelType();
            double horizExp      = ReadHorizExp();

            TurbineCollection.PowerCurve thisPowerCurve = GetPowerCurve();
            double avgTI     = ReadTI();
            string wakeCombo = ReadWakeCombo();

            double DW_Spacing = 0;
            double CW_Spacing = 0;
            double ambRough   = 0;

            if (wakeModelType == 1)
            { // read in inputs for DAWM
                DW_Spacing = ReadDW_Spacing();
                CW_Spacing = ReadCW_Spacing();
                ambRough   = ReadAmbRough();
            }

            // Check to see if wake model has been added
            bool wakeModelExists = thisInst.wakeModelList.WakeModelExists(wakeModelType, horizExp, avgTI, thisPowerCurve.name, DW_Spacing, CW_Spacing, ambRough, wakeCombo);

            if (wakeModelExists == false)
            {
                thisInst.wakeModelList.AddWakeModel(wakeModelType, horizExp, avgTI, thisPowerCurve, DW_Spacing, CW_Spacing, ambRough, wakeCombo);
            }

            int wakeModelInd = 0;

            for (int i = 0; i < thisInst.wakeModelList.NumWakeModels; i++)
            {
                if (thisInst.wakeModelList.wakeModels[i].wakeModelType == wakeModelType && thisInst.wakeModelList.wakeModels[i].horizWakeExp == horizExp &&
                    thisInst.wakeModelList.wakeModels[i].powerCurve.name == thisPowerCurve.name && thisInst.wakeModelList.wakeModels[i].ambTI == avgTI &&
                    thisInst.wakeModelList.wakeModels[i].comboMethod == wakeCombo)
                {
                    if (wakeModelType == 1)
                    {
                        if (thisInst.wakeModelList.wakeModels[i].DW_Spacing == DW_Spacing && thisInst.wakeModelList.wakeModels[i].CW_Spacing == CW_Spacing &&
                            thisInst.wakeModelList.wakeModels[i].ambRough == ambRough)
                        {
                            wakeModelInd = i;
                            break;
                        }
                    }
                    else
                    {
                        wakeModelInd = i;
                        break;
                    }
                }
            }

            if (thisInst.turbineList.TurbineCount > 0)
            {
                if (thisInst.turbineList.turbineEsts[0].EstsExistForWakeModel(thisInst.wakeModelList.wakeModels[wakeModelInd], thisInst.wakeModelList))
                {
                    MessageBox.Show("Wake losses have already been calculated with this model and settings.", "Continuum 3");
                    return;
                }
            }
            else
            {
                Close();
                return;
            }

            if (thisInst.turbineList.turbineEsts[0].EstsExistForWakeModel(thisInst.wakeModelList.wakeModels[wakeModelInd], thisInst.wakeModelList) == false)
            {
                BackgroundWork.Vars_for_TurbCalcs argsForBW = new BackgroundWork.Vars_for_TurbCalcs();

                if (thisInst.metList.ThisCount > 0)
                {
                    argsForBW.thisInst      = thisInst;
                    argsForBW.thisWakeModel = thisInst.wakeModelList.wakeModels[wakeModelInd];
                    argsForBW.MCP_Method    = thisInst.Get_MCP_Method();

                    // Call background worker to run calculations
                    thisInst.BW_worker = new BackgroundWork();
                    thisInst.BW_worker.Call_BW_TurbCalcs(argsForBW);
                    thisInst.ChangesMade();
                }
            }
            else
            {
                // Update Net turb tab
                Update updateThe = new Update();
                updateThe.NetTurbineEstsTAB(thisInst);
            }

            Close();
        }