Building the model takes a large portion of user's time, though it may only take a small portion of CPU time.
Before you start building the model, you enter the Begin-level commands which start with "/":
And then you enter the model building phase with the /PREP7 command:
The file name prefix - the jobname - can be specified in two ways:
ansys -j name at the execution, or /FILENAME,name within the program.
If you don't specify a job name, all files are given the default prefix name FILE.
These commands start with "/" as the following:
/SHOW,X11C ! Use X-windows for display /FILNAM,PLATE ! Specify prefix of file names /TITLE,An Aluminum Plate with a Hole /STITLE, .... ! Up to 4 subtitles /UNITS,BIN ! British units: lbs, in, etc. for ref. only /PREP7 ! Enter preprocessing phase /SOLU ! Enter loading and solution phase /POST1 ! Review the results /EXIT ! Exit ansys program
There are over 80 different element types defined in ANSYS element library. Element type is identified by the element category and a unique number: BEAMn,PLANEn, SOLIDn,SHELLn,LINKn, etc. The number n remains the same as STIFFn. ET,1,42 and ET,1,PLANE42 are the same.
ET ETCHG ETLIST ETDELE TYPEMany element types also have additional options, known as KEYOPTs and referred to as KEYOPT(1), KEYOPT(2), etc.
KEYOPT
Element types can also be defined by the control panel; so can the element options and the real constants.
Element real constants are properties that are specific to a given element type, such as cross-sectional properties of a beam element. Not all elements require real constants. As with element type, each set of real constants is given a reference number. While defining the element, you can point to the appropriate real constant reference number using REAL command.
R RMODIF RMORE RLIST RDELE REAL
Depending on the application, material properties may be linear, nonlinear, or anisotropic. As with element type and real constants, each set of material properties is given a material reference number, and you point to the appropriate material reference number using the MAT command.
Linear material properties may be constant or temperature dependent, and isotropic or orthotropic.
MP MPLIST MPDELE MAT MP,EX,1,2E11 ! Young's modulus for material 1 is 2E11 MP,DENS,1,7800 ! Density for material 1 is 7800 MP,KXX,3,43 ! Thermal conductivity for ! material 3 is 43
Temperature dependent material properties may be defined by a property-versus-temperature function in the form of a polynomial with MP command, or by MPTEMP and MPDATA commands.
MP,xyz,C0,C1,..C4To define a different set of temperature for the next material property, you first erase the current temperature table by MPTEMP without any arguments and then define the new temperature using MPTEMP or MPTGEN command.MPTEMP MPTGEN MPDATA MPTEMP,1,1600,1800,2000,2325,2326,2335 ! 6 temperatures from loc 1 MPTEMP,7,2345,2355,2365,2374,2375,3000 ! 6 more from location 7 MPDATA,ENTH,4,1,53.81,61.23,68.83,81.51,81.55,82.31 ! corresponding MPDATA,ENTH,4,7,84.48,89.53,99.05,112.12,113.0,137.4 ! Enth values MPDATA,ENTH,4,6,83.09 ! Change loc 6 ENTH value to 83.09 MPTEMP,7,2340 ! Modify 7th temperature to 2340, retain others MPDRES,ENTH,4 ! Restore what is changed into virtual space
MPTRES ! Restore temperature table from virtual space MPWRITE ! Write from database to a coded file MPREAD ! Read from a coded file to database MPPLOT MPLIST
There are many changes in nonlinear material properties. NL and KNL commands are no longer used; data tables are used instead. TB command defines the type of data table: bilinear kinematic (BKIN), anisotropic elastic (ANEL), B-H curve (BH), etc. TBEDIT command (with menu on only) brings up a matrix of boxes for data entry. For non-menu mode, use TBPT to enter x, y data (stress-strain curves, B-H curves, etc.) and TBDATA to enter tabular data (creep constants, failure criteria, etc.)
TB,BH,2 ! activate B-H table for material ref. 2 TBTEMP TBPT TBDATA TBPLOT TBLIST TBCOPY TBDELE
Some element types accept anisotropic elastic material properties, which are usually in matrix form - SOLID64(3-D anisotropic solid), PLANE13(2-D couple-field solid),SOLID5 and SOLID89(3-D couple-field solids). Please refer to Element Reference Manual for details.
TB TBDATA TBLIST ! Be sure to verify your input TB,PIEZ,3 ! piezoelectric constants(6x3) TBDATA,3,-6.1,,,-6.1 TBDATA,9,15.70 TB,ANEL,3 ! [C(6x6)] matrix for NEPEC TBDATA,1,12.80E10,6.8E10,6.6E10} TBDATA,7,12.8E10,6.6E10 TBDATA,12,11.0E10 TBDATA,16,2.1E10,0.0,0.0,2.1E10,0.0,2.1E10
There are two different methods to generate a model: top-down solid modeling and bottom-up direct generation. With top-down solid modeling, you describe the geometric shapes of the model, establish controls over the size and desired shape of elements, and then instruct the ANSYS program to generate all nodes and elements automatically.
By contrast, with bottom-up direct generation method, you define the location of every node, and the size, shape, and connectivity of each element. Although some automatic data generation is possible ( such as FILL, NGEN, EGEN, etc.), the direct generation method requires you to keep track of all node numbers as you develop your finite element mesh.
You can combine top-down and bottom-up modeling techniques in building your model. In top-down solid modeling, free and mapped meshing are available; also concatenation of lines or areas greatly improves meshing. Elements are reordered automatically; use NOORD command to prevent reordering.
Top-down solid model is usually more powerful and versatile than bottom-up direct generation, and is commonly the preferred method.
Top-down solid modeling with Boolean operation greatly eases the preparation of many models. The following examples show the difference between meshing a plate with a hole using Boolean operation and without Boolean operation.
/PREP7 /TITLE,Plate with a Hole using Top-down Solid Modeling ! This plate is modeled with quarter symmetry ET,1,PLANE42 ! Use PLANE42 as element type 1 PCIRC,.5 ! Define a circle primitive, center at origin, with ! radius of 0.5 RECTNG,0.0,6.0,0.0,4.0 ! Define a rectangular primitive /PNUM,AREA,1 APLOT ASBA,2,1 ! Boolean subtract operation: area 2 minus area 1 ! yields a new area KLIST KSEL,S,KP,,1,2 ! Select keypoints on circle KESIZE,ALL,.1 ! Set element size to 0.1 KSEL,INVE ! Invert selection to select keypoints at rec. corners KESIZE,ALL,0.4 AMESH,3 ! Mesh area 3 ACLEAR,3 ! Clear the meshed area ESHAPE,2 ! Use quadrilateral element shape only LCCAT,6,7 ! Concatenate lines 6 and 7 AMESH,3 ! Mesh area 3 again SAVE ! Save the db file FINISH ! Exit PREP7
/PREP7 /TITLE,Plate with a Hole without using Boolean operations ! This plate is modeled with quarter symmetry ET,1,PLANE42 ! Use PLANE42 as element type 1 K,1,0.5 ! Define keypoints K,2,6 K,3,6,4 K,4,,4 K,5,,0.5 CSYS,1 ! Cylindrical CS for keypoint 6 K,6,0.5,45 /PNUM,KPOI,1 ! Show keypoint numbers on display KPLOT L,1,6,10 ! Define circular line segments L,6,5,15 CSYS ! Switch to Cartesian CS for area definition L,1,2,30,4 ! Define radial line segments L,6,3,30,4 ! with 4:1 spacing ratio L,5,4,30,4 L,2,3,10 ! Define line segments L,3,4,15 /PNUM,LINE,1 ! Show line numbers on display LPLOT ! Dis[lay line segments A,1,2,3,6 ! Define areas A,6,3,4,5 AMESH,ALL ! Generate nodes and elements SAVE ! Save the db file FINISH ! Exit PREP7
/PREP7 ET,1,PLANE42 ! Use PLANE42 as element type 1 N,1,0,0 ! Node 1 at (0.0,0.0) N,5,12,o ! Node 5 at (12.0,0.0) FILL,1,5 ! Fill in nodes 1 through 5 NGEN,6,10,1,5,1,1,2,0 ! Generate nodes from an existing, given pattern E,1,2,12,11 ! Define the first element with four nodes 1,2,12,11 EGEN,4,1,1 ! Generate 4 add'l elements by incrementing the ! nodes of the first element by 1. EGEN,5,10,1,4,1 ! Generate 5 sets of add'l elements by incrementing ! the nodes of the 1-4 elements by 10. SAVE ! Save the db file FINISH ! Exit PREP7
Regions of steep gradients in solution variables usually require finer mesh. In direct generation method, users may define denser points in these regions and connect them to form finer meshes. In solid modeling method, the mesh density can be experssed in either of two ways:
The following commands specify element size or number of division:
ESIZE,size,ndiv KESIZE,kpt(s),size LESIZE,line(s),size,angsize,ndiv,space LDVA
Free meshing allows a mixing of different element shapes and provides an easier transition from a fine mesh to a coarse mesh, and vice versa. It is the default meshing. To control element shape, use ESHAPE command.
Meshing an area or a volume with mapped mesh (ESHAPE,2) must observe the following restrictions:
KCLEAR,LCLEAR,ACLEAR, and VCLEAR commands delete the nodes and elements. To refine a mesh, the nodes and elements should be first deleted by one of these commands.
General meshing gudelines:
Parametric design allows users to build the model in terms of parameters(variables). Generally these variables are defined at the beginning of the program, and ANSYS commands use these variables in lieu of actual values. When the design needs to be modified, users just change the values of the corresponding variables and rerun the program.
Ansys parametric design language now permits 8-character names. Names may contain letters, numbers, and the underscore(_). Don't use the underscore as the first character.
A macro is a sequence of ANSYS commands stored in a file or a macro library. The macro can be used anywhere in an ANSYS program.
A macro can be created inside ANSYS program using *CREATE and *END commands. It can also created in a file or a library with an editor. If a macro file has a .MAC suffix, the file name can be used as an ANSYS command. For example, ELLIPTQ.MAC is stored in /ansys50a/docu and ELLIPTQ is a valid ANSYS command. Users can stored their macros in a file or in a macro library a directory and use *ULIB to refer the file/library if it not in user's home or current directory.
Up to 29 parameters and values can be passed to a macro. Inside a macro, ARG1,ARG2,...,ARG29 are reserved local variables, and while executing the macro, the first field value is referred as ARG1 and the second as ARG2, and so on.
New *ASK command, if included in macros, can be used to prompt for input:
*ASK,L,LENGTH:,5.0 ! Prompts for length, assigns value ! to L, default value is 5.0
New *AFUN command allows you to switch from default radians to degrees for trigonometric functions:
*AFUN,DEG ! Angular function units are in degrees X=SIN(30) *AFUN,RAD
*IF-THEN-*ELSEIF-*ELSE-*ENDIF and DO loop are available.
*IF,A,LT,B,THEN . . . *ELSEIF,B,LT,C,THEN . . . *ELSE . . . *ENDIF *DO,I,1,3 . . . *ENDDO
Using a wide range of features, such as macros, if-then-else branching, do-loops, vector and matrix operations, and Fortran functions, users can write a versatile ANSYS program.
! ELLIPT by Hai C. Tang in tang/ansys ! Creates an elliptic area ! *USE,ELLIPT,A,B,N ! where x**2/a**2 + y**2/b**2 = 1 ! and the whole elliptic arc is divided into N parts ! equally by the angle at origin *SET,A,ARG1 *SET,B,ARG2 *SET,N,ARG3 *AFUN,DEG THETA=360.0/N K,,A *GET,KMIN,KP,,NUM,MAX *DO,I,1,N ANGX=I*THETA X=A*COS(ANGX) Y=B*SIN(ANGX) K,,X,Y **GET,KMAX,KP,,NUM,MAX L,KMAX-1,KMAX *ENDDO *GET,LMAX,LINE,,NUM,MAX LMIN=LMAX-N+1 NUMMRG,ALL LSEL,S,LINE,,LMIN,LMAX AL,ALL LSEL,ALL
/PREP7 ET,1,42 R,1,.25 MP,EX,1,1e7 $*$USE,ELLIPT,.05,.2,36 /pnum,kp,1 RECTNG,,3,,2 /pnum,area,1 aplot asba,2,1 kesize,10,.01 ksel,s,kp,,1,5 kesize,all,.04 ksel,s,kp,,38,40 kesize,all,.2 ksel,all amesh,3 save FINISH /SOLU lsel,s,line,,41,42 dl,all,3,symm lsel,all sfl,38,pres,-100 solve FINISH /POST1 PLNSOL,S,EQV
High gradient areas generally require finer meshes. Meshes can be refined with:
Adaptive meshing automatically evaluates mesh discretization error in each element and determines if a particular mesh is fine enough. If it is not, the element is refined with finer meshes automatically.
Users can also revise the mesh by modifying the mesh controls after they have reviewed the results of initial runs. Only the meshes in the regions of steep gradients need to be revised. Usually this is less CPU intensive and is more applicable to the situation that requires only minor adjustments.
Consider the solution for the semi-infinite plate with an elliptic crack in last example. Clearly the steep gradient is located near the crack tip, and only the tip area need to be refined. So let's binarily bisect tip element m times with the following formula;
m = log(b/a + 1)
! *USE,ELLIPTQ,A,B,N *SET,A,ARG1 *SET,B,ARG2 *SET,N,ARG3 *AFUN,DEG THETA=90.0/N K *GET,KMIN,KP,,NUM,MAX K,,A L,KMIN,KMIN+1 *GET,LMIN,LINE,,NUM,MAX *IF,A,GT,B,THEN M=LOG(A/B+1) ANGX=THETA/2**(M+1) *DO,I,1,M ANGX=ANGX*2 X=A*COS(ANGX) Y=B*SIN(ANGX) K,,X,Y *GET,KMAX,KP,,NUM,MAX L,KMAX-1,KMAX *ENDDO *ENDIF *DO,I,1,N-1 ANGX=I*THETA X=A*COS(ANGX) Y=B*SIN(ANGX) K,,X,Y *GET,KMAX,KP,,NUM,MAX L,KMAX-1,KMAX *ENDDO *IF,A,LT,B,THEN M=LOG(B/A+1) ANGM=THETA *DO,I,1,M ANGM=ANGM/2 ANGX=ANGX+ANGM X=A*COS(ANGX) Y=B*SIN(ANGX) K,,X,Y *GET,KMAX,KP,,NUM,MAX L,KMAX-1,KMAX *ENDDO *ENDIF ANGX=N*THETA X=A*COS(ANGX) Y=B*SIN(ANGX) K,,X,Y *GET,KMAX,KP,,NUM,MAX L,KMAX-1,KMAX L,KMAX,KMIN *GET,LMAX,LINE,,NUM,MAX NUMMRG,ALL LSEL,S,LINE,,LMIN,LMAX AL,ALL LSEL,ALL
/PREP7 ET,1,42 R,1,.25 MP,EX,1,1e7 ELLIPTQ,.05,.2,9 /pnum,kp,1 RECTNG,,3,,2 /pnum,area,1 aplot asba,2,1 ksel,s,kp,,11,13 kesize,all,.005 ksel,s,kp,,9,10 kesize,all,.001 ksel,all kesize,2,.02 ksel,s,kp,,15,17 kesize,all,.2 ksel,all amesh,3 save FINISH /SOLU lsel,s,line,,18,19 dl,all,3,symm lsel,all sfl,15,pres,-100 solve FINISH /POST1 PLNSOL,S,EQV
The first command in an interactive ANSYS run, /SHOW specifies the graphics device driver. The most common drivers at NIST are:
X11,X11C, etc X-windows based 3D For local run only
3D has local graphics functions that work only the workstation actually running the ANSYS program. X-windows allow users to run ANSYS on a network connected remote machine and to instantaneously display the results on a local workstation or a X-terminal.
ANSYS has two types of commands that control a display:
xPLOT displays elements/volumes/areas/lines x = E,V,A,L,K,N /keypoints/nodes,respectively PLNSOL plots nodal solution PLESOL plots element solution etc.
/PNUM,label,key specifies if numbers of label are shown /PBC,item,component,key specifies if constraints or loads are shown /PSYMB,label,key specifies if symbols(CS/LDIR etc) are shown /EDGE,wn,key,angle specifies if edges are shown etc.
Selective displays can be made with the nodes and elements SELECT utilities - ASEL, NSLA, NSEL, ESEL, etc. If a selective command is issued before the PLNSOL command, only the results on the selected elements will be displayed. The following comands are the frquently used graphics commands:
PLNSOL,item,comp Displays the solution results as continuous contours PLDISP,kund,kscal Displays the displaced structure /WINDOW,wn,xmin,xmax, Defines window size on screen ymin,ymax,ncopy /TYPE,wn,type Defines type of display /FOCUS,wn,xf,yf,zf,ktrans Defines the location of object to be at the center of the window /DIST,wn,dval,kfact Defines the viewing distance for magnification and perspective /VIEW,wn,xv,yv,zv Defines the viewing direction of the ojbect Grph menu button Interactive graphics for Zoom, Rotation, and Translation
In Revision 5.0, many utility commands are generic and consistent for all disciplines, and they are available throughout the program. For example, select logic and components are available anywhere in the program, at anytime, and button menus are also available. The type of selection (reselect, unselect, additional select, all, etc.) has been moved to the first field on the command, and there are more fields for the basis of selection.
NSEL ESEL KSEL LSEL ASEL VSEL CMSEL
FINISH command at the end of PREP7 modeling does not save the database; issue SAVE command to save the database before exiting the process.
Thermal Modeling of a Cryogenic Radiometer Given: A radiometer at cryogenic temperature is applied with a constatnt heat flux at given nodes on the surface of a 2-layer cone whose base is welded to a cylindrical tube. The radiometer is modeled with axial symmetry.
/FILNAM,AXSYM1 ! Specify prefix of file names /TITLE,Cryogenic Radiometer /UNITS,cgs ! SI units: cm,g,s,K,1e-7 J, etc. ! for reference only /PREP7 ! Begin PREP7 preprocessing phase ET,1,55,,,1 ! 2-D 4 node PLANE element, axial sym. ! ET,1,PLANE77 ! 2-D 8 node PLANE element ! MPTEMP,1,2,5,10,20 ! Temp. at 2,5,10,and 20 K MPTEMP,1,0,2.8,7.8,17.8 ! Temp = ABTemp - 2.2 K /COM,Thermal Conductivity, KXX, ABW/cm.K (1E-7 W/cm.K) MPDATA,KXX,1,1,1.69E7,3.10E7,5.74E7,10.75E7 ! MAT 1 (Cu) MPDATA,KXX,2,1,2.2E4,5.0E4,10.0E4,20.0E4 ! MAT 2 (Paint) MPDATA,KXX,3,1,1.57E4,3.69E4,7.96E4,18.3E4 ! MAT 3 (SS) /COM,Specific Heat, C, ABJ/kg.K MPDATA,C,1,1,0.355E3,1.8E3,9.0E3,73.0E3 ! MAT 1 MPDATA,C,2,1,0.144E3,9.23E3,23.1E3,51.0E3 ! MAT 2 MPDATA,C,3,1,1.0E4,2.4E4,5.0E4,13.0E4 ! MAT 3 MP,DENS,1,9.08 ! Density for MAT 1 MP,DENS,2,1.154 ! Density for MAT 2 MP,DENS,3,8.00 ! Density for MAT 3 /COM, *** Define Geometry R=1.9185 ! SET radius, cone1 R1=1.905 ! SET radius, cone2 R2=1.8995 ! SET radius, cone3 R3=1.900 ! SET radius, cylinder I.D. H=4.632 ! SET Height of cone1 H1=4.600 ! SET Height of cone2 H2=4.586 ! SET Height of cone3 H3=-5.0E-1 ! SET Height of cylinder (MAT 1) H4=-3.50 ! SET Height of cylinder (MAT 3) THK1=R-R1 ! Cylinder thickness and cone disp for MAT 1 THK2=R1-R2 ! Paint displacement in x-dir for MAT 2 THK3=R1-R3 ! Cylinder thickness for MAT 3 DH=0.05 DR=DH*R/H ! rate of change of copper cone radius DH1=0.02 DR1=DH1*R/H ! rate of change of copper cone radius ! near the tip CSYS,0 N,1,R,H3 ! Node 1 NGEN,11,1,1,,,0,DH ! Node 1-11 NGEN,91,1,11,,,-DR,DH ! Node 11-101 NGEN,5,1,101,,,-DR1,DH1 ! Node 101-105 N,150,0,H ! Node 150 is the tip of cone1 NGEN,2,200,1,105,1,-THK1 ! Node 201-305 N,350,0,H1 ! Node 350 is the tip of cone2 NGEN,2,1,350,,,THK1 ! Node 351 on cone1 NGEN,2,200,211,305,1,-THK2 &! Node 411-505 N,550,0,H2 ! Node 550 is the tip of cone3 NGEN,2,1,550,,,THK2 ! Node 551 on cone2 NGEN,2,1,551,,,THK1 ! Node 552 on cone1 N,601,R1,H4 ! Node 601 at cylinder bottom NGEN,71,1,601,,,0,DH ! Node 601-671 NGEN,2,100,601,671,1,-THK3 ! Node 701-771 MAT,1 &! MAT 1 is copper E,201,1,2,202 ! Elem 1 EGEN,104,1,1 ! Elem 1-104 /PNUM,ELEM,1 E,305,105,552,551 ! Elem 105 E,551,552,351,350 ! Elem 106 E,350,351,150,150 ! Elem 107 EPLOT *ASK,KC,'<CR> to continue:',0 *IF,KC,NE,0,THEN FINISH /EXIT *ENDIF MAT,2 &! MAT 2 is paint E,411,211,212,412 ! Elem 108 EGEN,94,1,108 ! Elem 108-201 E,505,305,551,550 ! Elem 202 E,550,551,350,350 ! Elem 203 EPLOT *ASK,KC,'<CR> to continue:',0 *$IF,KC,NE,0,THEN FINISH /EXIT *ENDIF MAT,3 ! MAT 3 is stainless steel E,701,601,602,702 ! Elem 204 *GET,LELM,ELEM,,NUM,MAX ! Find the last element number ! LELM=204 EGEN,70,1,LELM ! Elem 204-273 EPLOT NUMMRG,NODE SAVE FINISH
/TITLE, Full NIST Piezo Shaker, Case A with Damping /PREP7 ET,1,SOLID5 ! 3-D Multi field solid element /COM, *** Material properties for Piezoelectric /COM, *** ceramic PZT-5 -- CLEVITE CORP MP,DENS,3,.000722 /COM, *** Permittivity (X,Y and Z Directions) MP,PERX,3,3.8853E-10 TB,PIEZ,3 ! [E] = Piezoelectric matrix TBDATA,3,-.00511 TBDATA,6,-.00511 TBDATA,9,.00972 TBDATA,11,.00795 TBDATA,13,.00795 MP,MURX,3,1 ! Create dummy properties to avoid MP,KXX,3,1 ! warning messages /COM *** B4C - Boron Carbide Properties (table) MP,DENS,2,.000345 MP,EX,2,54.E6 MP,NUXY,2,.345 /COM *** Adhesive Properties MP,DENS,4,.00016 MP,EX,4,15.E5 MP,NUXY,4,.38 /COM *** WC - Tungsten Carbide Properties (base) MP,DENS,5,.00163 MP,EX,5,99.E6 MP,NUXY,5,.3 DMPRAT,.01 HAA=1.002 ! Height of top of lower adhesive layer HP=1.202 ! Height to top of piezoelectric layer HAB=1.204 ! Height to top of upper adhesive layer RB=.75 HBA=.9 RT=.6 HT=1.6 ! Height to table surface HS=HT-.2 ! Height to base of stud hole /COM, *** Define Geometry DH=.10 ! Element high DANG=11.25 ! 11.25 Degrees DR=0.075 ! Radical length of element CYCS,1 N,1,RB NGEN,33,1,1,,,0,DANG NGEN,8,100,1,33,1,-DR ND1=701 *DO,I,1,2 N2I=2**I ND2=ND1+32 NGEN,2,100,ND1,ND2,N2I,-DR ND1=ND1+100 *ENDDO ND1=ND1+98 N,ND1,0 NGEN,10,1000,1,ND1,1,0,0,DH NGEN, 2,1000, 9201, 9000+ND1,1,0,0,DH NGEN, 2,1000,10201,10000+ND1,1,0,0,0.002 NGEN, 3,1000,11201,11000+ND1,1,0,0,DH NGEN, 2,1000,13201,13000+ND1,1,0,0,0.002 NGEN, 5,1000,14201,14000+ND1,1,0,0,DH NEGEN=32 MAT,5 ! WC - Tungsten Carbide (base) E,1,2,102,101,1001,1002,1102,1101 EGEN,NEGEN,1,1 EGEN,7,100,1,NEGEN,1 ND1=701 *DO,I,1,2 N2I=2**I N2IM1=N2I/2 NEGS=NEGEN/N2I ND2=ND1+100 ND3=ND1+1000 ND4=ND2+1000 ND2=ND1+100 ND3=ND1+1000 ND4=ND2+1000 E,ND1,ND1+N2IM1,ND2,ND3,ND3+N2IM1,ND4 E,ND2,ND2+N2I,ND1+N2IM1,ND4,ND4+N2I,ND3+N2IM1 E,ND1+N2IM1,ND1+N2I,ND2+N2I,ND3+N2IM1,ND3+N2I,ND4+N2I *GET,LELM,ELEM,,NUM,MAX ! Find the last element number EGEN,NEGS,N2I,LELM-2,LELM,1 ND1=ND1+100 *ENDDO ND2=ND1+98 ND3=ND1+1000 ND4=ND3+98 *DO,I,1,8 E,ND1,ND1+N2I,ND2,ND3,ND3+N2I,ND4 ND1=ND1+N2I ND3=ND3+N2I *ENDDO *GET,LELM,ELEM,,NUM,MAX ! Find the last element number EGEN,9,1000,1,LELM,1 NELM=LELM-64 *GET,LELM1,ELEM,,NUM,MAX ! Find the last element number EGEN,2,1000,LELM1-NELM+1,LELM1,1 MAT,4 ! MAT 4 is the bdhesive glue *GET,LELM1,ELEM,,NUM,MAX ! Find the last element number EGEN,2,1000,LELM1-NELM+1,LELM1,1 MAT,3 ! MAT 4 is the bdhesive glue *GET,LELM1,ELEM,,NUM,MAX ! Find the last element number EGEN,3,1000,LELM1-NELM+1,LELM1,1 *GET,LELM1,ELEM,,NUM,MAX ! Find the last element number MAT,2 ! MAT 2 is B4C - Boron Carbide (table) *GET,LELM1,ELEM,,NUM,MAX ! Find the last element number EGEN,5,1000,LELM1-NELM+1,LELM1,1 /PNUM,ELEM,1 EPLOT NUMMRG,NODE SAVE FINISH
/TITLE,Flow through a Curved Channel /UNITS,SI ! SI units /PREP7 ! Begin PREP7 preprocessing ET,1,55 ! Plane55 Element type ! Define pipe dimensions D=20 ! channel width R=0.5*D RI=40 ! Radius of curved center line of channel D4=D*4 ! Four times channel width RR=R*R V0=200 K,1,,-R K,2,,R K,3 L,1,2 /pnum,line,1 /pnum,kp,1 /pnum,area,1 /pnum,node,1 lplot LESIZE,1,,,16,-4 ESHAPE,2 ! Quadrilaterals only /triad,off ! turn off coordinate traid at origin KPLOT K,4,D4+RI K,5,D4+RI,D4*2+RI L,3,4 L,4,5 LFILL,2,3,RI LESIZE,2,,,32,0.5 LESIZE,3,,,48,2.5 LESIZE,4,,,32 LPLOT ADRAG,1,,,,,,2,4,3 APLOT AMESH,ALL
/TITLE,Flow through a Curved Pipe /UNITS,SI /PREP7 ET,1,55 ET,2,70 ! Define pipe dimensions D=20 ! Pipe diameter RI=40 ! Radius of curved center line of pipe D4=D*4 ! Four times diameter length RR=(0.5*D)**2 V0=200 PCIRC,0.4*D,,0,90 PCIRC,0.4*D,0.5*D,0,90 NUMMRG,ALL /PNUM,line,1 /PNUM,area,1 /PNUM,kp,1 RR=(0.5*D)**2 V0=200 PCIRC,0.4*D,,0,90 PCIRC,0.4*D,0.5*D,0,90 NUMMRG,ALL /PNUM,line,1 /PNUM,area,1 /PNUM,kp,1 LPLOT TYPE,1 LESIZE,1,,,8 LESIZE,2,,,8,2 LESIZE,3,,,8,0.5 LESIZE,5,,,4,2 LESIZE,7,,,4,2 APLOT ESHAPE,2 AMESH,ALL ARSYM,X,ALL NUMMRG,ALL ARSYM,Y,ALL NUMMRG,ALL NUMCMP,NODE /pnum,node,1 /triad,off TYPE,2 K,23,,,D4+RI K,24,D4*2+RI,,D4+RI L,3,23 L,23,24 lplot LFILL,13,16,RI LESIZE,13,,,16,0.25 LESIZE,18,,,32 LESIZE,16,,,24,5 /VIEW,1,1,1 VDRAG,ALL,,,,,,13,18,16 NUMMRG,NODE ASEL,S,TYPE,,1 ACLEAR,ALL /pnum,node,0 /pnum,kp,0 /pnum,elem,0 /triad,on EPLOT VSEL,S,TYPE,,2 NSLV,S,1