5#include <marenv/wake/WakeField.h>
6#include <marenv/wake/WakeTypes.h>
77 const double radicand = 1.0 - thrustCoefficient / (
amplitudeDenominator * sigmaOverD * sigmaOverD);
80 return 1.0 - std::sqrt(radicand);
86 return xi * xi * (3.0 - 2.0 * xi);
102inline double OnsetRamp(
double x,
double xStart,
double length)
104 if (!(x < xStart + length))
252 double XStart()
const {
return m_xStart; }
276 double UnrampedAmplitude(
double x,
double sigma)
const;
279 double CentrelineAmplitude(
double x,
double pinnedAmplitude)
const;
282 double LinearSigma(
double x)
const;
285 double Sigma(
double x)
const;
291 double m_thrustCoefficient;
292 double m_nearWakeDeficit;
298 double m_farWakeStart;
299 double m_farWakeSigma;
304 const double sigma = Sigma(x);
308inline double KernelProfile::UnrampedAmplitude(
double x,
double sigma)
const
310 const double pinnedAmplitude = std::min(
detail::FarWakeAmplitude(m_thrustCoefficient, sigma / m_diameter), m_nearWakeDeficit);
311 return CentrelineAmplitude(x, pinnedAmplitude);
314inline double KernelProfile::LinearSigma(
double x)
const
316 return (m_expansion * x / m_diameter + m_epsilon) * m_diameter;
319inline double KernelProfile::Sigma(
double x)
const
321 if (!(x > m_farWakeStart))
322 return LinearSigma(x);
324 return m_farWakeSigma * std::cbrt(1.0 + 3.0 * m_expansion * (x - m_farWakeStart) / m_farWakeSigma);
327inline double KernelProfile::CentrelineAmplitude(
double x,
double pinnedAmplitude)
const
329 if (!m_porous || x >= m_blendEnd)
330 return pinnedAmplitude;
331 if (x <= m_plateauEnd)
333 const double xi = (x - m_plateauEnd) / (m_blendEnd - m_plateauEnd);
KernelProfile(const ElementarySource &source, const KernelParams ¶ms)
KernelCentreline At(double x) const
Centreline amplitude, the onset ramp included, and sigma at x >= x_start, m along flowDir.
Definition Kernel.h:302
double XStart() const
x_start = max(xStartFactor D, xStartMin), m.
Definition Kernel.h:252
double PeakAmplitude(double xFrom, double xTo) const
double SettledFrom() const
ImageQueries MakeImageQueries(const ImageSet &images, const double pos[3], const double shift[3])
double OnsetRamp(double x, double xStart, double length)
Definition Kernel.h:102
double ElementaryDeficit(const ElementarySource &source, const KernelParams ¶ms, const double pos[3])
void Validate(const KernelParams ¶ms)
ImageSet MirrorImages(const KernelParams ¶ms)
ElementarySource ImageOf(const ImageMap &map, const ElementarySource &source)
ImagePlanes MirrorPlanes(const KernelParams ¶ms)
constexpr double eq11Slope
MF2022 Eq. 11, r = 1.08 - 0.97 Sn, so d = 0.97 Sn - 0.08.
Definition Kernel.h:71
double Smoothstep(double xi)
Smoothstep S(xi) = xi^2 (3 - 2 xi) for xi in [0, 1].
Definition Kernel.h:84
double FarWakeAmplitude(double thrustCoefficient, double sigmaOverD)
Far-wake centreline amplitude C(x), or 1 where the radicand is negative (near the source).
Definition Kernel.h:75
constexpr double eq11Offset
MF2022 Eq. 11, see eq11Slope.
Definition Kernel.h:72
constexpr double amplitudeDenominator
C(x) = 1 - sqrt(1 - C_T / (8 (sigma/D)^2)), as pinned by C4.
Definition Kernel.h:70
Definition WakeTypes.h:38
double sign
-1 for a mirror image, +1 for a translated one.
Definition Kernel.h:152
double offset
m.
Definition Kernel.h:151
double QueryDepth(double z) const
Depth at which the source's deficit equals the image's deficit at depth z, m.
Definition Kernel.h:155
double ImageDepth(double z) const
Depth of the image of a source at depth z, m (the inverse of QueryDepth()).
Definition Kernel.h:158
int count
Number of planes, 0 to 2.
Definition Kernel.h:131
double z[2]
Depths of the planes, m: 0 (the free surface) if params.surfaceImage, then params....
Definition Kernel.h:132
double point[1+ImageSet::kMaxImages][3]
The query points, relative to the source at t0.
Definition Kernel.h:193
int count
1 + the number of images.
Definition Kernel.h:192
double sign[1+ImageSet::kMaxImages]
1 for index 0, ImageMap::sign for an image (a jet flips its vertical velocity with it).
Definition Kernel.h:194
WakeQueryRegion region[1+ImageSet::kMaxImages]
The regions, the first count of them used.
Definition Kernel.h:216
int count
1 + the number of images.
Definition Kernel.h:215
int count
Number of images, 0 to kMaxImages.
Definition Kernel.h:168
static constexpr int kMaxImages
The most images a source has (two levels, R98).
Definition Kernel.h:166
ImageMap maps[kMaxImages]
The images: the first level (MirrorPlanes()), then the second.
Definition Kernel.h:169
double sigma
Gaussian width sigma across the wake axis, m.
Definition Kernel.h:233
double amplitude
Centreline deficit, the amplitude of the Gaussian.
Definition Kernel.h:232
Definition WakeTypes.h:104
Definition WakeField.h:23