ANSYS¶
Daniel Weschke
Mai 18, 2020
Tags: fem
1 APDL - Specify the boundary condition in tabular form¶
MAPDL-Input-File
/BATCH,LIST
FINISH
/CLEAR
/TITLE, Tabular loads
/FILNAM,file
/PREP7
! Elements
ET,1,SHELL181
! Material Props
MP,EX,1,2.1e5
MP,PRXY,1,.3
! Sections
SECT,1,SHELL,,
SECDATA,10,1,0.0,3
! Modeling
RECTNG,0,100,0,100,
! Meshing
AESIZE,ALL,2,
AMESH,ALL
! Loads
LSEL,R,LOC,X,0
DL,ALL,,ALL
ALLSEL
*DEL,_FNCNAME
*DEL,_FNCMTID
*SET,_FNCNAME,'MYFUNC'
*DEL,%_FNCNAME%
DATAS = 3
*DIM,%_FNCNAME%,TABLE,DATAS,1,,Y
%_FNCNAME%(1,0) = 0,50,75
%_FNCNAME%(1,1) = -.1,-.1,.1
LSEL,R,LOC,X,100
DL,ALL,,UX,%MYFUNC%
DL,ALL,,ROTZ,%MYFUNC%
!SFL,ALL,PRES,%MYFUNC%
ALLSEL
/SOL
ANTYPE,0
/STATUS,SOLU
SOLVE
/POST1
/EFACET,1
PLNSOL, ROT,Z, 0,1.0
FINISH
2 View and work with APDL Models inside ANSYS Workbench¶
2.1 Preparation in ANSYS Mechanical APDL¶
Write all finite element modal information in an archive file
Main Menu > Preprocesser > Archive Model > Write > Data To Archive > DB All finite element information
CDWRITE,DB,'file','cdb',,'',''
2.2 Steps in ANSYS Workbench¶
In the Properties window for the file one can choose the Unit System. Insert an analysis system, for example Static Structural and drag the Setup cell of the External Model to the Model cell of the Static Structural system. In the Properties window of the Model of the analysis system one can choose the Length Unit according to the archive file, the Analysis Type and check Create Geometry Face Components.
Update Setup of External Model
External Model > Setup > Right-click > Update
Open Mechanical of the analysis system for the last steps. The Geometry and the Mesh is available. If an analysis should be performed the material data has to be assigned via the Engineering Data cell as well as all necessary boundary conditions. But if the solution is available via MAPDL as an RST file this file can be imported to perform some post-processing.
Fist we have to fake the existence of boundary conditions via an Commands object. If we chose a transient analysis we also have to make some reasonable time stepping options to get rid of the question mark sign. Finally we can import the RST file in the Solution branch
Menu > Tools > Read Result Files...
An .ERR file must exist, create a blank jobname.err file if necessary.
3 MAPDL Scripts¶
! beam cantilever in x
! 1 element
! single force at end in -y using single node
/PREP7
!!!!! ELEMENTS !!!!!
ET,1,BEAM188
KEYOPT,1,1,1 ! dofs - 7 (incl. warp)
KEYOPT,1,3,3 ! element behaviouir - cubic form.
ET,2,MPC184,16,,,1 ! MPC184 element - General formulation
!!!!! MATERIALS !!!!!
! Material - Steel
MP,EX,1,210000
MP,PRXY,1,0.3
! Translation DOF stiffness (UX,UY,UZ)
TB,JOIN,2,,,STIF
TBDATA,1,1E6 ! D11
TBDATA, ,1E6 ! D22
!!!!! SECTIONS !!!!!
! Section for BEAM188
SECTYPE,1,BEAM,RECT
SECDATA,10,10
! Section for MPC184 - GENERAL JOINT
LOCAL,11,0
SECTYPE,2,JOIN,GENE
SECJOINT,LSYS,11
!!!!! ELEM GENERATION !!!!!
N,1,0,0,0
N,2,1000,0,0
TYPE,1
MAT,1
SECNUM,1
EN,1,1,2
/SOLU
ANTYPE,STATIC
NLGEOM,ON
NSUBST,10,10,1
! Boundary conditions
D,1,ALL,0
! Loads
F,2,FY,-100
SOLVE
! beam cantilever in x
! 1 element
! single force at end in -y using MPC joint element
/PREP7
!!!!! ELEMENTS !!!!!
ET,1,BEAM188
KEYOPT,1,1,1 ! dofs - 7 (incl. warp)
KEYOPT,1,3,3 ! element behaviouir - cubic form.
ET,2,MPC184,16,,,1 ! MPC184 element - General formulation
!!!!! MATERIALS !!!!!
! Material - Steel
MP,EX,1,210000
MP,PRXY,1,0.3
! Translation DOF stiffness (UX,UY,UZ)
TB,JOIN,2,,,STIF
TBDATA,1,1E6 ! D11
TBDATA, ,1E6 ! D22
!!!!! SECTIONS !!!!!
! Section for BEAM188
SECTYPE,1,BEAM,RECT
SECDATA,10,10
! Section for MPC184 - GENERAL JOINT
LOCAL,11,0
SECTYPE,2,JOIN,GENE
SECJOINT,LSYS,11
!!!!! ELEM GENERATION !!!!!
N,1,0,0,0
N,2,1000,0,0
N,3,1000,0,0
TYPE,1
MAT,1
SECNUM,1
EN,1,1,2
TYPE,2
MAT,2
SECNUM,2
EN,2,2,3
/SOLU
ANTYPE,STATIC
NLGEOM,ON
NSUBST,10,10,1
! Boundary conditions
D,1,ALL,0
! Loads
F,3,FY,-100
SOLVE
! beam cantilever in x
! 20 element (same as 1 if cubic is used)
! single force at end in -y using MPC joint element
/PREP7
!!!!! ELEMENTS !!!!!
ET,1,BEAM188
KEYOPT,1,1,1 ! dofs - 7 (incl. warp)
KEYOPT,1,3,3 ! element behaviouir - cubic form.
ET,2,MPC184,16,,,1 ! MPC184 element - General formulation
!!!!! MATERIALS !!!!!
! Material - Steel
MP,EX,1,210000
MP,PRXY,1,0.3
! Translation DOF stiffness (UX,UY,UZ)
TB,JOIN,2,,,STIF
TBDATA,1,1E6 ! D11
TBDATA, ,1E6 ! D22
!!!!! SECTIONS !!!!!
! Section for BEAM188
SECTYPE,1,BEAM,RECT
SECDATA,10,10
! Section for MPC184 - GENERAL JOINT
LOCAL,11,0
SECTYPE,2,JOIN,GENE
SECJOINT,LSYS,11
!!!!! ELEM GENERATION !!!!!
TYPE,1
MAT,1
SECNUM,1
K,1,0,0,0,
K,2,1000,0,0,
LSTR,1,2
ESIZE,50
LMESH,1
! creats 21 nodes, 1st node is 1 2nd node is 2
N,22,1000,0,0 ! master node
TYPE,2
MAT,2
SECNUM,2
EN,21,2,22
/SOLU
ANTYPE,STATIC
NLGEOM,ON
NSUBST,10,10,1
! Boundary conditions
D,1,ALL,0
! Loads
F,22,FY,-100
SOLVE