Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Goals
When you complete this workshop, you will be able to create and use an Abaqus macro
and requests input interactively using getInput.
Task 1:
Create a macro that adds three materials, in SI units, to Model-1.
Other information
1. Start Abaqus/CAE.
2. Open the Macro Manager (File→Macro Manager).
3. Create a macro named add_SI_Materials in the Work directory. This will limit
access of the macro to Abaqus/CAE sessions started from this directory. For
macros intended to be more widely used, it is often better to store them in the
home directory.
4. Switch to the Property module, and use the Materials Manager to create three
materials with the following properties:
Steel.
Young's Modulus 200 E 9
Poisson's ratio 0.3
Density 7800
Yield Stress, Plastic Strain 400 E 6, 0.00
420 E 6, 0.02
500 E 6, 0.20
600 E 6, 0.50
Copper
Young's Modulus 110 E 9
Poisson's ratio 0.3
Density 8970
Yield Stress, Plastic Strain 314 E 6, 0.00
Aluminum
Young's Modulus 70 E 9
Poisson's ratio 0.35
Density 2700
Yield Stress, Plastic Strain, Temp 270 E 6, 0, 0
300 E 6, 1, 0
243 E 6, 0, 300
270 E 6, 1, 300
5. Stop recording.
6. Exit Abaqus/CAE (do not save changes).
7. In an editor, open the file abaqusMacros.py. Review the file and close it when
completed.
8. Start Abaqus/CAE. Create a new model named Model-2, and run the macro.
Confirm that the materials have been added to Model-1. How can you get the
material from Model-1 to Model-2? What could you do to the macro to create this
material data in the current model?
Note: You will use the file called abaqusMacros.py again. You may want to
create a backup copy at this time.
Task 2:
Modify the material library macro that you created in Task 1.
Task 1:
Create a macro that prompts the user for the name of the model and adds three materials,
in SI units, to the model.
Answers
def add_SI_Materials():
import material
m = mdb.models['Model-1'].Material('Steel')
m.Elastic(table=((200.0E9, 0.3), ))
m.Plastic(table=((400.E6, 0.0), (420.E6, 0.02),
(500.E6, 0.2), (600.E6, 0.5)))
m.Density(table=((7800.0, ), ))
m = mdb.models['Model-1'].Material('Aluminum')
m.Elastic(table=((70.0E9, 0.35), ))
m.Plastic(temperatureDependency=ON, table=((270e6,0,0),
(300e6,1.0,0),(243e6,0,300),(270e6,1.0,300)))
m.Density(table=((2700,), ))
m = mdb.models['Model-1'].Material('Copper')
m.Elastic(table=((110e9,.3),))
m.Plastic(table=((314e6,0),))
m.Density(table=((8970,),))
Task 2:
def add_SI_Materials():
"""
Add Steel, Copper, Aluminum in SI units
"""
import material
m = mdb.models[name].Material('Steel')
m.Elastic(table=((200.0E9, 0.3), ))
m.Plastic(table=((400.E6, 0.0), (420.E6, 0.02),
(500.E6, 0.2), (600.E6, 0.5)))
m.Density(table=((7800.0, ), ))
m = mdb.models[name].Material('Aluminum')
m.Elastic(table=((70.0E9, 0.35), ))
m.Plastic(temperatureDependency=ON, table=((270e6,0,0),
(300e6,1.0,0),(243e6,0,300),(270e6,1.0,300)))
m.Density(table=((2700,), ))
m = mdb.models[name].Material('Copper')
m.Elastic(table=((110e9,.3),))
m.Plastic(table=((314e6,0),))
m.Density(table=((8970,),))