Build Model Fast
Build Model Fast
42 52 Floor 2
4252
5152 Floor 1
11
# add nodes at each floor at each column line location & fix nodes if at floor 1
foreach floor {1 2 3 4} floorLoc $floorLocs massX $massesX massY $massesY {
foreach colLine {1 2 3 4 5 6} colLoc $colLocs {
node $colLine$floor $colLoc $floorLoc -mass $massX $massY 0.
if {$floor == 1} {fix $colLine$floor 1 1 1}
}
}
#uniaxialMaterial Steel02 $tag $Fy $E $b $R0 $cr1 $cr2
uniaxialMaterial Steel02 1 50.0 29000. 0.003 20 0.925 0.15; ; # material to be used for steel elements
# set some list for col and beam sizes
set colSizes {W14X370 W14X370 W14X211}; #col sizes stories 1, 2 and 3
set beamSizes {W33X141 W33X130 W27X102}; #beams sizes floor 1, 2, and 3
# add columns at each column line between floors
geomTransf PDelta 1
foreach colLine {1 2 3 4 5 6} {
foreach floor1 {1 2 3} floor2 { 2 3 4} {
set theSection [lindex $colSizes [expr $floor1 -1]]; # obtain section size for column
ForceBeamWSection2d $colLine$floor1$colLine$floor2 $colLine$floor1 $colLine$floor2 $theSection 1 1 –nip 5
}
}
#add beams between column lines at each floor
geomTransf Linear 2
foreach colLine1 {1 2 3 4 5} colLine2 {2 3 4 5 6} {
foreach floor {2 3 4} {
set theSection [lindex $beamSizes [expr $floor -2]]; # obtain section size for floor
ForceBeamWSection2d $colLine1$floor$colLine2$floor $colLine1$floor $colLine2$floor $theSection 1 2
}
}
Steel2.tcl – contains a library of procedures
proc ElasticBeamWSection2d {eleTag iNode jNode sectType E transfTag {Orient XX}} {
global WSection
global in
set found 0
foreach {section prop} [array get WSection $sectType] {
set propList [split $prop]
set A [expr [lindex $propList 0]*$in*$in]
set Ixx [expr [lindex $propList 5]*$in*$in*$in*$in]
set Iyy [expr [lindex $propList 6]*$in*$in*$in*$in]
if {$Orient == "YY" } {
element elasticBeamColumn $eleTag $iNode $jNode $A $E $Iyy $transfTag
} else {
element elasticBeamColumn $eleTag $iNode $jNode $A $E $Ixx $transfTag
}
}
}
#Winxlb/f "Area(in2) d(in) bf(in) tw(in) tf(in) Ixx(in4) Iyy(in4)"
array set WSection {
W44X335 "98.5 44.0 15.9 1.03 1.77 31100 1200 74.7"
W44X290 "85.4 43.6 15.8 0.865 1.58 27000 1040 50.9"
W44X262 "76.9 43.3 15.8 0.785 1.42 24100 923 37.3"
W44X230 "67.7 42.9 15.8 0.710 1.22 20800 796 24.9"
W40X593 "174 43.0 16.7 1.79 3.23 50400 2520 445"
W40X503 "148 42.1 16.4 1.54 2.76 41600 2040 277"
proc ForceBeamWSection2d {eleTag iNode jNode sectType matTag transfTag args} {
global FiberSteelWSection2d
global ElasticSteelWSection2d
set nFlange 8
if {[lsearch $args "-nFlange"] != -1} {
set loc [lsearch $args "-nFlange"]
set nFlange [lindex $args [expr $loc+1]]
}
set nWeb 4
if {[lsearch $args "-nWeb"] != -1} {
set loc [lsearch $args "-nWeb"]
set nWeb [lindex $args [expr $loc+1]]
}
set nip 4
if {[lsearch $args "-nip"] != -1} {
set loc [lsearch $args "-nip"]
set nip [lindex $args [expr $loc+1]]
}
wipe;
model BasicBuilder -ndm 2 -ndf 3;
….
….
# add columns at each column line between floors
geomTransf PDelta 1
foreach colLine {1 2 3 4 5 6} {
foreach floor1 {1 2 3} floor2 { 2 3 4} {
set theSection [lindex $colSizes [expr $floor1 -1]]; # obtain section size for column
ForceBeamWSection2d $colLine$floor1$colLine$floor2 $colLine$floor1 $colLine$floor2 $theSection 1 1 –nFlange $nFlange –nWeb $nWeb
}
}
Results 10 % in 50year
Time
1-4 292sec
2-4 302sec
3-4 309sec
10-10 578sec
20-20 1001sec
35-30 1305sec
# fibers flange- # fibers web
Results 2% in 50year
Time
1-4 254sec
2-4 265sec
3-4 272sec
10-10 506sec
20-20 879sec
35-30 1539sec
Little More Useful
(BUT COMPILCATED APPROACH)
Replace foreach with for construct
WHY?
So I Can generate a new model in SECONDS.
model Basic –ndm 2 –ndf 3
source Steel2d.tcl MRF3.tcl
# set up my structure
set floorOffsets {204. 180. 180.}
set colOffsets {360. 360. 360. 360. 360.}
set massesX {0. 0.419 0.419 0.400}
set massesY {0. 0.105 0.105 0.096}
set colSizes {W14X370 W14X370 W14X211};
set beamSizes {W33X141 W33X130 W27X102};
Floor 7
Floor 6
6@13’4”
Floor 5
Floor 4
Floor 3
Floor 2
22’4”
Floor 1
5@25
model Basic –ndm 2 –ndf 3
source Steel2d.tcl
MRF4.tcl
# set up my structure
set floorOffsets {268. 160. 160. 160. 160. 160. 160.}
set colOffsets {300. 300. 300. 300. 300.}
set colSizes {W24X146 W24X146 W24X76 W24X76 W14X61 W14X61 W24X55};
set beamSizes {W24X207 W21X62 W21X50 W21X44 W21X44 W21X44 W21X44};
W27X84
W14X176
HSS10X10X3/8
W30X116
3@15’
W14X176
HSS12X12X1/2
W36X210
W14X176
#number of beam elements HSS12X12X1/2
pinned at either end
30’
Imperfection so will buckle
proc HSSbrace $eleTag $iNode $jNode $secType $matTag $numSeg $imperfection $transfTag args
D Lignos (McGill)
source Steel2d.tcl
# set up my structure CBFbase.tcl
set colLocations {0. 180. 360.}
set floorLocations {0. 180. 360. 540.}
set masses {0. 0.419 0.419 0.400}
set colSizes {W14X176 W14X176 W14X176};
set beamSizes {W36X210 W30X116 W27X84};
set braceSizes {HSS12X12X1/2 HSS12X12X1/2 HSS10X10X3/8} W27X84
set numFloor [llength $floorLocations]
set numStory [expr $numFloor-1]
Floor 4
set numCline [llength $colLocations] W14X176
model BasicBuilder -ndm 2 -ndf 3;
#add the Nodes
W30X116
Floor 3
for {set floor 1} {$floor <= $numFloor} {incr floor 1} {
set floorLoc [lindex $floorLocations [expr $floor-1]]
set mass [lindex $masses [expr $floor-1]]
3@15’
for {set colLine 1} {$colLine <= $numCline} {incr colLine 1}
set colLoc [lindex $colLocations [expr $colLine-1]]
node $colLine$floor $colLoc $floorLoc -mass $mass $mass 0. W14X176
if {$floor == 1} {
fix $colLine$floor 1 1 1
}
W36X210
}
}
# define material for col and beams
Floor 2
uniaxialMaterial Steel02 1 50.0 29000 0.03 20 0.925 0.15 0.0005 0.01 0.0005 0.01
# add the columns W14X176
geomTransf PDelta 1
for {set colLine 1} {$colLine <= $numCline} {incr colLine 2} {
for {set floor1 1} {$floor1 < $numFloor} {incr floor1 1} {
set floor2 [expr $floor1+1]
set theSection [lindex $colSizes [expr $floor1 -1]]
Floor 1 2@15’
cline 1 cline 2 cline 3
ForceBeamWSection2d $colLine$floor1$colLine$floor2 $colLine$floor1 $colLine$floor2 $theSection 1 1 -nip 5
}
}
* While diagonal and X braced models do
# add the beams, pinned connection at column end
geomTransf Linear 2 not need me to break up beams, I am doing
for {set floor 2} {$floor <= $numFloor} {incr floor 1} {
set colLine1 1; set colLine2 2; set colLine3 3; so as to keep all examples the same.
set theSection [lindex $beamSizes [expr $floor -2]]
DispBeamWSection2d $colLine1$floor$colLine2$floor $colLine1$floor $colLine2$floor $theSection 1 2 -release1
DispBeamWSection2d $colLine2$floor$colLine3$floor $colLine2$floor $colLine3$floor $theSection 1 2 -release2
}
source Steel2d.tcl
# set up my structure
set colLocations {0. 180. 360.}
set floorLocations {0. 180. 360. 540.}
CBF1.tcl
set masses {0. 0.419 0.419 0.400}
set colSizes {W14X176 W14X176 W14X176};
set beamSizes {W36X210 W30X116 W27X84};
set braceSizes {HSS12X12X1/2 HSS12X12X1/2 HSS10X10X3/8}
(Diagonal bracing)
set numFloor [llength $floorLocations]
set numStory [expr $numFloor-1]
set numCline [llength $colLocations]
model BasicBuilder -ndm 2 -ndf 3;
#add the Nodes
for {set floor 1} {$floor <= $numFloor} {incr floor 1} {
set floorLoc} [lindex $floorLocations [expr $floor-1]]
set mass [lindex $masses [expr $floor-1]]
for {set colLine 1} {$colLine <= $numCline} {incr colLine 1}
set colLoc [lindex $colLocations [expr $colLine-1]]
# define material for braces
node $colLine$floor $colLoc $floorLoc -mass $mass $mass 0.
if {$floor == 1} {
set Fy_b 46.0;
}
fix $colLine$floor 1 1 1
}
}
# define material for col and beams
set E0 0.095
uniaxialMaterial Steel02 1 50.0 29000 0.03 20 0.925 0.15 0.0005 0.01 0.0005 0.01
# add the columns
set m -0.3
geomTransf PDelta 1
for {set colLine 1} {$colLine <= $numCline} {incr colLine 2} {
uniaxialMaterial Steel02 2 $Fy_b $Es $b 20 0.925 0.15 0.0005 0.01 0.0005 0.01
for {set floor1 1} {$floor1 < $numFloor} {incr floor1 1} {
set floor2 [expr $floor1+1]
set theSection [lindex $colSizes [expr $floor1 -1]]
uniaxialMaterial
}
Fatigue 3 2 $colLine$floor1
ForceBeamWSection2d $colLine$floor1$colLine$floor2 -E0 $E0$colLine$floor2
-m $m$theSection
-min1 1-1.0
-nip 5 -max 0.04
}
geomTransf
}
Corotational 3
for {set story 1} {$story <= $numStory} {incr story 1} {
set colLine1 1; set colLine2} 3;
set floor1 $story; set floor2 [expr $story +1];
set m -0.3
}
# define material for col and beams
uniaxialMaterial Steel02 2 $Fy_b $Es $b 20 0.925 0.15 0.0005 0.01 0.0005 0.01
uniaxialMaterial Steel02 1 50.0 29000 0.03 20 0.925 0.15 0.0005 0.01 0.0005 0.01
# add the columns
uniaxialMaterial
geomTransf PDelta 1
Fatigue
for {set colLine 1} {$colLine <= $numCline} {incr 3 2 2}-E0
colLine { $E0 -m $m -min -1.0 -max 0.04
for {set floor1 1} {$floor1 < $numFloor} {incr floor1 1} {
set floor2 [expr $floor1+1]
set theSection [lindex $colSizes [expr $floor1 -1]]
set imperfection 0.001
}
ForceBeamWSection2d $colLine$floor1$colLine$floor2 $colLine$floor1 $colLine$floor2 $theSection 1 1 -nip 5
}
for DispBeamWSection2d
{set story $colLine2$floor$colLine3$floor
1} {$story <= $numStory} {incr
$colLine2$floor $colLine3$floor story
$theSection 1} {
DispBeamWSection2d $colLine1$floor$colLine2$floor $colLine1$floor $colLine2$floor $theSection 1 2 -release1
1 2 –release2
}
set colLine1 1; set colLine2 2; set colLine3 3;
set floor1 $story; set floor2 [expr $story +1];
set theSection [lindex $braceSizes } [expr $story -1]]
HSSbrace $colLine1$floor1$colLine2$floor2 $colLine1$floor1 $colLine2$floor2 $theSection 3 4 $im
HSSbrace $colLine3$floor1$colLine2$floor2 $colLine3$floor1 $colLine2$floor2 $theSection 3 4 $im
}
Outline of Seminar
• Introduction
• Moment Frame Example 1
• Moment Frame Example 2
• Braced Frame Examples
• Conclusions
• THINK Before You Type
• Develop a Library of Procedures
• If Done Correctly, someone
who develops their models
using a scripting language will
crush someone who has to use
a GUI.
* AND Spend the time you save with
scripting to explore the effects of modeling
choices (i.e. element types, discretizations, ..) on
the response.
Obtaining This Source Code
svn option:
svn co svn://opensees.berkeley.edu:/usr/local/svn/OpenSees/trunk/Workshops/OpenSeesDays/Steel2dModels Steel2dModels
/Workshops/OpenSeesDays/Steel2dModels
Any Questions?