News:

SMF - Just Installed!

Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Mark Barkey

#62
from Matt F.

During your video I would mention that when editing the Python script which was generated by Abaqus CAE make sure to change ALL lines of code which might save the file to a particular location. While following along with your video I saved my file periodically, but when I changed the Python script to save the file to a new location I only edited the last save command at the very bottom of the file, and left the original file name in some of the previous save commands. This caused me to overwrite some data but it was easily fixed. In hindsight this should have been obvious to me, but perhaps it's worth mentioning in your video.
#63
From Greg L.

Suggestions for an Updated Assignment:
Knowing that the general arrangement of the optimized mesh is accurate with respect to the convergence analysis solution, one possible update to the assignment could be to create one more mesh in Hypermesh but change the radius size of the hole. The same meshing style (number of elements biased towards the hole, transition zone, etc.) should be relatively quick to make. The boundary conditions would be the same and the new loading condition could be provided to ensure the normalized solution. The results of this new analysis could then be compared to the theoretical stress concentration chart provided in class. This effort could be used to show how known meshing solutions can be scaled up for similar applications.
#64
AEM class related files / Re: HW-2 Plate with a hole
February 21, 2017, 09:03:01 PM

HW2: Use a rectangular plate with 2:1 aspect ratio to get Kt more near 2.5 instead of 2.6.  (Ben W.)
#65
HW1:  pipe in tension: I need to be sure to use U3 instead of Umagnitude for the displacement of the pipe.
#69
AEM class related files / Updates for HW assignments
January 28, 2017, 04:45:25 PM
These are my notes to update the FEA assignments.

update report format to include element type, software and version.

refer to posts related to each assignment for updates related to that assignment
#75
Scripting and Python / ODB temperature writer
December 15, 2016, 12:33:33 AM
data files are here:
http://forums.mbarkey.com/index.php?topic=124.0



#write selected frame results for nodal temperatures to an ODB file
#or write nodal temperature from a file to an ODB file
#M. E. Barkey
# 14 December 2016

#with reference from python code from Mustaine
#ww3.cad.de/foren/ubb/Forum254/HTML/000798.shmtl
#and
#www.eng-tips.com/viewthread.cfm?qid=306565
#and
#http://www.eng-tips.com/viewthread.cfm?qid=248461




#some of these may not be needed, but I haven't taken the time to sort it out.
import sys
import csv
from odbAccess import *
from abaqusConstants import *
from types import IntType
from numpy import array
from numpy import genfromtxt
import numpy as np
import odbAccess


odbName = 'spt1b'
odb = openOdb(odbName + '.odb', readOnly=False)

#The following is the target ODB
odbWrite=openOdb(path="spt1c.odb", readOnly=False)

print'------------------------------------------------'
print'Define step and frame to be read from existing ODB'
steptoread=odb.steps['Step-2']
frametoread=steptoread.frames[4]
odbSelectResults=frametoread.fieldOutputs['NT11']
t = odbSelectResults

#these can be uncommented for some checks of the data
#print '-------------------------------------------'
#print t.__members__
#print '-------------------------------------------'
#print t.values[1]

print odb.rootAssembly.instances.keys()


#note that this must be the part in your file
instance1 = odbWrite.rootAssembly.instances['PART-1-1']


#the following lines write the entire frame of the first ODB into the target ODB
#the step name, desctription, etc, can all be changed here
newDataSet = odbSelectResults
newResultsStep=odbWrite.Step(name='TestStep3', description = 'user defined', domain=TIME, timePeriod = 0)
newResultsFrame=newResultsStep.Frame(incrementNumber=0, frameValue=0.0)
newResultsField=newResultsFrame.FieldOutput(name='NT11', description='user def', type=SCALAR)
newResultsField.addData(field=newDataSet)
odbWrite.save()



#the following lines read a single column text file of nodes
#then reads a single column text file of corresponding temepatures
#note that the scalar field must be a "sequence of sequences"
#so it must look like this:    (  (temp1,) ,   (temp2,),   (temp3,),   (temp4,) ... )
#and NOT this: (temp1, temp2, temp3, temp4,...)

with open('nodelist.txt') as f:
    nodes = f.read().splitlines()

#makes sure this is a tuple of integer nodes   
n = map(int, nodes)   



#this line reads in the temperature values.  They must be sequentially corressponding to the nodes.
#it puts them in the proper format (sequence of sequence)   
with open('values.txt') as f:
    mylist = [tuple(map(float, i.split(','))) for i in f]   
   

v = mylist

#print v


#the following is the format of the data that will work for 6 nodes
#meblabel = (41312, 41313, 41314, 41315, 41316, 41317)
#mebdata = ( (-100.0,), (-100.0,),(-100.0,),(-100.0,),(-100.0,),(-100.0,))


#un-comment the following line if you want the read-in data to go to a new step
#newResultsStep=odbWrite.Step(name='TestStep4', description = 'user defined', domain=TIME, timePeriod = 0)

newResultsFrame=newResultsStep.Frame(incrementNumber=1, frameValue=1.0)
newResultsField=newResultsFrame.FieldOutput(name='NT11', description='user def', type=SCALAR)

#this is to double check that the correct key has been created--it should be NT11
print '-------------------------------------------'
print newResultsFrame.fieldOutputs.keys('')
print '-------------------------------------------'


newResultsField.addData(position=NODAL, instance=instance1, labels=n, data=v)


odbWrite.save()


print
print '-------------------------------------------'


odb.save()
odb.close()