# Calculating Dynamic Derivatives using Sliding Interfaces

## Contents

# 7.6. Calculating Dynamic Derivatives using Sliding Interfaces#

This tutorial demonstrates how to obtain dynamic stability derivatives by oscillating a wing enclosed in a sliding interface.

## 7.6.1. Geometry and Mesh#

In this example, the geometry is a wing with NACA0012 airfoil.
The chord \(c\) = 1 m and the span \(b\) = 2 m.
So the `momentLength`

= [\(b\)/2, \(c\), \(b\)/2] = [1, 1, 1].
The `momentCenter`

is set at [0, 0, 0], which is the airfoil quarter-chord point and midspan of the wing.
As shown in the following figure, there is a cylindrical sliding interface enclosing the wing.
The radius of the cylinder is 1 m and the length is 2.5 m.
The rotational center is also located at [0, 0, 0] and the axis of rotation is along the y-axis.

The mesh was generated using the automated meshing workflow. The geometry file, surfaceMesh.json and volumeMesh.json are provided so the readers can easily generate the mesh in their account. For more information about this automated meshing workflow please see Automated Meshing.

## 7.6.2. Case Setup#

The entire simulation contains two cases:

Steady case with a fixed sliding interface for initializing the flow field.

Unsteady case with an oscillating sliding interface for collecting the data.

The steady case is quite trivial since the sliding interface is stationary.
For readers’ convenience, the Flow360Steady.json is provided.
As for the unsteady case, when preparing the Flow360Unsteady.json, the key is to correctly set up the `thetaDegrees`

input expression:

Where \(A\) is the amplitude of oscillation in degrees,
`omega`

is the nondimensional angular frequency of the oscillation,
and `t`

is the nondimensional time. Note that `omega`

and `t`

are nondimensional variables of the Flow360 solver.

In this case we set \(A=2\)°, so the pitching angle of the wing is oscillating between \(\pm 2\)°.
`omega`

is typically computed from the number of flowthroughs per radian, denoted by \(n\).
In this example, we have \(n = 2.5\) flowthru/rad, which means when `omega*t`

changes 1 radian, the air will flow through 2.5 chord lengths.
In this tutorial, the freestream velocity \(U_\infty=50\) m/s.
The physical angular frequency is given by,

Since we have the freestream speed of sound \(C_\infty = 340.294\) m/s and gridUnit = 1 m. The nondimensional angular frequency can be written as,

Therefore, the `slidingInterfaces`

section is:

```
"slidingInterfaces": [
{
"stationaryPatches": ["stationaryBlock/slidingInterface-0"],
"rotatingPatches": ["rotatingBlock-0/slidingInterface-0"],
"axisOfRotation": [0,1,0],
"centerOfRotation": [0,0,0],
"volumeName": "rotatingBlock-0",
"thetaDegrees": "2.00 * sin(0.05877271 * t)"
}
]
```

Another critical value we need to set up carefully is the nondimensional `timeStepSize`

.
In this example, each period is spilt into 100 steps, therefore,

Note that the `omega`

in the above equation is the nondimensional angular frequency.

## 7.6.3. Submission#

The surface/volume meshes and steady/unsteady cases can be easily submitted via our PythonAPI:

```
surfaceMeshId = flow360client.NewSurfaceMeshFromGeometry('path/to/geometry.csm', 'path/to/surfaceMesh.json')
volumeMeshId = flow360client.NewMeshFromSurface(surfaceMeshId=surfaceMeshId, config='path/to/volumeMesh.json')
steadyCaseId = flow360client.NewCase(meshId=volumeMeshId, config='path/to/SteadyFlow360.json', caseName='dynamic-derivatives-steady')
unsteadyCaseId = flow360client.NewCase(meshId=volumeMeshId, config='path/to/UnsteadyFlow360.json', caseName='dynamic-derivatives-unsteady', parentId=steadyCaseId)
```

## 7.6.4. Postprocessing#

Once the case is completed, the user can download the “total_forces_v2.csv”, where the first column is `physical_step`

.
Note that the flowfield was initialized from a steady case, so the nondimensional time can be written as,

In this example, the angle of attack \(\alpha\) is always identical to the pitch angle \(\theta\),

Therefore, \(\dot{\alpha}\) is always identical to the pitch rate \(q\).
The \(\dot{\alpha}\) at time step `i`

can be obtained by finite differencing \(\alpha\) at the `i-1`

and `i+1`

time step

Note that the unit of \(\dot{\alpha}\) in the equation above is rad/flowthru.

As shown in the following plot, when \(\alpha=0\), \(\dot{\alpha}\) will reach the extrema.

If we plot CMy versus \(\dot{\alpha}\) and linearly fit the points with \(\alpha=0\) (i.e. min/max \(\dot{\alpha}\)) the slope of the fitted line is the dynamic derivative: