예제 #1
0
        public int GetMaxTemp(PinchDataModels model, int type)
        {
            for (int i = 1; i <= 100; i++)
            {
                model.Approach = i;
                if (type == 0)
                {
                    postStreams((StreamModel)model);
                }
                else
                {
                    postExchangers((ExchangerModel)model);
                }

                List <Interval> interval = new List <Interval>();
                List <Net>      net      = new List <Net>();
                getPinchPoint   trial    = new getPinchPoint(Streams, UtilityStreams, interval, net, model.Approach, model.Units, this.formNumber);
                trial.getCurrentDuties();
                if (trial.TAppLimitReached())
                {
                    Streams.Clear();
                    UtilityStreams.Clear();
                    return(i);
                }
                Streams.Clear();
                UtilityStreams.Clear();
            }
            return(100);
        }
예제 #2
0
        public double getQh(double approach, List <PinchAnalysis_DLL.NormalStream> streams)
        {
            List <PinchAnalysis_DLL.NormalStream> NewStreams = ExtensionMethods.CloneStreamsWithNewApproach(streams, approach);
            List <Interval> trialInterval = new List <Interval>();
            List <Net>      trialNet      = new List <Net>();
            getPinchPoint   trial         = new getPinchPoint(NewStreams, UtilityStreams, trialInterval, trialNet, approach, NewStreams[0].Units, this.formNumber);

            if (approach == 1)
            {
                trial.getCurrentDuties();
                CurrentQh = trial.CurrentQh;
            }
            return(Math.Abs(CurrentQh - Math.Abs(trial.Qh)));
        }
예제 #3
0
        public void CalculateCurrentApproach(StreamModel model, int type)
        {
            MaxApproach = GetMaxTemp(model, type);

            for (int i = 1; i <= MaxApproach; i++)
            {
                getPinchPoint trial = PinchFun(model, i, type);
                trial.getCurrentDuties();
                if (trial.Qh == trial.CurrentQc)
                {
                    trial.CurrentApproach = i;
                }
            }
        }
예제 #4
0
        public IHttpActionResult Calculate(List <PinchAnalysis_DLL.NormalStream> streams, List <PinchAnalysis_DLL.UtilityStream> UtilityStreams, double ApproachTemp)
        {
            List <Interval> interval = new List <Interval>();
            List <Net>      net      = new List <Net>();

            if (CurrentApproach == -1)
            {
                CurrentApproach = Bisection(1, 100, 0.01, streams);
            }
            getPinchPoint getPinch = new getPinchPoint(streams, UtilityStreams, interval, net, ApproachTemp, streams[0].Units, this.formNumber);

            getPinch.drawGccDiagram();
            getPinch.drawHTDiagram();
            getPinch.drawGridDiagram();
            getPinch.getCurrentDuties();
            getPinch.getCurrentDutiesPerUtility();
            getPinch.CurrentApproach = CurrentApproach;
            Solution answer = getPinch.Answer();

            return(Ok(answer));
        }
예제 #5
0
        public getPinchPoint PinchFun(PinchDataModels model, int approach, int type)
        {
            model.Approach = approach;
            if (type == 0)
            {
                postStreams((StreamModel)model);
            }
            else
            {
                postExchangers((ExchangerModel)model);
            }

            List <Interval> interval = new List <Interval>();
            List <Net>      net      = new List <Net>();
            getPinchPoint   trial    = new getPinchPoint(Streams, UtilityStreams, interval, net, model.Approach, model.Units, this.formNumber);

            trial.getCurrentDuties();
            trial.drawGccDiagram();
            trial.drawHTDiagram();
            return(trial);
        }