-
Notifications
You must be signed in to change notification settings - Fork 3
/
15_Reinforced_Concrete_Building.js
216 lines (199 loc) · 8.13 KB
/
15_Reinforced_Concrete_Building.js
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
if (!RFEM) {
throw new Error("This script is only for RFEM, it creates surfaces.");
}
run("../includes/tools/clearAll.js");
if (a === undefined) {
var a = 20; // Total Length and Width
var H = 3.5; // Height
var n_f = 10; // Number of floors
var rotation_degree = 45; // Rotation Degree
var chamfer = 3; // Chamfer of edges
var d = 6; // Distance between openings
var len = 4; // Opening Length
var w = 3; // Opening Width
var thickness_1 = 0.35; // Roof thickness
var thickness_2 = 0.3; // Wall thickness
}
// create material
var materialConcrete = new Material(1, 'C50/60'); // Concrete
// Create thickness
var thicknessRoof = new Thickness();
thicknessRoof.Uniform(1, "Roof", 1, thickness_1);
var thicknessWall = new Thickness();
thicknessWall.Uniform(2, "Wall", 1, thickness_2);
// Create section
var section_1 = new Section(1, 'CIRCLE_M1 0.500', materialConcrete.GetNo()); // concrete column
// Create nodes
var R = sqrt(sqr(a) / 2);
var D = sqrt(2 * sqr(chamfer));
var r = R - D / 2;
var r_1 = sqrt(sqr(r) + sqr(D / 2));
var r_2 = sqrt(sqr(r - sqrt(2)) + sqr(D) / 4);
var nodeCount = 1;
Node(nodeCount, -d, -d / 2, 0); // Nodes for interior walls
nodeCount++;
Node(nodeCount, 0, -d / 2, 0);
nodeCount++;
Node(nodeCount, len, -d / 2, 0);
nodeCount++;
Node(nodeCount, len, -d / 2 - w, 0);
nodeCount++;
Node(nodeCount, 0, -d / 2 - w, 0);
nodeCount++;
Node(nodeCount, 0, d / 2, 0);
nodeCount++;
Node(nodeCount, -len, d / 2, 0);
nodeCount++;
Node(nodeCount, -len, d / 2 + w, 0);
nodeCount++;
Node(nodeCount, 0, d / 2 + w, 0);
nodeCount++;
Node(nodeCount, d, d / 2 + w, 0);
nodeCount++;
for (var k = 0; k < n_f + 1; ++k) {
for (var i = 0; i < 4; ++i) // Nodes of total floors
{
var alpha = i * PI * 2 / 4 + PI / 4 + k * rotation_degree * PI / (n_f * 180);
var delta = asin((D / 2) / r_1);
Node(nodeCount, r_1 * cos(alpha - delta), r_1 * sin(alpha - delta), -H * (k + 1));
nodeCount++;
Node(nodeCount, r_1 * cos(alpha + delta), r_1 * sin(alpha + delta), -H * (k + 1));
nodeCount++;
}
for (var j = 0; j < 2; ++j) {
for (var i = 0; i < 4; ++i) // Nodes of columns
{
var alpha = i * PI * 2 / 4 + PI / 4 + k * rotation_degree * PI / (n_f * 180);
var delta = asin((D / 2) / r_2);
Node(nodeCount, r_2 * cos(alpha - delta), r_2 * sin(alpha - delta), -j * H - H * k);
nodeCount++;
Node(nodeCount, r_2 * cos(alpha + delta), r_2 * sin(alpha + delta), -j * H - H * k);
nodeCount++;
}
}
Node(nodeCount, -d, -d / 2, -H * (k + 1));
nodeCount++;
Node(nodeCount, 0, -d / 2, -H * (k + 1));
nodeCount++;
Node(nodeCount, len, -d / 2, -H * (k + 1));
nodeCount++;
Node(nodeCount, len, -d / 2 - w, -H * (k + 1));
nodeCount++;
Node(nodeCount, 0, -d / 2 - w, -H * (k + 1));
nodeCount++;
Node(nodeCount, 0, d / 2, -H * (k + 1));
nodeCount++;
Node(nodeCount, -len, d / 2, -H * (k + 1));
nodeCount++;
Node(nodeCount, -len, d / 2 + w, -H * (k + 1));
nodeCount++;
Node(nodeCount, 0, d / 2 + w, -H * (k + 1));
nodeCount++;
Node(nodeCount, d, d / 2 + w, -H * (k + 1));
nodeCount++;
}
//Create Lines for floors
var lineCount = 1;
var surfaceCount = 1;
for (var i = 0; i < n_f + 1; ++i) {
var line = new Line();
line.Polyline(lineCount, [11 + i * 34, 12 + i * 34, 13 + i * 34, 14 + i * 34, 15 + i * 34, 16 + i * 34, 17 + i * 34, 18 + i * 34, 11 + i * 34]);
var surface = new Surface();
surface.Standard(surfaceCount, [line.GetNo()], thicknessRoof.GetNo());
lineCount++;
surfaceCount++;
}
// Create Members
for (var j = 0; j < n_f + 1; ++j) {
for (var i = 0; i < 8; ++i) {
var member = new Member();
member.Beam(lineCount, [19 + i + 34 * j, 27 + i + 34 * j], section_1.GetNo());
lineCount++;
}
}
// Create lines for interior walls
for (var j = 0; j < n_f + 2; ++j) {
Line(lineCount, [1 + 34 * j, 2 + 34 * j]);
lineCount++;
Line(lineCount, [2 + 34 * j, 3 + 34 * j]);
lineCount++;
Line(lineCount, [3 + 34 * j, 4 + 34 * j]);
lineCount++;
Line(lineCount, [4 + 34 * j, 5 + 34 * j]);
lineCount++;
Line(lineCount, [5 + 34 * j, 2 + 34 * j]);
lineCount++;
Line(lineCount, [2 + 34 * j, 6 + 34 * j]);
lineCount++;
Line(lineCount, [6 + 34 * j, 7 + 34 * j]);
lineCount++;
Line(lineCount, [7 + 34 * j, 8 + 34 * j]);
lineCount++;
Line(lineCount, [8 + 34 * j, 9 + 34 * j]);
lineCount++;
Line(lineCount, [9 + 34 * j, 6 + 34 * j]);
lineCount++;
Line(lineCount, [9 + 34 * j, 10 + 34 * j]);
lineCount++;
if (j == n_f + 1) { break; }
for (var i = 0; i < 10; ++i) {
Line(lineCount, [1 + i + 34 * j, 35 + i + 34 * j]);
lineCount++;
}
}
// Create surface - interior walls
var start_n_l = 9 * (n_f + 1) + 1; // Number of first line of interior walls
for (var j = 0; j < n_f + 1; ++j) {
var sur = new Surface();
sur.Standard(surfaceCount, [start_n_l + 21 * j, start_n_l + 11 + 21 * j, start_n_l + 21 + 21 * j, start_n_l + 12 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 4 + 21 * j, start_n_l + 15 + 21 * j, start_n_l + 25 + 21 * j, start_n_l + 12 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 3 + 21 * j, start_n_l + 14 + 21 * j, start_n_l + 24 + 21 * j, start_n_l + 15 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 2 + 21 * j, start_n_l + 13 + 21 * j, start_n_l + 23 + 21 * j, start_n_l + 14 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 1 + 21 * j, start_n_l + 12 + 21 * j, start_n_l + 22 + 21 * j, start_n_l + 13 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 5 + 21 * j, start_n_l + 16 + 21 * j, start_n_l + 26 + 21 * j, start_n_l + 12 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 6 + 21 * j, start_n_l + 17 + 21 * j, start_n_l + 27 + 21 * j, start_n_l + 16 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 7 + 21 * j, start_n_l + 18 + 21 * j, start_n_l + 28 + 21 * j, start_n_l + 17 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 8 + 21 * j, start_n_l + 19 + 21 * j, start_n_l + 29 + 21 * j, start_n_l + 18 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 9 + 21 * j, start_n_l + 16 + 21 * j, start_n_l + 30 + 21 * j, start_n_l + 19 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
sur.Standard(surfaceCount, [start_n_l + 10 + 21 * j, start_n_l + 20 + 21 * j, start_n_l + 31 + 21 * j, start_n_l + 19 + 21 * j], thicknessWall.GetNo());
surfaceCount++;
}
// Openings
var open_no = 1;
var start_n_o = 9 * (n_f + 1) + 23;
for (var j = 0; j < n_f; ++j) {
Opening(open_no, [start_n_o + 21 * j, start_n_o + 1 + 21 * j, start_n_o + 2 + 21 * j, start_n_o + 3 + 21 * j]);
open_no++;
Opening(open_no, [start_n_o + 5 + 21 * j, start_n_o + 6 + 21 * j, start_n_o + 7 + 21 * j, start_n_o + 8 + 21 * j]);
open_no++;
}
// Define Supports
var nodalSupport = new NodalSupport();
nodalSupport.Hinged();
var lineSupport = new LineSupport();
lineSupport.Hinged();
lineSupport.RotationZ(true);
// Assign Supports
for (var i = 0; i < 8; ++i) {
nodes[19 + i].support = nodalSupport.GetNo();
}
for (var i = 0; i < 11; ++i) {
lines[9 * (n_f + 1) + 1 + i].support = lineSupport.GetNo();
}
//load
var SASGeometricallyLinear = new StaticAnalysisSettings();
SASGeometricallyLinear.GeometricallyLinear(1);
var SASSecondOrder = new StaticAnalysisSettings();
SASSecondOrder.SecondOrder(2, "MySASLinear", "METHOD_OF_EQUATION_SYSTEM_DIRECT", "NEWTON_RAPHSON");
var lc1 = new LoadCase();
lc1.StaticAnalysis(1, "Self weight", SASGeometricallyLinear.GetNo(), "PERMANENT_G", [true, 0, 0, 1.0]);