public void TestMethod1() { var geoInput = new GeometryInput(); var refInput = new RefStateInput(); var airInput = new AirStateInput(); CapiliaryInput capInput = new CapiliaryInput(); //ref input refInput.FluidName = "R32"; AbstractState coolprop = AbstractState.factory("HEOS", refInput.FluidName); refInput.Massflowrate = 0.01870031119662376; //kg/s for (int i = 0; i < 20; i++) { //for condenser refInput.tc = 45; refInput.tri = 80; //for evaporator //refInput.te = 280 - 273.15; //refInput.P_exv = CoolProp.PropsSI("P", "T", refInput.tc + 273.15, "Q", 0, refInput.FluidName) / 1000; //refInput.T_exv = refInput.tc - 8; //refInput.H_exv = 250; //air input airInput.Volumetricflowrate = 0.01 + i * 0.025789474; //m3/s airInput.tai = 25; airInput.RHi = 0.5; airInput.ha = 80; //geo input, mm geoInput.Pt = 21; geoInput.Pr = 22; geoInput.Di = 6.9; geoInput.Do = 7.4; geoInput.L = 842; geoInput.FPI = 21; geoInput.Fthickness = 0.095; geoInput.Nrow = 2; geoInput.Ntube = 24; geoInput.CirNum = 2; //cap input capInput.d_cap = new double[] { 0.006, 0.006 }; capInput.lenth_cap = new double[] { 0.5, 0.5 }; DateTime Time1 = DateTime.Now; var rr = Main.main_condenser_py(refInput, airInput, geoInput, Model.HumidAirSourceData.SourceTableData); DateTime Time2 = DateTime.Now; double time = (Time2 - Time1).TotalSeconds; using (StreamWriter wr = File.AppendText(@"D:\Work\Simulation\Test\smoothness.txt")) { wr.WriteLine("v, {0}, href, {1}, PressD, {2}, Q, {3}, Xo, {4}, Tro, {5}, Hro, {6}, Charge, {7}, Time, {8}", airInput.Volumetricflowrate, rr.href, rr.DP, rr.Q, rr.x_o, rr.Tro, rr.hro, rr.M, time); } } //var r = Main.main_evaporator_py(refInput, airInput, geoInput); }
public void TestMethod1(double[,] SourceTableData) { //var r = Main.main_evaporator(); //var r1 = Main.main_condenser(); RefStateInput refInput = new RefStateInput(); CapiliaryInput cap_inlet = new CapiliaryInput(); CapiliaryInput cap_outlet = new CapiliaryInput(); refInput.FluidName = "R32"; AbstractState coolprop = AbstractState.factory("HEOS", refInput.FluidName); refInput.Massflowrate = 0.005; refInput.tc = 45; refInput.tri = 75; AirStateInput airInput = new AirStateInput(); airInput.RHi = 0.5; airInput.tai = 35; airInput.Volumetricflowrate = 1000; GeometryInput geoInput = new GeometryInput(); geoInput.Pt = 21; geoInput.Pr = 22; geoInput.Di = 6.9; geoInput.Do = 7.4; geoInput.L = 600; geoInput.FPI = 1.3; geoInput.Fthickness = 0.095; geoInput.Nrow = 2; geoInput.Ntube = 14; geoInput.CirNum = 3; // cap input cap_inlet.d_cap = new double[6]; // { 0, 0 };//0.006 cap_inlet.lenth_cap = new double[6]; // { 0, 0 };//0.5 cap_outlet.d_cap = new double[6]; // { 0, 0 };//0.006 cap_outlet.lenth_cap = new double[6]; // { 0, 0 };//0.5 string flowtype = "逆流"; string fin_type = "平片"; string tube_type = "光管"; string hex_type = "冷凝器"; var r1 = Main.main_condenser_Slab(refInput, airInput, geoInput, flowtype, fin_type, tube_type, hex_type, cap_inlet, cap_outlet, SourceTableData); //var r = Main.MinNout(); //var r = Main.NinMout(); }
public void TestMethod1() { var geoInput = new GeometryInput(); var refInput = new RefStateInput(); var airInput = new AirStateInput(); CapiliaryInput capInput = new CapiliaryInput(); //ref input refInput.FluidName = "R32"; AbstractState coolprop = AbstractState.factory("HEOS", refInput.FluidName); //*************if input SC or Sh, Massflowrate is the initial input*************** refInput.Massflowrate = 0.02161311486;//0.02 //kg/s refInput.zh = 1.6; refInput.zdp = 4; airInput.za = 1; airInput.zdpa = 1.0; //for condenser refInput.tc = 45; refInput.tri = 80; //refInput.tc = 40; //refInput.tri = 70; //for evaporator refInput.te = 6.92842345;//12 //refInput.P_exv = CoolProp.PropsSI("P", "T", refInput.tc + 273.15, "Q", 0, refInput.FluidName) / 1000; coolprop.update(input_pairs.QT_INPUTS, 0, refInput.tc + 273.15); refInput.P_exv = coolprop.p() / 1000; refInput.T_exv = refInput.tc - 8; refInput.H_exv = 272; //air input airInput.Volumetricflowrate = 0.23; //m3/s airInput.tai = 27; //24.85 airInput.RHi = 0.47; //airInput.ha = 80; //geo input //mm geoInput.Pt = 21; geoInput.Pr = 13.37; geoInput.Di = 6.89; geoInput.Do = 7.35; geoInput.L = 653; geoInput.FPI = 21; geoInput.Fthickness = 0.095; geoInput.Nrow = 2; geoInput.Ntube = 15; geoInput.CirNum = 2; //初始化湿空气数组 double[,] HumidSourceData = Model.HumidAirSourceData.InitializeSourceTableData(); DateTime Time1 = DateTime.Now; //var rr = Main.main_condenser_py(refInput, airInput, geoInput, capInput, coolprop, Model.HumidAirSourceData.SourceTableData); //var r = Main.main_evaporator_py(refInput, airInput, geoInput, capInput, coolprop, HumidAirSourceData.SourceTableData); var rr = Main.main_condenser_py(refInput, airInput, geoInput, HumidSourceData); var r = Main.main_evaporator_py(refInput, airInput, geoInput, HumidSourceData); //for (int i=0;i<5;i++) //r = Main.main_evaporator_py(refInput, airInput, geoInput, capInput); //DateTime Time2 = DateTime.Now; //double time01 = (Time2 - Time1).TotalSeconds; //using (StreamWriter wr = File.AppendText(@"D:\QQQ.txt")) //{ // for (int i = 0; i < 10; i++) // { // refInput.H_exv = 270 + i; // var r = Main.main_evaporator_py(refInput, airInput, geoInput, HumidSourceData); // wr.WriteLine("{0}", r.Q); // } //} //using (StreamWriter wr = File.AppendText(@"D:\QQQ.txt")) //{ // for (int i = 0; i < 15; i++) // { // for (int j = 0; j < 2;j++ ) // { // wr.WriteLine("{0}", r.Q_detail[i,j]); // } // } //} //double Tsc_set = 5; //double Tsh_set = 5; //var rr = Main.main_condenser_inputSC_py(Tsc_set, refInput, airInput, geoInput, capInput, coolprop); //var rrr = Main.main_evaporator_inputSH_py(Tsh_set, refInput, airInput, geoInput, capInput, coolprop); DateTime Time2 = DateTime.Now; double time01 = (Time2 - Time1).TotalSeconds; }