Difference between revisions of "Sample MPM Input Command File"
Line 63: | Line 63: | ||
These scripted commands can be tried out by copying all the commands and pasting them into an empty window in [[NairnFEAMPM]] or in [[NairnFEAMPMViz]]. When done, choose the "Analyze → Run FEA/MPM Analysis" menu command. The results will stream to a window. When they are done, you can visualize the results. These sample calculations are for two disks approach each other, impacting, and the bouncing back. The image below shows plot of stress in the <tt>x</tt>-direction in the middle of the impact event: | These scripted commands can be tried out by copying all the commands and pasting them into an empty window in [[NairnFEAMPM]] or in [[NairnFEAMPMViz]]. When done, choose the "Analyze → Run FEA/MPM Analysis" menu command. The results will stream to a window. When they are done, you can visualize the results. These sample calculations are for two disks approach each other, impacting, and the bouncing back. The image below shows plot of stress in the <tt>x</tt>-direction in the middle of the impact event: | ||
[[File: | [[File:MPMImpact.jpg|center]] | ||
== XML MPM Input Command File == | == XML MPM Input Command File == |
Revision as of 12:29, 15 January 2014
The two sample MPM input command files given below will run an analysis of two disks impacting each other
Scripted MPM Input Command File
! ********** Preamble Section ********** Title "Two Disk Impact" Name "John Nairn" ! Header Header 2D simulation of two identical disks colliding in a head-on impact EndHeader ! Method Analysis "Plane Stress MPM" MPMMethod USAVG,GIMP Archive "Two_Disks_Results/USAVG." ArchiveTime .5 MaximumTime 20 ! ********** Parameters Section ********** #cell=2 ! cell size (square cells) #width=52 ! semi grid size x direction #height=24 ! semi grid size y direction #thickness=1 ! Thickness in mm #vel=2500 ! velocity #modulus=1.0 ! modulus in MPa #nu=0.33 ! Poisson's ratio #rho=1.5 ! Density ! ********** Materials Section ********** Material "Left","Polymer","Isotropic" E #modulus nu #nu a 60 rho #rho Done Material "Right","Polymer","Isotropic" E #modulus nu #nu a 60 rho #rho Done ! ********** Grid Section ********** GridHoriz 2*#width/#cell,-#width,-1,#width GridVert 2*#height/#cell,-#height,-1,#height GridThickness #thickness GridRect -#width,#width,-#height,#height ! ********** Material Points Section ********** Region "Left",#vel,0,#thickness Oval -45,-15,-15,15 EndRegion Region "Right",-#vel,0,#thickness Oval 15,45,-15,15 EndRegion
Trial Run with Scripted MPM Input
These scripted commands can be tried out by copying all the commands and pasting them into an empty window in NairnFEAMPM or in NairnFEAMPMViz. When done, choose the "Analyze → Run FEA/MPM Analysis" menu command. The results will stream to a window. When they are done, you can visualize the results. These sample calculations are for two disks approach each other, impacting, and the bouncing back. The image below shows plot of stress in the x-direction in the middle of the impact event:
XML MPM Input Command File
<?xml version='1.0'?> <!DOCTYPE JANFEAInput SYSTEM "/Users/nairnj/Programming/Cocoa_Projects/nairn-mpm-fea/NairnMPM/input/NairnMPM.dtd" [ <!ENTITY modulus "1.0"> <!-- modulus of the spheres --> <!ENTITY nu "0.33"> <!-- Poisson's ratio of the spheres --> <!ENTITY rho "1.5"> <!-- density of the spheres --> <!ENTITY vel "2500"> <!-- velocity of the approach --> <!ENTITY maxtime "20"> <!-- time to stop calculation (ms) --> <!ENTITY atime ".5"> <!-- archive time (ms) --> <!ENTITY cs "2"> <!-- cell size in grid (disks have diameter 30mm) --> <!ENTITY hmax "52"> <!-- semi grid size x direction --> <!ENTITY vmax "24"> <!-- semi grid size y direction --> ]> <JANFEAInput version='3'> <Header> <Description> 2D simulation of two identical disks colliding in a head-on impact </Description> <Analysis>10</Analysis> </Header> <MPMHeader> <MaxTime units="ms">&maxtime;</MaxTime> <ArchiveTime units="ms">&atime;</ArchiveTime> <ArchiveRoot>Two_Disks_Results/USAVG.</ArchiveRoot> <MPMArchiveOrder>iYYYYNNNNNNNNNNNNY</MPMArchiveOrder> <GlobalArchiveTime units="ms">&atime;</GlobalArchiveTime> <GlobalArchive type="velx" matname="Disk 1"/> <GlobalArchive type="Kinetic Energy"/> <GIMP/> </MPMHeader> <Mesh output="file"> <Grid xmin="-&hmax;" xmax="&hmax;" ymin="-&vmax;" ymax="&vmax;"> <Horiz cellsize="&cs;" symmin="-&hmax;" symmax="&hmax;"/> <Vert cellsize="&cs;" symmin="-&vmax;" symmax="&vmax;"/> </Grid> </Mesh> <MaterialPoints> <Body matname="Disk 1" angle="0" thick="1" vx="&vel;" vy="0"> <Oval xmin="-45" xmax="-15" ymin="-15" ymax="15"/> </Body> <Body matname="Disk 2" angle="0" thick="1" vx="-&vel;" vy="0"> <Oval xmin="15" xmax="45" ymin="-15" ymax="15"/> </Body> </MaterialPoints> <Material Type="1" Name="Disk 1"> <rho>ρ</rho> <E>&modulus;</E> <nu>ν</nu> <alpha>60</alpha> </Material> <Material Type="1" Name="Disk 2"> <rho>ρ</rho> <E>&modulus;</E> <nu>ν</nu> <alpha>60</alpha> </Material> </JANFEAInput>
Trial Run with XML MPM Input
These XML commands can be tried in NairnFEAMPM or NairnFEAMPMViz as described above. Alternatively, they can be used to try out command line execution. To do a command-line trial run, first compile NairnMPM using the command-line method, which will install the executable in the NairnMPM/input folder. Next, run the following commands:
cd nairn-mpm-fea/NairnMPM/input ./NairnMPM XML_Input/TwoDisks.fmcmd > TwoDisks.mpm
The first command cd's to the nairn-mpm-fea project folder with the executable and a folder with an example XML input file TwoDisks.fmcmd. The second command runs the MPM calculations. These sample calculations are for two disks approach each other, impacting, and then bouncing back. The outfile file TwoDisks.mpm will have the plain text output results and archived results at various times will be in a Two_Disks_Results folder. To verify the results, open the new Cantilever.fea in your visualization tools (e.g., NairnFEAMPM or NairnFEAMPMViz). A sample plot of stresses during impact given above.