You are on page 1of 19

46910: Advanced finite element

simulations using Abaqus

Lars P. Mikkelsen
DTU Wind Energy

Topic 3b: Box-scripting


Scripting of square box model
Build a script version of box model
• Part: 2D, planar
– Size 1x1x1 • Mesh control
– Sets: x0,x1,y0,y1,xy0 – Structured, Quad
• Material: Linear elastic, isotropic • Element type (Quad)
– E=200.000MPa, ν=0.3 – Quadratic, full integration
• Section: Solid, Homogeneous • Seeds: 1x1
– Thickness = 1 • Mesh the instance
• Assign section to part
• Field output
• Assembly of part to instance
– E, S, U
– Dependent (mesh on part)
• History output
• Step: General Static Analysis,
– Nlgeom: Off – x1: u1, RF1
• BC: Initial • Job: IsoElastic
– x0: u1=0
– xy0: u2=0 • LINK to build up demo
• BC: Step-1 – https://www.youtube.com/wa
– x1: u1=0.01 tch?v=c1tXGHjvGVo

3 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Step-by-step
• Before starting input the following line
– session.journalOptions.setValues(replayGeometry=COORDINATE,
recoverGeometry=COORDINATE)

• Follow the instructions on the previous slide and build up the model. End
with saving the model to a cae-file and look at the content of the jnl-file
using an text-editor e.g. the open source editor notepad++.
• Click e.g. the save bottom between each element in the build up in order
to be able to split up the part in the script
• Build up the script and make clean up during the scripting

4 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
First element in the script: Square box

5 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Build a script for square box using notepad++

6 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Structured script

.






 Always included








7 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Structured script with parameters

8 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Use “print()” to check content of variables

9 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Define
functions

10 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Move functions to separate file

11 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Add set names to part
Run this first
session.journalOptions.setValues(replayGeometry=COORDINATE,
recoverGeometry=COORDINATE)
Then this is coming from a set-name definition

Which can be change to this

12 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Defined as set-naming function

13 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Complete script (1/2)

14 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Complete script (2/2)

15 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Functions

16 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Post-processing and output

17 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
Post processing as a separate rutine
Remember to include the top:

18 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018
How to start
• Make an empty cae-file and click on that. Thereby, from abaqus import *
Abaqus will use that folder as the working folder and
from abaqusConstants import *
save all files there
from part import *
• Make an empty py-file and add the lines shown to the
right
from material import *
from section import *
• Run the following command in the scripting part of
the Abaqus GUI window in order to get coordinates from assembly import *
out from the click operations from step import *
– session.journalOptions.setValues(replayGeometr from interaction import *
y=COORDINATE, from load import *
recoverGeometry=COORDINATE) from mesh import *
• Define the following parameter and start building up from optimization import *
the model replacing “mdb.models(‘xxx’)” with from job import *
modelObj from sketch import *
– NameModel=‘NewModelName' from visualization import *
– modelObj = mdb.Model(name=NameModel) from connectorBehavior import *

• From the demo video in the link to the right LINK to demo video on starting
note that “model-1” is not changed. Will make up a script. See this video before
it easier to reset and run the script multiple starting
times. https://www.youtube.com/w
atch?v=VMxSzdtpzJg
• See the content and run the start-up script
Box00PreProcesssStart.py
19 DTU Wind Energy, Technical University of Denmark Topic 3b, Box scripting Spring 2018

You might also like