minjie zhu and michael h. scott · summary summary 1 the openseespy has been implemented with most...

30
Fluid-Structure interaction and Python scripting capabilities in OpenSees Minjie Zhu and Michael H. Scott Civil & Construction Engineering PEER Researchers’ Workshop 2018 August 8, 2018 M.Z. (OSU) OpenSeesPy PEER 2018 1 / 29

Upload: others

Post on 17-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure interaction and Python

scripting capabilities in OpenSees

Minjie Zhu and Michael H. Scott

Civil & Construction Engineering

PEER Researchers’ Workshop 2018August 8, 2018

M.Z. (OSU) OpenSeesPy PEER 2018 1 / 29

Page 2: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy

Outline

1 Introduction to OpenSeesPyOpenSeesPyFrom Tcl to Python

2 Fluid-Structure Interaction in OpenSeesPyA background meshBreaking dam on elastic columnPublic Works Research Institute (PWRI)3D Breaking dam on obstacle

3 Summary

M.Z. (OSU) OpenSeesPy PEER 2018 2 / 29

Page 3: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy OpenSeesPy

Background

1 OpenSees was developed and linked with Tcl for many years.

2 Tcl is difficult to learn because of its syntax.

3 Python has become popular as a scientific programminglanguage.

4 Python syntax is clean and easy to use.

5 Many students learn Python in undergraduate.

6 Python has a very large ecosystem with many libraries forOpenSees users:NumPy, SciPy, Pandas, Jupyter, Matplotlib, Mayavi,

VTK, mpi4py, Sphinx, PyQt, wxPython, Django, Flask,

and others on conda or pip.

M.Z. (OSU) OpenSeesPy PEER 2018 3 / 29

Page 4: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy OpenSeesPy

OpenSeesPy

1 OpenSeesPy is a Python 3 interpreter of OpenSees.Python 2 will be offcially deprecated in 2020.

2 All model building (elements, materials, ...), analysis, output,utility, sensitivity, FSI commands have been implemented inOpenSeesPy.

3 http://openseespydoc.readthedocs.io/

M.Z. (OSU) OpenSeesPy PEER 2018 4 / 29

Page 5: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

Migration from Tcl to Python

Most Python commands have the same arguments as in the Tcl

Tcl node command:

1 node $nodeTag (ndm $ c r d s ) −mass ( ndf $mass )

Python node command:

1 node ( nodeTag , ∗ c rds , ’−mass ’ , ∗mass )

where (ndm $crds) is a list of Tcl variables, which can only be givenindividually,

1 node $nodeTag [ l i n d e x $ c r d s 0 ] [ l i n d e x $ c r d s 1 ] \2 [ l i n d e x $ c r d s 2 ]

∗crds is a Python list, which can be used in two ways,

1 node ( nodeTag , c r d s [ 0 ] , c r d s [ 1 ] , c r d s [ 2 ] )2 node ( nodeTag , ∗ c r d s )

M.Z. (OSU) OpenSeesPy PEER 2018 5 / 29

Page 6: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

A Truss Example

72 in 96 in

48 in

144 in

1 2 3

4

1 2 3

160 kip

M.Z. (OSU) OpenSeesPy PEER 2018 6 / 29

Page 7: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

A Truss Example

Tcl defining nodes

1 s e t x {0 . 0 72 . 0 168 . 0 48 . 0 }2 s e t y {0 . 0 0 . 0 0 . 0 144 . 0 }3

4 f o r { s e t i 0} { $ i <4} { i n c r i } {5 node [ e x p r $ i +1] [ l i n d e x $x $ i ] [ l i n d e x $y $ i ]6 }

Python defining nodes

1 x = [ 0 . 0 , 7 2 . 0 , 1 6 8 . 0 , 4 8 . 0 ]2 y = [ 0 . 0 , 0 . 0 , 0 . 0 , 1 4 4 . 0 ]3

4 f o r i i n ran ge ( 4 ) :5 node ( i +1, x [ i ] , y [ i ] )

M.Z. (OSU) OpenSeesPy PEER 2018 7 / 29

Page 8: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

A Truss Example

Tcl defining material

1 s e t A 4 . 0 ; s e t E 29000 . 0 ;2 s e t a l p h a 0 . 0 5 ; s e t sigmaY 36 . 03

4 u n i a x i a l M a t e r i a l Harden ing 1 $E $sigmaY 0 . 0 [ e x p r$ a l p h a /(1− $ a l p h a ) ∗ $E ]

5

6

Python defining material

1 A = 4 . 0 ; E = 2 9 0 0 0 . 0 ; a l p h a = 0 . 0 5 ; sigmaY = 3 6 . 02

3 u n i a x i a l M a t e r i a l ( ’ Harden ing ’ , 1 , E , sigmaY , 0 . 0 ,a l p h a /(1− a l p h a ) ∗E)

4

M.Z. (OSU) OpenSeesPy PEER 2018 8 / 29

Page 9: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

A Truss Example

Tcl defining elements:

1 f o r e a c h i {1 2 3} {2 e l em en t t r u s s $ i $ i 4 $A 13 }4

Python defining elements:

1 f o r i i n [ 1 , 2 , 3 ] :2 e l em en t ( ’ t r u s s ’ , i , i , 4 , A, 1 )3

M.Z. (OSU) OpenSeesPy PEER 2018 9 / 29

Page 10: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

A Truss Example

Tcl defining load pattern:

1 t i m e S e r i e s L i n e a r 12 p a t t e r n P l a i n 1 1 {3 l o a d 4 $Px $Py4 }5

Python defining load pattern:

1 t i m e S e r i e s ( ’ L i n e a r ’ , 1)2 p a t t e r n ( ’ P l a i n ’ , 1 , 1)3 l o a d ( 4 , Px , Py )4

Nested Tcl commands that use {}, e.g., load pattern, fiber section,have no braces in Python interpreter for OpenSees

M.Z. (OSU) OpenSeesPy PEER 2018 10 / 29

Page 11: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

Generic Interface for OpenSees

1 vo i d ∗2 OPS TrussElement ( )3 {4 i n t numRemainingArgs = OPS GetNumRemainingInputArgs ( ) ;5

6 i n t numData = 3 ;7 i f ( OPS GetInt(&numData , iData ) != 0) { /∗ tag , iNode , jNode ∗/ }8

9 numData = 1 ;10 i f ( OPS GetDouble(&numData , &A) != 0) { . . . }11

12 . . .13

14 Un i a x i a lM a t e r i a l ∗ t h eU n i a x i a lM a t e r i a l =15 OPS GetUn i a x i a lMat e r i a l (matTag ) ;16

17 theE lement = new Truss ( iData [ 0 ] , ndm , iData [ 1 ] , iData [ 2 ] ,18 ∗ t h eUn i a x i a lMa t e r i a l , A , rho , doRay l e igh , cMass ) ;19

20 r e t u r n theE lement ;21 }

M.Z. (OSU) OpenSeesPy PEER 2018 11 / 29

Page 12: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

Run Python Script in Terminal

M.Z. (OSU) OpenSeesPy PEER 2018 12 / 29

Page 13: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

OpenSeesPy From Tcl to Python

Run Python Script in Jupyter Notebook

M.Z. (OSU) OpenSeesPy PEER 2018 13 / 29

Page 14: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy

Outline

1 Introduction to OpenSeesPyOpenSeesPyFrom Tcl to Python

2 Fluid-Structure Interaction in OpenSeesPyA background meshBreaking dam on elastic columnPublic Works Research Institute (PWRI)3D Breaking dam on obstacle

3 Summary

M.Z. (OSU) OpenSeesPy PEER 2018 14 / 29

Page 15: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy

Background

The FSI in OpenSees uses the Particle Finite Element Method.

Finite Element Method with Lagrangian formulationThe position and physical properties of the particles aredescribed in terms of the material coordinates and time

Effective for solving free-surface flow problemsThe changes in the position and physical properties as thematerial particles moves in free-surface are easy to captureFractional Step Method ⇒ fast iterative solver

Natural for solving structure-fluid interaction problemsCurrent configuration is chosen as the referential coordinateswhich is normally used in solid mechanicsThe FSI in OpenSees can use all the elements in OpenSees.

The ongoing research is using a new background mesh approachfor more efficient FSI.

M.Z. (OSU) OpenSeesPy PEER 2018 15 / 29

Page 16: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy A background mesh

A background mesh: Steps

1. Fixed mesh in fluid only area

Take only fluidparticles.

Createbackgroundfixed grid cellsand FE nodes.

M.Z. (OSU) OpenSeesPy PEER 2018 16 / 29

Page 17: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy A background mesh

A background mesh: Steps

2. Identify FSI area

(a) Structure on fixed mesh

Particles FE Fluid NodesFE Structure Nodes FE Fluid Mesh

Identify thelocation ofstructures.

Identify the FSIarea.

Remove theclosest gridsnodes for allstructuralnodes.

M.Z. (OSU) OpenSeesPy PEER 2018 17 / 29

Page 18: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy A background mesh

A background mesh: Steps

3. Delaunay Triangulation in FSI area

(b) DT around structure

Particles FE Fluid NodesFE Structure Nodes FE Fluid Mesh

Create DT withremaining gridnodes andstructuralnodes.

Remove emptytriangles in DT.

M.Z. (OSU) OpenSeesPy PEER 2018 18 / 29

Page 19: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy A background mesh

A background mesh: Steps

4. The background mesh

(c) Background mesh

Particles FE Fluid NodesFE Structure Nodes FE Fluid Mesh

Create elementsin the FSI area.

Create elementsin the Fluidarea.

M.Z. (OSU) OpenSeesPy PEER 2018 19 / 29

Page 20: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Breaking dam on elastic column

Breaking dam on elastic column

M.Z. (OSU) OpenSeesPy PEER 2018 20 / 29

Page 21: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Breaking dam on elastic column

Breaking dam on elastic column

0 0.2 0.4 0.6 0.8 1−0.04

−0.02

0

0.02

0.04

(a) Unified FSI formulation

Back. M.Idelsohn

0 0.2 0.4 0.6 0.8 1−0.04

−0.02

0

0.02

0.04

(b) SPH

Back. M.Rafiee

0 0.2 0.4 0.6 0.8 1−0.04

−0.02

0

0.02

0.04

(c) Quasi-incompressible PFEM

Back. M.Ryzhakov

0 0.2 0.4 0.6 0.8 1−0.04

−0.02

0

0.02

0.04

(d) Space-time FEM

Back. M.Walhorn

M.Z. (OSU) OpenSeesPy PEER 2018 21 / 29

Page 22: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Public Works Research Institute (PWRI)

PWRI flume experiments

Public Works Research Institute 1:20 scale wave flume experiments inJapan (Hoshikuma et al 2013)

Bridge Deck

WaveGauges

Gate

Pier

hSWL

hres

12.0 m

30.0 m

7.5 m

2.5 m

1.0 m

0.1 m0.5 m

hSWL=10 cm

50 cm

20 cm

wave height for(expected

20 cm

hres=61.7 cm)5 cm 10.67 cm

2 cm 7 cm

3 cm

M.Z. (OSU) OpenSeesPy PEER 2018 22 / 29

Page 23: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Public Works Research Institute (PWRI)

PWRI flume experiments

M.Z. (OSU) OpenSeesPy PEER 2018 23 / 29

Page 24: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Public Works Research Institute (PWRI)

Wave height and velocity

20 30 40 50 600

2

4

6

Time (s)

h(m

)

(a) Wave Height

Exp.Back. M.

20 30 40 50 60

0

5

10

Time (s)

v(m

/s)

(b) Wave Velocity

Exp.Back. M.

M.Z. (OSU) OpenSeesPy PEER 2018 24 / 29

Page 25: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Public Works Research Institute (PWRI)

Wave pressures on deck and girders

20 30 40 50 60

0

50

100

Pres

sure

(kPa

)

Leading Face of Deck (p1)

Exp.Back. M.

20 30 40 50 60

0

50

100Leading Face of Girder (p9)

Exp.Back. M.

20 30 40 50 60−50

0

50

100

Time (s)

Pres

sure

(kPa

)

Under Deck Overhang (p4)

Exp.Back. M.

20 30 40 50 60

−20

0

20

40

Time (s)

Top of Deck (p2)

Exp.Back. M.

M.Z. (OSU) OpenSeesPy PEER 2018 25 / 29

Page 26: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy Public Works Research Institute (PWRI)

Total forces on bridge deck

20 30 40 50 60

0

2,000

4,000

Time (s)

F(k

N)

(a) Total Horizontal Force

Exp.Back. M.

20 30 40 50 60−6,000

−4,000

−2,000

0

2,000

4,000

Time (s)

(b) Total Vertical Force

Exp.Back. M.

M.Z. (OSU) OpenSeesPy PEER 2018 26 / 29

Page 27: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Fluid-Structure Interaction in OpenSeesPy 3D Breaking dam on obstacle

3D Breaking dam on obstacle

M.Z. (OSU) OpenSeesPy PEER 2018 27 / 29

Page 28: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Summary

Outline

1 Introduction to OpenSeesPyOpenSeesPyFrom Tcl to Python

2 Fluid-Structure Interaction in OpenSeesPyA background meshBreaking dam on elastic columnPublic Works Research Institute (PWRI)3D Breaking dam on obstacle

3 Summary

M.Z. (OSU) OpenSeesPy PEER 2018 28 / 29

Page 29: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

Summary

Summary

1 The OpenSeesPy has been implemented with most of theOpenSees Tcl commands.

2 The commands for parallel computing and reliability analysis willbe added in the future.

3 Online user documentation is available and will be updatedaccordingly.

4 The OpenSeesPy is distributed as a Python module in Windowsand Linux. The Mac version may be released in the future.

5 The FSI in OpenSees has been implemented for 2D problems.

6 The 3D FSI is under development.

7 A more efficient background mesh FSI is under development.

M.Z. (OSU) OpenSeesPy PEER 2018 29 / 29

Page 30: Minjie Zhu and Michael H. Scott · Summary Summary 1 The OpenSeesPy has been implemented with most of the OpenSees Tcl commands. 2 The commands for parallel computing and reliability

References

Zhu, M., Elkhetali, I., and Scott, M. (2017).Validation of opensees for tsunami loading on bridgesuperstructures.Journal of Bridge Engineering, 23(4):04018015.

Zhu, M., McKenna, F., and Scott, M. (2018).Openseespy: Python library for the opensees finite elementframework.SoftwareX, 7:6–11.

Zhu, M. and Scott, M. H. (2014).Improved fractional step method for simulating fluid-structureinteraction using the pfem.International Journal for Numerical Methods in Engineering,99(12):925–944.

M.Z. (OSU) OpenSeesPy PEER 2018 29 / 29