Introduction To Modeling of Structures Using Opensees: Maha Kenawy, PH.D
Introduction To Modeling of Structures Using Opensees: Maha Kenawy, PH.D
Introduction To Modeling of Structures Using Opensees: Maha Kenawy, PH.D
OpenSees
1
Topics
Getting Started
• What is OpenSees?
• How to use OpenSees?
• Resources for learning OpenSees
The Details
• OpenSees architecture
• OpenSees model components and commands
• Basic example problem
2
Basics of structural modeling
• Computers do not deal with
continua (real structure), but
rather discrete idealizations. joint
beam
Frame Material
Structure Cross section
element model
𝜎𝜎
𝜀𝜀
4
What is OpenSees?
What is OpenSees?
• An open-source modular software framework for
structural simulations using finite element methods Elements
(developed at UC Berkeley)
Materials
• Platform for sharing research advances in nonlinear
models (you can add your new analysis models into
Opensees! You don’t have to understand all of Load
OpenSees to contribute new elements) Pattern
• Command Manual:
http://opensees.berkeley.edu/wiki/index.php/Command_Manual
• Examples Manuals:
http://opensees.berkeley.edu/wiki/index.php/Examples
6
OpenSees resources
• Tcl language tutorial
http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html
9
Example OpenSees Program
Build # define loads
myexample.tcl model pattern Plain 1 Linear {
# create model builder Create output
space load 2 100.0 -50.0}
BasicBuilder -ndm 2 -ndf 2 recorders
# define output recorders
# create nodes
node 1 0.0 0.0 recorder Node -file disp.out -time -node 2 -dof 1 2 disp
node 2 144.0 0.0 # define analysis parameters
… system BandSPD
# fix supports Create domain numberer Plain
fix 1 1 1 components Define analysis
constraints Plain parameters
fix 2 0 1
# create materials integrator LoadControl 1.0
uniaxialMaterial Elastic 1 3000.0 algorithm Linear
# create elements analysis static
element Truss 1 1 2 10.0 1 # perform the analysis
…
analyze 1 10
How to use Opensees?
• Download the Opensees interpreter at:
https://opensees.berkeley.edu/OpenSees/user/index.php
• Keep OpenSees.exe in the same folder where your model scripts are (or
add the Opensees.exe location to your Windows environment
variables)
11
What does the OpenSees interpreter do
again?
OpenSees interpreter enables the language ‘Tcl’ to understand finite
element analysis (it adds structural analysis vocabulary to Tcl):
12
OpenSees architecture: main “abstractions”
Recorder
Monitors user-defined
parameters during the analysis
Source: Frank McKenna, UC Berkeley
Introduction to Opensees 13
Some OpenSees domain components
Domain
Truss
Element Node
Truss Material
elasticBeamColumn
dispBeamColumn
nonlinearBeamColumn Uniaxial 𝜎𝜎 Section
BeamColumn Shell element
Joint element Elastic Elastic
zeroLength Steel01 Fiber
Steel02 𝜎𝜎 RC
…. 𝜀𝜀 ….
Concrete01
Concrete02
….
14
𝜀𝜀
Some OpenSees domain components
Domain
Generic
“abstract” Element Node LoadPattern Constraint
type Element load Boundary
Nodal load conditions
Truss Material Element load
Time series
elasticBeamColumn
Specific dispBeamColumn
types nonlinearBeamColumn Uniaxial Section Nodal
Shell element
Elastic load
Joint element Elastic
Steel01 Fiber
zeroLength
Steel02 RC
….
Concrete01 ….
Concrete02
…. Fixed
support 15
Why do we need to understand OpenSees
architecture?
Many OpenSees commands take element truss 1 …
the following format:
Truss
(1)
Command className $uniqueTag …
𝜀𝜀
16
Truss example problem
Basic truss example:
https://opensees.berkeley.edu/wiki/index.php/Basic_Truss_E
xample
50 kip
4 100 kip 𝐸𝐸 = 3000 𝑘𝑘𝑘𝑘𝑘𝑘
𝐴𝐴1 = 10 𝑖𝑖𝑛𝑛2
(1) (3) 𝐴𝐴2,3 = 5 𝑖𝑖𝑛𝑛2
8’
(2)
1
2 3
6’ 6’ 2’ 17
Basic truss example: model builder
# Build model: The Model command
# units: kip, in
• Define spatial dimension of model
and number of degrees-of-freedom
# Remove existing model at nodes.
wipe
• Add additional commands to the
# Create ModelBuilder (with two- interpreter such as:
dimensions and 2 DOF/node) Node, mass, element, equalDOF, fix,
model BasicBuilder -ndm 2 -ndf 2 pattern, timeSeries, load, eleLoad,
uniaxial material, section, geoTransf,
etc…
18
Basic truss example: create nodes
# Create nodes and add to Domain:
# node $nodeId $xCrd $yCrd
node 1 0.0 0.0
4
node 2 144.0 0.0
node 3 168.0 0.0 8’
node 4 72.0 96.0 1
2 3
6’ 6’ 2’
19
Basic truss example: boundary conditions
# Set the boundary conditions:
# fix $nodeID $xResraint? $yRestraint?
fix 1 1 1 4
fix 2 1 1
fix 3 1 1 8’
1
2 3
1 = fixed DOF
0 = free DOF 6’ 6’ 2’
20
Basic truss example: create material
# Create Elastic material:
# uniaxialMaterial Elastic $matID $E
𝜎𝜎
uniaxialMaterial Elastic 7 3000.0
𝐸𝐸 = 3000 𝑘𝑘𝑘𝑘𝑘𝑘
𝜀𝜀
21
Basic truss example: create elements
# Create truss elements:
# element Truss $trussID $node1 $node2 $A $matID
element Truss 1 1 4 10.0 7
element Truss 2 2 4 5.0 7 4
6’ 6’ 2’
22
How to apply loads?
LoadPattern: defines nodal loads, element loads and
constraints – each load pattern is associated with a Element load
TimeSeries
UniformExcitation pattern
Earthquake acceleration record
uniform excitation to the model in a certain direction
(will use that for earthquake loading)
23
How to apply loads?
TimeSeries: relationship between time (or pseudo time) and
factor applied to the load in a load pattern
• We will use the recorder command to track parameters of interest and write them to
output files.
26
Output recorder types
27
Basic truss example: record nodal
displacements
Recorder example
# create a Recorder object for the nodal displacements at node 4
recorder Node -file example.out -time -node 4 -dof 1 2 disp
Always use engineering
Output File judgement: does this 4 ∆𝑥𝑥
(1) (3)
1 0.530093 -0.177894 (2)
1 2 3
time Disp in Disp in
DOF 1 DOF 2 6’ 6’ 2’ 28
Basic truss example: record global forces
Recorder example
CHECK
✓
# create a Recorder for element forces, one for global system and the other for local system
𝐹𝐹𝐹𝐹 -ele
= 26.36 + 34.52 + 39.11 = 100
𝐹𝐹𝑦𝑦 = 35.15 − 46.04 − 39.11 = −50 ✓
recorder Element -file eleGlobal.out -time 1 2 3 forces
Output File:
eleGlobal.out
1 -26.3611 -35.1482 26.3611 35.1482 -34.5278 46.0371 34.5278 -46.0371 -39.1111 39.1111 39.1111 -39.1111
35.1482
-46.0371 -39.1111
4
26.3611 4 34.5278 4 39.1111
(1)
(3)
(2)
-26.3611 1 -39.1111
-34.5278 2 3
-35.1482
46.0371 39.1111
29
Basic truss example: record local forces
Recorder example
# create a Recorder for element forces, one for global system and the other for local system
recorder Element -file eleLocal.out -time -ele 1 2 3 localForce
Output Files:
eleLocal.out
1 43.9352 -57.5463 -55.3114
35.1482
4 8
✓
𝜃𝜃 = arctan
26.3611 6
✓
(1) 𝐹𝐹𝑥𝑥 = 43.9352 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐 = 26.3611
43.9352
8 𝐹𝐹𝑦𝑦 = 43.9352 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 = 35.1482
-26.3611 1 𝜃𝜃
-35.1482 6
30
OpenSees architecture: main “abstractions”
Recorder
Monitors user-defined
parameters during the analysis
31
Finite element analysis steps
Analysis Objects • Discretize the domain
DOF Numberer System • Formulate the system of equations
𝑡𝑡+∆𝑡𝑡
Integrator 𝑭𝑭𝑖𝑖𝑖𝑖𝑖𝑖 − 𝑭𝑭𝑡𝑡+∆𝑡𝑡
𝑒𝑒𝑒𝑒𝑒𝑒 = 𝟎𝟎
𝑲𝑲 𝒖𝒖 = 𝑭𝑭
Constraints Handler • Incorporate boundary conditions
SolnAlgorithm Convergence • Solve the system of equations
test
𝒖𝒖 = 𝑲𝑲−𝟏𝟏 𝑭𝑭
Selecting the appropriate
analysis parameters
become important in • Update the node and element response
nonlinear analysis 32
Basic truss example: analysis commands
Analysis commands example # Create a linear solution algorithm for solving the
How to solve the
# Create a system of equation suitable for postivive- equilibrium equations
How to create and system of equations?
definite stiffness matrices with banded profile algorithm Linear
arrange the system of
system BandSPD equilibrium equations?
# create the analysis object
Is the(static or transient)
analysis static
# Create a plain numberer to number the DOFs analysis Static or dynamic?
numberer Plain
#After defining the model, analysis and output objects,
How to enforce we now perform the analysis in 1 step
# Create a Plain constraint
boundaryhandler
conditions? analyze 1
constraints Plain
# Integrate the solution using load control and one Learn about OpenSees analysis
increment commands
integrator LoadControl 1.0 How to advance the https://opensees.berkeley.edu/wiki/index.php
solution in time? /System_Command
33
Now execute your program!
• All the commands are
written in Truss.tcl file
34
Things we need to know about Tcl
• Capable of setting variables and variable substitution
> set E 3000.0
3000.0
• Math pitfall
Pay attention to your integers and floats
> set a [expr 1/2]
0 Computer scientists thought this
> set a [expr 1./2.] was a good idea…
0.5
• At the end of your model (or after execution), use ‘wipe’ to finish writing output
> wipe
Maha Kenawy
mkenawy@unr.edu
39
References
• McKenna, F. (2012). Getting Started With OpenSees and OpenSees on
NEEShub Presentation, Pacific Earthquake Engineering Research Center
40
Node recorder command
recorder Node <-file $fileName> <-precision $nSD> <-time> <-dT $deltaT> <-node $node1 $node2 ...> <-nodeRange
$startNode $endNode> <-region $regionTag> -dof ($dof1 $dof2 ...) $respType
# UniformExcitation pattern
uniform excitation to the model in a certain direction
𝑭𝑭𝑡𝑡+∆𝑡𝑡 𝑡𝑡+∆𝑡𝑡
𝑖𝑖𝑖𝑖𝑖𝑖 − 𝑭𝑭𝑒𝑒𝑒𝑒𝑒𝑒 = 𝟎𝟎
Static analysis
𝑲𝑲 𝒖𝒖 = 𝑹𝑹 Transient analysis
47
Analysis Commands: Constraints Handler
Enforce boundary conditions and constraints between DOFs (e.g.,
rigid diaphragms) A blogpost on Constraint
Handlers by Michael Scott (not
Michael Scott from the Office…):
• Plain handler https://portwooddigital.com/20
Enforce pin, roll, fixed single point constraints, and equal DOF constrains 20/06/05/handle-your-
constraints-with-care/
• Lagrange Multipliers
Constraint equations are added to the system of nodal equilibrium Can cause
equations with Lagrange multipliers as the additional unknowns
convergence issues
and may not work
• Penalty Method
with certain
Adds artificial springs of high stiffness to the nodal equilibrium equations
to enforce multi-point constraints convergence tests if
not used carefully…
• Transformation Method
Uses static condensation to enforce multi-point constraints
48
Analysis Commands: DOF Numberer
The DOF Numberer object determines how the equations are numbered.
• Plain Numberer
Does not do anything special – works for small problems
• Linear Algorithm
• Newton Algorithm
• Newton with Line Search Algorithm
• Modified Newton Algorithm Make sure you
• Krylov-Newton Algorithm understand the
• Secant Newton Algorithm Nonlinear algorithm you are
• BFGS Algorithm using…
• Broyden Algorithm
52
Analysis Commands: Analysis & Integrator
Analysis Integrator
Static or dynamic analysis? How are you advancing the solution forward?
Load control
Static
Displacement control
Newmark Method To approximate a
nonlinear solution,
you have to divide
Transient Central Difference the solution process
into several steps…
… 53