CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Structural Mechanics

Abaqus python scripting

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2023, 20:10
Default Abaqus python scripting
  #1
New Member
 
Nouzil
Join Date: Jan 2023
Posts: 6
Rep Power: 3
inouzil is on a distinguished road
Hi,

I want to extract history output of interaction contact force using a python script in abaqus. I was trying to use an example code as below:

[I]"import odbAccess
import csv

odb_path = 'Job1.odb'
set_name = 'ASSEMBLY_S_SET-44_CNS_/ASSEMBLY_M_SURF-10' # Name of the set containing the contact region
output_name = 'CFT1' # Name of the contact force output variable

# Open the ODB file
odb = odbAccess.openOdb(odb_path)

# Get the output object
step = odb.steps.values()[0]
output = step.historyRegions[set_name].historyOutputs[output_name]

# Get the data for the output variable
data = output.data

# Export the data to a CSV file
with open('contact_force.csv', 'w', newline='') as csvfile:
writer = csv.writer(csvfile)
writer.writerow(['Time', 'Contact Force'])
for i in range(len(data)):
writer.writerow([data[i][0], data[1]])

# Close the ODB file
odb.close()"



The set name for the interaction I obtained from abaqus GUI. It appears I am making some mistake. I get 'Key word error for the setname'.

Kindly assist.

Ibrahim
inouzil is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[PyFoam] Using pyFoamPlotWatcher.py To Plot Residuals m_ridzon OpenFOAM Community Contributions 22 January 26, 2021 19:48
material for python scripting amin.z Pointwise & Gridgen 4 June 19, 2018 14:14
[General] Filters using Python Scripting Birro ParaView 0 January 11, 2017 11:26
[ICEM] ICEM python geometry scripting eromon84 ANSYS Meshing & Geometry 0 December 12, 2015 12:39
python scripting in paraFoam chegdan OpenFOAM Post-Processing 0 March 31, 2010 20:06


All times are GMT -4. The time now is 15:09.