-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhighRiseDatabaseTest.py
58 lines (48 loc) · 1.47 KB
/
highRiseDatabaseTest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# -*- coding: utf-8 -*-
"""
Original code: fmk
Modification for CFD data: Abiy
This is a temporary script file for writing the data
"""
# python code to read TPU .mat file and store
# data into a SimCenter JSON file
import sys
import os
import subprocess
import json
import stat
import shutil
import numpy as np
import scipy.io as sio
from pprint import pprint
import aerodynamicDatabaseLib as adb
bldg_type = "highRise"
roof_type = "flat"
roof_slope = 0.0
scale = 1.0/400.0
air_density = 1.225
data_type = "EXP"
length_unit = "m"
time_unit = "sec"
roughness_length = 0.03
power_law_alpha = 1.0/6.0
#Reading and writing data from TPU database
data = adb.WindLoadData(data_type=data_type)
data.building_type = bldg_type
data.scale = scale
data.air_density = air_density
data.roughness_length = roughness_length
data.length_unit = length_unit
data.time_unit = time_unit
data.power_law_alpha = power_law_alpha
data.exposure_type = "Open"
data.roof_type = roof_type
data.roof_slope = roof_slope
#Read and write for Open exposure type
data.read_matlab_file('rawData/T114_6_000_1.mat')
case_name = '{}_{}_{:.2f}_{:.2f}_{:.2f}_{:.3f}'.format(bldg_type, data_type, data.height_to_width, data.width_to_depth, data.wind_direction, data.roughness_length)
data.file_name = case_name
#Write the general info file
data.write_to_json_general_info('processedData/' + case_name)
#Damp all the data
data.write_to_json_all('processedData/' + case_name)