You are on page 1of 19

Femap Application Programing Interface - API - Overview

Automated Finite Element Model Construction and


Analysis via Visual Basic API Programming

Jared Ellefson, MSME


Predictive Engineering, Inc.
Jared.Ellefson@PredictiveEngineering.com
Abstract

Streamlining the creation of extremely complex finite element models


through the use of the API capabilities present in Femap is discussed.

A brief overview is given on the modeling challenges presented in a


specific case study. This analysis challenge consisted of a large amount
of point locations, that could not be manually specified and
manipulated, in a realistic timeframe.

How the API was utilized for the model construction is discussed. Some
of the results of the analysis output are shown, and the implications of
this output is briefly shared.

Two other uses of the API are also briefly shown and discussed.
Femap V93 2007

A common theme in all of these examples is the powerful functionality


of the Femap modeler and how its functionality can be customized
through the use of its elegant application programming interface (API).
Case Study: Problem Definition

Secondary
P
Surface

Primary
Surface
P
Rubber Gasket
Femap V93 2007

The number of contact points on the surface averaged around 50,000.


Femap V93 2007

A way was needed to import these point locations, associate them with geometry and then
to create a mesh that included nodes at each of these point locations. After this was
accomplished, a way was needed to enforce contact between these bumps and the
secondary surface.
Bump Modeling Approach

A top-down view of the bump is shown on the left.


The first step in the project was to quantify the
stiffness of these bumps. A number of bump
geometries were provided. These bumps were to
be normally distributed on the primary surface, i.e.
bump height would be variable.
Separate finite element models were used to
quantify the stiffness of the bumps.
Femap V93 2007
Femap V93 2007
Bump Modeling Approach

It was decided that the best way to model


the bumps was through the use of gap
elements.
Gap elements provide an Initial Gap
capability which we utilized to simulate
bump height. They also allow the user to
specify the gap compression stiffness, which
we used to simulate the bump stiffness.
Femap V93 2007

Bump Stiffness

Initial Gap
Overall Algorithm Flow

Geometry Point Specifying of


Creation Importing Hard Points

Load and
Meshing & Gap Element Boundary
Mesh Copying Creation Condition
Specification

Submit the
Femap V93 2007

Model to Solver
Example Code: Specifying of Hard Points

Cycles through all areas, Scurr is the identifying variable for the current
While Scurr < SLast surface
LastInterest = hardSet.Last
I=0
rc = hardSet.Reset
Do
t = hardSet.Next() Cycles through each point contained in the set named hardSet
rc = pt.Get(t)
Pcurr(0) = pt.x
Pcurr(1) = pt.y
Pcurr(2) = pt.z
rc = su.XYZToParam(Pcurr, uuu, vvv)
Changes the current points coordinates from Global Cartesian to Parametric
If rc = su.Inside(uuu, vvv) Then
Uses a function associated with the surface object to check if the current point
su.MeshPoint(I) = t lies within the boundaries of the current surface
I = I+1
rc = hardSet.Remove(t) Uses a function associated with the surface object to check if the current point
End If lies within the boundaries of the current surface
Loop Until t = LastInterest
su.Put( su.ID )
Femap V93 2007

rc = su.Next()
Scurr = su.ID This bit of code cycles through each area searching
rc = femap.feAppStatusUpdate(Scurr) for points that lie in its boundaries.
Wend
If the program finds a point to be within the
boundaries of the area, it sets the point as a hard
point.
Because of the inefficiency of
performing an analysis on the
entire model, the program was
written to allow the user to
specify what their region of
interest was.
Femap V93 2007
Desired Outputs

Output for two regions were desired:


Center of the model
Edge of the model

The two specific engineering outputs the program generated for


these regions were:
Surface Deflection
Bump Force
Femap V93 2007
Sample Model: Center
Femap V93 2007
Femap V93 2007
Sample Model: Edge
Femap V93 2007
Femap V93 2007
API Functionality: Two More Examples
1. Explicit Timestep Calculator
Femap V93 2007

The Tet Time Step Calculator was written to be used with LS-DYNA. The API calculates the
characteristic speed of a stress wave through the selected elements, and then creates an
output vector so that the speeds can be contoured. The API makes preparing a mesh for
use in LS-DYNA much easier.
API Functionality: Two More Examples
2. ASME Pressure Vessel
Femap V93 2007
Femap V93 2007

ASME Div VIII requires stress outputs for Stress Intensity and tensile membrane stresses.
Femaps powerful API language provides an elegant solution to provide additional post-
processing capabilities.
Author Biography

Jared Ellefson is the staff analyst for Predictive Engineering, a


mechanical engineering solutions company, headquarted in
Portland, Oregon. Jareds masters degree project focused on using
computer code to build and run FEA models in an optimization
routine. His work has ranged from a deep-diving luxury submarine to
PSD analysis of a modular satellite. Numerous other projects have
involved seismic analysis of large nuclear waste vessels, engine test
equipment drive trains, and electron microscope turret analyses.
Additionally, Jared has developed many custom computer programs
which have focused on streamlining repetitive tasks, adding
capability to Femap not inherently present, and automation of model
construction.
Femap V93 2007

You might also like