示例#1
0
        /// <summary> Calculates wind speed from predictor met to Map node along path of nodes.  </summary>
        public void DoWS_EstAlongNodes(Continuum thisInst, ref MapNode thisMapNode, int WS_Est_Ind)
        {
            InvestCollection radiiList = thisInst.radiiList;
            ModelCollection  modelList = thisInst.modelList;
            NodeCollection   nodeList  = new NodeCollection();

            Met thisMet    = thisInst.metList.GetMet(thisMapNode.WS_Estimates[WS_Est_Ind].predictorMetName);
            int thisRadius = thisMapNode.WS_Estimates[WS_Est_Ind].radius;

            if (thisMet == null)
            {
                return;
            }

            int numWD       = thisInst.metList.numWD;
            int radiusIndex = 0;

            for (int i = 0; i < radiiList.ThisCount; i++)
            {
                if (thisRadius == radiiList.investItem[i].radius)
                {
                    radiusIndex = i;
                    break;
                }
            }

            Model[] models    = modelList.GetModels(thisInst, thisInst.metList.GetMetsUsed(), Met.TOD.All, Met.Season.All, thisInst.modeledHeight, false);
            Model   thisModel = models[radiusIndex];

            Nodes endNode = nodeList.GetMapAsNode(thisMapNode);

            ModelCollection.WS_Est_Struct WS_EstStr = modelList.DoWS_Estimate(thisMet, endNode, thisMapNode.WS_Estimates[WS_Est_Ind].pathOfNodes, thisModel, thisInst);

            thisMapNode.WS_Estimates[WS_Est_Ind].sectorWS = WS_EstStr.sectorWS;

            // Have sectorwise wind speed at map node now need to calculate avg WS using wind rose
            for (int WD = 0; WD < numWD; WD++)
            {
                thisMapNode.WS_Estimates[WS_Est_Ind].WS = thisMapNode.WS_Estimates[WS_Est_Ind].WS + thisMapNode.WS_Estimates[WS_Est_Ind].sectorWS[WD] * thisMapNode.windRose[WD];
            }
        }