deyentl
Materials
- Jul 12, 2011
- 39
Hello,
I'm a big fan of these forums. Especially the Abaqus FEA forum has helped me a lot. It has already given me answers to quite a number of questions I had. But now I've started scripting and I ran into a major issue. To clarify my problem, I've uploaded a simplified version of my inputfile ( The model contains fibres and matrix. All fibres and matrix are subjected to a displacement, except for the centre fibre. These boundary conditions give rise to stress concentrations. The core of my work is to determine this stress concentration.
I want to create a code that does the following:
Input: x,y,z (a random location)
Output: the stress S33 at x,y,z.
Based on some previous topics here, I'm close to the solution, but now I'm stuck again. I've already applied the tip discussed by xerf and bEakerPPK ( However, now I get an OdpError saying when I'm calling a variable: "The selected variable is unavailable." I have no idea on how to solve this. I've posted my script below.
Any help would be highly appreciated.
# Import all the necessary packages
import os
import visualization
import sys
from odbAccess import *
from abaqusConstants import *
# The point at a random location (x, y, z) where we want to extract S33
locx = 25
locy = 25
locz = 25
point= ( (locx,locy,locz), )
# The path object to map all the values to
myPath=session.Path(name='track', type=POINT_LIST, expression=point)
# These parameters are used in XYDataFromPath
var_s33=(('S', INTEGRATION_POINT, ((COMPONENT, 'S33' ), )),)
session.paths['track']
StepName = 'Step-1'
# Setup the odb and viewport
myodb = openOdb(path = 'Small_model.odb')
viewport = session.viewports[session.viewports.keys()[-1]]
viewport.setValues(displayedObject=myodb)
viewport.odbDisplay.setPrimaryVariable(variableLabel = 'S',outputPosition = INTEGRATION_POINT, refinement=COMPONENT,'S33'))
viewport.odbDisplay.display.setValues(plotState=CONTOURS_ON_DEF,))
# Map S33 values to the path
stress33XYData=session.XYDataFromPath(name='Stress in 33-direction',
path=myPath,
includeIntersections=False,
shape=DEFORMED,
labelType=TRUE_DISTANCE,
step=-1,
frame=-1,
variable=var_s33)
# Extract the S33 value from the XYData
stress33Value = stress33XYData.data[0][1]
I'm a big fan of these forums. Especially the Abaqus FEA forum has helped me a lot. It has already given me answers to quite a number of questions I had. But now I've started scripting and I ran into a major issue. To clarify my problem, I've uploaded a simplified version of my inputfile ( The model contains fibres and matrix. All fibres and matrix are subjected to a displacement, except for the centre fibre. These boundary conditions give rise to stress concentrations. The core of my work is to determine this stress concentration.
I want to create a code that does the following:
Input: x,y,z (a random location)
Output: the stress S33 at x,y,z.
Based on some previous topics here, I'm close to the solution, but now I'm stuck again. I've already applied the tip discussed by xerf and bEakerPPK ( However, now I get an OdpError saying when I'm calling a variable: "The selected variable is unavailable." I have no idea on how to solve this. I've posted my script below.
Any help would be highly appreciated.
# Import all the necessary packages
import os
import visualization
import sys
from odbAccess import *
from abaqusConstants import *
# The point at a random location (x, y, z) where we want to extract S33
locx = 25
locy = 25
locz = 25
point= ( (locx,locy,locz), )
# The path object to map all the values to
myPath=session.Path(name='track', type=POINT_LIST, expression=point)
# These parameters are used in XYDataFromPath
var_s33=(('S', INTEGRATION_POINT, ((COMPONENT, 'S33' ), )),)
session.paths['track']
StepName = 'Step-1'
# Setup the odb and viewport
myodb = openOdb(path = 'Small_model.odb')
viewport = session.viewports[session.viewports.keys()[-1]]
viewport.setValues(displayedObject=myodb)
viewport.odbDisplay.setPrimaryVariable(variableLabel = 'S',outputPosition = INTEGRATION_POINT, refinement=COMPONENT,'S33'))
viewport.odbDisplay.display.setValues(plotState=CONTOURS_ON_DEF,))
# Map S33 values to the path
stress33XYData=session.XYDataFromPath(name='Stress in 33-direction',
path=myPath,
includeIntersections=False,
shape=DEFORMED,
labelType=TRUE_DISTANCE,
step=-1,
frame=-1,
variable=var_s33)
# Extract the S33 value from the XYData
stress33Value = stress33XYData.data[0][1]