sewkokot / opsvis

OpenSeesPy postprocessing and plotting module
GNU General Public License v3.0
35 stars 21 forks source link

Elastic Beam Column Timoshenko elements not (yet) supported #31

Closed Lomarandil closed 2 years ago

Lomarandil commented 2 years ago

It appears the plot_defo will kick back an error "element not supported yet". Other plots (section_force_diagram_2d) seem to just silently plot the frame but no results are superimposed.

Appreciate your efforts -- having a lot of fun playing with what Opsvis can do!

sewkokot commented 2 years ago

What opsvis and openseespy versions create this error? Starting from opsvis 1.0, the Timoshenko elements should be supported but send a MWE to check what could be wrong.

Lomarandil commented 2 years ago

This is on ops 3.4.0.2 and opsvis 1.0.5. MWE adopted from the elastic truss analysis example:

import openseespy.opensees as ops
import opsvis as opsv
import matplotlib.pyplot as plt

#Initialize OpenSees
ops.wipe()
ops.model('basic','-ndm',2,'-ndf',3)
transfTag = 1
ops.geomTransf('Linear',transfTag)

# Build model
################

# Material Steel01
matlTag = 1

Fy=227      # Yield stress MPa
Es=200.e3   # Modulus of Elasticity of Steel MPa
v=0.3       # Poisson's ratio
Gs=Es/(1+v) # Shear modulus
b=0.0       # Strain hardening ratio
alpha=0.05  # Coefficient of thermal expansion

ops.uniaxialMaterial('Steel01', matlTag, Fy, Es, b)

# create nodes
ops.node(1, 0.0, 0.0)
ops.node(2, 144.0,  0.0)
ops.node(3, 168.0,  0.0)
ops.node(4,  72.0, 96.0)

# set boundary condition
ops.fix(1, 1, 1, 1)
ops.fix(2, 1, 1, 0)
ops.fix(3, 1, 1, 0)
opsv.plot_model()

# Section Properties
Area = 1755
Avw = 920
Ixx = 2757500
Iyy = 2757500
Ixy = -5.6e-09
J = 4364370
Phi = 0

# Define Elements
eleType = "ElasticTimoshenkoBeam"  
ops.element(eleType,1,1,4,Es,Gs,Area,Ixx,Avw,transfTag)
ops.element(eleType,2,2,4,Es,Gs,Area,Ixx,Avw,transfTag)
ops.element(eleType,3,3,4,Es,Gs,Area,Ixx,Avw,transfTag)

# Loading
################
# create TimeSeries
ops.timeSeries("Linear", 1)
# create a plain load pattern
ops.pattern("Plain", 1, 1)
# Create the nodal load - command: load nodeID xForce yForce xyRot
ops.load(4, 100.0, -50.0, 0)

# Analysis
################
ops.constraints('Transformation')
ops.numberer('RCM')
ops.system('BandGeneral')
ops.test('NormDispIncr', 1.0e-6, 6, 2)
ops.algorithm('Linear')
ops.integrator('LoadControl', 1)
ops.analysis('Static')
ops.analyze(1)

# Results
################
opsv.plot_loads_2d(nep=10,sfac=20,fig_wi_he=(40.0,14.0))

opsv.plot_defo(fig_wi_he=(40.0,14.0))

sfacN, sfacV, sfacM = 5e-2,2e-0,5e-3
opsv.section_force_diagram_2d('N', sfacN, nep=17, fig_wi_he=(40.0,14.0))
plt.title('Axial force distribution')

opsv.section_force_diagram_2d('T', sfacV, nep=17, fig_wi_he=(40.0,14.0))
plt.title('Shear force distribution')

opsv.section_force_diagram_2d('M', sfacM, nep=17, end_max_values=True, fig_wi_he=(40.0,14.0))
plt.title('Bending moment distribution')

#print(ops.nodeDisp(4))
#ops.reactions()
#print(ops.nodeReaction(1))
#print(ops.nodeReaction(2))

Results in:

Warning! Elements not supported yet. nen: 2; must be: 2, 3, 4, 8.

Warning! Elements not supported yet. nen: 2; must be: 2, 3, 4, 8.

Warning! Elements not supported yet. nen: 2; must be: 2, 3, 4, 8.

Text(0.5, 1.0, 'Bending moment distribution') image image image image image

sewkokot commented 2 years ago

@Lomarandil, Thank you for more details. In fact Timoshenko elements were only supported for the plot_model() command. I have made some changes and now other opsvis commands should work as well. Update the opsvis package and let me know if it works.

Lomarandil commented 2 years ago

Excellent, thanks so much! Working wonderfully.