Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

using Python script: problem about extracting no value in nodal stress

Status
Not open for further replies.

cclcjp228

Aerospace
May 30, 2016
5
hi everyone,

i was writing a python script to extract nodal customised shear stress from odb file over each frame. i first tried to extract shear stress from each frame as a practice.
i successfully obtained all the nodes in the part of interests, i.e. the total number is correct.
however, i did not get any values as it generates "0" value.
i really dont know where my problem is. how can i deal with that problems?

here is my code:

ForceFile = open('Results.dat','w')
odbPath = "C:/Temp/123.odb"
odb = session.openOdb(name=odbPath,readOnly=FALSE)
allSteps = session.odbData[odbPath].steps.keys()
for i in range(len(allSteps)):
step = odb.steps[allSteps]
allFrames = session.odbData[odbPath].steps[allSteps].frames.keys()
for j in range(len(allFrames)):
frame = step.frames[j] #get the current frame in step
myInstance = odb.rootAssembly.instances["BOTTOM-1"] #get the instance of interest
numNodes = len(myInstance.nodes) #get the number of nodes
ReactionForce = frame.fieldOutputs['S']
for el in range(0,numNodes):
ReactionForceInterest = ReactionForce.getSubset(region=myInstance.nodes[el]).values # get the node inside the instance
ForceFile.write( + " ") ####! PLOBLEMS need help; i have tried to use ReactionForceInterest.data[3]...
ForceFile.write("\n")
ForceFile.close()
odb.close()


thanks in advance.
 
Replies continue below

Recommended for you

Think about these questions and you may find the solution.

Are stresses node or element result? So where are they calculated and stored? And what keyword is used to request that output? Is it possible to change that behavior with that keyword?
 
Thanks for your hint!
stress are element results. i found i need to request the nodal stress output by having "*element output, POSITION=NODES" in the inp file. In the CAE, i first tried to define a set of nodes in the instance of interest. and then added a Field Output Requests for each step in the domain of that set of nodes. but i did not get the same output request command as suggested.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor