Open System for Earthquake Engineering Simulation (OpenSees)
OpenSees Examples Primer
Silvia Mazzoni, Frank McKenna, Michael H. Scott, Gregory L. Fenves,
Boris Jeremic
Printed on 14 June, 2006
Contents
Introduction
EXAMPLE 1 - Truss Example
iii
5
7
EXAMPLE 2 - Moment-Curvature Analysis of a Reinforced Concrete Section 12
EXAMPLE 3 - Portal Frame Examples
19
Example 3.1 .................................................................................................................................20
Example 3.2 .................................................................................................................................26
Example 3.3 .................................................................................................................................29
EXAMPLE 4 - Multibay Two Story Frame
EXAMPLE 5 - Three-Dimensional Rigid Frame
EXAMPLE 6 - Simply Supported Beam
EXAMPLE 7 - Dynamic Shell Analysis
EXAMPLE 8 - Cantilever Beam
35
43
52
57
61
Reinforced Concrete Plane Frame Examples
65
Example3.1.tcl....................................................................................................................65
Example3.2.tcl....................................................................................................................68
Example3.3.tcl....................................................................................................................71
PortalFrame.tcl...................................................................................................................73
Example4.1.tcl....................................................................................................................78
RCFrame1.tcl.....................................................................................................................83
RCFrame2.tcl.....................................................................................................................86
RCFrame3.tcl.....................................................................................................................90
RCFrame4.tcl.....................................................................................................................92
RCFrame5.tcl.....................................................................................................................95
Contents
iv
Steel Plane Frame Examples
100
SteelFrame1.tcl ......................................................................................................................... 100
SteelFrame2.tcl ......................................................................................................................... 103
SteelFrame3.tcl ......................................................................................................................... 105
Rigid Floor Diaphragm Example
109
RigidFrame3D.tcl....................................................................................................................... 109
Zero Length Element Examples
114
ZeroLength1.tcl ......................................................................................................................... 114
ZeroLength2.tcl ......................................................................................................................... 115
ZeroLength3.tcl ......................................................................................................................... 116
ZeroLength4.tcl ......................................................................................................................... 117
ZeroLength5.tcl ......................................................................................................................... 118
Section Analysis Example
120
Example2.1.tcl........................................................................................................................... 120
Quad Examples
122
Brick Examples
123
solid01.tcl .................................................................................................................................. 123
Reliability Examples
125
Script Utilities Library
126
genPlaneFrame.tcl .................................................................................................................... 126
matTest.tcl................................................................................................................................. 128
MomentCurvature.tcl................................................................................................................. 130
RCcircSection.tcl....................................................................................................................... 131
RCcircSectionFEDEAS.tcl ........................................................................................................ 133
RCFrameDisplay.tcl .................................................................................................................. 135
RCsection.tcl ............................................................................................................................. 135
RCsectionFEDEAS.tcl............................................................................................................... 138
ReadSMDFile.tcl ....................................................................................................................... 142
RotSpring2D.............................................................................................................................. 144
StFramePZLdisplay.tcl .............................................................................................................. 145
Wsection.tcl............................................................................................................................... 145
RigidFrame3Ddisplay.tcl ........................................................................................................... 146
Index
149
C H A P T E R 1
Introduction
5
The objective of this primer is to provide new users of OpenSees (Open System for Earthquake
Engineering Simulation) familiar structural engineering examples as a convenient method for
learning how to use the software. OpenSees is an object-oriented framework for building models
of structural and geotechnical systems, performing nonlinear analysis with the model, and
processing the response results. The goal for OpenSees is to support a wide range of simulation
applications in earthquake engineering. The details, however, on how OpenSees accomplishes
this goal are not particularly important for new users, who are primarily interested in how to solve
problems.
This primer examines a few typical examples. Most users will conduct a simulation with a
scripting language that has been extended to incorporate the features of OpenSees. As new
features are developed, such as material models, elements, solution methods, etc., the scripting
language can be extended to include them. The scripting language is named Tcl/Tk, and it has
many features for dealing with variables, expressions, loops, data structures, input/output, that
are useful for doing a simulation. Some of the basic features of Tcl will be illustrated in the
examples.
Although users do not need to understand the object-oriented principles in the OpenSees
framework, some terminology helps in the description of the examples. We talk about
commands creating objects, which may be a specific material, element, analysis procedure, etc.
To conduct a simulation, the user creates objects for three main purposes:
Modeling: The user first creates a ModelBuilder object which defines the type of model, and
commands available for building the model. With a ModelBuilder defined, the user then
creates the Element, Node, LoadPattern and Constraint objects that define the model. In this
primer, the use of a basic ModelBuilder will be demonstrated.
Analysis: After defined the model, the next step is to create the Analysis object for analyzing the
model. This may be a simple static linear analysis or a transient non-linear analysis. In
OpenSees, an Analysis object is composed of several component objects, which define how the
analysis is performed. The component objects consist of the following: {SolutionAlgorithm},
{Integrator}, { ConstraintHandler}, { DOF\_Numberer}, { SystemOfEqn}, { Solver}, and
{ AnalysisModel}. This approach provides a great deal of flexibility in how an analysis is
conducted.
Output Specification: Once the model and analysis have been defined, the user has the option
of specifying what is to be monitored during the analysis. This, for example, could be the
displacement history at a node or internal state of an element in a transient analysis or the entire
state of the model at each step in the solution procedure. Several Recorder objects are created
to store what the user wants to examine.
Chapter 1 错误!未定义样式。
6
In the examples, Tcl scripts are used to create a model, analysis, and output specification. The
examples are (1) simple truss structure, (2) reinforced concrete portal frame, (3) two-story multi-
bay reinforced concrete frame, and (4) a three-dimensional frame. The examples are not meant
to be completely realistic, but they are representative of typical structures. The analyses
performed on these models consist of simple static analysis, pushover analysis and transient
analysis. An example of moment-curvature analysis is also performed on a reinforced concrete
section.
C H A P T E R 2
EXAMPLE 1 - Truss Example
7
The first example is a simple truss structure. The purpose of this example is to show that model
generation in OpenSees can resemble typical finite element analysis programs with the
definition of nodes, materials, elements, loads and constraints. The example also demonstrates
how an analysis object is 'built' from component objects.
This example is of a linear-elastic three bar truss, as shown in the figure (page 7), subject to
static loads.
Files Required
Example1.1.tcl
Model
The model consists of four nodes, three truss elements, a single load pattern with a nodal load
acting at node 4, and constraints at the three support nodes. Since the truss elements have the
same elastic material, a single Elastic material object is created.
Figure 1: Example 1.1
Truss
Analysis
Chapter 2 错误!未定义样式。
8
The model is linear, so we use a solution Algorithm of type Linear. Even though the solution is
linear, we have to select a procedure for applying the load, which is called an Integrator. For this
problem, a LoadControl integrator advances the solution. The equations are formed using a
banded system, so the System is BandSPD (banded, symmetric positive definite). This is a
good choice for most moderate size models. The equations have to be numbered, so typically
an RCM numberer object is used (for Reverse Cuthill-McKee). The constraints are most easily
represented with a Plain constraint handler.
Once all the components of an analysis are defined, the Analysis object itself is created. For this
problem a Static Analysis object is used.
Output Specification
When the analysis is complete the state of node 4 and all three elements will be printed to the
screen. Nothing is recorded for later use.
OpenSees Script
The Tcl script for the example is shown below. A comment is indicated by a \# symbol. In the
comments below, the syntax for important commands are given.
# OpenSees Example 1.1
# OpenSees Primer
#
# Units: kips, in, sec
# ------------------------------
# Start of model generation
# ------------------------------
# Create ModelBuilder (with two-dimensions and 2 DOF/node)
model BasicBuilder -ndm 2 -ndf 2
# Create nodes & add to Domain - command: node nodeId xCrd yCrd
node 1 0.0 0.0
node 2 144.0 0.0
node 3 168.0 0.0
node 4 72.0 96.0
# Set the boundary conditions - command: fix nodeID xResrnt? yRestrnt?
fix 1 1 1
fix 2 1 1
fix 3 1 1
# Define materials for truss elements
# -----------------------------------
# Create Elastic material prototype - command: uniaxialMaterial Elastic matID E