ANYstructure 5.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- anystruct/ANYstructure_documentation.pdf +0 -0
- anystruct/SN_curve_parameters.py +35 -0
- anystruct/__init__.py +0 -0
- anystruct/__main__.py +24 -0
- anystruct/api.py +772 -0
- anystruct/buckling_calc_external.py +120 -0
- anystruct/bulb_anglebar_tbar_flatbar.csv +677 -0
- anystruct/calc_loads.py +526 -0
- anystruct/calc_structure.py +4838 -0
- anystruct/compartment_window.py +176 -0
- anystruct/example_data.py +532 -0
- anystruct/example_data_puls.py +46 -0
- anystruct/excel_inteface.py +244 -0
- anystruct/fatigue_window.py +352 -0
- anystruct/grid_window.py +307 -0
- anystruct/gui.py +24 -0
- anystruct/helper.py +623 -0
- anystruct/images/ANYstructure_logo.jpg +0 -0
- anystruct/images/Buckling_Strength_of_Shells.png +0 -0
- anystruct/images/Panel_geometry_definitions.png +0 -0
- anystruct/images/current_comps_NONE.png +0 -0
- anystruct/images/fls_button.gif +0 -0
- anystruct/images/img_T_L_FB.gif +0 -0
- anystruct/images/img_axial_stresses.gif +0 -0
- anystruct/images/img_ext_pressure_button.gif +0 -0
- anystruct/images/img_ext_pressure_button_def.gif +0 -0
- anystruct/images/img_fixation_parameters.gif +0 -0
- anystruct/images/img_generate_report.gif +0 -0
- anystruct/images/img_int_pressure_button.gif +0 -0
- anystruct/images/img_int_pressure_button_search.gif +0 -0
- anystruct/images/img_multi_opt.gif +0 -0
- anystruct/images/img_optimize.gif +0 -0
- anystruct/images/img_plate_and_stiffener.gif +0 -0
- anystruct/images/img_stf_button.gif +0 -0
- anystruct/images/img_stiffener.gif +0 -0
- anystruct/images/img_stress_button.gif +0 -0
- anystruct/images/img_title.gif +0 -0
- anystruct/images/img_transverse_stress.gif +0 -0
- anystruct/load_factor_window.py +166 -0
- anystruct/load_window.py +721 -0
- anystruct/main_application.py +7918 -0
- anystruct/make_grid_numpy.py +506 -0
- anystruct/make_queue.py +52 -0
- anystruct/make_stack.py +52 -0
- anystruct/ml_files/CL_CSR-Tank_req_cl_predictor.pickle +0 -0
- anystruct/ml_files/CL_CSR-Tank_req_cl_scaler.pickle +0 -0
- anystruct/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_predictor.pickle +0 -0
- anystruct/ml_files/CL_CSR_plate_cl,_CSR_web_cl,_CSR_web_flange_cl,_CSR_flange_cl_scaler.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_110_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_buc_115_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_110_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_predictor_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_1_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_1_UP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_2,_3_SP.pickle +0 -0
- anystruct/ml_files/CL_output_cl_str_ult_115_scaler_In-plane_support_cl_2,_3_UP.pickle +0 -0
- anystruct/opt_problem.py +31 -0
- anystruct/optimize.py +1680 -0
- anystruct/optimize_cylinder.py +898 -0
- anystruct/optimize_geometry.py +1708 -0
- anystruct/optimize_multiple_window.py +1507 -0
- anystruct/optimize_window.py +1117 -0
- anystruct/pl_stf_window.py +572 -0
- anystruct/report_generator.py +912 -0
- anystruct/sections.csv +202 -0
- anystruct/sesam_interface.py +115 -0
- anystruct/ship_section_example.txt +1 -0
- anystruct/stresses_window.py +269 -0
- anystruct/testCalc.py +118 -0
- anystructure-5.2.0.dist-info/METADATA +86 -0
- anystructure-5.2.0.dist-info/RECORD +99 -0
- anystructure-5.2.0.dist-info/WHEEL +5 -0
- anystructure-5.2.0.dist-info/entry_points.txt +2 -0
- anystructure-5.2.0.dist-info/licenses/LICENSE +21 -0
- anystructure-5.2.0.dist-info/top_level.txt +1 -0
anystruct/calc_loads.py
ADDED
|
@@ -0,0 +1,526 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
class Loads():
|
|
4
|
+
'''
|
|
5
|
+
This Class calculates the load to be applied on the structure
|
|
6
|
+
'''
|
|
7
|
+
|
|
8
|
+
def __init__(self, main_load_dict):
|
|
9
|
+
|
|
10
|
+
self.main_load_dict = main_load_dict
|
|
11
|
+
self.static_draft = main_load_dict['static_draft']
|
|
12
|
+
self.poly_third = main_load_dict['poly_third']
|
|
13
|
+
self.poly_second = main_load_dict['poly_second']
|
|
14
|
+
self.poly_first = main_load_dict['poly_first']
|
|
15
|
+
self.poly_const = main_load_dict['poly_const']
|
|
16
|
+
self.manual_press = main_load_dict['man_press']
|
|
17
|
+
self.load_condition = main_load_dict['load_condition']
|
|
18
|
+
|
|
19
|
+
if main_load_dict['load_condition'] == 'slamming':
|
|
20
|
+
self.slamming_pl_reduction_factor = main_load_dict['slamming mult pl']
|
|
21
|
+
self.slamming_stf_reduction_factor = main_load_dict['slamming mult stf']
|
|
22
|
+
else:
|
|
23
|
+
self.slamming_pl_reduction_factor = 1
|
|
24
|
+
self.slamming_stf_reduction_factor = 1
|
|
25
|
+
|
|
26
|
+
self.name_of_load = main_load_dict['name_of_load']
|
|
27
|
+
try:
|
|
28
|
+
self.limit_state = main_load_dict['limit_state']
|
|
29
|
+
except KeyError:
|
|
30
|
+
self.limit_state = 'ULS'
|
|
31
|
+
try:
|
|
32
|
+
self.horizontal_types = main_load_dict['structure_types']['horizontal']
|
|
33
|
+
self.vertical_types = main_load_dict['structure_types']['vertical']
|
|
34
|
+
except KeyError:
|
|
35
|
+
self.horizontal_types = ['BOTTOM', 'BBT', 'HOPPER', 'MD']
|
|
36
|
+
self.vertical_types = ['BBS', 'SIDE_SHELL', 'SSS']
|
|
37
|
+
|
|
38
|
+
self.dynamic_pressure = 0
|
|
39
|
+
self.static_pressure = 0
|
|
40
|
+
self.is_external = True
|
|
41
|
+
|
|
42
|
+
def __str__(self):
|
|
43
|
+
string = str('Properties selected load is:'+
|
|
44
|
+
'\n----------------------------'+
|
|
45
|
+
'\n Name of load: ' + str(self.name_of_load) +
|
|
46
|
+
'\n Polynominal (x^3): '+ str(self.poly_third) +
|
|
47
|
+
'\n Polynominal (x^2): '+ str(self.poly_second) +
|
|
48
|
+
'\n Polynominal (x): '+ str(self.poly_first) +
|
|
49
|
+
'\n Constant (C): '+ str(self.poly_const) +
|
|
50
|
+
'\n Load condition: '+ str(self.load_condition) +
|
|
51
|
+
'\n Limit state ' + str(self.limit_state) +
|
|
52
|
+
'\n Is external? '+ str(self.is_external) +
|
|
53
|
+
'\n Static draft: '+ str(self.static_draft))
|
|
54
|
+
return string
|
|
55
|
+
|
|
56
|
+
def get_calculated_pressure(self,varibale_value, acceleration, structure_type):
|
|
57
|
+
'''
|
|
58
|
+
Input variable is a tuple of (x,y). This method need one variable and the right one must be chosen.
|
|
59
|
+
:param varibale_value:
|
|
60
|
+
:return:
|
|
61
|
+
'''
|
|
62
|
+
#print(' pressure requested for var/acc: ', varibale_value,'/',acceleration, 'type is: ', structure_type)
|
|
63
|
+
input_var = varibale_value
|
|
64
|
+
|
|
65
|
+
if self.is_static():
|
|
66
|
+
press = 1025 * acceleration * (self.static_draft - input_var[1])
|
|
67
|
+
elif structure_type in self.horizontal_types:
|
|
68
|
+
press = self.__calculate_poly_value(input_var[0])
|
|
69
|
+
elif structure_type in self.vertical_types:
|
|
70
|
+
press = self.__calculate_poly_value(input_var[1])
|
|
71
|
+
else:
|
|
72
|
+
press = 0
|
|
73
|
+
|
|
74
|
+
if self.load_condition == 'slamming':
|
|
75
|
+
psl = self.__calculate_poly_value(0)
|
|
76
|
+
return max(press, psl)
|
|
77
|
+
else:
|
|
78
|
+
return press
|
|
79
|
+
|
|
80
|
+
def get_report_string(self):
|
|
81
|
+
return [ 'Name of load: ' + self.name_of_load,
|
|
82
|
+
'Polynominal (x^3): '+ str(self.poly_third) ,
|
|
83
|
+
'Polynominal (x^2): '+ str(self.poly_second) ,
|
|
84
|
+
'Polynominal (x): '+ str(self.poly_first) ,
|
|
85
|
+
'Constant (C): '+ str(self.poly_const) ,
|
|
86
|
+
'Load condition: '+ str(self.load_condition) ,
|
|
87
|
+
'Limit state ' + str(self.limit_state) ,
|
|
88
|
+
'Is external? '+ str(self.is_external) ,
|
|
89
|
+
'Static draft: '+ str(self.static_draft)]
|
|
90
|
+
|
|
91
|
+
def __calculate_poly_value(self, variable):
|
|
92
|
+
'''
|
|
93
|
+
Returning magnitude of load in the polynominal equation.
|
|
94
|
+
:param variable:
|
|
95
|
+
:return:
|
|
96
|
+
'''
|
|
97
|
+
|
|
98
|
+
return np.polyval( [self.poly_third, self.poly_second, self.poly_first, self.poly_const], variable)
|
|
99
|
+
|
|
100
|
+
def get_load_condition(self):
|
|
101
|
+
return self.load_condition
|
|
102
|
+
|
|
103
|
+
def is_tank_test(self):
|
|
104
|
+
return self.load_condition == 'tanktest'
|
|
105
|
+
|
|
106
|
+
def get_load_parmeters(self):
|
|
107
|
+
return self.poly_third, self.poly_second, self.poly_first, self.poly_const, self.load_condition, \
|
|
108
|
+
None, self.manual_press, self.static_draft, self.name_of_load, self.limit_state, \
|
|
109
|
+
self.slamming_pl_reduction_factor, self.slamming_stf_reduction_factor
|
|
110
|
+
|
|
111
|
+
def get_name(self):
|
|
112
|
+
return self.name_of_load
|
|
113
|
+
|
|
114
|
+
def is_static(self):
|
|
115
|
+
'''
|
|
116
|
+
Checking if the load is static type.
|
|
117
|
+
:return:
|
|
118
|
+
'''
|
|
119
|
+
return self.static_draft != None
|
|
120
|
+
|
|
121
|
+
def get_static_draft(self):
|
|
122
|
+
'''
|
|
123
|
+
Return static draft if is_static
|
|
124
|
+
:return:
|
|
125
|
+
'''
|
|
126
|
+
if self.is_static():
|
|
127
|
+
return self.static_draft
|
|
128
|
+
else:
|
|
129
|
+
pass
|
|
130
|
+
|
|
131
|
+
def get_limit_state(self):
|
|
132
|
+
''' Return ULS, FLS.... '''
|
|
133
|
+
return self.limit_state
|
|
134
|
+
|
|
135
|
+
def get_load_condition(self):
|
|
136
|
+
''' Getting loaded, ballast or part '''
|
|
137
|
+
return self.load_condition
|
|
138
|
+
|
|
139
|
+
def get_slamming_reduction_plate(self):
|
|
140
|
+
return self.slamming_pl_reduction_factor
|
|
141
|
+
|
|
142
|
+
def get_slamming_reduction_stf(self):
|
|
143
|
+
return self.slamming_stf_reduction_factor
|
|
144
|
+
|
|
145
|
+
class Tanks():
|
|
146
|
+
'''
|
|
147
|
+
This class incorporates all tank definitions
|
|
148
|
+
temp_tank_dict = {0 'comp_no' : comp_no,
|
|
149
|
+
1 'cells' : properties[0],
|
|
150
|
+
2 'min_el' : properties[1],
|
|
151
|
+
3 'max_el' : properties[2],
|
|
152
|
+
4 'content' : '',
|
|
153
|
+
5 'added_press' : 0,
|
|
154
|
+
6 'acc' : {static:g,dyn_loaded:az,dyn_ballast:az}
|
|
155
|
+
7 'density' : 1025}
|
|
156
|
+
|
|
157
|
+
'''
|
|
158
|
+
|
|
159
|
+
def __init__(self, tank_dict):
|
|
160
|
+
|
|
161
|
+
self.properties = tank_dict
|
|
162
|
+
self.compartment_number = tank_dict['comp_no']
|
|
163
|
+
self.cells = tank_dict['cells']
|
|
164
|
+
self.min_elevation = tank_dict['min_el']
|
|
165
|
+
self.max_elevation = tank_dict['max_el']
|
|
166
|
+
self.content = tank_dict['content']
|
|
167
|
+
self.added_pressure = tank_dict['added_press']
|
|
168
|
+
self.density = tank_dict['density']
|
|
169
|
+
self.acc_static = tank_dict['acc']['static']
|
|
170
|
+
self.acc_dyn_loaded = tank_dict['acc']['dyn_loaded']
|
|
171
|
+
self.acc_dyn_ballast = tank_dict['acc']['dyn_ballast']
|
|
172
|
+
self.all_types = ['crude_oil', 'diesel', 'slop', 'fresh water', 'ballast']
|
|
173
|
+
|
|
174
|
+
def __str__(self):
|
|
175
|
+
'''
|
|
176
|
+
Prints a string for the tank.
|
|
177
|
+
:return:
|
|
178
|
+
'''
|
|
179
|
+
tank_string = str('--- Tank properties (selected tank) ---'+
|
|
180
|
+
'\n Minimum elevtaion: ' + str(self.min_elevation) +
|
|
181
|
+
'\n Maximum elevation: ' + str(self.max_elevation) +
|
|
182
|
+
'\n Content of tank: ' + self.content +
|
|
183
|
+
'\n Defined density: ' + str(self.density) +
|
|
184
|
+
'\n Defined acceleration: ' + 'st = ' + str(self.acc_static) + ' , azl = ' +
|
|
185
|
+
str(self.acc_dyn_loaded) + ' , azb = ' +
|
|
186
|
+
str(self.acc_dyn_ballast) +
|
|
187
|
+
'\n Added pressure at tank top: ' + str(self.added_pressure) )
|
|
188
|
+
|
|
189
|
+
return tank_string
|
|
190
|
+
|
|
191
|
+
def set_overpressure(self, overpressure):
|
|
192
|
+
'''
|
|
193
|
+
Setter
|
|
194
|
+
:param overpressure:
|
|
195
|
+
:return:
|
|
196
|
+
'''
|
|
197
|
+
|
|
198
|
+
self.added_pressure = overpressure
|
|
199
|
+
self.properties['added_press'] = overpressure
|
|
200
|
+
|
|
201
|
+
def set_content(self, content):
|
|
202
|
+
'''
|
|
203
|
+
Setter
|
|
204
|
+
:param overpressure:
|
|
205
|
+
:return:
|
|
206
|
+
'''
|
|
207
|
+
self.properties['content'] = content
|
|
208
|
+
self.content = content
|
|
209
|
+
|
|
210
|
+
def set_acceleration(self, acc):
|
|
211
|
+
'''
|
|
212
|
+
Setter
|
|
213
|
+
:param overpressure:
|
|
214
|
+
:return:
|
|
215
|
+
'''
|
|
216
|
+
|
|
217
|
+
self.acc_static = acc['static']
|
|
218
|
+
self.properties['static'] = acc['static']
|
|
219
|
+
|
|
220
|
+
self.acc_dyn_loaded = acc['dyn_loaded']
|
|
221
|
+
self.properties['dyn_loaded'] = acc['dyn_loaded']
|
|
222
|
+
|
|
223
|
+
self.acc_dyn_ballast = acc['dyn_ballast']
|
|
224
|
+
self.properties['dyn_ballast'] = acc['dyn_ballast']
|
|
225
|
+
|
|
226
|
+
def set_density(self,density):
|
|
227
|
+
'''
|
|
228
|
+
Setter
|
|
229
|
+
:param overpressure:
|
|
230
|
+
:return:
|
|
231
|
+
'''
|
|
232
|
+
self.properties['density'] = density
|
|
233
|
+
self.density = density
|
|
234
|
+
|
|
235
|
+
def get_name(self):
|
|
236
|
+
'''
|
|
237
|
+
Returns the name of the compartmnet
|
|
238
|
+
:return:
|
|
239
|
+
'''
|
|
240
|
+
return 'comp'+str(self.compartment_number)
|
|
241
|
+
|
|
242
|
+
def get_highest_elevation(self):
|
|
243
|
+
'''
|
|
244
|
+
Find the top of the tank.
|
|
245
|
+
:return:
|
|
246
|
+
'''
|
|
247
|
+
return self.max_elevation
|
|
248
|
+
|
|
249
|
+
def get_lowest_elevation(self):
|
|
250
|
+
'''
|
|
251
|
+
Find the bottom of the tank.
|
|
252
|
+
:return:
|
|
253
|
+
'''
|
|
254
|
+
return self.min_elevation
|
|
255
|
+
|
|
256
|
+
def get_line_pressure_from_max_pressure(self, pressure, coordinates):
|
|
257
|
+
'''
|
|
258
|
+
Used when you have a maximum pressure and request the pressure at a specific coordinate.
|
|
259
|
+
:param coordinates:
|
|
260
|
+
:return:
|
|
261
|
+
'''
|
|
262
|
+
elevation = coordinates[1]
|
|
263
|
+
return pressure *((self.get_highest_elevation()-elevation)/
|
|
264
|
+
(self.get_highest_elevation()-self.get_lowest_elevation()))
|
|
265
|
+
|
|
266
|
+
def get_calculated_pressure(self, coordinates, acceleration):
|
|
267
|
+
'''
|
|
268
|
+
Get the pressure with specified variable.
|
|
269
|
+
:param elevaiton:
|
|
270
|
+
:return:
|
|
271
|
+
'''
|
|
272
|
+
|
|
273
|
+
elevation = coordinates[1]
|
|
274
|
+
press = (self.get_highest_elevation()-elevation)*self.density*acceleration
|
|
275
|
+
#print(' tank calculated pressure: ',str(self.get_highest_elevation()),'-', str(elevation),'*', str(self.density),'*',str(acceleration), ' = ', press)
|
|
276
|
+
return press
|
|
277
|
+
|
|
278
|
+
def get_bottom_pressure(self):
|
|
279
|
+
'''
|
|
280
|
+
Get pressure at bottom of tank.
|
|
281
|
+
:return:
|
|
282
|
+
'''
|
|
283
|
+
|
|
284
|
+
return (self.get_highest_elevation() - self.get_lowest_elevation()) * self.density * self.acceleration + self.added_pressure
|
|
285
|
+
|
|
286
|
+
def get_top_pressure(self):
|
|
287
|
+
'''
|
|
288
|
+
Get the pressure at the top of the tank.
|
|
289
|
+
:return:
|
|
290
|
+
'''
|
|
291
|
+
|
|
292
|
+
return self.added_pressure
|
|
293
|
+
|
|
294
|
+
def get_density(self):
|
|
295
|
+
'''
|
|
296
|
+
Get the tank density.
|
|
297
|
+
:return:
|
|
298
|
+
'''
|
|
299
|
+
return self.density
|
|
300
|
+
|
|
301
|
+
def get_content(self):
|
|
302
|
+
'''
|
|
303
|
+
Returnt the tank content type
|
|
304
|
+
:return:
|
|
305
|
+
'''
|
|
306
|
+
return self.content
|
|
307
|
+
|
|
308
|
+
def get_accelerations(self):
|
|
309
|
+
'''
|
|
310
|
+
Returns the defined accelerations
|
|
311
|
+
:return:
|
|
312
|
+
'''
|
|
313
|
+
return (self.acc_static, self.acc_dyn_loaded,self.acc_dyn_ballast)
|
|
314
|
+
|
|
315
|
+
def get_overpressure(self):
|
|
316
|
+
'''
|
|
317
|
+
Get the overpressure at tank top.
|
|
318
|
+
:return:
|
|
319
|
+
'''
|
|
320
|
+
return self.added_pressure
|
|
321
|
+
|
|
322
|
+
def get_parameters(self):
|
|
323
|
+
'''
|
|
324
|
+
Returns properties
|
|
325
|
+
:return:
|
|
326
|
+
'''
|
|
327
|
+
# return_dict = {'comp_no':self.compartment_number, 'cells':self.cells, 'min_el':self.min_elevation,
|
|
328
|
+
# 'max_el':self.max_elevation, 'content':self.content, 'added_press':self.added_pressure,
|
|
329
|
+
# 'density':self.density, 'acc':{'static':self.acc_static, 'dyn_loaded':self.acc_dyn_loaded,
|
|
330
|
+
# 'dyn_ballast':self.acc_dyn_ballast}}
|
|
331
|
+
# return return_dict
|
|
332
|
+
return self.properties
|
|
333
|
+
|
|
334
|
+
def is_loaded_condition(self):
|
|
335
|
+
'''
|
|
336
|
+
Check to see if the tank shall be in cluded in loaded condition.
|
|
337
|
+
self.tank_options = ['crude_oil', 'diesel', 'slop', 'ballast']
|
|
338
|
+
:return:
|
|
339
|
+
'''
|
|
340
|
+
try: return self.content in self.all_types[0:4]
|
|
341
|
+
except AttributeError: return False
|
|
342
|
+
|
|
343
|
+
def is_ballast_condition(self):
|
|
344
|
+
'''
|
|
345
|
+
Check to see if the tank shall be in cluded in loaded condition.
|
|
346
|
+
:return:
|
|
347
|
+
'''
|
|
348
|
+
try: return self.content == self.all_types[4]
|
|
349
|
+
except AttributeError: return False
|
|
350
|
+
|
|
351
|
+
def is_tank_test_condition(self):
|
|
352
|
+
'''
|
|
353
|
+
Check to see if the tank shall be in cluded in loaded condition.
|
|
354
|
+
:return:
|
|
355
|
+
'''
|
|
356
|
+
try: return self.content == self.all_types
|
|
357
|
+
except AttributeError: return False
|
|
358
|
+
|
|
359
|
+
def get_condition(self):
|
|
360
|
+
'''
|
|
361
|
+
Returning the condition.
|
|
362
|
+
self.load_conditions = ['loaded', 'ballast','tanktest']
|
|
363
|
+
:return:
|
|
364
|
+
'''
|
|
365
|
+
try:
|
|
366
|
+
if self.is_ballast_condition():
|
|
367
|
+
return 'ballast'
|
|
368
|
+
elif self.is_loaded_condition():
|
|
369
|
+
return 'loaded'
|
|
370
|
+
elif self.is_tank_test_condition():
|
|
371
|
+
return 'tanktest'
|
|
372
|
+
except AttributeError: return False
|
|
373
|
+
|
|
374
|
+
def get_tank_dnv_minimum_pressure(self, lf_static, lf_enviromental):
|
|
375
|
+
'''
|
|
376
|
+
Calculating 4.3.7 and 4.3.8 and returning the highest of these pressures.
|
|
377
|
+
:return:
|
|
378
|
+
'''
|
|
379
|
+
|
|
380
|
+
if self.is_loaded_condition():
|
|
381
|
+
dyn_acc = self.acc_dyn_loaded
|
|
382
|
+
elif self.is_ballast_condition():
|
|
383
|
+
dyn_acc = self.acc_dyn_ballast
|
|
384
|
+
else:
|
|
385
|
+
dyn_acc = 0
|
|
386
|
+
|
|
387
|
+
hop = self.get_highest_elevation()-self.get_lowest_elevation()
|
|
388
|
+
|
|
389
|
+
#All tanks shall be designed for the following internal design pressure:
|
|
390
|
+
p_4_3_7 = self.density * self.acc_static * hop *(lf_static+(dyn_acc/self.acc_static)*lf_enviromental)
|
|
391
|
+
|
|
392
|
+
#For tanks where the air pipe may be filled during filling operations, the following additional internal
|
|
393
|
+
#design pressure conditions shall be considered:
|
|
394
|
+
|
|
395
|
+
p_4_3_8 = (self.density*self.acc_static*hop + self.get_overpressure())*lf_static
|
|
396
|
+
|
|
397
|
+
return max(p_4_3_7, p_4_3_8)
|
|
398
|
+
|
|
399
|
+
class Combination():
|
|
400
|
+
'''
|
|
401
|
+
THIS CLASS IS CURRENTLY NOT USED. MAY NOT BE USED AT ALL. IT IS STUPID.
|
|
402
|
+
This class cointaines the load combinations.
|
|
403
|
+
combination,self.active_line,compartment
|
|
404
|
+
'''
|
|
405
|
+
def __init__(self, object_line, comb_dict = None, tank_dict = None, load_dict = None):
|
|
406
|
+
'''
|
|
407
|
+
Input from main application is:
|
|
408
|
+
line for this object
|
|
409
|
+
tank_dict = {} #main tank dictionary (created when BFS search is executed for the grid) (comp# : TankObj)
|
|
410
|
+
load_dict = {} #main load dictionary (created in separate load window (load# : [LoadObj, lines])
|
|
411
|
+
comb_dict = {} #load combination dictionary (comb,line,load) : [DoubleVar(), DoubleVar], IntVar()]
|
|
412
|
+
'''
|
|
413
|
+
|
|
414
|
+
self.object_line = object_line
|
|
415
|
+
|
|
416
|
+
self.comb_dict = comb_dict
|
|
417
|
+
self.tank_dict = tank_dict
|
|
418
|
+
self.load_dict = load_dict
|
|
419
|
+
|
|
420
|
+
try: self.combination = comb_dict.keys()[0]
|
|
421
|
+
except AttributeError : self.combination = None
|
|
422
|
+
|
|
423
|
+
try: self.load_case = comb_dict.keys()[2]
|
|
424
|
+
except AttributeError: self.load_case = None
|
|
425
|
+
|
|
426
|
+
try: self.load_factor_static = comb_dict.values()[0]
|
|
427
|
+
except AttributeError: self.load_factor_static = None
|
|
428
|
+
|
|
429
|
+
try: self.load_factor_dynamic = comb_dict.values()[1]
|
|
430
|
+
except AttributeError: self.load_factor_dynamic = None
|
|
431
|
+
|
|
432
|
+
try: self.on_off = comb_dict.values()[2]
|
|
433
|
+
except AttributeError: self.on_off = None
|
|
434
|
+
|
|
435
|
+
def __str__(self):
|
|
436
|
+
return 'NOT IMPLEMENTED'
|
|
437
|
+
|
|
438
|
+
def get_load_factors(self):
|
|
439
|
+
'''
|
|
440
|
+
Get the tk.DoubleVar, tk.DoubleVar, tk.IntVar that is used in the load factor input and on/off.
|
|
441
|
+
:return:
|
|
442
|
+
'''
|
|
443
|
+
return self.load_factor_static.get(), self.load_factor_dynamic.get(), self.on_off.get()
|
|
444
|
+
|
|
445
|
+
def get_load_factor_static(self):
|
|
446
|
+
'''
|
|
447
|
+
Setting the the dynamic load factor.
|
|
448
|
+
:return:
|
|
449
|
+
'''
|
|
450
|
+
return self.load_factor_static.get()
|
|
451
|
+
|
|
452
|
+
def get_load_factor_dynamic(self):
|
|
453
|
+
'''
|
|
454
|
+
Setting the the dynamic load factor.
|
|
455
|
+
:return:
|
|
456
|
+
'''
|
|
457
|
+
return self.load_factor_dynamic.get()
|
|
458
|
+
|
|
459
|
+
def get_on_off(self, value):
|
|
460
|
+
'''
|
|
461
|
+
Setting the the dynamic load factor.
|
|
462
|
+
:return:
|
|
463
|
+
'''
|
|
464
|
+
return self.on_off.get()
|
|
465
|
+
|
|
466
|
+
def set_load_factor_static(self, value):
|
|
467
|
+
'''
|
|
468
|
+
Setting the the dynamic load factor.
|
|
469
|
+
:return:
|
|
470
|
+
'''
|
|
471
|
+
self.load_factor_static = value
|
|
472
|
+
|
|
473
|
+
def set_load_factor_dynamic(self, value):
|
|
474
|
+
'''
|
|
475
|
+
Setting the the dynamic load factor.
|
|
476
|
+
:return:
|
|
477
|
+
'''
|
|
478
|
+
self.load_factor_dynamic = value
|
|
479
|
+
|
|
480
|
+
def set_on_off(self, value):
|
|
481
|
+
'''
|
|
482
|
+
Setting the the dynamic load factor.
|
|
483
|
+
:return:
|
|
484
|
+
'''
|
|
485
|
+
self.on_off= value
|
|
486
|
+
|
|
487
|
+
def set_combination_dictionary(self, value):
|
|
488
|
+
'''
|
|
489
|
+
Setting the combination dictionary.
|
|
490
|
+
:return:
|
|
491
|
+
'''
|
|
492
|
+
self.comb_dict = value
|
|
493
|
+
|
|
494
|
+
assert tuple(value.keys())[0][1] == self.object_line, 'line is not correct!'
|
|
495
|
+
assert len(tuple(value.keys())[0]) == 3 , 'length of key must be 3'
|
|
496
|
+
assert len(tuple(value.values())[0]) == 3, 'length of values must be 3'
|
|
497
|
+
|
|
498
|
+
try: self.set_load_factor_static(list(value.values())[0][0])
|
|
499
|
+
except AttributeError: pass
|
|
500
|
+
|
|
501
|
+
try: self.set_load_factor_dynamic(list(value.values())[0][1])
|
|
502
|
+
except AttributeError: pass
|
|
503
|
+
|
|
504
|
+
try: self.set_on_off(list(value.values())[0][2])
|
|
505
|
+
except AttributeError: pass
|
|
506
|
+
|
|
507
|
+
def set_load_dictionary(self, value):
|
|
508
|
+
'''
|
|
509
|
+
Setting the load dictionary.
|
|
510
|
+
:return:
|
|
511
|
+
'''
|
|
512
|
+
self.load_dict = value
|
|
513
|
+
|
|
514
|
+
def set_tank_dictionary(self, value):
|
|
515
|
+
'''
|
|
516
|
+
Setting the tank dictionary.
|
|
517
|
+
:return:
|
|
518
|
+
'''
|
|
519
|
+
self.tank_dict = value
|
|
520
|
+
|
|
521
|
+
if __name__ == '__main__':
|
|
522
|
+
import example_data as ex
|
|
523
|
+
|
|
524
|
+
for load, type in zip([Loads(ex.load_bottom), Loads(ex.load_side), Loads(ex.load_static), Loads(ex.load_slamming)],
|
|
525
|
+
['BOTTOM', 'SIDE_SHELL', '', '']):
|
|
526
|
+
print(load.get_calculated_pressure((10,10), 3, type))
|