Exemple #1
0
        private void Button_Click_Start(object sender, RoutedEventArgs e)
        {
            try
            {
                float startPower = float.Parse(txtStartPower.Text);
                float coeffA     = float.Parse(txtCoeffA.Text.Replace('.', ','));
                float coeffB     = float.Parse(txtCoeffB.Text.Replace('.', ','));
                float coeffC     = float.Parse(txtCoeffC.Text.Replace('.', ','));

                float fuelC = float.Parse(txtFuelC.Text.Replace('.', ','));
                float fuelP = float.Parse(txtFuelP.Text.Replace('.', ','));
                float fuelV = float.Parse(txtFuelV.Text.Replace('.', ','));

                float coolantС = float.Parse(txtCoolantС.Text.Replace('.', ','));
                float coolantP = float.Parse(txtCoolantP.Text.Replace('.', ','));
                float coolantV = float.Parse(txtCoolantV.Text.Replace('.', ','));
                float coolantA = float.Parse(txtCoolantA.Text.Replace('.', ','));
                float coolantF = float.Parse(txtCoolantF.Text.Replace('.', ','));
                float coolantT = float.Parse(txtCoolantT.Text.Replace('.', ','));

                this.modelReactor = new ModelNuclearReactor(fuelC, fuelP, fuelV, coolantС, coolantP, coolantV, coolantA, coolantF, coolantT);
            } catch (System.FormatException exc)
            {
                MessageBox.Show("Введены не все параметры или введены неверно!", "Ошибка");
                Console.WriteLine(exc.ToString() + " : Не все поля заполнены или заполены неверно.");
            }
        }
Exemple #2
0
        private void Button_Click_Start(object sender, RoutedEventArgs e)
        {
            try
            {
                float startPower = float.Parse(txtStartPower.Text) * 1000000.0f;
                float initPower  = float.Parse(txtInitPower.Text) * 1000000.0f;
                float coeffA     = float.Parse(txtCoeffA.Text.Replace('.', ','));
                float coeffB     = float.Parse(txtCoeffB.Text.Replace('.', ','));
                float coeffC     = float.Parse(txtCoeffC.Text.Replace('.', ','));

                float fuelC = float.Parse(txtFuelC.Text.Replace('.', ',')); //Ct
                float fuelP = float.Parse(txtFuelP.Text.Replace('.', ',')); //pT
                float fuelV = float.Parse(txtFuelV.Text.Replace('.', ',')); //Vt
                // const1 = Ct*pT*Vt

                float coolantС = float.Parse(txtCoolantС.Text.Replace('.', ',')); //Сж
                float coolantP = float.Parse(txtCoolantP.Text.Replace('.', ',')); //рЖ
                float coolantV = float.Parse(txtCoolantV.Text.Replace('.', ',')); //Vж //const2


                if (startPower + initPower < 0)
                {
                    MessageBox.Show("Вы ввели значение параметра W0 функции отклонения мощности от номинальной больше значения самой номинальной мощности! Попробуйте ввести значение, меньшее по модулю.", "Ошибка");
                    return;
                }

                float coolantAlphaFT = float.Parse(txtCoolantA.Text.Replace('.', ',')) * 1000000.0f; //альфаFT

                float coolantT = float.Parse(txtCoolantT.Text.Replace('.', ','));                    //t0

                modelReactor = new ModelNuclearReactor(fuelC, fuelP, fuelV, coolantС, coolantP, coolantV, coolantAlphaFT, coolantT);
                double fuelParams    = modelReactor.getPt() * modelReactor.getVt() * modelReactor.getCt();
                double alphaF        = modelReactor.getAlphaFT();
                double coolantParams = modelReactor.getP() * modelReactor.getC() * modelReactor.getV();
                float  t0            = modelReactor.getT0();
                //int k = 5

                //EnvironmentPreset env = new EnvironmentPreset();
                session          = new ModellingSession(fuelParams, alphaF, coolantParams, t0, coeffA, coeffB, coeffC, startPower, initPower); //создаем новую сессию
                this.DataContext = session;
                session.ModelNextNeutron();
                plotAverageTau.InvalidatePlot();
                plotEr.InvalidatePlot();
            }
            catch (System.FormatException exc)
            {
                MessageBox.Show("Введены не все параметры или введены неверно!", "Ошибка");
                Console.WriteLine(exc.ToString() + " : Не все поля заполнены или заполены неверно.");
            }
        }