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); }
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); }
public List <PinchAnalysis_DLL.UtilityStream> FillUtilityStreamLists(List <PinchAnalysis_DLL.UtilityStream> UtilityStreams, PinchDataModels model) { if (model.hotUtilityStreams != null) { foreach (var item in model.hotUtilityStreams) { if (model.DutyType == 0) { UtilityStreams.Add(new PinchAnalysis_DLL.HotUtilityStream(item.name, model.Approach, item.UtilityApproach, item.Supply, item.Target, item.Duty, 0, 0, model.Units, item.Cost)); } else { UtilityStreams.Add(new PinchAnalysis_DLL.HotUtilityStream(item.name, model.Approach, item.UtilityApproach, item.Supply, item.Target, -1, 1, item.Duty, model.Units, item.Cost)); } } } if (model.coldUtilityStreams != null) { foreach (var item in model.coldUtilityStreams) { if (model.DutyType == 0) { UtilityStreams.Add(new PinchAnalysis_DLL.ColdUtilityStream(item.name, model.Approach, item.UtilityApproach, item.Supply, item.Target, item.Duty, 0, 0, model.Units, item.Cost)); } else { UtilityStreams.Add(new PinchAnalysis_DLL.ColdUtilityStream(item.name, model.Approach, item.UtilityApproach, item.Supply, item.Target, -1, 1, item.Duty, model.Units, item.Cost)); } } } return(UtilityStreams); }