Table of Contents

Cart3D Setup With VSP

Using Cart3D with a model created in VSP is mostly just like using Cart3D with any other model. However, VSP and Cart3D use different axis conventions by default. In VSP, +X runs from nose to tail, +Y runs out the right wing, and +Z is up. In this example, we will analyze a symmetrical flow condition with a symmetry condition on the XZ plane.

Cart3D v1.4 includes an adjoint based mesh adaptation capability which is extremely effective at efficiently generating a mesh which is good for your purposes. In this example, we will use adjoint based adaptation with drag coefficient as the adaptation functional.

The Cart3D v1.4 adjoint calculation capability is not available on MPI-based clusters. If you have a large case to run with the adjoint calculation, you must use a shared memory computer. This tutorial example should run acceptably on a modern laptop.

input.cntl

The Cart3D 'input.cntl' file requires some modifications to work with a VSP oriented geometry and also some modifications to match our Onera M6 test case. These modifications will be detailed below or you can download a ready-to-go 'input.cntl'.

Flow Conditions

The freestream flow conditions must be set to match the Onera M6 test conditions. Test 2308 was conducted at Mach 0.8395 at 3.06 degrees angle of attack.

$__Case_Information:          # ...Specify Free Stream Quantities

Mach  	 0.8395  #  (double)
alpha    3.06  #  (double) - angle of attack
beta     0.0  #  (double) - sideslip angle

Control Volume Boundary Conditions

The far-field boundary conditions and the symmetry wall condition must be specified. Because the +Y direction runs out the wing, the symmetry condition is applied to the Low end of direction 1.

$__Boundary_Conditions: # BC types: 0 = FAR FIELD 
                        #           1 = SYMMETRY
                        #           2 = INFLOW  (specify all)
                        #           3 = OUTFLOW (simple extrap)
Dir_Lo_Hi     0   0 0   # (int) (0/1/2) direction  (int) Low BC   (int) Hi BC
Dir_Lo_Hi     1   1 0   # (int) (0/1/2) direction  (int) Low BC   (int) Hi BC
Dir_Lo_Hi     2   0 0   # (int) (0/1/2) direction  (int) Low BC   (int) Hi BC

Reference Quantities

Although we aren't going to compare force and moment coefficients in this example, it is always a good idea to set the reference quantities appropriately. Because we are analyzing a half wing, the reference area is the area of the half wing. These reference quantities match the values specified in AGARD-AR-138.

refArea    0.7532
refLength  0.64607
momentCtr  0.0 0.0 0.0

The reference quantities appear in two places in the 'input.cntl' file. Don't forget to set them in both locations. The second location appears a bit later in the file, so when you change this, scroll back up to make the next change.

# ... reference area and length specifications

Reference_Area    0.7532  all

Reference_Length  0.64607  all

# ... Force Info

Force entire

# Moment_Point Xctr(%f) Yctr(%f) Zctr(%f) CompName or CompNumber
Moment_Point 0.0 0.0 0.0 entire

Cut Planes

The Onera M6 wing had a few rows of pressure taps. Although most visualization tools can extract the pressure distribution on any cut through a surface, it is a good idea to have Cart3D place cut planes at the pressure tap locations. The pressure tap locations are specified in AGARD-AR-138.

#                                   Pretty printed cutplanes
Xslices  0.0
Yslices  0.001   0.23926   0.526372   0.777595   0.95704   1.07667   1.136485   1.184337
Zslices  0.0
#                                      ...general format
#Xslices  (float) (float) ...(float)     -- any number of locations
#Yslices  (float) (float) ...(float)     -- any number of locations
#Zslices  (float) (float) ...(float)     -- any number of locations

Axis Definition

Cart3D needs the axis system defined so that lift, drag, and moment coefficients will be reported with the expected meaning.

# 
# ... Axis definitions (with respect to body axis directions (Xb,Yb,Zb)
#                       w/ usual stability and control orientation)
Model_X_axis  -Xb 
Model_Y_axis   Yb 
Model_Z_axis  -Zb 

Adaptation Metric

Cart3D provides a flexible means for constructing objective functionals which may be used to drive the adjoint based adaptation. In this example, we construct a simple functional equal to the drag coefficient.

# Objective Function: SUM of functionals (J)
# J = 0 -> W(P-T)^N
# J = 1 -> W(1-P/T)^N

# Ref. Frame = 0 Aerodynamic Frame
#            = 1 Aircraft (Body) Frame

# Force coefficients
# Force Codes: CD=0 Cy=1 CL=2 in Aerodynamic Frame
# Force Codes: CA=0 CY=1 CN=2 in Aircraft (Body) Frame
# Format: 
#         Name    Force   Frame    J      N    Target   Weight  Bound  GMP Comp
#        (String) (0,1,2) (0,1) (0,1,2) (int)  (dble)   (dble) (-1,0,1)
# -----------------------------------------------------------------------------
optForce   CD        0      0      0      1      0.     1.0       0     entire

aero.csh

The Cart3D 'aero.csh' file requires very little modification to work with a VSP oriented geometry. In addition, the file will be modified to limit the solution procedure so this example will comfortably run on a typical laptop computer. These modifications will be detailed below or you can download a ready-to-go 'aero.csh'.

Adaptation Limits

When first working with a new analysis case - or when working on a computer with limited resources - it is often a good idea to limit the adaptation procedure. The following limits should keep most cases small enough to run on a modern laptop. When you go to run a 'real' case, be sure to increase these limits in concert.

# choose functional error tolerance
set etol = 0.005
# max number of cells allowed in mesh
# if the new mesh exceeds this limit, the adaptation terminates
set max_nCells = 1000000

# number of adaptation cycles
set n_adapt_cycles = 7

Spanwise Orientation

The only required change to 'aero.csh' for using VSP geometries is to set the spanwise orientation parameter.

# spanwise orientation: set -y_is_spanwise (default null)
# set y_is_spanwise 
set y_is_spanwise = -y_is_spanwise

Next Steps

Once you have these input files set up for your case, proceed to the Cart3D Execution tutorial.

Or, feel free to jump to your topic of choice.

  1. Cart3D Setup (This Page)