개정판 a25e9bcd
issue #1201 : 2 Phase 계산식
Change-Id: If8b0516eb60c819a2699ad82741030acd29b12fa
HYTOS/HYTOS/Calculation.py | ||
---|---|---|
1632 | 1632 |
values = {} |
1633 | 1633 |
values['Phase_Type'] = 'Mixed' |
1634 | 1634 |
values['Flowrate_Mass'] = float(self.process['v_flowrate']) + float(self.process['l_flowrate']) |
1635 |
values['Viscosity'] = None
|
|
1636 |
values['Temperature'] = None if self.process['v_temp'] == '-' else float(self.process['v_temp'])
|
|
1637 |
values['Molecular_Weight'] = None if self.process['v_mw'] == '-' else float(self.process['v_mw'])
|
|
1638 |
values['Specific_Heat_Ratio'] = None
|
|
1639 |
values['Compress_Factor'] = None if self.process['v_z'] == '-' else float(self.process['v_z'])
|
|
1640 |
values['Limitation_Velocity'] = None
|
|
1641 |
values['Limitation_Pressure_Drop'] = None
|
|
1642 |
values['Reynolds'] = None
|
|
1643 |
values['Friction_Factor'] = None
|
|
1644 |
values['Pressure_Drop'] = None
|
|
1635 |
values['Viscosity'] = 'Mixed'
|
|
1636 |
values['Temperature'] = self.process['v_temp']
|
|
1637 |
values['Molecular_Weight'] = self.process['v_mw']
|
|
1638 |
values['Specific_Heat_Ratio'] = 'Mixed'
|
|
1639 |
values['Compress_Factor'] = self.process['v_z']
|
|
1640 |
values['Limitation_Velocity'] = 'Mixed'
|
|
1641 |
values['Limitation_Pressure_Drop'] = 'Mixed'
|
|
1642 |
values['Reynolds'] = 'Mixed'
|
|
1643 |
values['Friction_Factor'] = 'Mixed'
|
|
1644 |
values['Pressure_Drop'] = 'Mixed'
|
|
1645 | 1645 |
|
1646 | 1646 |
values['Nominal_Pipe_Size'] = self.geometry.item(0, 1).text() |
1647 | 1647 |
values['Schedule_No'] = self.geometry.item(0, 2).text() |
1648 | 1648 |
values['Inside_Pipe_Size'] = self.geometry.item(0, 3).text() |
1649 | 1649 |
|
1650 |
values['Straight_Length'] = None
|
|
1650 |
values['Straight_Length'] = 'Mixed'
|
|
1651 | 1651 |
equivalent_length = self.get_equivalent_length() |
1652 | 1652 |
values['Equivalent_Length'] = equivalent_length |
1653 | 1653 |
values['Equivalent_Length_Cal'] = equivalent_length |
HYTOS/HYTOS/GeometryData_MixedDialog.py | ||
---|---|---|
276 | 276 |
from RoughnessDialog import QRoughnessDialog |
277 | 277 |
|
278 | 278 |
dialog = QRoughnessDialog() |
279 |
roughness = dialog.show_dialog() |
|
279 |
roughness = dialog.show_dialog('Mixed')
|
|
280 | 280 |
|
281 | 281 |
self.ui.lineEdit_Roughness.setText(str(roughness)) |
282 | 282 |
|
HYTOS/HYTOS/HMBTable.py | ||
---|---|---|
116 | 116 |
|
117 | 117 |
@flowrate_mass.setter |
118 | 118 |
def flowrate_mass(self, value): |
119 |
self._flowrate_mass = float(value) if value else None
|
|
119 |
self._flowrate_mass = value
|
|
120 | 120 |
|
121 | 121 |
@property |
122 | 122 |
def flowrate_volume(self): |
... | ... | |
124 | 124 |
|
125 | 125 |
@flowrate_volume.setter |
126 | 126 |
def flowrate_volume(self, value): |
127 |
self._flowrate_volume = float(value) if value else None
|
|
127 |
self._flowrate_volume = value
|
|
128 | 128 |
|
129 | 129 |
@property |
130 | 130 |
def density(self): |
... | ... | |
132 | 132 |
|
133 | 133 |
@density.setter |
134 | 134 |
def density(self, value): |
135 |
self._density = float(value) if value else None
|
|
135 |
self._density = value
|
|
136 | 136 |
|
137 | 137 |
@property |
138 | 138 |
def viscosity(self): |
... | ... | |
140 | 140 |
|
141 | 141 |
@viscosity.setter |
142 | 142 |
def viscosity(self, value): |
143 |
self._viscosity = float(value) if value else None
|
|
143 |
self._viscosity = value
|
|
144 | 144 |
|
145 | 145 |
@property |
146 | 146 |
def temperature(self): |
... | ... | |
148 | 148 |
|
149 | 149 |
@temperature.setter |
150 | 150 |
def temperature(self, value): |
151 |
self._temperature = float(value) if value else None
|
|
151 |
self._temperature = value
|
|
152 | 152 |
|
153 | 153 |
@property |
154 | 154 |
def molecular_weight(self): |
... | ... | |
156 | 156 |
|
157 | 157 |
@molecular_weight.setter |
158 | 158 |
def molecular_weight(self, value): |
159 |
self._molecular_weight = float(value) if value else None
|
|
159 |
self._molecular_weight = value
|
|
160 | 160 |
|
161 | 161 |
@property |
162 | 162 |
def specific_heat_ratio(self): |
... | ... | |
164 | 164 |
|
165 | 165 |
@specific_heat_ratio.setter |
166 | 166 |
def specific_heat_ratio(self, value): |
167 |
self._specific_heat_ratio = float(value) if value else None
|
|
167 |
self._specific_heat_ratio = value
|
|
168 | 168 |
|
169 | 169 |
@property |
170 | 170 |
def compress_factor(self): |
... | ... | |
172 | 172 |
|
173 | 173 |
@compress_factor.setter |
174 | 174 |
def compress_factor(self, value): |
175 |
self._compress_factor = float(value) if value else None
|
|
175 |
self._compress_factor = value
|
|
176 | 176 |
|
177 | 177 |
@property |
178 | 178 |
def nominal_pipe_size(self): |
... | ... | |
180 | 180 |
|
181 | 181 |
@nominal_pipe_size.setter |
182 | 182 |
def nominal_pipe_size(self, value): |
183 |
self._nominal_pipe_size = float(value) if value else None
|
|
183 |
self._nominal_pipe_size = value
|
|
184 | 184 |
|
185 | 185 |
@property |
186 | 186 |
def inside_pipe_size(self): |
... | ... | |
188 | 188 |
|
189 | 189 |
@inside_pipe_size.setter |
190 | 190 |
def inside_pipe_size(self, value): |
191 |
self._inside_pipe_size = float(value) if value else None
|
|
191 |
self._inside_pipe_size = value
|
|
192 | 192 |
|
193 | 193 |
@property |
194 | 194 |
def schedule_no(self): |
... | ... | |
205 | 205 |
|
206 | 206 |
@straight_length.setter |
207 | 207 |
def straight_length(self, value): |
208 |
self._straight_length = float(value) if value else None
|
|
208 |
self._straight_length = value
|
|
209 | 209 |
|
210 | 210 |
@property |
211 | 211 |
def equivalent_length(self): |
... | ... | |
213 | 213 |
|
214 | 214 |
@equivalent_length.setter |
215 | 215 |
def equivalent_length(self, value): |
216 |
self._equivalent_length = float(value) if value else None
|
|
216 |
self._equivalent_length = value
|
|
217 | 217 |
|
218 | 218 |
@property |
219 | 219 |
def equivalent_length_input(self): |
... | ... | |
221 | 221 |
|
222 | 222 |
@equivalent_length_input.setter |
223 | 223 |
def equivalent_length_input(self, value): |
224 |
self._equivalent_length_input = float(value) if value else None
|
|
224 |
self._equivalent_length_input = value
|
|
225 | 225 |
|
226 | 226 |
@property |
227 | 227 |
def fitting_length(self): |
... | ... | |
229 | 229 |
|
230 | 230 |
@fitting_length.setter |
231 | 231 |
def fitting_length(self, value): |
232 |
self._fitting_length = float(value) if value else None
|
|
232 |
self._fitting_length = value
|
|
233 | 233 |
|
234 | 234 |
@property |
235 | 235 |
def fitting_K(self): |
... | ... | |
237 | 237 |
|
238 | 238 |
@fitting_K.setter |
239 | 239 |
def fitting_K(self, value): |
240 |
self._fitting_K = float(value) if value else None
|
|
240 |
self._fitting_K = value
|
|
241 | 241 |
|
242 | 242 |
@property |
243 | 243 |
def equivalent_length_cal(self): |
... | ... | |
245 | 245 |
|
246 | 246 |
@equivalent_length_cal.setter |
247 | 247 |
def equivalent_length_cal(self, value): |
248 |
self._equivalent_length_cal = float(value) if value else None
|
|
248 |
self._equivalent_length_cal = value
|
|
249 | 249 |
|
250 | 250 |
@property |
251 | 251 |
def roughness(self): |
... | ... | |
253 | 253 |
|
254 | 254 |
@roughness.setter |
255 | 255 |
def roughness(self, value): |
256 |
self._roughness = float(value) if value else None
|
|
256 |
self._roughness = value
|
|
257 | 257 |
|
258 | 258 |
@property |
259 | 259 |
def limitation_velocity(self): |
... | ... | |
261 | 261 |
|
262 | 262 |
@limitation_velocity.setter |
263 | 263 |
def limitation_velocity(self, value): |
264 |
self._limitation_velocity = float(value) if value else None
|
|
264 |
self._limitation_velocity = value
|
|
265 | 265 |
|
266 | 266 |
@property |
267 | 267 |
def limitation_pressure_drop(self): |
... | ... | |
269 | 269 |
|
270 | 270 |
@limitation_pressure_drop.setter |
271 | 271 |
def limitation_pressure_drop(self, value): |
272 |
self._limitation_pressure_drop = float(value) if value else None
|
|
272 |
self._limitation_pressure_drop = value
|
|
273 | 273 |
|
274 | 274 |
@property |
275 | 275 |
def velocity(self): |
... | ... | |
277 | 277 |
|
278 | 278 |
@velocity.setter |
279 | 279 |
def velocity(self, value): |
280 |
self._velocity = float(value) if value else None
|
|
280 |
self._velocity = value
|
|
281 | 281 |
|
282 | 282 |
@property |
283 | 283 |
def reynolds(self): |
... | ... | |
285 | 285 |
|
286 | 286 |
@reynolds.setter |
287 | 287 |
def reynolds(self, value): |
288 |
self._reynolds = float(value) if value else None
|
|
288 |
self._reynolds = value
|
|
289 | 289 |
|
290 | 290 |
@property |
291 | 291 |
def friction_factor(self): |
... | ... | |
293 | 293 |
|
294 | 294 |
@friction_factor.setter |
295 | 295 |
def friction_factor(self, value): |
296 |
self._friction_factor = float(value) if value else None
|
|
296 |
self._friction_factor = value
|
|
297 | 297 |
|
298 | 298 |
@property |
299 | 299 |
def pressure_drop(self): |
... | ... | |
301 | 301 |
|
302 | 302 |
@pressure_drop.setter |
303 | 303 |
def pressure_drop(self, value): |
304 |
self._pressure_drop = float(value) if value else None
|
|
304 |
self._pressure_drop = value
|
|
305 | 305 |
|
306 | 306 |
@property |
307 | 307 |
def pressure_drop_friction(self): |
... | ... | |
309 | 309 |
|
310 | 310 |
@pressure_drop_friction.setter |
311 | 311 |
def pressure_drop_friction(self, value): |
312 |
self._pressure_drop_friction = float(value) if value else None
|
|
312 |
self._pressure_drop_friction = value
|
|
313 | 313 |
|
314 | 314 |
@property |
315 | 315 |
def pressure_drop_static(self): |
... | ... | |
317 | 317 |
|
318 | 318 |
@pressure_drop_static.setter |
319 | 319 |
def pressure_drop_static(self, value): |
320 |
self._pressure_drop_static = float(value) if value is not None else None
|
|
320 |
self._pressure_drop_static = value
|
|
321 | 321 |
|
322 | 322 |
@property |
323 | 323 |
def pressure_pipe_end_point(self): |
... | ... | |
325 | 325 |
|
326 | 326 |
@pressure_pipe_end_point.setter |
327 | 327 |
def pressure_pipe_end_point(self, value): |
328 |
self._pressure_pipe_end_point = float(value) if value is not None else None
|
|
328 |
self._pressure_pipe_end_point = value
|
|
329 | 329 |
|
330 | 330 |
@property |
331 | 331 |
def power(self): |
... | ... | |
333 | 333 |
|
334 | 334 |
@power.setter |
335 | 335 |
def power(self, value): |
336 |
self._power = float(value) if value is not None else None
|
|
336 |
self._power = value
|
|
337 | 337 |
|
338 | 338 |
def fromRow(row): |
339 | 339 |
hmb = HMBData() |
HYTOS/HYTOS/RoughnessDialog.py | ||
---|---|---|
38 | 38 |
def double_clicked(self, row): |
39 | 39 |
QDialog.accept(self) |
40 | 40 |
|
41 |
def show_dialog(self): |
|
41 |
def show_dialog(self, phase_type=None):
|
|
42 | 42 |
self.init_units() |
43 |
self.init_roughness() |
|
43 |
self.init_roughness(phase_type)
|
|
44 | 44 |
self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint) |
45 | 45 |
self.exec_() |
46 | 46 |
|
... | ... | |
66 | 66 |
|
67 | 67 |
return item |
68 | 68 |
|
69 |
def init_roughness(self): |
|
69 |
def init_roughness(self, phase_type):
|
|
70 | 70 |
from AppDocData import AppDocData |
71 | 71 |
|
72 | 72 |
self.ui.tableWidget_Roughness.setColumnCount(6) |
... | ... | |
97 | 97 |
self.ui.tableWidget_Roughness.hideColumn(3) |
98 | 98 |
self.ui.tableWidget_Roughness.hideColumn(4) |
99 | 99 |
|
100 |
roughness_list = AppDocData.instance().getRoughness() |
|
100 |
if phase_type == 'Mixed': |
|
101 |
roughness_list = AppDocData.instance().getRoughness('Mixed') |
|
102 |
else: |
|
103 |
roughness_list = AppDocData.instance().getRoughness('Normal') |
|
104 |
|
|
101 | 105 |
for roughness in roughness_list: |
102 | 106 |
row_count = self.ui.tableWidget_Roughness.rowCount() |
103 | 107 |
self.ui.tableWidget_Roughness.setRowCount(row_count + 1) |
HYTOS/HYTOS/StreamDataDialog.py | ||
---|---|---|
385 | 385 |
process['v_mw'] = self.ui.lineEdit_Mixed_Molecular_Weight_Vapor.text() |
386 | 386 |
process['v_z'] = self.ui.lineEdit_Mixed_Compress_Factor_Vapor.text() |
387 | 387 |
|
388 |
if is_not_blank(process['l_flowrate']) or is_not_blank(process['v_flowrate']) or is_not_blank( |
|
389 |
process['l_density']) or is_not_blank(process['l_viscosity']) or is_not_blank( |
|
390 |
process['v_viscosity']): |
|
388 |
if self.ui.tableWidget_GeometryData_Mixed.rowCount() == 0: |
|
389 |
QMessageBox.information(self, self.tr("Notice"), self.tr("Please input [Geometry Data] !")) |
|
390 |
elif is_not_blank(process['l_flowrate']) or is_not_blank(process['v_flowrate']) or is_not_blank( |
|
391 |
process['l_density']) or is_not_blank(process['l_viscosity']) or is_not_blank(process['v_viscosity']): |
|
391 | 392 |
if is_not_blank(process['v_density']): |
392 | 393 |
if is_not_blank(process['tp_pressure']): |
393 | 394 |
Calculation_2Phase(self.item.uid, process, self.ui.tableWidget_GeometryData_Mixed) |
... | ... | |
401 | 402 |
else: |
402 | 403 |
QMessageBox.information(self, self.tr("Notice"), self.tr("Please input [Vapor property] !")) |
403 | 404 |
return |
404 |
elif self.ui.tableWidget_GeometryData_Mixed.rowCount() == 0: |
|
405 |
QMessageBox.information(self, self.tr("Notice"), self.tr("Please input [Geometry Data] !")) |
|
406 | 405 |
else: |
407 | 406 |
QMessageBox.information(self, self.tr("Notice"), self.tr("Please input all property !")) |
408 | 407 |
except Exception as ex: |
내보내기 Unified diff