FEM Interface Module

This module contains a basic environment for conducting finite element analysis.

The primary purpose of this library is to fascilitate the creation of a FEM within the AeroComBAT package.

SUMARRY OF THE CLASSES:
 
  • Model: The Model class has two main purposes. The first is that it is meant

    to serve as an organizational class. Once an aircraft part has been loaded into the model by using the addAircraftPart() method, the aircraft part can be loaded and constrained by the user. Once all parts have been loaded into the model and all loads and constraints have been applied, the user can choose to execute the plotRigidModel() method to visualize the model and make sure it accurately represents their problem. If the model appears as it should, the user can elect to run a static, buckling, normal mode, static aeroelastic, or dynamic flutter analysis.

  • LoadSet: This class is used to fascilitate the created of many loads that

    cal be individually applied to a finite element model. Typically this class is not explicitly used. Instead the are created by the applyLoads method of the Model class.

  • FlutterPoint: Primarily as a way to fascilitate the interpolation of

    flutter results generated from the flutterAnalysis method of Model.

Note

Currently the only avaliable part in the AeroComBAT package are wing parts, however this is likely to change as parts such as masses, fuselages and other types of aircraft parts are added.

MODEL

class AeroComBAT.FEM.Model[source]

Creates a Model which is used to organize and analyze FEM.

The primary used of Model objects are to organize FEM’s and analyze them. The Model object doesn’t create any finite elements. Instead, it loads aircraft parts which contain various types of finite element structural models as well as aerodynamic models. The type of model will depend on the type of aircraft part added. Once all of the models are created and added to the model object, the model object will serve as the analysis primary interface used to manipulate the generated model.

Attributes:
  • Kg (DOFxDOF np.array[float]): This is the global stiffness matrix.

  • Kgr ((DOF-CON)x(DOF-CON) np.array[float]): This is the global reduced

    stiffness matrix. In other words, the global stiffness matrix with the rows and columns corresponding to the constraints (CON) removed.

  • Fg (DOFx1 np.array[float]): The global force vector.

  • Fgr ((DOF-CON)x1 np.array[float]): The global reduced force vector. In

    other words, the global force vector with the rows corresponding to the constraints (CON) removed.

  • Mg (DOFxDOF np.array[float]): The global mass matrix.

  • Mgr ((DOF-CON)x(DOF-CON) np.array[float]): The global reduced mass

    matrix. In other words, the global mass matrix with the rows and columns corresponding to the constraints (CON) removed.

  • Qg (DOFx1 np.array[float]): The global force boundary condition vector.

    This is where all of the nodal loads are stored before the system is assembled.

  • nids (Array[int]): This array contains all of the node IDs used within

    the model.

  • nodeDict (dict[NID,node]): This dictionary is a mapping of the node IDs

    used within the model to the corresponding node objects.

  • elems (Array[obj]): This array contains all of the element objects used

    in the model.

  • const (dict[NID,Array[DOF]): This dictionary is a mapping of the node

    IDs constrained and the corresponding degrees of freedom that are constrained.

  • parts (dict[PID, part]): This dictionary is a mapping of part ID’s

    (PID) and the aircraft part objects that are added to the model. Currently the only suported parts are wings.

  • loads (dict[LID,int]): This dictionary is a mapping of the load ID

    (LID) and the load set objects.

  • aeroBox (dict[PANID,panel]): This dictionary is a mapping of the

    aerodynamic panel ID’s (PANID) and the aerodynamic panel objects used in the flutter analysis.

  • SuperBeams (array[obj]): This array contains all of the superbeam’s

    added to the model through addElements. In otherwords, this superbeam object is without an associated part.

  • u (dict[str,1xDOF np.array[float]]): This dictionary maps analysis

    names to displacement results for a static analysis.

  • freqs (1x(DOF-CON) np.array[float]): This is a 1D array which holds the

    frequencies of a normal modes analysis.

Methods:
  • addElements: A method to add individual elements to the model.

  • addAircraftParts: A method to add an Aircraft part to the model. This

    is a much more effective method than addElements as when a part is added, the model can utilize all of the organizational and post processing methods built into the part.

  • resetPointLoads: A convenient way to reset all of the nodal loads in

    the model to zero.

  • resetResults: A convenient way to clear the results in all of the

    elements from a previous analysis. This method is subject to change as the way in which results are stored is likely to change.

  • applyLoads: A method to apply nodal loads as well as distributed loads

    to a range of elements, all of the elements in a part, or all of the elements in the model.

  • applyConstraints: A method to apply nodal constraints to the model.

  • staticAnalysis: A method which conducts a linear static analysis.

  • normalModesAnalysis: A method which conducts a normal modes analysis on

    the model.

  • flutterAnalysis: A method which conducts a linearized flutter pk-method

    analysis on the model.

  • plotRigidModel: A method to plot and visualize the model.

  • plotDeformedModel: A method to plot and visualize the results from an

    analysis on the model.

addAircraftParts(parts)[source]

A method to add an array of aircraft parts to the model.

This method is a more robust version of addElements. Provided an array of part objects, this method will add the parts to the model. This includes adding all of the elements and nodes to the model, as well as a few other pieces of information. In addition, if a wing has aerodynamic panels associated with it, these will also be added to the model.

Args:
  • parts (Array[obj]): An array of part objects.
Returns:
  • None
addElements(elemarray)[source]

A method to add elements to the model.

Provided an array of elements, this method can add those elements to the model for analysis. This is a rather rudementary method as the post processing methods utilized by the parts are not at the users disposal for the elements added to the model in this way.

Args:
  • elemarray (Array[obj]): Adds all of the elements in the array to

    the model.

Returns:
  • None

Note

Currently supported elements include: SuperBeam, Tbeam.

applyConstraints(NID, const)[source]

A method for applying nodal constraints to the model.

This method is the primary method for applying nodal constraints to the model.

Args:
  • NID (int): The node ID of the node to be constrained.

  • const (str, np.array[int]): const can either take the form of a

    string in order to take advantage of the two most common constraints being ‘pin’ or ‘fix’. If a different constraint needs to be applied, const could also be a numpy array listing the DOF (integers 1-6) to be constrained.

Returns:
  • None

Note

When constraining nodes, only 0 displacement and rotation

constraints are currently supported.

applyLoads(LID, **kwargs)[source]

A method to apply nodal and distributed loads to the model.

This method allows the user to apply nodal loads to nodes and distributed loads to elements within the model.

Args:
  • f (func): A function which, provided the provided a length 3 numpy

    array representing a point in space, calculates the distributed load value at that point. See an example below:

  • F (dict[NID,1x6 np.array[float]]): A dictionary mapping a node ID

    to the loads to be applied at that node ID.

  • allElems (bool): A boolean value used to easily load all of the

    elements which have been added to the model.

  • PIDs (Array[int]): An array containing part ID’s, signifying that

    all elements used by that part should be loaded.

  • eids (Array[int]): An array containing all of the element ID’s

    corresponding to all of the elements which should be loaded.

Returns:
  • None

Distributed load function example:

def f(x):
   vx = (1/10)*10*x[2]**2-7*x[2]-2.1
   vy = 10*x[2]**2-7*x[2]
   pz = 0
   mx = 0
   my = 0
   tz = (10*x[2]**2-7*x[2])/10+3*x[0]**2
   return np.array([vx,vy,pz,mx,my,tz])

Nodal load dictionary example:

F[NID] = np.array([Qx,Qy,P,Mx,My,T])
flutterAnalysis(U_vec, kr_vec, M_vec, b, rho_0, nModes, **kwargs)[source]

Conducts a flutter analysis.

This method calculates the flutter modes and damping provided velocities, reduced frequencies, Mach numbers, and the reference semi-chord.

Args:
  • U_vec (1xN np.array[float]): A vector of trial velocities where the

    damping and frequency of all of the respective mode shapes will be calculated.

  • kr_vec (1xM np.array[float]): A vector of reduced frequencies for

    which the AIC’s will be calculated. The minimum possible value can be 0.

  • M_vec (1xM np.array[float]): A vector of mach numbers at which the

    AIC’s will be calculated. Currently interpolating results by Mach number aren’t possible. As such, select mach numbers to be close to the suspected instability.

  • b (float): The reference semi-chord.

  • rho_0 (float): The reference density at sea level.

  • nmodes (int): The number of modes to be considered for the flutter

    analysis. For a composite cantilevered wing, 6 modes should usually be sufficient.

  • g (float): A proportional structural damping term. Acceptable

    ranges of g can be approximated between 0. and 0.05.

  • symxz (bool): A boolean value indicating whether the aerodynamics

    should be mirrored over the xz-plane.

  • rho_rat (1xN np.array[float]): An array of density ratios to allow

    for flutter calculations at different altitudes.

  • analysis_name (str): The string name to be associated with this

    analysis. By default, this is chosen to be ‘analysis_untitled’.

Returns:
  • None

Note

Currently static aeroelastic instability (divergence) cannot

be captured by AeroComBAT.

normalModesAnalysis(**kwargs)[source]

Conducts normal mode analysis.

This method conducts normal mode analysis on the model. This will calculate all of the unknown frequency eigenvalues and eigenvectors for the model, which can be plotted later.

Args:
  • analysis_name (str): The string name to be associated with this

    analysis. By default, this is chosen to be ‘analysis_untitled’.

Returns:
  • None

Note

There are internal loads that are calculated and stored within the model elements, however be aware that these loads are meaningless and are only retained as a means to display cross section warping.

plotDeformedModel(**kwargs)[source]

Plots the deformed model.

This method plots the deformed model results for a given analysis in the mayavi environement.

Args:
  • analysis_name (str): The string identifier of the analysis.

  • figName (str): The name of the figure. This is ‘Rigid Model’ by

    default.

  • clr (1x3 tuple(int)): The color tuple or RGB values to be used for

    plotting the reference axis for all beam elements. By default this color is black.

  • numXSects (int): The number of cross-sections desired to be plotted

    for all wing sections. The default is 2.

  • contour (str): A string keyword to determine what analysis should

    be plotted.

  • contLim (1x2 Array[float]): An array containing the lower and upper

    contour limits.

  • warpScale (float): The scaling factor used to magnify the cross

    section warping displacement factor.

  • displScale (float): The scaling fator used to magnify the beam

    element displacements and rotations.

  • mode (int): If the analysis name refers to a modal analysis, mode

    refers to which mode from that analysis should be plotted.

Returns:
  • mayavi figure
plotRigidModel(**kwargs)[source]

Plots the rigid model.

This method plots the rigid model in the mayavi environement.

Args:
  • figName (str): The name of the figure. This is ‘Rigid Model’ by

    default.

  • clr (1x3 tuple(int)): The color tuple or RGB values to be used for

    plotting the reference axis for all beam elements. By default this color is black.

  • numXSects (int): The number of cross-sections desired to be plotted

    for all wing sections. The default is 2.

Returns:
  • mayavi figure
resetPointLoads()[source]

A method to reset the point loads applied to the model.

This is a good method to reset the nodal loads applied to a model. This method will be useful when attempting to apply a series different analysis.

Args:
  • None
Returns:
  • None
resetResults()[source]

A method to reset the results in a model.

This is a good method to reset the results in the model from a given analysis. This method will be useful when attempting to apply a series different analysis.

Args:
  • None
Returns:
  • None
staticAnalysis(LID, **kwargs)[source]

Linear static analysis.

This method conducts a linear static analysis on the model. This will calculate all of the unknown displacements in the model, and save not only dispalcements, but also internal forces and moments in all of the beam elements.

Args:
  • LID (int): The ID corresponding to the load set to be applied to

    the model.

  • analysis_name (str): The string name to be associated with this

    analysis. By default, this is chosen to be ‘analysis_untitled’.

Returns:
  • None

LOAD SET

class AeroComBAT.FEM.LoadSet(LID)[source]

Creates a Model which is used to organize and analyze FEM.

The primary use of LoadSet is to fascilitate the application of many different complex loads to a finite element model.

Attributes:
  • LID (int): The integer identifier for the load set object.

  • pointLoads (dict[pointLoads[NID,F]): A dictionary mapping applied point

    loads to the node ID’s of the node where the load is applied.

  • distributedLoads (dict[EID,f]): A dictionary mapping the distributed

    load vector to the element ID of the element where the load is applied.

Methods:
  • __init__: The constructor of the class. This method initializes the

    dictionaries used by the loads

  • addPointLoad: Adds point loads to the pointLoads dictionary attribute.

  • addDictibutedLoad: Adds distributed loads to the distributedLoads

    dictionary attribute.

addDistributedLoad(f, eid)[source]

Initialized the load set ibject.

This method is a simple constructor for the load set object.

Args:
  • LID (int): The integer ID linked with the load set object.
Returns:
  • None
addPointLoad(F, NID)[source]

Initialized the load set ibject.

This method is a simple constructor for the load set object.

Args:
  • LID (int): The integer ID linked with the load set object.
Returns:
  • None

FLUTTER POINT

class AeroComBAT.FEM.FlutterPoint(FPID, U_vec, nModes)[source]

Creates a flutter point object.

The primary purpose for the flutter point class is to allow for easier post processing of the data from the flutter modes.

Attributes:
  • FPID (int): The integer identifier associated with the flutter point

    object.

  • U_vec (1xN np.array[float]): A vector of the velocities where the

    flutter point frequency and damping have been solved.

  • omegaAeroDict(dict[U,array[float]): This dictionary maps velocities to

    the aerodynamic frequencies used to generate the AIC matricies.

  • omegaRootDict(dict[U,array[float]): This dictionary maps velocities to

    the root frequencies of the flutter mode solution for particular reduced frequencies.

  • gammaDict(dict[U,array[float]): This dictionary maps velocities to

    the root damping of the flutter mode solution for particular reduced frequencies.

  • gammaDict(dict[U,array[float]): This dictionary maps velocities to

    the root mode shape of the flutter mode solution for particular reduced frequencies.

  • omega (array[float]): An array of floats which are the

    flutter mode frequencies corresponding to the velocities in U_vec.

  • gamma (array[float]): An array of floats which are the

    flutter mode damping values corresponding to the velocities in U_vec.

  • shape (array[MxN np.array[float]]): An MxL numpy array which

    contain the eigenvector solutions of the flutter mode. The values in the eigenvectors are the coefficient weighting factors for the normal mode shapes.

Methods:
  • __init__: The constructor of the class. This method initializes the

    attributes of the model, as well as the flutter

  • saveSol: Saves solutions to the flutter equation for the particular

    mode.

  • interpOmegaRoot: Interpolates the flutter mode frequency, damping and

    mode shapes for the different velocities.

__init__(FPID, U_vec, nModes)[source]

Creates a flutter point object.

This is the constructor for the flutter point object.

Args:
  • FPID (int): The integer ID linked with the flutter point object.

  • U_vec (1xN np.array[float]): An array of velocities where the

    flutter problem will be solved.

  • nModes (int): The number of modes that are used for the flutter

    solution.

Returns:
  • None
interpOmegaRoot()[source]

Interpolates correct dynamic frequencies and damping.

From the data saved using the saveSol method, this method interpolates the correct dynamic frequencies and damping for the different flutter velocities.

Args:
  • None
Returns:
  • None
saveSol(U, omega_aero, omega_root, gamma_root, shape)[source]

Saves data from the flutter solutions.

This method saves the damping, frequencies and mode shapes for the different flutter velocities and reduced frequencies.

Args:
  • U (float): The flutter velocity of the data.

  • omega_aero (float): The aerodynamic frequency corresponding to the

    reduced frequency.

  • omega_root (float): The root frequency corresponding to the

    flutter solution of the particular aerodynamic frequency.

  • gamma_root (float): The root damping of the flutter solution

  • shape (1xM np.array[float]): The mode shape of the flutter

    solution.

Returns:
  • None