FRICTION Analysis Interface Module (AIM)
FRICTION Analysis Interface Module (AIM)
FRICTION Examples

Table of Contents

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

First step is to define the analysis intention that the geometry is intended support.

attribute capsIntent LINEARAERO

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 capsType 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 capsType $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 capsType $Wing
rotatex 90 0 0
scale croot
# left tip
udprim naca Thickness thick Camber camber
attribute capsType $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 capsType $VTail
scale 0.75*ctip
translate tlen+0.75*(croot-ctip) 0.0 ctip+toff
# root
udprim naca Thickness thick
attribute capsType $VTail
scale 0.75*croot
translate tlen 0.0 toff

Horizontal Tail definition

# tip left
udprim naca Thickness thick
attribute capsType $HTail
scale 0.75*ctip
rotatex 90 0 0
translate tlen+0.75*(croot-ctip) -ctip toff
# tip right
udprim naca Thickness thick
attribute capsType $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.

skbeg -0.4*tlen 0.0 0.0
skend
attribute capsType $Fuse
udprim ellipse ry 0.5*croot rz 0.2*croot
attribute capsType $Fuse
translate 0.0 0.0 0.0
udprim ellipse ry 0.4*croot rz 0.1*croot
attribute capsType $Fuse
translate croot 0.0 0.0
udprim ellipse ry 0.1*croot rz 0.1*croot
attribute capsType $Fuse
translate tlen 0.0 toff
udprim ellipse ry 0.01*croot rz 0.01*croot
attribute capsType $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 capsProblem from pyCAPS
from pyCAPS import capsProblem
# Import os module
import os

Once the modules have been loaded the problem needs to be initiated.

myProblem = capsProblem()

Next the *.csm file is loaded 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...

myGeometry = myProblem.loadCAPS("./csmData/frictionWingTailFuselage.csm")
myGeometry.setGeometryVal("area", 10.0)

Next local variables used throughout the script are defined.

workDir = "FrictionAnalysisTest"

The FRICTION AIM is then loaded with the capsIntent set to LINEARAERO (this is consistent with the intention specified above in the *.csm file.

myAnalysis = myProblem.loadAIM( aim = "frictionAIM",
analysisDir = workDir,
capsIntent = "LINEARAERO")

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.

myAnalysis.setAnalysisVal("Mach", [0.5, 1.5])
# Note: friction wants kft (defined in the AIM) - Automatic unit conversion to kft
myAnalysis.setAnalysisVal("Altitude", [9000, 18200.0], units= "m")

Once all the inputs have been set, preAnalysis needs to be executed. During this operation, all the necessary files to run FRICTION are generated and placed in the analysis working directory (analysisDir).

myAnalysis.preAnalysis()

At this point the required files necessary run FRICTION should have been created and placed in the specified analysis working directory. Next FRICTION needs to executed such as through an OS system call (see FRICTION AIM Overview for additional details) like,

print ("\n\nRunning FRICTION......")
currentDirectory = os.getcwd() # Get our current working directory
os.chdir(myAnalysis.analysisDir) # Move into test directory
os.system("friction frictionInput.txt frictionOutput.txt > Info.out"); # Run FRICTION via system call
os.chdir(currentDirectory) # Move back to top directory

A call to postAnalysis is then made to check to see if FRICTION executed successfully and the expected files were generated.

myAnalysis.postAnalysis()

Similar to the AIM inputs, after the execution of FRICTION and postAnalysis, any of the AIM's output variables (AIM Outputs) are readily available; for example,

Cdtotal = myAnalysis.getAnalysisOutVal("CDtotal")
CdForm = myAnalysis.getAnalysisOutVal("CDform")
CdFric = myAnalysis.getAnalysisOutVal("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]