opensees introduction

4
Useful Links: Download OpenSees and Tcl/Tk: http://opensees.berkeley.edu/OpenSees/user/download.php You will have to register as a user Running “opensees.exe” will give you a command prompt for which you will run OpenSees code Documentation of OpenSees commands: http://opensees.berkeley.edu/wiki/index.php/Command_Manual Modeling Commands (e.g. creating nodes, elements, constraints, loads, masses, etc.) Analysis Commands (e.g. constraint handler, solution algorithms, convergence tests, analysis control type, etc.) Output Commands (e.g. record node displacements, element forces, etc.) Basic OpenSees Examples: http://opensees.berkeley.edu/wiki/index.php/Basic_Examples_Manual Examples for truss, frame, concrete, steel, pushover, time history, etc. Step-by-step description of commands Text Editors: You can use NotePad to edit Tcl scripts (just be sure to save as a .tcl file) For syntax highlighting (e.g. comments in a different color), Crimson Editor is a nice alternative http://www.crimsoneditor.com/ (It’s FREE!) The above links should provide you with the information necessary for your use of OpenSees in this class. If you would like further background information see: Step-by-step manual for people new to OpenSees or command line interpreters: http://opensees.berkeley.edu/wiki/index.php/Getting_Started Introduction: To run a model: Put the OpenSees executable in the same folder as the file you wish to run, OR use the “cd” command in the OpenSees.exe command prompt to move the directory containing your OpenSees model (modelDirectory) E.g. >> cd modelDirectory To execute your code, in the OpenSees.exe command prompt type (Note: you can also include this command in your Tcl files to call another file): >> source filename.tcl General Tips: Note: There are no units in OpenSees. You define basic units and stick with it (i.e. if your input is all in units of kips & inches, your output will be in kips & inches) Comments in Tcl are with the # symbol. Use them often!! Defining and using variables: o Define a variable (a=23) with: set a 23. o Use a variable by putting $ in front of it (e.g. $a) o Do simple math (4*a) with: [expr 4*$a]

Upload: mehdi-kashani

Post on 25-Jan-2016

13 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: OpenSees Introduction

Useful Links:

Download OpenSees and Tcl/Tk:

http://opensees.berkeley.edu/OpenSees/user/download.php

You will have to register as a user

Running “opensees.exe” will give you a command prompt for which you will run OpenSees code

Documentation of OpenSees commands:

http://opensees.berkeley.edu/wiki/index.php/Command_Manual

Modeling Commands (e.g. creating nodes, elements, constraints, loads, masses, etc.)

Analysis Commands (e.g. constraint handler, solution algorithms, convergence tests, analysis control

type, etc.)

Output Commands (e.g. record node displacements, element forces, etc.)

Basic OpenSees Examples:

http://opensees.berkeley.edu/wiki/index.php/Basic_Examples_Manual

Examples for truss, frame, concrete, steel, pushover, time history, etc.

Step-by-step description of commands

Text Editors:

You can use NotePad to edit Tcl scripts (just be sure to save as a .tcl file)

For syntax highlighting (e.g. comments in a different color), Crimson Editor is a nice alternative

http://www.crimsoneditor.com/ (It’s FREE!)

The above links should provide you with the information necessary for your use of OpenSees in this class. If

you would like further background information see:

Step-by-step manual for people new to OpenSees or command line interpreters:

http://opensees.berkeley.edu/wiki/index.php/Getting_Started

Introduction:

To run a model:

Put the OpenSees executable in the same folder as the file you wish to run, OR use the “cd” command in

the OpenSees.exe command prompt to move the directory containing your OpenSees model

(modelDirectory)

E.g. >> cd modelDirectory

To execute your code, in the OpenSees.exe command prompt type (Note: you can also include this

command in your Tcl files to call another file):

>> source filename.tcl

General Tips:

Note: There are no units in OpenSees. You define basic units and stick with it (i.e. if your input is all in

units of kips & inches, your output will be in kips & inches)

Comments in Tcl are with the # symbol. Use them often!!

Defining and using variables:

o Define a variable (a=23) with: set a 23.

o Use a variable by putting $ in front of it (e.g. $a)

o Do simple math (4*a) with: [expr 4*$a]

Page 2: OpenSees Introduction

Simple cantilever example (cantileverEx.tcl):

#---- SET-UP MODEL ----

# units : kip, in

# clear all variables

wipe;

# Define model domain: 2 dimensions, 3 dof per node

model basic -ndm 2 -ndf 3;

#---- define GEOMETRY ----

set L 50;

# create nodal coordinates: node, #, x-coord, y-coord

node 1 0. 0.;

node 2 0. $L;

# boundary conditions: node#, DX, DY, RZ (1=fixed, 0-free)

fix 1 1 1 1;

#---- define MATERIALS ----

set SteelTag 1; # associate a tag to the material

set Es 29000;

set Fy 50;

set b 0.02; # Strain hardening ratio

uniaxialMaterial Steel02 $SteelTag $Fy $Es $b 20 0.925 0.15;

#---- define CROSS-SECTION ----

# rectangular 3”x4” steel fiber cross-section

# with 5 fibers along the width, 5 fibers along the height

set b [expr 3./2.];

set h [expr 4./2.];

set SectionTag 1

section Fiber $SectionTag{

#command: patch rect $matTag $numSubdivY $numSubdivZ $yI $zI $yJ $zJ

patch rect $SteelTag 5 5 -$b -$h $b $h

}

#---- define ELEMENTS ----

# define geometric transformation: Linear, PDelta, or Corotational

set TransTag 1; # associate a tag to transformation

geomTransf Linear $TransTag;

# number of integration points

Page 3: OpenSees Introduction

set np 5;

# create beam-column (element #1) from node 1 to 2

element forceBeamColumn 1 1 2 $np $ SectionTag $TransTag;

#---- define RECORDERS (Output) ----

# displacements of free nodes

recorder Node -file DFree.out -time -node 2 -dof 1 2 3 disp;

# support reaction

recorder Node -file RBase.out -time -node 1 -dof 1 2 3 reaction;

# element global forces

recorder Element -file FEle.out -time -ele 1 force;

#---- define LOADS ----

set Fx 1.;

pattern Plain 1 Linear {

load 2 $Fx 0. 0.; # node#, FX, FY, MZ

}

#---- define ANALYSIS PARAMETERS ----

# Method to create and solve system of equation

system BandSPD

# Method to number DOFs

numberer Plain

# Constraint handler (Plain, Penalty, Lagrange, Transformation)

constraints Plain

# Convergence test and tolerance

set Tol 1.0e-8;

test NormDispIncr $Tol 6 ;

# Solution algorithm (Linear, Newton, ModifiedNewton, NewtonLineSearch, etc.)

algorithm Newton

# Integration (control) scheme (LoadControl, DisplacementControl, ArcLength)

set numIncr 50; # number of increments in analysis

set maxDispl 5.0; # total displacement = 5 inch

set delta [expr $maxDispl/$numIncr];

# push node 2, in the x-dir (dof=1)

integrator DisplacementControl 2 1 $delta

# create the analysis object (Static, Transient)

analysis Static

# Do the analysis

analyze $numIncr

wipe; # clear everything after analysis is done

Page 4: OpenSees Introduction

Output:

In static analysis, the first column is the load multiplier. If your applied load is 1 (as in this example),

then this column is equal to the applied load

For the cantilever example, the data in each column of the output files are listed below:

o DFree.out (displacements/rotation of node 2): Load, x, y, rotation

o RBase.out (reaction forces at node 1): Load, Fx, Fy, M

o FEle.out (global element forces at node i, j): Load, Fxi, Fyi, Mi, Fxj, Fyj, Mj

There are many different types of output recorders. In the homework, you will be told what column

pertains to which data.

In Matlab:

dFree = load('DFree.out');

F = dFree(:,1);

d = dFree(:,2);

figure(), hold all, box on

plot(d,F,'b-*')

xlabel('Displ (in)'), ylabel('Force (kip)')

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 50

2

4

6

8

10

12

Displ (in)

Forc

e (

kip

)