FEA H1: STATIC ANALYSIS OF A TUBE COMPENSATOR

! Created by Tamas Poloskei, 2017. February 14.
! Units: [N],[Nmm],[N/mm^2=MPa],[N/mm]

Define constant parameters

T=5
ELAST=2E5
NU=0.3
FRC=1000
P=0.2

SETUP: element types, materials, sections

KEYWKEYW, Keyword, KEY Sets a keyword used by the GUI for context filtering (GUI).,PR_STRUC,1! Preferences / Structural
/PREP7/PREP7 Enters the model creation preprocessor.
ETET, ITYPE, Ename, KOP1, KOP2, KOP3, KOP4, KOP5, KOP6, INOPR Defines a local element type from the element library.,1,SHELL181
MPTEMPMPTEMP, SLOC, T1, T2, T3, T4, T5, T6 Defines a temperature table for material properties.,1,0
MPDATAMPDATA, Lab, MAT, SLOC, C1, C2, C3, C4, C5, C6 Defines property data to be associated with the temperature table.,EX,1,,ELASTELAST = 2E5
MPDATAMPDATA, Lab, MAT, SLOC, C1, C2, C3, C4, C5, C6 Defines property data to be associated with the temperature table.,PRXY,1,,NUNU = 0.3
SECTSECTYPE, SECID, Type, Subtype, Name, REFINEKEY Associates section type information with a section ID number.,1,SHELL ! shell lay-up definition
SECDATASECDATA, VAL1, VAL2, VAL3, VAL4, VAL5, VAL6, VAL7, VAL8, VAL9, VAL10, VAL11, VAL12 Describes the geometry of a section.,TT = 5,1,0.0,3
SECOFFSETSECOFFSET, Location, OFFSET1, OFFSET2, CG-Y, CG-Z, SH-Y, SH-Z Defines the section offset for cross sections.,MID
KK, NPT, X, Y, Z Defines a keypoint.,1,0,0
KK, NPT, X, Y, Z Defines a keypoint.,2,0,220
KK, NPT, X, Y, Z Defines a keypoint.,3,300,0
KK, NPT, X, Y, Z Defines a keypoint.,4,240,60
KK, NPT, X, Y, Z Defines a keypoint.,5,140,60
KK, NPT, X, Y, Z Defines a keypoint.,6,100,100
KK, NPT, X, Y, Z Defines a keypoint.,7,100,220
KK, NPT, X, Y, Z Defines a keypoint.,8,240,0
KK, NPT, X, Y, Z Defines a keypoint.,9,140,100
LARCLARC, P1, P2, PC, RAD Defines a circular arc.,3,4,8,60
LL, P1, P2, NDIV, SPACE, XV1, YV1, ZV1, XV2, YV2, ZV2 Defines a line between two keypoints.,4,5
LARCLARC, P1, P2, PC, RAD Defines a circular arc.,5,6,9,40
LL, P1, P2, NDIV, SPACE, XV1, YV1, ZV1, XV2, YV2, ZV2 Defines a line between two keypoints.,6,7
AROTATAROTAT, NL1, NL2, NL3, NL4, NL5, NL6, PAX1, PAX2, ARC, NSEG Generates cylindrical areas by rotating a line pattern about an axis.,1,2,3,4,,,1,2,-90,1

! Set the number of finite elements on the meridian curves
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,9,,,36
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,10,,,36
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,11,,,36
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,12,,,36
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,13,,,36
! Set the number of finite elements of the contour curves
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,1,,,10
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,5,,,10
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,2,,,8
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,6,,,8
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,3,,,8
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,7,,,8
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,4,,,12
LESIZELESIZE, NL1, SIZE, ANGSIZ, NDIV, SPACE, KFORC, LAYER1, LAYER2, KYNDIV Specifies the divisions and spacing ratio on unmeshed lines.,8,,,12
! Mesh the areas using mapped mesh
MSHKEYMSHKEY, KEY Specifies whether free meshing or mapped meshing should be used to mesh a model.,1
AMESHAMESH, NA1, NA2, NINC Generates nodes and area elements within areas.,ALL
! Isometric view
/VIEW/VIEW, WN, XV, YV, ZV Defines the viewing direction for the display.,1,1,1,1
/ANG/ANGLE, WN, THETA, Axis, KINCR Rotates the display about an axis.,1
/REP/REPLOT, Label Automatically reissues the last display command for convenience.,FAST
! We can see that the orientation of one of the area is the opposite of the others (purple - turquoise)
! defining the kinematic constraints (left and right)
*DO*DO, Par, IVAL, FVAL, INC Defines the beginning of a do-loop.,III,1,4,1
  DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,III,,UZ,0
  DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,III,,ROTX,0
  DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,III,,ROTY,0
  DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,III+4,,UX,0
  DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,III+4,,ROTY,0
  DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,III+4,,ROTZ,0
*ENDDO*ENDDO Ends a do-loop and starts the looping action.
! Bottom
DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,9,,UY,0
DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,9,,ROTX,0
DLDL, LINE, AREA, Lab, Value1, Value2 Defines DOF constraints on lines.,9,,ROTZ,0
! Reverse the normal of area 2, to achieve an identical normal of the surfaces
AREVERSEAREVERSE, ANUM, NOEFLIP Reverses the normal of an area, regardless of its connectivity or mesh status.,2,0
! Define the force on the top part
LSELLSEL, Type, Item, Comp, VMIN, VMAX, VINC, KSWP Selects a subset of lines.,S,,,13
NSLLNSLL, Type, NKEY Selects those nodes associated with the selected lines.,S,1
! Put the same amount force on all the nodes (36 elements -> 37 nodes)
FF, NODE, Lab, VALUE, VALUE2, NEND, NINC Specifies force loads at nodes.,ALL,FY,-FRCFRC = 1000/4/37
ALLSELALLSEL, LabT, Entity Selects all entities with a single command.,ALL
! Write loadstep file
LSWRITELSWRITE, LSNUM Writes load and load step option data to a file.,1
! Delete all active nodal loads
FDELEFDELE, NODE, Lab, NEND, NINC, Lkey Deletes force loads on nodes.,ALL,ALL
! Define uniform pressure on all areas
SFASFA, Area, LKEY, Lab, VALUE, VALUE2 Specifies surface loads on the selected areas.,ALL,2,PRES,PP = 0.2
LSWRITELSWRITE, LSNUM Writes load and load step option data to a file.,2
FINISHFINISH Exits normally from a processor.

Solve the finite element equation K.U = F, for loadstep 1 and 2

/SOL/SOLU Enters the solution processor.
LSSOLVELSSOLVE, LSMIN, LSMAX, LSINC Reads and solves multiple load steps.,1,2,1,

Postprocessing

/POST1/POST1 Enters the database results postprocessor.

! Create the load cases
LCDEFLCDEF, LCNO, LSTEP, SBSTEP, KIMG Creates a load case from a set of results on a results file.,1,1,Last,
LCDEFLCDEF, LCNO, LSTEP, SBSTEP, KIMG Creates a load case from a set of results on a results file.,2,2,Last,
! Add the two solutions
LCASELCASE, LCNO Reads a load case into the database.,1
LCOPERLCOPER, Oper, LCASE1, Oper2, LCASE2 Performs load case operations.,ADD,2,,