vorlap.interpolation module

vorlap.interpolation.interpolate_fft_spectrum_optimized(afft: AirfoilFFT, Re_val: float, AOA_val: float, fields: List[str], n_freq_depth: int | None = None) Dict[str, Tuple[ndarray, ndarray, ndarray]][source]

Vectorized, fast bilinear interpolation with flat extrapolation for multiple fields at once.

Parameters:
  • afft – AirfoilFFT struct containing FFT results.

  • Re_val – Desired Reynolds number.

  • AOA_val – Desired angle of attack (degrees).

  • fields – List of field strings (‘CL’, ‘CD’, ‘CM’, ‘CF’) to interpolate.

  • n_freq_depth – Optional number of frequencies to return.

Returns:

Dictionary mapping field names to (ST, Amp, Pha) tuples with arrays of length n_freq_depth.

vorlap.interpolation.interpolate_fft_spectrum_batch(afft: AirfoilFFT, Re_vals: ndarray, AOA_vals: ndarray, field: str, n_freq_depth: int | None = None) Tuple[ndarray, ndarray, ndarray][source]

Batch interpolation for multiple Re/AOA points simultaneously.

Parameters:
  • afft – AirfoilFFT struct containing FFT results with cached interpolators.

  • Re_vals – Array of Reynolds numbers.

  • AOA_vals – Array of angles of attack (degrees).

  • field – Field string (‘CL’, ‘CD’, ‘CM’, ‘CF’) to interpolate.

  • n_freq_depth – Optional number of frequencies to return.

Returns:

  • ST_out: Array of shape [n_points, n_freq]

  • amp_out: Array of shape [n_points, n_freq]

  • phase_out: Array of shape [n_points, n_freq]

Return type:

Tuple containing

vorlap.interpolation.interpolate_fft_spectrum(afft: AirfoilFFT, Re_val: float, AOA_val: float, field: str, n_freq_depth: int | None = None) Tuple[ndarray, ndarray, ndarray][source]

Interpolate the FFT amplitude and phase spectra using bilinear interpolation over the stored Re × AOA grid.

Parameters:
  • afft – AirfoilFFT struct containing FFT results.

  • Re_val – Desired Reynolds number.

  • AOA_val – Desired angle of attack (degrees).

  • field – String (‘CL’, ‘CD’, ‘CM’, or ‘CF’) indicating which force coefficient to interpolate.

  • n_freq_depth – Optional number of frequencies to return. If None, returns all frequencies.

Returns:

  • freqs: Vector of frequency values.

  • amp_out: Vector of interpolated amplitudes at each frequency.

  • phase_out: Vector of interpolated phases at each frequency.

Return type:

Tuple containing

Note

  • The interpolation is performed independently at each frequency index in the spectrum.

  • Assumes consistent frequency axis across the full 3D data structure.

  • Returns values suitable for reconstructing time-domain or frequency-domain force estimates.

vorlap.interpolation.resample_airfoil(xy: ndarray, npoints: int = 200) ndarray[source]

Resample the given airfoil shape using uniform x-spacing.

Process:
  1. Identify leading (min x) and trailing (max x) edges.

  2. Split into upper and lower surfaces.

  3. Interpolate both surfaces using npoints uniformly spaced x-values.

  4. Recombine to produce a smooth resampled airfoil shape.

Parameters:
  • xy – Nx2 matrix of (x, y) airfoil coordinates, not assumed to start at TE or LE.

  • npoints – Number of points used in interpolation (default: 200).

Returns:

Resampled and recombined airfoil shape.