Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Abaqus Python scripting issue

Status
Not open for further replies.

vhr

Mechanical
Aug 13, 2020
4
Hello everyone,

I am currently trying to do a simulation using python scripts. I am modeling heat flow through pipe thickness but I am having a hard time defining a surface to which I want to apply constant temperature BC. I am attempting to apply Temp BC to the pipe surface but am not able to capture the surface I think. I am using the following script. I am getting an error message 'Set must contain some entities' at the last line in the script below. I am new to this so any help would be highly appreciated. Thanks in advance!

internal radius of the pipe = 0.1
length of the pipe = 1.0

internalPipePoint = (0.1, 0.0, 0.5)
internalPipe = myInstance.faces.findAt((internalPipePoint,))
intDiaRegion = regionToolset.Region(side1Faces=internalPipe)
myModel.TemperatureBC(name='Temp Int',createStepName='temp', region=intDiaRegion, magnitude=100.0)

Also, when trying to print 'internalPipe' and 'intDiaRegion' in the abaqus I am getting this output.

internalPipe: (mdb.models['Pipe'].rootAssembly.instances['pipeInstance'].faces.findAt(((0.1, 0.0, 0.5),)))
intDiaRegion: (Region(side1Faces=mdb.models['Pipe'].rootAssembly.instances['pipeInstance'].faces.findAt(((0.099154, 0.012978, 0.666667),),)))
 
Replies continue below

Recommended for you

Maybe the face is not at the location you are searching. Create a datum point with those coordinates and see where it is.

You can also try getClosest().
 
Hi Mustaine3,

Thank you for your answer. I did create a datum point to check whether the specified point is there or not and it does seem onto the surface. I have attached the pipe images herewith for reference. And I have also used getClosest as below but it still shows the same error when ran, i.e, 'Set must contain some entities'.

internalPipePoint = (0.1, 0.0, 0.5)
#internalPipe = myPart.faces.getByBoundingCylinder((0.0,0.0,0.1),(0.0,0.0,0.9),0.12)
#internalPipe = myPart.faces.getByBoundingBox(0.0,0.0,0.1,0.1,0.1,0.9)
internalPipe = myPart.faces.getClosest(coordinates=((0.1, 0.0, 0.5),))
face_i = internalPipe[0][0].index
side1Faces = myPart.faces[face_i:face_i+1]

intDiaRegion = regionToolset.Region(side1Faces=side1Faces)
myModel.TemperatureBC(name='Temp Int',createStepName='temp', region=intDiaRegion, magnitude=100.0)

When printing 'internalPipe' and 'intDiaRegion', it gives following output in Abaqus now. I also tried using 'getByBoundingCylinder' and 'getByBoundingBox' but still the same error.

internalPipe: ({0: (mdb.models['Pipe'].parts['Part Pipe'].faces.findAt((0.1, 0.0, 0.5), (-1.0, 0.0, 0.0)), (0.1, 0.0, 0.5))})
intDiaRegion: (Region(side1Faces=mdb.models['Pipe'].parts['Part Pipe'].faces.findAt(((0.099154, 0.012978, 0.666667),),)))
 
 https://files.engineering.com/getfile.aspx?folder=eb5a6775-a42d-447b-8399-4e5cec02cc5c&file=pipe_side.PNG
Upload the cae file and the script and I will have a look at it.
 
Hi Mustaine3,

I have uploaded the cae file and the script herewith. Please find it in the link below.

Link
 
Loads, boundary conditions, contact, etc. are applied at the instance(s), so you have to use them instead the part to get the geometric entities. Or you generate a set/surface at part level and use the derived set/surface from an instance for those definitions.

Apply the load in the UI and look what the .rpy is reporting. If you don't get a .rpy because of the Student edition, then you might check if you can record a macro and look into that.
 
Hi Mustaine3,

I did initially apply BCs at Instance only but I changed it a day before sharing it with you to the 'Part' as I read on some other forum that it might solve the problem. But great advice there. I applied loads and BCs in the UI and checked out the file later. And it created Set before applying BC to it. I did the same and it worked for me along with 'getByBoundingCylinder'. Here's the final script. Thanks a lot.

innerPipeRadius = 0.1
outerPipeRadius = 0.15
pipeLength = 1.0

internalPipe = myInstance.faces.getByBoundingCylinder((0.0,0.0,-0.1),(0.0,0.0,1.1),0.12)
intDiaRegion = myAssembly.Set(faces=internalPipe, name='IntDia Set')
myModel.TemperatureBC(name='Temp Int',createStepName='temp', region=intDiaRegion, magnitude=1.0)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor