FhSim  3.1.0
Marine systems simulation
Loading...
Searching...
No Matches
Kernel.h
1#pragma once
4
5#include <marenv/wake/WakeField.h>
6#include <marenv/wake/WakeTypes.h>
7
8namespace marenv::wake
9{
62double ElementaryDeficit(const ElementarySource& source, const KernelParams& params, const double pos[3]);
63
75double OnsetRamp(double x, double xStart, double length);
76
86void Validate(const KernelParams& params);
87
96{
97 int count;
98 double z[2];
99};
100
106
116{
117 double offset;
118 double sign;
119
121 double QueryDepth(double z) const { return offset + sign * z; }
122
124 double ImageDepth(double z) const { return sign * (z - offset); }
125};
126
131{
132 static constexpr int kMaxImages = 4;
133
134 int count;
136};
137
150
157{
158 int count;
161};
162
172ImageQueries MakeImageQueries(const ImageSet& images, const double pos[3], const double shift[3]);
173
184
186ImageRegions MakeImageRegions(const ImageSet& images, const WakeQueryRegion& region);
187
192
197{
198 double amplitude;
199 double sigma;
200};
201
211{
212public:
215 KernelProfile(const ElementarySource& source, const KernelParams& params);
216
218 double XStart() const { return m_xStart; }
219
221 KernelCentreline At(double x) const;
222
230 double PeakAmplitude(double xFrom, double xTo) const;
231
232private:
234 double UnrampedAmplitude(double x) const;
235
237 double CentrelineAmplitude(double x, double pinnedAmplitude) const;
238
240 double LinearSigma(double x) const;
241
243 double Sigma(double x) const;
244
245 double m_diameter;
246 double m_expansion;
247 double m_xStart;
248 double m_rampLength;
249 double m_thrustCoefficient;
250 double m_nearWakeDeficit;
251 double m_epsilon;
252 double m_plateau;
253 double m_plateauEnd;
254 double m_blendEnd;
255 bool m_porous;
256 double m_farWakeStart;
257 double m_farWakeSigma;
258};
259
267double ElementaryDeficit(const ElementarySource& source, const KernelProfile& profile, const double pos[3]);
268} // namespace marenv::wake
Definition Kernel.h:211
KernelProfile(const ElementarySource &source, const KernelParams &params)
KernelCentreline At(double x) const
Centreline amplitude, the onset ramp included, and sigma at x >= x_start, m along flowDir.
double XStart() const
x_start = max(xStartFactor D, xStartMin), m.
Definition Kernel.h:218
double PeakAmplitude(double xFrom, double xTo) const
ImageQueries MakeImageQueries(const ImageSet &images, const double pos[3], const double shift[3])
double OnsetRamp(double x, double xStart, double length)
double ElementaryDeficit(const ElementarySource &source, const KernelParams &params, const double pos[3])
void Validate(const KernelParams &params)
ImageSet MirrorImages(const KernelParams &params)
ElementarySource ImageOf(const ImageMap &map, const ElementarySource &source)
ImagePlanes MirrorPlanes(const KernelParams &params)
Definition WakeTypes.h:36
Definition Kernel.h:116
double sign
-1 for a mirror image, +1 for a translated one.
Definition Kernel.h:118
double offset
m.
Definition Kernel.h:117
double QueryDepth(double z) const
Depth at which the source's deficit equals the image's deficit at depth z, m.
Definition Kernel.h:121
double ImageDepth(double z) const
Depth of the image of a source at depth z, m (the inverse of QueryDepth()).
Definition Kernel.h:124
Definition Kernel.h:96
int count
Number of planes, 0 to 2.
Definition Kernel.h:97
double z[2]
Depths of the planes, m: 0 (the free surface) if params.surfaceImage, then params....
Definition Kernel.h:98
Definition Kernel.h:157
double point[1+ImageSet::kMaxImages][3]
The query points, relative to the source at t0.
Definition Kernel.h:159
int count
1 + the number of images.
Definition Kernel.h:158
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:160
Definition Kernel.h:180
WakeQueryRegion region[1+ImageSet::kMaxImages]
The regions, the first count of them used.
Definition Kernel.h:182
int count
1 + the number of images.
Definition Kernel.h:181
Definition Kernel.h:131
int count
Number of images, 0 to kMaxImages.
Definition Kernel.h:134
static constexpr int kMaxImages
The most images a source has (two levels, R98).
Definition Kernel.h:132
ImageMap maps[kMaxImages]
The images: the first level (MirrorPlanes()), then the second.
Definition Kernel.h:135
Definition Kernel.h:197
double sigma
Gaussian width sigma across the wake axis, m.
Definition Kernel.h:199
double amplitude
Centreline deficit, the amplitude of the Gaussian.
Definition Kernel.h:198
Definition WakeTypes.h:102
Definition WakeField.h:23