Transformation of field results

This example illustrates how field results can be transformed to a different coordinate system. The example computes deviation of the nodal displacements with respect to a perfectly cylindrical displacement (cylinder bore distortion). The example does the following:

  • Creates a cylindrical coordinate system.

  • Transforms the results to the new coordinate system.

  • Computes the average radial displacement.

  • Computes the distortion as the difference between radial displacement and the average radial displacement.

  • Saves the distortion field to the output database for viewing.

Use the following commands to retrieve the example script and an input file to create a sample output database:

abaqus fetch job=transformExa
abaqus fetch job=esf4sxdg

from odbAccess import *

# Retrieve request from user.

odbName = raw_input('Enter odb name')
stepName = raw_input('Enter step name')
frameNo = int( raw_input('Enter frame number') )


odb = openOdb(odbName)

# Retrieve the displacements from last frame of the last step.

step = odb.steps[stepName]
frame = step.frames[frameNo]
displacement = frame.fieldOutputs['U']

# Create cylindrical coordinate system and compute
# associated results

coordSys = odb.rootAssembly.DatumCsysByThreePoints(name='cylC',
    coordSysType=CYLINDRICAL, origin=(0,0,0),
    point1=(1.0, 0.0, 0), point2=(0.0, 0.0, 1.0) )

cylindricalDisp = displacement.getTransformedField(
    datumCsys=coordSys)
radialDisp = cylindricalDisp.getScalarField(componentLabel='U1')

# Compute average radius.

sum = 0.0
for val in radialDisp.values:
    sum = sum + val.data
aveDisp = sum / len(radialDisp.values)

# Compute distortion.

distortion = radialDisp - aveDisp

# Save computed results to the database.

frame.FieldOutput(field=radialDisp)
fieldDescription = 'Distortion ( \
     average radial displacement = ' + str(aveDisp) + ')'
frame.FieldOutput(name='Distortion',
    description=fieldDescription, field=distortion)

odb.save()
odb.close()