Scripting in Abaqus:
Solving the model
Lars P. Mikkelsen, DTU Wind Energy
Based on the following files:
DTU Wind Energy 1
Box-model
• Open correct abaqus version in folder:
• CAE-file for abaqus box-model
DTU Wind Energy 2
One-element case for material models
• Uni-axial tensile test of material model can be model by a
one-element case
• Size of model: 1x1x1
• If using the unit mm and N, then the stress and stiffness
units is in MPa [M/mm2]
• Uni-axial in the x-direction modelled with:
– Plane stress element
– U1=0 along boundary x=0 [X0]
– U2=0 at the point (x,y)=(0,0) [X0Y0]
– U1=delta along boundary x=1 [X1]
DTU Wind Energy
The one-element case (BoxModel) can be build
up using the following steps
• Part: 2D, planar • Step: General Static Analysis, • Mesh control
– Size 1x1x1 – Nlgeom: Off – Structured, Quad
– Sets: X0,X1,Y0,Y1,XY0 • BC: Initial • Element type (Linear)
• Material: Linear elastic, isotropic – X0: U1=0 – Linear, full integration
– E=200000MPa, ν=0.3 – XY0: U2=0 • Seeds: 1x1
• Section: Solid, Homogeneous • BC: Step-1 • Mesh the instance
– Thickness = 1 – X1: U1=0.01 • Field output
• Assign section to part – E, S, U
• Assembly of part to instance • History output
– Dependent (mesh on part) – X1: U1, RF1
• Job: Job-BoxModel
Or follow the demonstration video:
https://www.youtube.com/watch?v=c1tXGHjvGVo
Model saved as:
DTU Wind Energy
Abq01CAE_solve.py:
Generic python script for solving the model
Name of model in cae-file
Output file-names
DTU Wind Energy 5
Abq01CAE_solve.py:
Generic python script for solving the model
DTU Wind Energy 6
Abq01CAE_solve.py :
Run the job on the Abaqus linux cluster
DTU Wind Energy 7
_AbqRun.sh:
DTU Wind Energy 8
Abq01CAE_solve.py:
Solution of the abaqus
model
DTU Wind Energy 9
Scripting in Abaqus:
Post-processing
Lars P. Mikkelsen, DTU Wind Energy
Based on the following files:
DTU Wind Energy 10
Abq02CAE_post.py:
Post-processing of odb-file
DTU Wind Energy 11
Abq02CAE_post.py:
Output from post-processing
DTU Wind Energy 12
Plot history output
DTU Wind Energy 13
Plot history output (here only one file)
DTU Wind Energy 14
Scripting in Abaqus:
Combine and looping
Lars P. Mikkelsen, DTU Wind Energy
Based on the following files:
DTU Wind Energy 15
Abq03CAE_solve_post.py:
Combined solve and post-processing
DTU Wind Energy 16
Abq04CAE_loop.py:
Parametric study: E-modulus
DTU Wind Energy 17
Abq04CAE_loop.py:
Parametric study: E-modulus
DTU Wind Energy 18
Abq04CAE_loop.py:
Parametric study: E-modulus
DTU Wind Energy 19
Abq04CAE_loop.py:
Output:
DTU Wind Energy 20
Scripting in Abaqus: Tips
Lars P. Mikkelsen, DTU Wind Energy
DTU Wind Energy 21
Extract commands for script
• Get the commend for changing a specific thing
– Open the abaqus.cae file
– Change the specific thing in the cae-file
– Save the CAE-file
– Extract the commend from the *.jnl or abaqus.rpy file
– Edit and add to script file
– It is only the abaqus.rpy file which include the post-processing part
For example, max number of increments and how often to save an field output
DTU Wind Energy 22
Shorten and generalize the commands
.
Always included
DTU Wind Energy
Use “print()” to check content of variables
DTU Wind Energy 24
Looping over the code
• When you are making the loop over the code you should be aware that
you can not overwrite a model. You need either to delete it before you
are building up a new version
• del mdb.models['BoxModel']
– or generate a new model for each case
• NameModel='BoxModelAngle'+str(Angle)
• modelObj = mdb.Model(name=NameModel)
– In addition you also need to close the output and delete the odb-file if
you want to overwrite
DTU Wind Energy
Save a separate output file for each case when
running a loop
• Give each file a unique name
DTU Wind Energy 26
Example on modifying geometry and include
parameters
Remembet to regenerate part and
assembly and remesh model if
geometry is changed
DTU Wind Energy
Post-processing, calculate on output
DTU Wind Energy
Operate on field variables
DTU Wind Energy
Tips on extracting post-processing parameters
• Tips to extract post-processing parameters
– Look into the abaqus.rpy file (not the jnl-file)
– Record macros and see the python commands in the macro.py file
– Look into the abaqus scripting reference manual
– Google solutions
– Use the script command window to see the content of variables
DTU Wind Energy