MAIA bb96820c
Multiphysics at AIA
Loading...
Searching...
No Matches
acasolver.h
Go to the documentation of this file.
1// Copyright (C) 2024 The m-AIA AUTHORS
2//
3// This file is part of m-AIA (https://git.rwth-aachen.de/aia/m-AIA/m-AIA)
4//
5// SPDX-License-Identifier: LGPL-3.0-only
6
7#ifndef ACASOLVER_H_
8#define ACASOLVER_H_
9
10#include "COMM/mpioverride.h"
11#include "INCLUDE/maiamacro.h"
12#include "INCLUDE/maiatypes.h"
13#include "IO/parallelio.h"
14#include "UTIL/debug.h"
15#include "UTIL/functions.h"
17#include "acapostprocessing.h"
19#include "compiler_config.h"
20#include "solver.h"
21
22
23namespace maia {
24namespace acoustic {
25
26// Create struct for easy timer identification
27struct Timers_ {
28 // Enum to store timer "names"
29 enum {
43
44 // Special enum value used to initialize timer array
45 _count
46 };
47};
48
57};
58
59struct SourceVars {
60 MFloat* rho = nullptr;
61 MFloat* u = nullptr;
62 MFloat* v = nullptr;
63 MFloat* w = nullptr;
64 MFloat* p = nullptr;
65};
66
67} // namespace acoustic
68} // namespace maia
69
70
77template <MInt nDim>
78class AcaSolver : public Solver {
79 // Types
80 private:
86
91 };
92
93 // Methods
94 public:
95 AcaSolver(const MInt solverId, const MPI_Comm comm);
96 ~AcaSolver() override {
98 RECORD_TIMER_STOP(m_timers[Timers::SolverType]);
99 };
100
101 MBool solutionStep() override;
103 MBool isActive() const override { return true; } // All ranks are active
104
105 void initSolver() override;
106 void finalizeInitSolver() override{};
107
108 // Required to override but should not be used
109 MFloat time() const override {
110 m_log << "WARNING: Empty body of AcaSolver::time() called" << std::endl;
111 return NAN;
112 }
113 MInt noVariables() const override { return 0; }
114 MInt noInternalCells() const override { return 0; }
115 void preTimeStep() override {}
116 void postTimeStep() {}
117 virtual void saveSolverSolution(const MBool, const MBool){};
118 virtual void cleanUp(){};
119
120 // Solver internal methods
121 private:
122 // Constructor methods
123 void initTimers();
124 void averageTimer();
127
130
132 MBool hasSurface(const MInt surfaceId) { return m_noSurfaceElements.at(surfaceId) > 0; }
133
135 MInt noSurfaceElements(const MInt surfaceId) { return m_noSurfaceElements.at(surfaceId); }
136
138 MInt totalNoSurfaceElements() { return std::accumulate(m_noSurfaceElements.begin(), m_noSurfaceElements.end(), 0); }
139
142 return std::accumulate(&m_noSurfaceElements.at(0), &m_noSurfaceElements.at(sId), 0);
143 }
144
147
155 MInt a_localObserverId(const MInt globalObserverId) {
156 if(globalObserverId < m_offsetObserver || (m_offsetObserver + m_noObservers) < globalObserverId) {
157 return -1;
158 } else {
159 return globalObserverId - m_offsetObserver;
160 }
161 };
163 MInt a_globalObserverId(const MInt localObserverId) { return localObserverId + m_offsetObserver; };
165 MFloat a_globalObserverCoordinate(const MInt globalObserverId, const MInt dir) {
166 return m_globalObserverCoordinates[globalObserverId * nDim + dir];
167 };
169 std::array<MFloat, nDim> getGlobalObserverCoordinates(const MInt globalObserverId) {
170 std::array<MFloat, nDim> coord;
171 for(MInt dir = 0; dir < nDim; dir++) {
172 coord[dir] = a_globalObserverCoordinate(globalObserverId, dir);
173 }
174 return coord;
175 };
177 MInt getObserverDomainId(const MInt globalObserverId) {
178 const MInt minNoObsPerDomain = globalNoObservers() / noDomains();
179 const MInt remainderObs = globalNoObservers() % noDomains();
180 if(globalObserverId < remainderObs * (minNoObsPerDomain + 1)) {
181 return globalObserverId / (minNoObsPerDomain + 1);
182 } else {
183 return (globalObserverId - remainderObs) / minNoObsPerDomain;
184 }
185 };
186
188 void initObserverPoints();
189
191 void initParallelization();
193 void distributeObservers();
194
196 MString getSurfaceDataFileName(const MInt surfaceId, const MInt fileNo);
197 void readSurfaceData();
198 void readSurfaceDataFromFile(const MInt surfaceId);
199 void storeSurfaceData(const MInt surfaceId);
200 void readNoSegmentsAndSamples(const MInt surfaceId, MInt& noSegments, MInt& noSamples, MString& inputFileName);
201
203 inline void printMessage(const MString msg) {
204 m_log << msg << std::endl;
205 if(domainId() == 0) std::cout << msg << std::endl;
206 };
207
209 void calcSourceTerms();
210 void calcWindowFactors(MFloat* const p_window);
213 void calcFrequencies();
214 void calcSurfaceIntegralsForObserver(const std::array<MFloat, nDim> coord, MFloat* const p_complexVariables);
215 void calcSurfaceIntegralsAtSourceTime(const MInt globalObserverId);
216 MFloat calcTimeDerivative(const MInt segmentId, const MInt varId, const MInt tau);
217 void interpolateFromSourceToObserverTime(const MFloat distMinObservers, MFloat* const p_perturbedFWH);
218 void combineSurfaceIntegrals(const MInt globalObserverId, MFloat* const p_complexVariables);
219 void combineSurfaceIntegralsInTime(const MInt globalObserverId, MFloat* const p_perturbedFWH);
220 void calcMinDistanceForObservers(MFloat* const distMinObservers);
224 void saveObserverSignals();
225 void loadObserverSignals();
227
229 void FastFourierTransform(MFloat* dataArray, const MInt size, const MInt dir, MFloat* result, const MBool inPlace);
230 void DiscreteFourierTransform(MFloat* dataArray, const MInt size, const MInt dir, MFloat* result,
231 const MBool inPlace);
233
235 void calcSourceTermsFwhFreq(const MInt segmentId);
236 void calcSourceTermsFwhTime(const MInt segmentId);
237
239 void transformCoordinatesToFlowDirection2D(MFloat* const fX, MFloat* const fY);
240 void transformCoordinatesToFlowDirection3D(MFloat* const fX, MFloat* const fY, MFloat* const fZ);
241 void transformBackToOriginalCoordinate2D(MFloat* const fX, MFloat* const fY);
242 void transformBackToOriginalCoordinate3D(MFloat* const fX, MFloat* const fY, MFloat* const fZ);
243
245 void generateSurfaces();
246 void generateSurfacePlane(const MInt sId);
247 void generateSurfaceCircle(const MInt sId);
248 MInt readNoSegmentsSurfaceGeneration(const MInt sId, std::vector<MInt>& noSegments, const MInt lengthCheck = -1);
249
251 void generateSurfaceData();
253 void genMonopoleAnalytic2D(const MFloat* coord, const SourceParameters& param, SourceVars& vars);
254 void genMonopoleAnalytic3D(const MFloat* coord, const SourceParameters& param, SourceVars& vars);
256 void genDipoleAnalytic2D(const MFloat* coord, const SourceParameters& param, SourceVars& vars);
257 void genDipoleAnalytic3D(const MFloat* coord, const SourceParameters& param, SourceVars& vars);
259 void genQuadrupoleAnalytic2D(const MFloat* coord, const SourceParameters& param, SourceVars& vars);
260 void genQuadrupoleAnalytic3D(const MFloat* coord, const SourceParameters& param, SourceVars& vars);
263 SourceVars& sourceVars);
264
266 void applySymmetryBc(const std::array<MFloat, nDim> coord, MFloat* const p_complexVariables);
267
268 // void genSurfaceDataNumeric2D(const MInt segmentId, const SourceParameters& param);
269 // void genSurfaceDataNumeric3D(const MInt segmentId, const SourceParameters& &param);
270
271 // Postprocessing operations
272 std::vector<std::unique_ptr<AcaPostProcessing>> m_post;
274
275 // Change the non-dimensionalizion of input data from a previous simulation
279 void computeDt();
280
281 // Accuracy computation
282 void computeAccuracy();
283
287
289
299
303 std::vector<MInt> m_surfaceIds{};
304
308
310 std::vector<MInt> m_noSurfaceElements{};
311
314
316 std::vector<MInt> m_noSurfaceElementsGlobal{};
317
319 std::vector<MInt> m_surfaceElementOffsets{};
320
322 std::vector<MPI_Comm> m_mpiCommSurface{};
324 std::vector<MInt> m_noDomainsSurface{};
326 std::vector<MInt> m_domainIdSurface{};
327
329 std::vector<MFloat> m_surfaceWeightingFactor{};
330
332 std::vector<MString> m_surfaceInputFileName{};
333
342
345
350
353
355 std::map<MString, MInt> m_inputVars{};
356
361
364
367
368 std::vector<MFloat> m_globalObserverCoordinates;
370
373
375 std::array<MFloat, nDim * nDim> m_transformationMatrix;
377
381
384
389
390
393
396
399
402
406
410
412 std::vector<MFloat> m_Analyticfreq{};
413
415 std::vector<MFloat> m_rmsP_Analytic{};
416
418 MFloat m_dt = -1.0;
419
423 MFloat m_Ma = -1.0;
426
427 static constexpr MFloat m_gamma = 1.4; // isentropic exponent
428
431
433 std::vector<MFloat> m_times{};
434 std::vector<MFloat> m_frequencies{};
436
439 std::vector<MInt> m_postprocessingOps{};
440
443
444 // Timers
445 // Timer group which holds all solver-wide timers
447 // Stores all solver-wide timers
448 std::array<MInt, Timers::_count> m_timers{};
449
451 // Hold indices for variables for different formulations
452 struct FWH {
453 // Flow variables: u, v, w, rho, p
454 static constexpr const MInt U = 0;
455 static constexpr const MInt V = 1;
456 static constexpr const MInt W = nDim - 1;
457 static constexpr const MInt RHO = nDim;
458 static constexpr const MInt P = nDim + 1;
459
460 // Source terms
461 static constexpr const MInt FX = nDim + 2;
462 static constexpr const MInt FY = nDim + 3;
463 static constexpr const MInt FZ = 2 * nDim + 1;
464 static constexpr const MInt Q = 2 * nDim + 2;
465 // Number of variables
466 static constexpr const MInt noVars = 2 * nDim + 3;
467
468 // Complex variables
469 static constexpr const MInt FX_C = 0;
470 static constexpr const MInt FY_C = 1;
471 static constexpr const MInt FZ_C = nDim - 1;
472 static constexpr const MInt Q_C = nDim;
473 // Number of complex variables
474 static constexpr const MInt noComplexVars = nDim + 1;
475 };
476
477 struct FWH_TIME {
478 // Flow variables: u, v, w, rho, p
479 static constexpr const MInt U = 0;
480 static constexpr const MInt V = 1;
481 static constexpr const MInt W = nDim - 1;
482 static constexpr const MInt RHO = nDim;
483 static constexpr const MInt P = nDim + 1;
484
485 // Surface velocities
486 static constexpr const MInt surfMX = nDim + 2;
487 static constexpr const MInt surfMY = nDim + 3;
488 static constexpr const MInt surfMZ = 2 * nDim + 1;
489
490 // Source terms
491 static constexpr const MInt srcUn = 2 * nDim + 2;
492 static constexpr const MInt srcLX = 2 * nDim + 3;
493 static constexpr const MInt srcLY = 2 * nDim + 4;
494 static constexpr const MInt srcLZ = 3 * nDim + 2;
495
496 // Source-Time FW-H varaiables
497 static constexpr const MInt timeObs = 3 * nDim + 3;
498 static constexpr const MInt fwhPP = 3 * nDim + 4;
499
500 // Number of variables
501 static constexpr const MInt noVars = 3 * nDim + 5;
502 };
503
504 struct FWH_APE {
505 // Perturbed APE variables: u', v', w', p'
506 static constexpr const MInt UP = 0;
507 static constexpr const MInt VP = 1;
508 static constexpr const MInt WP = nDim - 1;
509 static constexpr const MInt PP = nDim;
510 // Source terms
511 static constexpr const MInt FX = nDim + 1;
512 static constexpr const MInt FY = nDim + 2;
513 static constexpr const MInt FZ = 2 * nDim;
514 static constexpr const MInt Q = 2 * nDim + 1;
515 // Number of variables
516 static constexpr const MInt noVars = 2 * nDim + 2;
517
518 // Complex variables
519 static constexpr const MInt FX_C = 0;
520 static constexpr const MInt FY_C = 1;
521 static constexpr const MInt FZ_C = nDim - 1;
522 static constexpr const MInt Q_C = nDim;
523 // Number of complex variables
524 static constexpr const MInt noComplexVars = nDim + 1;
525 };
527
528 // Hold indices for different postprocessing operations
529 struct PP {
530 static constexpr const MInt RMS_PRESSURE = 0;
531 static constexpr const MInt OASPL = 1;
532 static constexpr const MInt SPL = 2;
533 static constexpr const MInt pABS = 3;
534 static constexpr const MInt calcObsPress = 4;
535 };
536
537 // Hold indices for different window types
538 struct WINDOW {
539 static constexpr const MInt NONE = 0;
540 static constexpr const MInt HANNING = 1;
541 static constexpr const MInt HAMMING = 2;
542 static constexpr const MInt MODHANNING = 3;
543
544 static const std::array<MString, 4> windowNames;
545 };
546
547 // Hold indices for different transformation types
548 struct FOURIER {
549 static constexpr const MInt DFT = 0;
550 static constexpr const MInt FFT = 1;
551 };
552
554 struct AcaSymBc {
555 std::array<MFloat, nDim> origin;
556 std::array<MFloat, nDim> normal;
557 };
558 std::vector<AcaSymBc> m_symBc;
559};
560
561#endif // ACASOLVER_H_
Acoustic extrapolation of near/near-far field data to the true far-field using an integral method (cu...
Definition: acasolver.h:78
std::array< MInt, Timers::_count > m_timers
Definition: acasolver.h:448
MInt getObserverDomainId(const MInt globalObserverId)
Get domain id of (global) observer.
Definition: acasolver.h:177
virtual void saveSolverSolution(const MBool, const MBool)
Definition: acasolver.h:117
void transformCoordinatesToFlowDirection3D(MFloat *const fX, MFloat *const fY, MFloat *const fZ)
Definition: acasolver.cpp:2006
MInt m_noPostprocessingOps
Post Processing of observer signals.
Definition: acasolver.h:438
MBool m_generateObservers
Enable observer point generation (instead of reading from file)
Definition: acasolver.h:388
void readNoSegmentsAndSamples(const MInt surfaceId, MInt &noSegments, MInt &noSamples, MString &inputFileName)
Read the number of segments and samples for the given surface id.
Definition: acasolver.cpp:2994
void generateSurfaceData()
Generation of analytical input data.
Definition: acasolver.cpp:3924
MInt m_sampleStride
Stride of used samples in input data files.
Definition: acasolver.h:339
MFloat a_globalObserverCoordinate(const MInt globalObserverId, const MInt dir)
Accessor for global observer coordinates.
Definition: acasolver.h:165
MInt m_noComplexVariables
Definition: acasolver.h:352
void loadObserverSignals()
Load the observer signals from a file for further postprocessing.
Definition: acasolver.cpp:2477
void applySymmetryBc(const std::array< MFloat, nDim > coord, MFloat *const p_complexVariables)
Symmetry boundary condition.
Definition: acasolver.cpp:4547
MFloat m_cInfty
Non-dimensionalization variables.
Definition: acasolver.h:408
void initConversionFactors()
Initialize the conversion factors required to convert between.
Definition: acasolver.cpp:4721
MInt noSamples()
Return number of samples (i.e. number of time steps)
Definition: acasolver.h:146
void interpolateFromSourceToObserverTime(const MFloat distMinObservers, MFloat *const p_perturbedFWH)
Interpolate the observer pressure signal from source time to observer time using the advanced time ap...
Definition: acasolver.cpp:2123
std::vector< MInt > m_postprocessingOps
Definition: acasolver.h:439
void storeSurfaceData(const MInt surfaceId)
Store the surface data. Note: used for validating the data input and for the output of generated data...
Definition: acasolver.cpp:3428
virtual void cleanUp()
Definition: acasolver.h:118
maia::acoustic::SourceParameters m_sourceParameters
Parameter vector.
Definition: acasolver.h:398
std::vector< MInt > m_noSurfaceElements
Number of (local) surface elements for each surface.
Definition: acasolver.h:310
static constexpr MFloat m_gamma
Definition: acasolver.h:427
MFloat m_lambdaZero
Wave length lambda.
Definition: acasolver.h:404
MInt m_fwhMeanStateType
Definition: acasolver.h:349
MBool m_generateSurfaceData
Enable generation of analytical surface data.
Definition: acasolver.h:392
void calcObsPressureAnalytic()
Definition: acasolver.cpp:2583
MInt a_globalObserverId(const MInt localObserverId)
Return global observer id.
Definition: acasolver.h:163
void genQuadrupoleAnalytic2D(const MFloat *coord, const SourceParameters &param, SourceVars &vars)
Quadrupole.
Definition: acasolver.cpp:4307
std::vector< MFloat > m_times
Storage for times and frequencies.
Definition: acasolver.h:433
MInt m_offsetObserver
Collector for (local) observer data.
Definition: acasolver.h:371
void combineSurfaceIntegralsInTime(const MInt globalObserverId, MFloat *const p_perturbedFWH)
Combine the FWH surface integrals of the time domain method of all ranks.
Definition: acasolver.cpp:2253
void genDipoleAnalytic2D(const MFloat *coord, const SourceParameters &param, SourceVars &vars)
Dipole.
Definition: acasolver.cpp:4160
MInt m_noGlobalObservers
Number of samples.
Definition: acasolver.h:366
MBool m_allowMultipleSurfacesPerRank
Allow multiple surfaces per rank.
Definition: acasolver.h:313
MFloat time() const override
Return the time.
Definition: acasolver.h:109
std::array< MFloat, nDim > getGlobalObserverCoordinates(const MInt globalObserverId)
Accessor for global observer coordinates.
Definition: acasolver.h:169
void checkNoSamplesPotencyOfTwo()
Definition: acasolver.cpp:4864
void changeDimensionsObserverData()
Definition: acasolver.cpp:4816
ObserverDataCollector m_observerData
Coordinates of (global) observer points.
Definition: acasolver.h:369
void calcSurfaceIntegralsAtSourceTime(const MInt globalObserverId)
Calculate the FWH surface integrals for a certain observer using the time-domain formulation.
Definition: acasolver.cpp:1866
MInt totalNoSurfaceElements()
Return total number of (local) surfaces elements.
Definition: acasolver.h:138
MInt m_sampleOffset
Offset in input data files from which to start reading samples.
Definition: acasolver.h:341
MInt m_acousticMethod
Acoustic extrapolation method to use, see enum ExtrapolationMethods in enums.h.
Definition: acasolver.h:347
std::vector< MFloat > m_surfaceWeightingFactor
Weighting factor for each surface (for surface averaging)
Definition: acasolver.h:329
MInt m_transformationType
Fourier type.
Definition: acasolver.h:363
MFloat calcTimeDerivative(const MInt segmentId, const MInt varId, const MInt tau)
Definition: acasolver.cpp:2048
std::vector< MString > m_surfaceInputFileName
Surface input file names that were used for sampling.
Definition: acasolver.h:332
MInt noSurfaces()
Return number of surfaces.
Definition: acasolver.h:129
std::vector< AcaSymBc > m_symBc
Definition: acasolver.h:558
void transformBackToOriginalCoordinate2D(MFloat *const fX, MFloat *const fY)
Definition: acasolver.cpp:2020
MInt m_timerGroup
Definition: acasolver.h:446
MBool m_isFinished
Definition: acasolver.h:286
MInt a_localObserverId(const MInt globalObserverId)
Return local observer id.
Definition: acasolver.h:155
MBool isActive() const override
Definition: acasolver.h:103
MBool m_useMergedInputFile
Definition: acasolver.h:305
MFloat m_rhoInfty
Definition: acasolver.h:409
void genQuadrupoleAnalytic3D(const MFloat *coord, const SourceParameters &param, SourceVars &vars)
3D quadrupole analytic
Definition: acasolver.cpp:4409
void setNumericalProperties()
Read/set all numerical properties.
Definition: acasolver.cpp:421
void generateSurfaceCircle(const MInt sId)
Generate a circular surface in 2D.
Definition: acasolver.cpp:3853
void distributeObservers()
Distribute observers on all ranks.
Definition: acasolver.cpp:2333
MInt m_noSurfaces
Number of surfaces.
Definition: acasolver.h:301
MBool solverConverged()
Definition: acasolver.h:102
MInt noObservers()
Return local number of observer points.
Definition: acasolver.h:149
void calcSourceTermsFwhTime(const MInt segmentId)
Calculate FWH source terms for the time domain FWH formulation Reference: [1] Brentner,...
Definition: acasolver.cpp:1062
void genDipoleAnalytic3D(const MFloat *coord, const SourceParameters &param, SourceVars &vars)
3D dipole analytic
Definition: acasolver.cpp:4233
void postprocessObserverSignals()
Postprocessing of observer signals.
Definition: acasolver.cpp:2531
MInt noVariables() const override
Return the number of variables.
Definition: acasolver.h:113
std::vector< MInt > m_surfaceIds
Ids of the surface input file.
Definition: acasolver.h:303
void calcFrequencies()
Calculate the frequencies.
Definition: acasolver.cpp:1549
void genMonopoleAnalytic3D(const MFloat *coord, const SourceParameters &param, SourceVars &vars)
3D analytic monopole generation
Definition: acasolver.cpp:4097
void calcSurfaceIntegralsForObserver(const std::array< MFloat, nDim > coord, MFloat *const p_complexVariables)
Calculate the FWH surface integrals for a certain observer location.
Definition: acasolver.cpp:1573
MBool solutionStep() override
Main compute method to perform acoustic far-field prediction.
Definition: acasolver.cpp:807
MInt m_inputFileIndexStart
Definition: acasolver.h:306
std::vector< MInt > m_surfaceElementOffsets
Local surface element offsets for each surface.
Definition: acasolver.h:319
void calculateObserverInFrequency()
Calculate the observer signals in frequency domain.
Definition: acasolver.cpp:2294
MBool m_FastFourier
Can FFT be used?
Definition: acasolver.h:430
std::array< MFloat, nDim *nDim > m_transformationMatrix
Number of local observer.
Definition: acasolver.h:375
std::map< MString, MInt > m_inputVars
Set of input variables.
Definition: acasolver.h:355
void windowAndTransformSources()
Apply window function to source terms and transform into frequency domain.
Definition: acasolver.cpp:1253
MBool m_hasTimes
Definition: acasolver.h:435
struct AcaSolver::ConversionFactors m_input2Aca
void generateSurfacePlane(const MInt sId)
Generate a surface plane (Cartesian).
Definition: acasolver.cpp:3581
void DiscreteFourierTransform(MFloat *dataArray, const MInt size, const MInt dir, MFloat *result, const MBool inPlace)
Discrete Fourier transform (computational expensive O(n^2) instead of O(n*logn) compared to FFT)
Definition: acasolver.cpp:1500
void generateSurfaces()
Generation of surfaces.
Definition: acasolver.cpp:3493
MFloat m_MaDim
Mach number used for change of nondimensionalization.
Definition: acasolver.h:425
void saveObserverSignals()
Save the observer signals. Save observer data: 1. pressure data in time domain and 2....
Definition: acasolver.cpp:2388
std::vector< MFloat > m_frequencies
Definition: acasolver.h:434
MFloat m_Ma
Mach number.
Definition: acasolver.h:423
void calcSourceTerms()
Main compute functions.
Definition: acasolver.cpp:879
void genMonopoleAnalytic2D(const MFloat *coord, const SourceParameters &param, SourceVars &vars)
Monopole.
Definition: acasolver.cpp:4035
MInt localSurfaceOffset(const MInt sId)
Return local offset of a surface in m_surfaceData.
Definition: acasolver.h:141
MInt noInternalCells() const override
Return the number of internal cells within this solver.
Definition: acasolver.h:114
void changeDimensionsSurfaceData()
Change of the non-dimensionalization of input data from the stagnation state (0) non-dim....
Definition: acasolver.cpp:4784
void calcMinDistanceForObservers(MFloat *const distMinObservers)
Find the minimum distance from the surface elements to the observers.
Definition: acasolver.cpp:2069
MFloat m_MaVec[3]
Mach vector.
Definition: acasolver.h:421
MInt m_inputFileIndexEnd
Definition: acasolver.h:307
MInt m_windowType
Window type.
Definition: acasolver.h:358
MBool m_zeroFlowAngle
Definition: acasolver.h:376
MInt m_noObservers
Offset of local observer.
Definition: acasolver.h:372
void finalizeInitSolver() override
Definition: acasolver.h:106
void printMessage(const MString msg)
Info functions.
Definition: acasolver.h:203
void readSurfaceData()
Read the surface data (or generate for an analytical case)
Definition: acasolver.cpp:2925
MFloat m_dt
Constant time step size.
Definition: acasolver.h:418
MInt m_totalNoSamples
Total number of samples in input data files.
Definition: acasolver.h:337
void readSurfaceDataFromFile(const MInt surfaceId)
Read the data for one surface.
Definition: acasolver.cpp:3064
MInt readNoSegmentsSurfaceGeneration(const MInt sId, std::vector< MInt > &noSegments, const MInt lengthCheck=-1)
Determine the number of segments to be generated for a surface, returns the total number of segments ...
Definition: acasolver.cpp:3541
void initTimers()
Initialize solver timers.
Definition: acasolver.cpp:41
void initParallelization()
Initialize parallelization (distribution of surface segments on all domains)
Definition: acasolver.cpp:2672
MString m_observerFileName
File containing observer points.
Definition: acasolver.h:386
MInt globalNoObservers()
Return number of observer points.
Definition: acasolver.h:153
SurfaceDataCollector m_surfaceData
Collector for surface data.
Definition: acasolver.h:344
void initSolver() override
Initialize solver.
Definition: acasolver.cpp:28
void averageTimer()
Average all FWH timer over participating ranks.
Definition: acasolver.cpp:74
MFloat m_windowNormFactor
Normalization factor of window.
Definition: acasolver.h:360
void initObserverPoints()
Initialize observer points.
Definition: acasolver.cpp:4572
MInt m_fwhTimeShiftType
Definition: acasolver.h:348
MFloat m_lambdaMach
Definition: acasolver.h:405
std::vector< MFloat > m_rmsP_Analytic
Analytic rms pressure for accuracy function.
Definition: acasolver.h:415
void genVortexConvectionAnalytic2D(const MFloat *obsCoord, const SourceParameters &m_sourceParameters, SourceVars &sourceVars)
Inviscid vortex convection.
Definition: acasolver.cpp:4506
std::vector< MInt > m_noDomainsSurface
Surface local number of domains.
Definition: acasolver.h:324
MInt m_acaResultsNondimMode
Definition: acasolver.h:288
MBool m_acaPostprocessingMode
Definition: acasolver.h:441
void backtransformObservers()
Backtransform the observer frequency signals into the time domain.
Definition: acasolver.cpp:2348
MString m_outputFilePrefix
Input directory.
Definition: acasolver.h:380
maia::acoustic::SourceParameters SourceParameters
Definition: acasolver.h:83
std::vector< MInt > m_noSurfaceElementsGlobal
Total number of surface elements for each surface.
Definition: acasolver.h:316
MInt m_noVariables
Definition: acasolver.h:351
std::vector< MFloat > m_globalObserverCoordinates
Definition: acasolver.h:368
MBool m_storeSurfaceData
Prefix for all output files.
Definition: acasolver.h:383
void windowAndTransformObservers()
Apply window function to the observer time series data and transform it into frequency domain.
Definition: acasolver.cpp:1354
struct AcaSolver::ConversionFactors m_aca2Output
MString m_inputDir
I/O.
Definition: acasolver.h:379
MInt m_noSamples
Number of samples.
Definition: acasolver.h:335
void transformCoordinatesToFlowDirection2D(MFloat *const fX, MFloat *const fY)
Coordinate transformation.
Definition: acasolver.cpp:1994
MInt noSurfaceElements(const MInt surfaceId)
Return number of (local) surfaces elements for a surface.
Definition: acasolver.h:135
void preTimeStep() override
Definition: acasolver.h:115
std::vector< MInt > m_domainIdSurface
Surface local domain id.
Definition: acasolver.h:326
std::vector< MFloat > m_Analyticfreq
Analytic Fourier Transformation, also used for Validation.
Definition: acasolver.h:412
maia::acoustic::SourceVars SourceVars
Definition: acasolver.h:84
MBool hasSurface(const MInt surfaceId)
Return if this rank has data of this surface.
Definition: acasolver.h:132
void calcWindowFactors(MFloat *const p_window)
Compute the window function factors and the normalization factor.
Definition: acasolver.cpp:1195
@ NONDIMACA
Definition: acasolver.h:88
@ NONDIMSTAGNATION
Definition: acasolver.h:89
@ NONDIMLB
Definition: acasolver.h:90
std::vector< std::unique_ptr< AcaPostProcessing > > m_post
Definition: acasolver.h:272
~AcaSolver() override
Definition: acasolver.h:96
void setInputOutputProperties()
Read/set all I/O related properties.
Definition: acasolver.cpp:107
MFloat m_omega_factor
Omega factor.
Definition: acasolver.h:401
void postTimeStep()
Definition: acasolver.h:116
void FastFourierTransform(MFloat *dataArray, const MInt size, const MInt dir, MFloat *result, const MBool inPlace)
Functions for Fourier Transformation.
Definition: acasolver.cpp:1411
void calculateObserverInTime()
Calculate the observer signals in time domain.
Definition: acasolver.cpp:2309
MInt observerOffset()
Return local number of observer points.
Definition: acasolver.h:151
std::vector< MPI_Comm > m_mpiCommSurface
Surface local MPI communicators.
Definition: acasolver.h:322
MString getSurfaceDataFileName(const MInt surfaceId, const MInt fileNo)
IO methods.
Definition: acasolver.cpp:2913
void transformBackToOriginalCoordinate3D(MFloat *const fX, MFloat *const fY, MFloat *const fZ)
Definition: acasolver.cpp:2033
void combineSurfaceIntegrals(const MInt globalObserverId, MFloat *const p_complexVariables)
Combine the FWH surface integrals of all ranks.
Definition: acasolver.cpp:2203
void calcSourceTermsFwhFreq(const MInt segmentId)
Source term compute kernels.
Definition: acasolver.cpp:909
MInt m_sourceType
Source Type.
Definition: acasolver.h:395
MString m_acaPostprocessingFile
Definition: acasolver.h:442
void computeAccuracy()
Definition: acasolver.cpp:4892
void computeDt()
Definition: acasolver.cpp:4845
Parent class of all solvers This class is the base for all solvers. I.e. all solver class (e....
Definition: solver.h:29
virtual MInt domainId() const
Return the domainId (rank)
Definition: solver.h:383
MInt solverId() const
Return the solverId.
Definition: solver.h:425
virtual MInt noDomains() const
Definition: solver.h:387
InfoOutFile m_log
int32_t MInt
Definition: maiatypes.h:62
std::basic_string< char > MString
Definition: maiatypes.h:55
double MFloat
Definition: maiatypes.h:52
bool MBool
Definition: maiatypes.h:58
Namespace for auxiliary functions/classes.
Hold data for symmetry boundary condition.
Definition: acasolver.h:554
std::array< MFloat, nDim > origin
Definition: acasolver.h:555
std::array< MFloat, nDim > normal
Definition: acasolver.h:556
Conversion-Factors for the input conversion.
Definition: acasolver.h:291
static constexpr const MInt FFT
Definition: acasolver.h:550
static constexpr const MInt DFT
Definition: acasolver.h:549
static constexpr const MInt WP
Definition: acasolver.h:508
static constexpr const MInt FX
Definition: acasolver.h:511
static constexpr const MInt FZ
Definition: acasolver.h:513
static constexpr const MInt FY_C
Definition: acasolver.h:520
static constexpr const MInt Q
Definition: acasolver.h:514
static constexpr const MInt UP
Definition: acasolver.h:506
static constexpr const MInt noVars
Definition: acasolver.h:516
static constexpr const MInt Q_C
Definition: acasolver.h:522
static constexpr const MInt FZ_C
Definition: acasolver.h:521
static constexpr const MInt noComplexVars
Definition: acasolver.h:524
static constexpr const MInt FY
Definition: acasolver.h:512
static constexpr const MInt VP
Definition: acasolver.h:507
static constexpr const MInt FX_C
Definition: acasolver.h:519
static constexpr const MInt surfMZ
Definition: acasolver.h:488
static constexpr const MInt srcLY
Definition: acasolver.h:493
static constexpr const MInt fwhPP
Definition: acasolver.h:498
static constexpr const MInt surfMX
Definition: acasolver.h:486
static constexpr const MInt noVars
Definition: acasolver.h:501
static constexpr const MInt timeObs
Definition: acasolver.h:497
static constexpr const MInt V
Definition: acasolver.h:480
static constexpr const MInt srcUn
Definition: acasolver.h:491
static constexpr const MInt W
Definition: acasolver.h:481
static constexpr const MInt U
Definition: acasolver.h:479
static constexpr const MInt RHO
Definition: acasolver.h:482
static constexpr const MInt srcLZ
Definition: acasolver.h:494
static constexpr const MInt srcLX
Definition: acasolver.h:492
static constexpr const MInt surfMY
Definition: acasolver.h:487
static constexpr const MInt P
Definition: acasolver.h:483
static constexpr const MInt FX
Definition: acasolver.h:461
static constexpr const MInt W
Definition: acasolver.h:456
static constexpr const MInt noVars
Definition: acasolver.h:466
static constexpr const MInt V
Definition: acasolver.h:455
static constexpr const MInt Q
Definition: acasolver.h:464
static constexpr const MInt Q_C
Definition: acasolver.h:472
static constexpr const MInt RHO
Definition: acasolver.h:457
static constexpr const MInt FZ_C
Definition: acasolver.h:471
static constexpr const MInt P
Definition: acasolver.h:458
static constexpr const MInt FZ
Definition: acasolver.h:463
static constexpr const MInt FY
Definition: acasolver.h:462
static constexpr const MInt U
Definition: acasolver.h:454
static constexpr const MInt noComplexVars
Definition: acasolver.h:474
static constexpr const MInt FY_C
Definition: acasolver.h:470
static constexpr const MInt FX_C
Definition: acasolver.h:469
static constexpr const MInt RMS_PRESSURE
Definition: acasolver.h:530
static constexpr const MInt OASPL
Definition: acasolver.h:531
static constexpr const MInt pABS
Definition: acasolver.h:533
static constexpr const MInt SPL
Definition: acasolver.h:532
static constexpr const MInt calcObsPress
Definition: acasolver.h:534
static constexpr const MInt MODHANNING
Definition: acasolver.h:542
static constexpr const MInt HANNING
Definition: acasolver.h:540
static constexpr const MInt NONE
Definition: acasolver.h:539
static constexpr const MInt HAMMING
Definition: acasolver.h:541
static const std::array< MString, 4 > windowNames
Definition: acasolver.h:544
Parameter for analytical acoustic source terms.
Definition: acasolver.h:50