WANtaroHP (FEM: 2D Truss Analysis)



Outline of a program 'f90_fem_truss.f90'

  • This is a program for 2D-truss Analysis. Elastic and small displacement problems can be treated.
  • Truss element with 2 nodes is used. 1 node has 2 degrees of freedom in horizontal, vertical direction.
  • Nodal forces, nodal displacements, nodal temperature changes and inertia forces for element cam be given as loads.
  • In coordinate system, x-direction is defined as right-direction, y-direction is defined as upward direction and counterclockwise direction is defined as positive in rotation.
  • Simultaneous linear equations are solved using Cholesky method for banded matrix.
  • Input/Output file name can be defined arbitrarily with the format of 'csv' and those are inputted from command line of a terminal.
  • Used language for program is 'Fortran 90' and used compiler is 'GNU gfortran.'
Workable condition
ItemDescription
Element2D truss element
LoadSpecify the loaded nodes and load values
TemperatureSpecify the temperature changes for all nodes
Inertia forceSpecify the inertia forces as a ratio to gravity acceleration in horizontal and vertical directions for all elements
DisplacementSpecify the nodes and displacements at the nodes. Any values can be applied including zero

The Stiffness matrix of an element is shown below:

\begin{equation*} \begin{Bmatrix} X_i \\ Y_i \\ X_j \\ Y_j \end{Bmatrix} =\begin{bmatrix} EA/L & 0 & -EA/L & 0 \\ 0 & 0 & 0 & 0 \\ -EA/L & 0 & EA/L & 0 \\ 0 & 0 & 0 & 0 \end{bmatrix} \begin{Bmatrix} u_i \\ v_i \\ u_j \\ v_j \end{Bmatrix} \end{equation*}
$EA$ Axial rigidity    $X$ Force in x-direction   $u$Displacement in x-direction
$L$ Length of element    $Y$ Force in y-direction   $v$Displacement in y-direction


Format of input data file ('csv' format)

Comment                         # Comments
NODT,NELT,MATEL,KOX,KOY,NF      # Basic values for analysis
Em,AA,gamma,gkh,gkv,alpha       # material properties
    ....(1 to MATEL)....        #
node-1,node-2,matno             # Element connectivity, material set number
    ....(1 to NELT)....         #
x,y,deltaT                      # Node coordinates, temperature change of node
    ....(1 to NODT)....         #
nokx,rdisx                      # Restricted node number and displacement in x-direction
    ....(1 to KOX)....          # (Omit data input if KOX=0)
noky,rdisy                      # Restricted node number and displacement in y-direction
    ....(1 to KOY)....          # (Omit data input if KOY=0)
node,fx,fy                      # loaded node number, Load value in x & y-direction
    ....(1 to NF)....           # (Omit data input if NF=0)
NODT : Number of nodes      Em : Elastic modulus of element
NELT : Number of elements      AA : Section area of element
MATEL : Number of material sets      gamma : Unit weight of element
KOX : Number of restricted nodes in x-direction      gkh : Horizontal acceleration (ratio to 'g')
KOY : Number of restricted nodes in y-direction      gkv : vertical acceleration (ratio to 'g')
NF : Number of loaded nodes      alpha : Coefficient of thermal expansion of element
     matno : Material set number
Notice
  • Horizontal and vertical acceleration are defined as the ratio of acted acceleration to gravity acceleration.
  • Temperature changes are inputted as them of nodes and they must be written in the same row written the node coordinates. For this item, temperature rising is positive.
  • Restricted node means the node which has known (given) displacement. As a known (given) value of nodal displacement, any value can be given including zero for a restricted node.
  • Since stress resultants of element are defined as equivalent nodal forces in local coordinate system, it is necessary to note that signs are different from it on general structural mechanics. Positive directions are always right-direction, upward-direction for each node in local coordinate system.


Format of output file ('csv' format)

Comment
NODT,NELT,MATEL,KOX,KOY,NF
(Each value for above item)
*node characteristics
node,x,y,fx,fy,fix-x,fix-y,rdis-x,rdis-y,deltaT
    node     : Node number
    x,y      : x & y-coordinates
    fx,fy    : Nodal forces in x & y direction and Moment of node
    fix-x    : x-direction restricted condition (1: restricted, 0: not restricted)
    fix-y    : y-direction restricted condition (1: restricted, 0: not restricted)
    rdis-x,rdis-y : Displacements in x & y-direction
    deltaT   : temperature change of node
  .....(1 to NODT).....
*element characteristics
element,node-1,node-2,E,A,gamma,kh,kv,alpha,matno
    element       : Element number
    node-1,node-2 : Element-nodes relationship
    E             : Elastic modulus of element
    A             : Section area of element
    gamma         : Unit weight of element
    gkh           : Horizontal acceleration of element (ratio to 'g')
    gkv           : Vertical acceleration of element (ration to 'g')
    alpha         : Coefficient of thermal expansion of element
    matno         : Material set number
  .....(1 to NELT).....
*displacements and forces
node,coord-x,coord-y,dis-x,dis-y,reac-x,reac-y,ftvec-x,ftvec-y
    node            : Node number
    x-cood,y-cood   : Coordinates in x & y-directions
    dis-x,dis-y     : Nodal displacements in x & y-directions
    reac-x,reac-y   : Internal forces in x & y-directions
    ftvec-x,ftvec-y : External forces in x & y-directions
  .....(1 to NODT).....
*stress resultants
element,Ni,Si,Nj,Sj
    element : Element number
    Ni,Nj   : Axial forces at node 'i' and 'j'
    Si,Sj   : Shear forces at node 'i' and 'j'
  .....(1 to NELT).....
NODT=(Number of node), nt=(nt), mm=(mm), ib=(ib)
Calculation time=(calculation time)
Date_time=(date of execution)
    nt : Total degrees of freedom of FE equation
    mm : Dimension of reduced FE equation
    ib : band width of reduced FE equation




inserted by FC2 system