Sample FEA Input Command File

From OSUPDOCS
Revision as of 22:25, 14 January 2014 by Nairnj (talk | contribs) (→‎Trial Run with XML FEA Input)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The two sample FEA input command files given below will run an analysis of an end-loaded cantilever beam.

Scripted FEA Input Command File

! ********** Preamble Section **********
Title "FEA Analysis of Cantilever Beam"
Name "A nairn-mpm-fea Project Member"

! Header
Header
  A cantilever beam that is clamped at its base and
  loaded on its free end with a single point load.
EndHeader

Analysis "Plane Stress FEA"
Element "8 Node Quadrilateral"

! ********** Parameters Section **********
! Define variables for more general mesh generation capabilities
#length=50               ! Length in mm
#depth=10                ! Depth in mm
#thick=10                ! Thickness in mm
#horiz=6                 ! Elements in horizontal direction
#vert=3                  ! Elements in vertical direction
#load=500                ! End load in N
#matname$="polymer"      ! which material to use

! ********** Materials Section **********
Material "polymer","Polymer","Isotropic"
  E 2300
  nu .33
  a 60
Done

! ********** Meshing Section **********
Area #matname$,#thick
  Path "Bottom",#horiz
    Keypoint "BotLeft",0,0
    Keypoint "BotRight",#length,0
  EndPath
  Path "Right",#vert
    Keypoint "BotRight"
    Keypoint "TopRight",#length,#depth
  EndPath
  Path "Top",#horiz
    Keypoint "TopRight"
    Keypoint "TopLeft",0,#depth
  EndPath
  Path "Left",#vert
    Keypoint "TopLeft"
    Keypoint "BotLeft"
  EndPath
EndArea
Resequence "BotRight"

! ********** Boundary Condition Section **********
FixLine 0,0,0,#depth
  Displacement x
  Displacement y
EndFixLine

FixPoint "TopRight"
  Load y,#load
EndFixPoint

Trial Run with Scripted FEA 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 an end-loaded cantilever beam. The image below shows plot of stress in the x-direction for this sample problem.

Beam.jpg

XML FEA Input Command File

<?xml version='1.0'?>
<!DOCTYPE JANFEAInput SYSTEM '/Users/jnairn/Programming/Cocoa_Projects/nairn-mpm-fea/NairnFEA/input/NairnFEA.dtd'>
<JANFEAInput version="3">

  <Header>
    <Description>
A cantilever beam that is clamped at its base and
loaded on its free end with a single point load.
    </Description>
    <Analysis>1</Analysis>
  </Header>

  <Mesh>
    <Keypoints>
      <pt x="0.000000" y="0.000000" id="BotLeft"/>
      <pt x="50.000000" y="0.000000" id="BotRight"/>
      <pt x="50.000000" y="10.000000" id="TopRight"/>
      <pt x="0.000000" y="10.000000" id="TopLeft"/>
    </Keypoints>
    
    <Path id="Bottom" intervals="6">
      <keypt id="BotLeft"/>
      <keypt id="BotRight"/>
    </Path>
    <Path id="Right" intervals="3">
      <keypt id="BotRight"/>
      <keypt id="TopRight"/>
    </Path>
    <Path id="Top" intervals="6">
      <keypt id="TopRight"/>
      <keypt id="TopLeft"/>
    </Path>
    <Path id="Left" intervals="3">
      <keypt id="TopLeft"/>
      <keypt id="BotLeft"/>
    </Path>
    
    <Area mat="1" thick="10.000000" type="3" flip="0">
      <path id="Bottom"/>
      <path id="Right"/>
      <path id="Top"/>
      <path id="Left"/>
    </Area>
  </Mesh>

  <Material Type="1" Name="Polymer">
    <E>2300</E>
    <nu>0.33</nu>
    <alpha>60</alpha>
  </Material>

  <GridBCs>
    <BCLine x1="0" y1="0" x2="0" y2="10">
      <DisBC dof="1" disp="0"/>
      <DisBC dof="2" disp="0"/>
    </BCLine>
    <BCPt keypt="TopRight">
      <LoadBC dof="2" load="500"/>
    </BCPt>
    <Resequence keypt="BotRight"/>
  </GridBCs>

</JANFEAInput>

Trial Run with XML FEA 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 NairnFEA using the command-line method, which will install the executable in the NairnFEA/input folder. Next, run the following commands:

cd nairn-mpm-fea/NairnFEA/input
./NairnFEA XML_Input/Cantilever.fmcmd > Cantilever.fea

The first command cd's to the nairn-mpm-fea project folder with the executable and a folder with an example XML input file Cantilever.fmcmd. The second command runs the FEA calculations. This sample calculation is for an end-loaded cantilever beam and it will finish quickly. The outfile file Cantilever.fea will have the plain text output results. To verify the results, open the new Cantilever.fea in your visualization tools (e.g., NairnFEAMPM or NairnFEAMPMViz). A sample plot of beam stresses is given above.