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!

Changing out data and/or removing data fields

Status
Not open for further replies.

A Meza

Automotive
Nov 24, 2017
2
I am currently running a thermal analysis using abaqus, the output file .odb provides the results in kelvin (K). I would like the temperature output to be in Degrees Celcius.
I have a python script that reads the temperature results field (NT11) subtracts 273.15 from the value and writes it in a new field (which i have named DegC). This is fine, however i would like to either overwrite the NT11 field to show all the values in Degrees Celcius only or, use the current script and add a few lines that would remove the NT11 field completely and rename the new field (DegC) to NT11.
Is this possible?

Thanks
Mez
 
Replies continue below

Recommended for you

I think you can't delete a field - just create new fields.

Why did you used a script? The built-in functionality could do the same job.
See Tools -> Field Output -> Create From Fields
A/CAE Manual 42.7.4 Creating field output by operating on fields
 
Yes thats what ive been reading, it only allows you to create new ones.
I need a script becuase i need to save it to the .odb
I have been looking at another thread which is trying to achieve something slightly different but i think it might be a good approach?
thread799-413825
So the alternate solution would be to create a new step and frames with the new field...?
the thread i have referenced creates new steps and frames, but not perfectly clear on what his code is doing...

my current code reads:

from abaqusConstants import *
from odbAccess import *

# ******************************************************************************
# Modify the next variables accordingly:
odbPath = 'directory/filename.odb' # path to output database
# ******************************************************************************

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]
s1f1_NT11=frame.fieldOutputs['NT11']
tmpField = s1f1_NT11-273.15
newField = frame.FieldOutput(name='degC', description='convert_to_degC', field=tmpField)
print 'stepName = ', allSteps, ' frameNumber = ', allFrames[j]
odb.save()
odb.close()

how would i go about creating new steps with the new field (that is dervied from an existing field) through script?

thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor