Changing out data and/or removing data fields
Changing out data and/or removing data fields
(OP)
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
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





RE: Changing out data and/or removing data 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
RE: Changing out data and/or removing data fields
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: [Urgent] Renaming output variables of the .odb file?
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[i]]
allFrames = session.odbData[odbPath].steps[allSteps[i]].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[i], ' 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