FRICTION Analysis Interface Module (AIM)
FRICTION Analysis Interface Module (AIM)
Loading...
Searching...
No Matches
FRICTION AIM Examples

This is a walkthrough for using FRICTION AIM to analyze a wing, tail, fuselage configuration.

Prerequisites

It is presumed that ESP and CAPS have been already installed, as well as FRICTION. Furthermore, a user should have knowledge on the generation of parametric geometry in Engineering Sketch Pad (ESP) before attempting to integrate with any AIM. Specifically this example makes use of Design Parameters, Set Parameters, User Defined Primitive (UDP) and attributes in ESP.

Script files

Two scripts are used for this illustration:

  1. frictionWingTailFuselage.csm: Creates geometry, as described in the following section.
  2. friction_PyTest.py: pyCAPS script for performing analysis, as described in Performing analysis using pyCAPS.

Creating Geometry using ESP

The CSM script generates Bodies which are designed to be used by specific AIMs. The AIMs that the Body is designed for is communicated to the CAPS framework via the “capsAIM” string attribute. This is a semicolon-separated string with the list of AIM names. Thus, the CSM author can give a clear indication to which AIMs should use the Body. In this example, the list contains only the frictionAIM:

attribute capsAIM $frictionAIM

FRICTION input is always in feet, to enable automatic conversion, the geometric attribute capsLength may be used to define the units the geometry (*.csm) file is in.

attribute capsLength $m

Next we will define the design parameters to define the wing cross section and planform.

despmtr thick 0.12 frac of local chord
despmtr camber 0.04 frac of loacl chord
despmtr tlen 5.00 length from wing LE to Tail LE
despmtr toff 0.5 tail offset
despmtr area 10.0
despmtr aspect 6.00
despmtr taper 0.60
despmtr sweep 20.0 deg (of c/4)
despmtr washout -5.00 deg (down at tip)
despmtr dihedral 4.00 deg

The design parameters will then be used to set parameters for use internally to create geometry.

set span sqrt(aspect*area)
set croot 2*area/span/(1+taper)
set ctip croot*taper
set dxtip (croot-ctip)/4+span/2*tand(sweep)
set dztip span/2*tand(dihedral)

Next the Wing, Vertical and Horizontal tails are created using the naca User Defined Primitive (UDP). The inputs used for this example to the UDP are Thickness and Camber. The naca sections generated are in the X-Y plane and are rotated to the X-Z plane. They are then translated to the appropriate position based on the design and set parameters defined above. Finally reference area can be given to the FRICTION AIM by using the capsReferenceArea attribute. If this attribute exists on any body that value is used otherwise the default is 1.0.

In addition, each section has a capsGroup attribute. This is used to logically group sections together. More information on this can be found in the AIM Attributes section.

# right tip
udprim naca Thickness thick Camber camber
attribute capsReferenceArea area
attribute capsGroup $Wing
scale ctip
rotatex 90 0 0
rotatey washout 0 ctip/4
translate dxtip -span/2 dztip
# root
udprim naca Thickness thick Camber camber
attribute capsGroup $Wing
rotatex 90 0 0
scale croot
# left tip
udprim naca Thickness thick Camber camber
attribute capsGroup $Wing
scale ctip
rotatex 90 0 0
rotatey washout 0 ctip/4
translate dxtip span/2 dztip

Vertical Tail definition

# tip
udprim naca Thickness thick
attribute capsGroup $VTail
scale 0.75*ctip
translate tlen+0.75*(croot-ctip) 0.0 ctip+toff
# root
udprim naca Thickness thick
attribute capsGroup $VTail
scale 0.75*croot
translate tlen 0.0 toff

Horizontal Tail definition

# tip left
udprim naca Thickness thick
attribute capsGroup $HTail
scale 0.75*ctip
rotatex 90 0 0
translate tlen+0.75*(croot-ctip) -ctip toff
# tip right
udprim naca Thickness thick
attribute capsGroup $HTail
scale 0.75*ctip
rotatex 90 0 0
translate tlen+0.75*(croot-ctip) ctip toff

Fuselage definition. Notice the use of the ellipse UDP. In this case, only translation is required to move the cross section into the desired location.

point -0.4*tlen 0.0 0.0
attribute capsGroup $Fuse
udprim ellipse ry 0.5*croot rz 0.2*croot
attribute capsGroup $Fuse
translate 0.0 0.0 0.0
udprim ellipse ry 0.4*croot rz 0.1*croot
attribute capsGroup $Fuse
translate croot 0.0 0.0
udprim ellipse ry 0.1*croot rz 0.1*croot
attribute capsGroup $Fuse
translate tlen 0.0 toff
udprim ellipse ry 0.01*croot rz 0.01*croot
attribute capsGroup $Fuse
translate tlen+0.75*croot 0.0 toff

Performing analysis using pyCAPS

An example pyCAPS script that uses the above *.csm file to run FRICTION is as follows.

First the pyCAPS and os module needs to be imported.

# Import pyCAPS module
import pyCAPS
# Import os module
import os
import argparse

Local variables used throughout the script are defined.

# Create working directory variable
workDir = os.path.join(str(args.workDir[0]), "FrictionAnalysisTest")

Once the modules have been loaded the problem needs to be initiated with the *.csm file, and design parameter is changed - area in the geometry. Any despmtr from the frictionWingTailFuselage.csm file is available inside the pyCAPS script. They are: thick, camber, area, aspect, taper, sweep, washout, dihedral...

geometryScript = os.path.join("..","csmData","frictionWingTailFuselage.csm")
capsProblem = pyCAPS.Problem(problemName=workDir,
capsFile=geometryScript,
outLevel=args.outLevel)
capsProblem.geometry.despmtr.area = 10.0

The FRICTION AIM is then loaded with:

friction = capsProblem.analysis.create( aim = "frictionAIM", unitSystem = "US" )

After the AIM is loaded, the Mach number and Altitude are set (see AIM Inputs for additional inputs). The FRICTION AIM supports variable length inputs. For example 1 or 10 or more, Mach and Altitude pairs can be entered. The example below shows two inputs. Note that the length of the Mach and Altitude inputs must be the same.

friction.input.Mach = [0.5, 1.5]
# Note: friction wants ft (defined in the AIM) - Automatic unit conversion to ft
friction.input.Altitude = [9000, 18200.0]*pyCAPS.Unit("m")
# Specify transition location applied to all surfaces
friction.input.BL_Transition = 0.1
# Specify lifting surfaces
friction.input.LiftSurface = {"Wing":{"BL_Transition":0.2},
"HTail":{},
"VTail":{}}
# Specify body of revolution surfaces
friction.input.RevolveSurface = {"Fuse":{"BL_Transition":0.05}}

Once all the inputs have been set, outputs can be directly requested. The FRICTION analysis will be automatically executed just-in-time (aimExecuteFRICTION).

Any of the AIM's output variables (AIM Outputs) are readily available; for example,

Cdtotal = friction.output.CDtotal
CdForm = friction.output.CDform
CdFric = friction.output.CDfric

Printing the above variables results in,

Total drag = [0.01321, 0.01227]
Form drag = [0.00331, 0.00308]
Friction drag = [0.0099, 0.00919]