Пример #1
0
        private void verticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            clsVertical  TrechoVertical = new clsVertical();
            frmTrecho    NovoTrecho     = new frmTrecho(frmTrecho.TipoJanela.Novo, frmTrecho.TipoDeTrecho.Vertical, TrechoVertical);
            DialogResult DR             = NovoTrecho.ShowDialog();

            if (DR == DialogResult.OK)
            {
                TrechoVertical.PC = DPGLV(TrechoVertical);

                Calculo.Trechos.Add(TrechoVertical);

                if (Status != Modo.Novo)
                {
                    SetStatus(Modo.Alterado);

                    TituloAlterado();
                }

                AtualizaTabela();
            }
            else
            {
            }
        }
Пример #2
0
        private void btToolCopy_Click(object sender, EventArgs e)
        {
            object Item = new object();

            Item = Calculo.Trechos[gridTrechos.CurrentRow.Index];

            if (Item is clsHorizontal)
            {
                clsHorizontal CopyH = new clsHorizontal();

                CopyH.Nome  = ((clsHorizontal)Item).Nome;
                CopyH.D     = ((clsHorizontal)Item).D;
                CopyH.L     = ((clsHorizontal)Item).L;
                CopyH.FLOWG = ((clsHorizontal)Item).FLOWG;
                CopyH.FLOWL = ((clsHorizontal)Item).FLOWL;
                CopyH.RHOG  = ((clsHorizontal)Item).RHOG;
                CopyH.RHOL  = ((clsHorizontal)Item).RHOL;
                CopyH.VISCG = ((clsHorizontal)Item).VISCG;
                CopyH.VISCL = ((clsHorizontal)Item).VISCL;
                CopyH.SIGMA = ((clsHorizontal)Item).SIGMA;
                CopyH.RF    = ((clsHorizontal)Item).RF;
                CopyH.PC    = ((clsHorizontal)Item).PC;

                CopyH.EPS = ((clsVertical)Item).EPS;

                Calculo.Trechos.Add(CopyH);
            }
            else
            {
                clsVertical CopyV = new clsVertical();

                CopyV.Nome  = ((clsVertical)Item).Nome;
                CopyV.D     = ((clsVertical)Item).D;
                CopyV.L     = ((clsVertical)Item).L;
                CopyV.FLOWG = ((clsVertical)Item).FLOWG;
                CopyV.FLOWL = ((clsVertical)Item).FLOWL;
                CopyV.RHOG  = ((clsVertical)Item).RHOG;
                CopyV.RHOL  = ((clsVertical)Item).RHOL;
                CopyV.VISCG = ((clsVertical)Item).VISCG;
                CopyV.VISCL = ((clsVertical)Item).VISCL;
                CopyV.SIGMA = ((clsVertical)Item).SIGMA;
                CopyV.EPS   = ((clsVertical)Item).EPS;
                CopyV.P     = ((clsVertical)Item).P;
                CopyV.PC    = ((clsVertical)Item).PC;

                Calculo.Trechos.Add(CopyV);
            }



            if (Status != Modo.Novo)
            {
                SetStatus(Modo.Alterado);

                TituloAlterado();
            }

            AtualizaTabela();
        }
Пример #3
0
        private double DPGLV(clsVertical TrechoV)
        {
            double NLB;
            double NLS;
            double NLM;
            double NGU;
            double ND;
            double NL;
            double NLU;
            double NSEC;
            double NHOLD;
            double LAMBDA;
            double P;
            double AREA;
            double USG;
            double USL;
            double UNS;
            double T1;
            double IFLOW;
            double RL;
            double RE;
            double T2;
            double T3;
            double FF;
            double DELP = 0;
            double SQD;
            double AN1;
            double AN2;
            double UR;
            double GAMA;
            double CGAMA;
            double GMAX;
            double DELPS = 0;
            double ANW;
            double TERM;
            double DELPM;
            double ALFA;
            double RHONS;
            double ACCN;
            double ALNSEC;
            double PSI;
            double ALNL;
            double CN;
            double ALNH;
            double VISCNS;
            double EPSD;

            P      = 1000 * TrechoV.P;
            AREA   = Math.PI * Math.Pow(TrechoV.D, 2) / 4;
            USG    = TrechoV.FLOWG / (AREA * TrechoV.RHOG);
            USL    = TrechoV.FLOWL / (AREA * TrechoV.RHOL);
            UNS    = USL + USG;
            LAMBDA = USL / UNS;
            T1     = TrechoV.EPS / (3.7 * TrechoV.D);

            if (TrechoV.D < 0.089)
            {
                // Correlação de Hagedorn e Brown
                // Cálculo do HoldUp

                ND     = 3.134 * TrechoV.D * Math.Sqrt(TrechoV.RHOL / TrechoV.SIGMA);
                NL     = 1.7696 * TrechoV.VISCL / Math.Pow((TrechoV.RHOL * Math.Pow(TrechoV.SIGMA, 3)), 0.25);
                NLU    = 0.5652 * USL * Math.Pow((TrechoV.RHOL / TrechoV.SIGMA), 0.25);
                NGU    = 0.5652 * USG * Math.Pow((TrechoV.RHOL / TrechoV.SIGMA), 0.25);
                NSEC   = NGU * Math.Pow(NL, 0.38) / Math.Pow(ND, 2.14);
                ALNSEC = Math.Log(NSEC);
                PSI    = 1 + Math.Exp(6.6598 + ALNSEC * (8.8173 + ALNSEC * (3.7693 + ALNSEC * 0.5359)));

                if (NSEC < 0.01)
                {
                    PSI = 1;
                }
                else if (NSEC > 0.09)
                {
                    PSI = 1.82;
                }

                ALNL = Math.Log(NL);
                CN   = Math.Exp(-4.895 - ALNL * (1.0775 + ALNL * (0.80822 + ALNL * (0.1597 + ALNL * 0.01019))));

                if (NL < 0.002)
                {
                    CN = 0.00195;
                }
                else if (NL > 0.4)
                {
                    CN = 0.0115;
                }

                NHOLD = (NLU / Math.Pow(NGU, 0.575)) * Math.Pow((P / (101.3 * Math.Pow(10, 3))), 0.1) * CN * (Math.Pow(10, 6) / ND);
                ALNH  = Math.Log(NHOLD);
                RL    = PSI * Math.Exp(-3.6372 + ALNH * (0.8813 + ALNH * (-0.1335 + ALNH * (0.018534 - ALNH * 0.001066))));

                if (NHOLD > 4000)
                {
                    RL = PSI;
                }
                else if (NHOLD < 0.1)
                {
                    RL = 0.02633;
                }

                if (RL < LAMBDA)
                {
                    RL = LAMBDA;
                }

                ACCN   = (TrechoV.FLOWL + TrechoV.FLOWG) * USG / (AREA * P);
                VISCNS = LAMBDA * TrechoV.VISCL + (1 - LAMBDA) * TrechoV.VISCG;
                RE     = (TrechoV.FLOWL + TrechoV.FLOWG) * TrechoV.D / (AREA * VISCNS);
                T2     = 5.02 / RE;
                T3     = Math.Log10(T1 - T2 * Math.Log10(T1 + 13 / RE));
                FF     = FRICTF(T1, T2, T3);
                DELP   = (2 * FF * (TrechoV.RHOL * Math.Pow(LAMBDA, 2) / RL + TrechoV.RHOG * Math.Pow((1 - LAMBDA), 2) / (1 - RL)) * Math.Pow(UNS, 2) / TrechoV.D + 9.81 * (RL * TrechoV.RHOL + (1 - RL) * TrechoV.RHOG)) * TrechoV.L / (1 - ACCN);
            }
            else
            {
                // Correlação de Orkiszewski

                NLB = 1.071 - 0.7277 * Math.Pow(UNS, 2) / TrechoV.D;

                if (NLB < 0.13)
                {
                    NLB = 0.13;
                }

                NLS = 50 + 20.417 * USL * Math.Pow((TrechoV.RHOL / TrechoV.SIGMA), 0.25);
                NLM = 75 + 54.77 * Math.Pow((USL * Math.Pow((TrechoV.RHOL / TrechoV.SIGMA), 0.25)), 0.75);
                NGU = 0.5652 * USG * Math.Pow((TrechoV.RHOL / TrechoV.SIGMA), 0.25);

                // Identificando Padrão de Escoamento
                // 1 - Bolhas (Bubble Flow)
                // 2 - Slug (Slug Flow)
                // 3 - Mist (Mist Flow)
                // 4 - Transição de Slug para Mist

                if (USG / UNS < NLB)
                {
                    IFLOW = 1;
                }
                else if (USG / UNS > NLB && NGU <= NLS)
                {
                    IFLOW = 2;
                }
                else if (NLM >= NGU && NGU > NLS)
                {
                    IFLOW = 3;
                }
                else
                {
                    IFLOW = 4;
                }

                if (IFLOW == 1)
                {
                    // Bubble Flow

                    RL = 0.5 - 2.0505 * UNS + Math.Sqrt(Math.Pow((0.5 + 2.0505 * UNS), 2) - 4.1011 * USG);
                    RE = TrechoV.D * USL * TrechoV.RHOL / (TrechoV.VISCL * RL);
                    T2 = 5.02 / RE;
                    T3 = Math.Log10(T1 - T2 * Math.Log10(T1 + 13 / RE));
                    FF = FRICTF(T1, T2, T3);

                    DELP = 2 * FF * Math.Pow((USL / RL), 2) * TrechoV.RHOL * TrechoV.L / TrechoV.D;
                }
                if (IFLOW == 2 || IFLOW == 3)
                {
                    // Slug Flow

                    SQD = Math.Sqrt(TrechoV.D);
                    AN1 = 0.572 * Math.Pow(10, 5) * (-0.35 + Math.Sqrt(0.1225 + 0.08932 * UNS / SQD));
                    AN2 = 0.572 * Math.Pow(10, 5) * (-0.546 + Math.Sqrt(0.2981 + 0.03349 * UNS / SQD));
                    RE  = TrechoV.D * UNS * TrechoV.RHOL / TrechoV.VISCL;
                    UR  = 0;

                    if (RE > AN1)
                    {
                        UR = (3.5955 + 9.0294 * Math.Pow(10, -5) * RE) * SQD;
                    }
                    else if (RE < AN2)
                    {
                        UR = (1.7098 + 9.0294 * Math.Pow(10, -5) * RE) * SQD;
                    }

                    if (UR <= 0)
                    {
                        GAMA = (2.5775 + 8.9805 * Math.Pow(10, -5) * RE) * SQD;
                        UR   = 0.1524 * (GAMA + Math.Sqrt(8.3391 * Math.Pow(GAMA, 2) + 1.2012 * Math.Pow(10, 5) * TrechoV.VISCL / (TrechoV.RHOL * SQD)));
                    }

                    if (UNS <= 3.048)
                    {
                        CGAMA = 2.3642 * Math.Pow(10, -3) * Math.Log10(Math.Pow(10, 3) * TrechoV.VISCL + 1) / Math.Pow(TrechoV.D, 1.415) - 0.4285 + 0.167 * Math.Log10(UNS) + 0.113 * Math.Log10(TrechoV.D);

                        if (CGAMA < (-0.2133 * UNS))
                        {
                            CGAMA = -0.2133 * UNS;
                        }
                    }
                    else
                    {
                        CGAMA = 5.3745 * Math.Pow(10, -3) * Math.Log10(Math.Pow(10, 3) * TrechoV.VISCL + 1) / Math.Pow(TrechoV.D, 1.371) - 0.1326 + 0.569 * Math.Log10(TrechoV.D) - Math.Log10(UNS / 0.3048) * (1.5466 * Math.Pow(10, -3) * Math.Log10(Math.Pow(10, 3) * TrechoV.VISCL + 1) / Math.Pow(TrechoV.D, 1.571) + 0.7221 - 0.63 * Math.Log10(TrechoV.D));
                        GMAX  = UR * (0.06243 * (TrechoV.FLOWG + TrechoV.FLOWL) / AREA - UNS) / ((UR + UNS) * (UR + UNS + 0.3048));

                        if (CGAMA < GMAX)
                        {
                            CGAMA = GMAX;
                        }
                    }

                    T2   = 5.02 / RE;
                    T3   = Math.Log10(T1 - T2 * Math.Log10(T1 + 13 / RE));
                    FF   = FRICTF(T1, T2, T3);
                    DELP = 2 * FF * Math.Pow(UNS, 2) * TrechoV.RHOL * TrechoV.L / TrechoV.D * (USL + UR) / (UNS + UR + CGAMA);

                    if (IFLOW != 2)
                    {
                        DELPS = DELP;
                        IFLOW = 4;
                    }
                }
                if (IFLOW == 4)
                {
                    // Mist FLow

                    RE = TrechoV.D * USG * TrechoV.RHOG / TrechoV.VISCG;

                    // Correção para a Rugosidade

                    ANW  = Math.Pow((USG * TrechoV.VISCL / TrechoV.SIGMA), 2) * (TrechoV.RHOG / TrechoV.RHOL);
                    TERM = TrechoV.SIGMA / (TrechoV.RHOG * Math.Pow(USG, 2) * TrechoV.D);

                    if (ANW > 0.005)
                    {
                        EPSD = 79247.3 * TERM * Math.Pow(ANW, 0.302);
                    }
                    else
                    {
                        EPSD = 34 * TERM;
                    }

                    T1   = EPSD / 3.7;
                    T2   = 5.02 / RE;
                    T3   = Math.Log10(T1 - T2 * Math.Log10(T1 + 13 / RE));
                    FF   = FRICTF(T1, T2, T3);
                    DELP = 2 * FF * TrechoV.RHOG * Math.Pow(USG, 2) * TrechoV.L / TrechoV.D;

                    if (IFLOW != 4)
                    {
                        DELPM = DELP;

                        // Transiçãao de Slug para Mist Flow

                        ALFA = (NLM - NGU) / (NLM - NLS);
                        DELP = ALFA * DELPS + (1 - ALFA) * DELPM;
                    }
                }

                RHONS = LAMBDA * TrechoV.RHOL + (1 - LAMBDA) * TrechoV.RHOG;
                ACCN  = (TrechoV.FLOWG + TrechoV.FLOWL) * USG / (AREA * P);
                DELP  = (DELP + RHONS * TrechoV.L * 9.81) / (1 - ACCN);
            }

            return(Math.Round(DELP, 4, MidpointRounding.AwayFromZero));
        }
Пример #4
0
        public frmTrecho(TipoJanela TipoJanela, TipoDeTrecho TipoTrecho, object oTrecho)
        {
            InitializeComponent();

            TipoHV = TipoTrecho;
            ArrumaBoxes(TipoTrecho);

            bool Editando = false;

            if (TipoJanela == TipoJanela.Editar)
            {
                Editando  = true;
                this.Text = "Editando Trecho";
            }
            else
            {
                Nome      = "NovoTrecho" + TipoTrecho.ToString();
                this.Text = "Adicionar Trecho " + TipoTrecho.ToString();
            }

            switch (TipoTrecho)
            {
            case TipoDeTrecho.Horizontal:
                TrechoH = (clsHorizontal)oTrecho;

                if (Editando)
                {
                    Nome  = TrechoH.Nome;
                    D     = TrechoH.D;
                    L     = TrechoH.L;
                    FLOWG = TrechoH.FLOWG;
                    FLOWL = TrechoH.FLOWL;
                    RHOG  = TrechoH.RHOG;
                    RHOL  = TrechoH.RHOL;
                    VISCG = TrechoH.VISCG;
                    VISCL = TrechoH.VISCL;
                    SIGMA = TrechoH.SIGMA;
                    RF    = TrechoH.RF;
                    EPS   = TrechoH.EPS;
                    ArrumaDecimais();
                }

                break;

            case TipoDeTrecho.Vertical:
                TrechoV = (clsVertical)oTrecho;

                if (Editando)
                {
                    Nome  = TrechoV.Nome;
                    D     = TrechoV.D;
                    L     = TrechoV.L;
                    FLOWG = TrechoV.FLOWG;
                    FLOWL = TrechoV.FLOWL;
                    RHOG  = TrechoV.RHOG;
                    RHOL  = TrechoV.RHOL;
                    VISCG = TrechoV.VISCG;
                    VISCL = TrechoV.VISCL;
                    SIGMA = TrechoV.SIGMA;
                    EPS   = TrechoV.EPS;
                    P     = TrechoV.P;

                    ArrumaDecimais();
                }
                break;
            }

            ArrumaNUD();

            txtNome.LostFocus += new EventHandler(txtNome_LostFocus);

            txtNome.KeyDown += new KeyEventHandler(frmTrecho_KeyDown);
            txtNome.Enter   += new EventHandler(txtNome_Enter);
            VerificaCampos();
        }