A common question is can I apply ground motions in more than one direction to a model in OpenSees?
The answer is Yes.
Let’s say you have files for three ground motion recordings: gm000.txt, gm090.txt, and gmUP.txt. Define a time series for each ground motion, then associate each time series with a uniform excitation load pattern and a global direction.
#
# Define your model, define g, don't forget mass
#
ops.timeSeries('Path',7,'-dt',0.02,'-filePath','gm000.txt','-factor',g)
ops.timeSeries('Path',8,'-dt',0.02,'-filePath','gm090.txt','-factor',g)
ops.timeSeries('Path',9,'-dt',0.02,'-filePath','gmUP.txt','-factor',g)
# direction = 1 (X), 2 (Y), 3 (Z)
ops.pattern('UniformExcitation',15,1,'-accel',7)
ops.pattern('UniformExcitation',16,3,'-accel',8)
ops.pattern('UniformExcitation',17,2,'-accel',9)
#
# Perform your analysis
#
While some specific element implementations assume Z is global vertical, OpenSees itself does not make any such assumptions on the global axes of a model. I like to use the Y-axis as global vertical in my models, so that direction got the gmUP.txt time series. But you can use the Z-axis as global vertical if you want. Or don’t apply vertical ground motion at all, in which case you just remove the associated pattern.
After you have the patterns defined, you can perform the analysis as usual.

Hi Professor,Thanks for your posts.Next Post: How to apply ground motion in non-main direction.
LikeLiked by 1 person
That’s a good topic. Two time series / patterns, but same ground motion with sine and cosine of the ground motion orientation in the time series factor… sin g and cos g
LikeLiked by 1 person
What if the structure is rotated? can it work?
https://opensees.berkeley.edu/wiki/index.php/Earthquake_in_Any_Direction
LikeLike