VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
Passport2D.cpp
Go to the documentation of this file.
1/*--------------------------------*- VM2D -*-----------------*---------------*\
2| ## ## ## ## #### ##### | | Version 1.14 |
3| ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2026/03/06 |
4| ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------*
5| #### ## ## ## ## ## | Open Source Code |
6| ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D |
7| |
8| Copyright (C) 2017-2026 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova |
9*-----------------------------------------------------------------------------*
10| File name: Passport2D.cpp |
11| Info: Source code of VM2D |
12| |
13| This file is part of VM2D. |
14| VM2D is free software: you can redistribute it and/or modify it |
15| under the terms of the GNU General Public License as published by |
16| the Free Software Foundation, either version 3 of the License, or |
17| (at your option) any later version. |
18| |
19| VM2D is distributed in the hope that it will be useful, but WITHOUT |
20| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22| for more details. |
23| |
24| You should have received a copy of the GNU General Public License |
25| along with VM2D. If not, see <http://www.gnu.org/licenses/>. |
26\*---------------------------------------------------------------------------*/
27
28
39
40#include "Passport2D.h"
41
42#include "Preprocessor.h"
43#include "StreamParser.h"
44
45using namespace VM2D;
46
47
48
49// Функция-множитель, позволяющая моделировать разгон
50double PhysicalProperties::accelCft(double currentTime) const
51{
52 switch (typeAccel.second)
53 {
54 case 0: //импульсный старт
55 return 1.0;
56 case 1: //разгон потока по линейному закону
57 return (currentTime < timeAccel) ? (currentTime / timeAccel) : 1.0;
58 case 2: //разгон потока по косинусоиде
59 return (currentTime < timeAccel) ? 0.5 * (1.0 - cos(PI * currentTime / timeAccel)) : 1.0;
60 }
61
62 return 1.0;
63}//accelCft()
64
65
66
67
68//Конструктор
69Passport::Passport(VMlib::LogStream& infoStream, const std::string& _problemName, const size_t _problemNumber, const std::string& _filePassport, const std::string& _mechanics, const std::string& _defaults, const std::string& _switchers, const std::vector<std::string>& vars, const std::vector<std::string>& paramList)
70: PassportGen(infoStream, _problemName, _problemNumber, _filePassport, _mechanics, _defaults, _switchers, vars),
72{
73 fileFullName = _filePassport;
74 mechanicsFileFullName = _mechanics;
75 defaultsFileFullName = _defaults;
76 switchersFileFullName = _switchers;
77 varLine = vars;
78
79 bool readAll = ((paramList.size() == 1) && (paramList[0] == ""));
80
81
82 VMlib::LogStream emptyStream;
83 VMlib::LogStream& infoOrEmptyStream = readAll ? info : emptyStream;
84
85 if (
86 fileExistTest(fileFullName, infoOrEmptyStream, true, {"txt", "TXT"}) &&
87 fileExistTest(defaultsFileFullName, infoOrEmptyStream, true, { "txt", "TXT" }) &&
88 fileExistTest(switchersFileFullName, infoOrEmptyStream, true, { "txt", "TXT" }) &&
89 fileExistTest(mechanicsFileFullName, infoOrEmptyStream, true, { "txt", "TXT" })
90 )
91 {
92 std::string str = VMlib::StreamParser::VectorStringToString(vars);
93 std::stringstream varsStream(str);
94
95 std::stringstream mainStream;
97
98 std::stringstream mechanicsStream;
100
101 std::stringstream defaultsStream;
103
104 std::stringstream switchersStream;
106
107
108 GetParamsFromParser(mainStream, mechanicsStream, defaultsStream, switchersStream, varsStream, paramList);
109
110 if (readAll)
112
113 }
114}
115
116
117//Считывание всех параметров расчета из соответствующих потоков
119(
120 std::istream& mainStream,
121 std::istream& mechanicsStream,
122 std::istream& defaultStream,
123 std::istream& switcherStream,
124 std::istream& varsStream,
125 const std::vector<std::string> paramList
126)
127{
129
130 bool readAll = ((paramList.size() == 1) && (paramList[0] == ""));
131 std::vector<std::string> PR;
132 for (const auto& s : paramList)
133 PR.push_back(UP(s));
134
135
136 auto ifUpdate = [&](const std::string& checkString) {return (readAll || std::count(PR.begin(), PR.end(), UP(checkString))); };
137
138
139 // 1. Разбор паспорта в целом
140
141 //создаем парсер и связываем его с нужным потоком
142 std::unique_ptr<VMlib::StreamParser> parser;
143 parser.reset(new VMlib::StreamParser(info, "parser", mainStream, defaultStream, switcherStream, varsStream));
144
145 //считываем общие параметры
146 if (readAll)
147 parser->get("rho", physicalProperties.rho);
148
149 if (ifUpdate("vInf") || ifUpdate("vRef"))
150 {
151 if (ifUpdate("vInf"))
152 parser->get("vInf", physicalProperties.vInf);
153
154 parser->get("vRef", physicalProperties.vRef, &defaults::defaultVRef, false);
155
156 if (physicalProperties.vRef == 0.0)
157 {
158 if (physicalProperties.vInf.length() == 0.0)
159 {
160 info('e') << "Reference velocity should be non-zero!" << std::endl;
161 exit(1);
162 }
163 physicalProperties.vRef = physicalProperties.vInf.length();
164 }
165 }
166
167
168 //Считывание схемы разгона потока
169 if (readAll)
170 {
171 std::pair<std::pair<std::string, int>, std::string> velAccel;
172 bool defParamAccelVel = parser->get("accelVel", velAccel, &defaults::defaultVelAccel);
173 if (velAccel.first.second != -1)
174 {
175 physicalProperties.typeAccel = velAccel.first;
176 std::stringstream sstr(velAccel.second);
177 std::istream& istr(sstr);
178
179 std::unique_ptr<VMlib::StreamParser> parserAccel;
180
181 parserAccel.reset(new VMlib::StreamParser(info, "parserAccel", istr, defaultStream, switcherStream, varsStream));
182 bool defParamTime = parserAccel->get("timeAccel", physicalProperties.timeAccel, &defaults::defaultTimeAccel, false);
183 parserAccel->get("_DEFVAR_0", physicalProperties.timeAccel, &physicalProperties.timeAccel, defParamAccelVel && !defParamTime);
184 }
185 else
186 {
187 info('e') << "Velocity acceleration scheme <" << velAccel.first.first << "> is unknown" << std::endl;
188 exit(1);
189 }
190
192 if (!defParamAccelVel)
193 parser->get("timeAccel", physicalProperties.timeAccel, &defaults::defaultTimeAccel);
194 else
195 {
196 double tempTimeAccel;
197 if (parser->get("timeAccel", tempTimeAccel, &defaults::defaultTimeAccel, false))
198 {
199 info('e') << "timeAccel parameter is set twice!" << std::endl;
200 exit(1);
201 }
202 }
203 }
204
205 if (readAll)
206 {
207 parser->get("nu", physicalProperties.nu);
208
209 parser->get("timeStart", timeDiscretizationProperties.timeStart, &defaults::defaultTimeStart);
210 }
211
212 if (ifUpdate("timeStop"))
213 parser->get("timeStop", timeDiscretizationProperties.timeStop);
214
215 if (ifUpdate("dt"))
216 parser->get("dt", timeDiscretizationProperties.dt);
217
218 if (ifUpdate("nameLength"))
219 parser->get("nameLength", timeDiscretizationProperties.nameLength, &defaults::defaultNameLength);
220
221
222 //Считывание схемы сохранения файлов Vtx
223 if (ifUpdate("saveVtx"))
224 {
225 std::pair<std::pair<std::string, int>, std::string> saveVtx;
226 bool defParamSaveVtx = parser->get("saveVt?", saveVtx, &defaults::defaultSaveVtx);
227 if (saveVtx.first.second != -1)
228 {
229 timeDiscretizationProperties.fileTypeVtx = saveVtx.first;
230 std::stringstream sstr(saveVtx.second);
231 std::istream& istr(sstr);
232
233 std::unique_ptr<VMlib::StreamParser> parserSaveVtx;
234
235 parserSaveVtx.reset(new VMlib::StreamParser(info, "parserSaveVtx", istr, defaultStream, switcherStream, varsStream));
236 parserSaveVtx->get("_DEFVAR_0", timeDiscretizationProperties.saveVtxStep, &defaults::defaultSaveVtxStep, defParamSaveVtx);
237 }
238 else
239 {
240 std::stringstream ss;
241 ss << saveVtx.first.first;
242 int step;
243 ss >> step;
244 if (!ss.fail())
245 {
247 timeDiscretizationProperties.saveVtxStep = step;
248 }
249 else
250 {
251 info('e') << "Vtx file type <" << saveVtx.first.first << "> is unknown" << std::endl;
252 exit(1);
253 }
254 }
255 }
256
257 //Считывание схемы сохранения файлов VP
258 if (ifUpdate("saveVP"))
259 {
260 std::pair<std::pair<std::string, int>, std::string> saveVP;
261 bool defParamSaveVP = parser->get("saveVP", saveVP, &defaults::defaultSaveVP);
262 if (saveVP.first.second != -1)
263 {
264 timeDiscretizationProperties.fileTypeVP = saveVP.first;
265 std::stringstream sstr(saveVP.second);
266 std::istream& istr(sstr);
267
268 std::unique_ptr<VMlib::StreamParser> parserSaveVP;
269
270 parserSaveVP.reset(new VMlib::StreamParser(info, "parserSaveVP", istr, defaultStream, switcherStream, varsStream));
271 parserSaveVP->get("_DEFVAR_0", timeDiscretizationProperties.saveVPstep, &defaults::defaultSaveVPstep, defParamSaveVP);
272 }
273 else
274 {
275 std::stringstream ss;
276 ss << saveVP.first.first;
277 int step;
278 ss >> step;
279 if (!ss.fail())
280 {
282 timeDiscretizationProperties.saveVPstep = step;
283 }
284 else
285 {
286 info('e') << "VP file type <" << saveVP.first.first << "> is unknown" << std::endl;
287 exit(1);
288 }
289 }
290 }
291
292 if (readAll)
293 {
294 parser->get("revisePassportStep", timeDiscretizationProperties.revisePassportStep, &defaults::defaultRevisePassportStep);
295 parser->get("reviseParameters", timeDiscretizationProperties.reviseParameters, &defaults::defaultReviseParameters);
296
297 const std::vector<std::string> varParams = { UP("nameLength"), UP("timeStop"), UP("dt"), UP("vInf"), UP("vRef"), UP("coefEpsAst"), UP("saveVtx"), UP("saveVP")};
298 for (const auto& s : timeDiscretizationProperties.reviseParameters)
299 if (std::count(varParams.begin(), varParams.end(), UP(s)) == 0)
300 {
301 info('e') << "Parameter \"" << s << "\" can not be changable (i.e., re-readable)!" << std::endl;
302 exit(1);
303 }
304
305 }
306
307 if (readAll)
308 {
309 parser->get("rotateVpPoints", rotateAngleVpPoints, &defaults::rotateAngleVpPoints);
310 parser->get("saveVisStress", timeDiscretizationProperties.saveVisStress, &defaults::defaultSaveVisStress);
311 }
312
313 if (readAll)
314 {
315 double oldEpsilon;
316 parser->get("eps", oldEpsilon, &defaults::defaultSigma0);
317 if (oldEpsilon != 0)
318 {
319 info('e') << "Rename 'eps' parameter in passport file: 'eps' -> 'sigma0'" << std::endl;
320 exit(1);
321 }
322
323
324 parser->get("sigma0", wakeDiscretizationProperties.sigma0, &defaults::defaultSigma0);
325
326
327 parser->get("epscol", wakeDiscretizationProperties.epscol, &defaults::defaultEpsCol);
328 parser->get("distFar", wakeDiscretizationProperties.distFar, &defaults::defaultDistFar);
329 parser->get("delta", wakeDiscretizationProperties.delta, &defaults::defaultDelta);
330 parser->get("vortexPerPanel", wakeDiscretizationProperties.minVortexPerPanel, &defaults::defaultVortexPerPanel);
331 parser->get("maxGamma", wakeDiscretizationProperties.maxGamma, &defaults::defaultMaxGamma);
332
333 if (wakeDiscretizationProperties.maxGamma == 0.0)
334 wakeDiscretizationProperties.maxGamma = 1e+10;
335 }
336
337 if (ifUpdate("coefEpsAst"))
338 parser->get("coefEpsAst", wakeDiscretizationProperties.coefEpsAst, &defaults::defaultCoefEpsAst, readAll);
339
340 if (readAll)
341 {
342 parser->get("linearSystemSolver", numericalSchemes.linearSystemSolver, &defaults::defaultLinearSystemSolver);
343 if (numericalSchemes.linearSystemSolver.second == 1 || numericalSchemes.linearSystemSolver.second == 2)
344 parser->get("gmresEps", numericalSchemes.gmresEps);
345
346 if (numericalSchemes.linearSystemSolver.second == 2)
347 {
348 parser->get("fastGmresTheta", numericalSchemes.gmresTheta);
349 parser->get("fastGmresMultipoleOrder", numericalSchemes.gmresMultipoleOrder);
350 }
351
352 parser->get("velocityComputation", numericalSchemes.velocityComputation, &defaults::defaultVelocityComputation);
353
354 if (numericalSchemes.velocityComputation.second == 1)
355 {
356 parser->get("nbodyTheta", numericalSchemes.nbodyTheta);
357 parser->get("nbodyMultipoleOrder", numericalSchemes.nbodyMultipoleOrder);
358 }
359
360 //parser->get("wakeMotionIntegrator", numericalSchemes.wakeMotionIntegrator);
361 parser->get("boundaryConditionSatisfaction", numericalSchemes.boundaryCondition, &defaults::defaultBoundaryCondition);
362
363 parser->get("airfoilsDir", airfoilsDir, &defaults::defaultAirfoilsDir);
364 parser->get("wakesDir", wakesDir, &defaults::defaultWakesDir);
365
366 parser->get("fileWake", wakeDiscretizationProperties.fileWake, &defaults::defaultFileWake);
367 parser->get("fileSource", wakeDiscretizationProperties.fileSource, &defaults::defaultFileSource);
368
369 //Для обдува ветром, когда углы считаются по компасу
370 //parser->get("geographicalAngles", geographicalAngles, &defaults::defaultGeographicalAngles);
371 //if (geographicalAngles && (physicalProperties.vInf[1] != 0.0))
372 //{
373 // info('e') << "For geographical angles vInf should be horizontal; now vInf = " << physicalProperties.vInf << "." << std::endl;
374 // exit(1);
375 //}
376
377 parser->get("rotateForces", rotateForces, &defaults::defaultRotateForces);
378 parser->get("calcCoefficients", calcCoefficients, &defaults::defaultCalcCoefficients);
379 }
380
381 // 2. Разбор параметров профилей
382 if (readAll)
383 {
384 std::vector<std::string> airfoil;
385 parser->get("airfoil", airfoil, &defaults::defaultAirfoil);
386
387 //определяем число профилей и организуем цикл по ним
388 size_t nAirfoil = airfoil.size();
389 //*(defaults::defaultPinfo) << "Number of airfoils = " << nAirfoil << endl;
390 for (size_t i = 0; i < nAirfoil; ++i)
391 {
392 //делим имя файла + выражение в скобках на 2 подстроки
393 std::pair<std::string, std::string> airfoilLine = VMlib::StreamParser::SplitString(info, airfoil[i], false);
394
395 AirfoilParams prm;
396 //первая подстрока - имя файла
397 prm.fileAirfoil = airfoilLine.first;
398
399 //вторую подстроку разделяем на вектор из строк по запятым, стоящим вне фигурных скобок
400 std::vector<std::string> vecAirfoilLineSecond = VMlib::StreamParser::StringToVector(airfoilLine.second, '{', '}');
401
402 //создаем парсер и связываем его с параметрами профиля
403 std::stringstream aflStream(VMlib::StreamParser::VectorStringToString(vecAirfoilLineSecond));
404 std::unique_ptr<VMlib::StreamParser> parserAirfoil;
405
406 parserAirfoil.reset(new VMlib::StreamParser(info, "airfoil parser", aflStream, defaultStream, switcherStream, varsStream));
407
408 //считываем нужные параметры с учетом default-значений
409 parserAirfoil->get("nPanels", prm.requiredNPanels, &defaults::defaultRequiredNPanels);
410
411 parserAirfoil->get("basePoint", prm.basePoint, &defaults::defaultBasePoint);
412
413 std::vector<double> tmpScale, defaultTmpScale = { defaults::defaultScale[0], defaults::defaultScale[1] };
414
415 parserAirfoil->get("scale", tmpScale, &defaultTmpScale);
416 switch (tmpScale.size())
417 {
418 case 1:
419 prm.scale[0] = prm.scale[1] = tmpScale[0];
420 break;
421 case 2:
422 prm.scale[0] = tmpScale[0];
423 prm.scale[1] = tmpScale[1];
424 break;
425 default:
426 info('e') << "Error in _scale_ value for airfoil" << std::endl;
427 exit(1);
428 }
429 //parserAirfoil->get("scale", prm.scalexy, &defaults::defaultScale);
430
431
432 parserAirfoil->get("angle", prm.angle, &defaults::defaultAngle);
433 prm.angle *= PI / 180.0;
434
435 parserAirfoil->get("chord", prm.chord, &defaults::defaultChord);
436
437 parserAirfoil->get("addedMass", prm.addedMass, &defaults::defaultAddedMass);
438
439
440 parserAirfoil->get("inverse", prm.inverse, &defaults::defaultInverse);
441 parserAirfoil->get("mechanicalSystem", prm.mechanicalSystem, &defaults::defaultMechanicalSystem);
442
444 {
445 prm.mechanicalSystemType = 0;
447 }
448 else
449 {
450 std::unique_ptr<VMlib::StreamParser> parserMechanicsList;
451 std::unique_ptr<VMlib::StreamParser> parserSwitchers;
452 parserMechanicsList.reset(new VMlib::StreamParser(info, "mechanical parser", mechanicsStream, defaultStream, switcherStream, varsStream, { prm.mechanicalSystem }));
453 parserSwitchers.reset(new VMlib::StreamParser(info, "switchers parser", switcherStream));
454
455 std::string mechString;
456
457 parserMechanicsList->get(prm.mechanicalSystem, mechString);
458
459 //делим тип мех.системы + выражение в скобках (ее параметры) на 2 подстроки
460 std::pair<std::string, std::string> mechanicsLine = VMlib::StreamParser::SplitString(info, mechString);
461
462 std::string mechTypeAlias = mechanicsLine.first;
463 parserSwitchers->get(mechTypeAlias, prm.mechanicalSystemType);
464
465 //вторую подстроку разделяем на вектор из строк по запятым, стоящим вне фигурных скобок
466 std::vector<std::string> vecMechLineSecond = VMlib::StreamParser::StringToVector(mechanicsLine.second, '{', '}');
468 }
469
470 //отправляем считанные параметры профиля в структуру данных паспорта
471 airfoilParams.push_back(prm);
472
473 } //for i
474 }//readAll
475}//GetAllParamsFromParser(...)
476
477
478
479
481(
482 const Passport& newPassport,
483 const std::vector<std::string> paramList
484)
485{
487
488 bool readAll = ((paramList.size() == 1) && (paramList[0] == ""));
489 std::vector<std::string> PR;
490 for (const auto& s : paramList)
491 PR.push_back(UP(s));
492
493
494 auto ifUpdate = [&](const std::string& checkString) {return (readAll || std::count(PR.begin(), PR.end(), UP(checkString))); };
495
496 if (ifUpdate("nameLength") && (this->timeDiscretizationProperties.nameLength != newPassport.timeDiscretizationProperties.nameLength))
497 {
499 info('i') << "updated nameLength = " << timeDiscretizationProperties.nameLength << std::endl;
500 }
501
502 if (ifUpdate("timeStop") && (timeDiscretizationProperties.timeStop != newPassport.timeDiscretizationProperties.timeStop))
503 {
505 info('i') << "updated timeStop = " << timeDiscretizationProperties.timeStop << std::endl;
506 }
507
508 if (ifUpdate("dt") && (timeDiscretizationProperties.dt != newPassport.timeDiscretizationProperties.dt))
509 {
511 info('i') << "updated dt = " << timeDiscretizationProperties.dt << std::endl;
512 }
513
514 if (ifUpdate("vInf") && (physicalProperties.vInf != newPassport.physicalProperties.vInf))
515 {
516 physicalProperties.vInf = newPassport.physicalProperties.vInf;
517 info('i') << "updated vInf = " << physicalProperties.vInf << std::endl;
518
519 if (physicalProperties.vRef != newPassport.physicalProperties.vRef)
520 {
521 physicalProperties.vRef = newPassport.physicalProperties.vRef;
522 info('i') << "updated vRef = " << physicalProperties.vRef << std::endl;
523 }
524 }
525
526 if (ifUpdate("vRef") && (physicalProperties.vRef != newPassport.physicalProperties.vRef))
527 {
528 physicalProperties.vRef = newPassport.physicalProperties.vRef;
529 info('i') << "updated vRef = " << physicalProperties.vRef << std::endl;
530 }
531
532 if (ifUpdate("coefEpsAst") && (wakeDiscretizationProperties.coefEpsAst != newPassport.wakeDiscretizationProperties.coefEpsAst))
533 {
535 info('i') << "updated coefEpsAst = " << wakeDiscretizationProperties.coefEpsAst << std::endl;
536 }
537
538
539 if (ifUpdate("saveVtx") &&
541 {
544
545 info('-') << "updated saveVtx = " << timeDiscretizationProperties.fileTypeVtx.first << "( " << timeDiscretizationProperties.saveVtxStep << " )" << std::endl;
546 }
547
548 if (ifUpdate("saveVP") &&
550 {
553
554 info('-') << "updated saveVtx = " << timeDiscretizationProperties.fileTypeVP.first << "( " << timeDiscretizationProperties.saveVPstep << " )" << std::endl;
555 }
556
557}//GetReviseParamsFromParser
558
559
560
561
562//Печать всех параметров расчета в поток логов
564{
565 const std::string str = "passport info: ";
566
567 info('i') << "--- Passport info ---" << std::endl;
568 info('-') << "rho = " << physicalProperties.rho << std::endl;
569 info('-') << "vInf = " << physicalProperties.vInf << std::endl;
570 info('-') << "vRef = " << physicalProperties.vRef << std::endl;
571 info('-') << "velAccel = " << physicalProperties.typeAccel.first << "( " << physicalProperties.timeAccel << " )" << std::endl;
572
573 info('-') << "nu = " << physicalProperties.nu << std::endl;
574 info('-') << "timeStart = " << timeDiscretizationProperties.timeStart << std::endl;
575 info('-') << "timeStop = " << timeDiscretizationProperties.timeStop << std::endl;
576 info('-') << "dt = " << timeDiscretizationProperties.dt << std::endl;
577 info('-') << "nameLength = " << timeDiscretizationProperties.nameLength << std::endl;
578 info('-') << "saveVtx = " << timeDiscretizationProperties.fileTypeVtx.first << "( " << timeDiscretizationProperties.saveVtxStep << " )" << std::endl;
579 info('-') << "saveVP = " << timeDiscretizationProperties.fileTypeVP.first << "( " << timeDiscretizationProperties.saveVPstep << " )" << std::endl;
580
581 info('-') << "revisePassportStep = " << timeDiscretizationProperties.revisePassportStep << std::endl;
582 info('-') << "reviseParameters = {";
583 for (const auto& s : timeDiscretizationProperties.reviseParameters)
584 info('-') << s << "";
585 info('-') << "}" << std::endl;
586
587 info('-') << "saveVisStress = " << timeDiscretizationProperties.saveVisStress << std::endl;
588 info('-') << "sigma0 = " << wakeDiscretizationProperties.sigma0 << std::endl;
589 info('-') << "epscol = " << wakeDiscretizationProperties.epscol << std::endl;
590 info('-') << "coefEpsAst = " << wakeDiscretizationProperties.coefEpsAst << std::endl;
591
592 info('-') << "distFar = " << wakeDiscretizationProperties.distFar << std::endl;
593 info('-') << "delta = " << wakeDiscretizationProperties.delta << std::endl;
594 info('-') << "vortexPerPanel = " << wakeDiscretizationProperties.minVortexPerPanel << std::endl;
595 info('-') << "maxGamma = " << ((wakeDiscretizationProperties.maxGamma == 1e+10) ? 0.0 : wakeDiscretizationProperties.maxGamma) << std::endl;
596
597 info('-') << "linearSystemSolver = " << numericalSchemes.linearSystemSolver.first << std::endl;
598 if (numericalSchemes.linearSystemSolver.second == 1 || numericalSchemes.linearSystemSolver.second == 2)
599 {
600 info('-') << "gmresEps = " << numericalSchemes.gmresEps << std::endl;
601 if (numericalSchemes.linearSystemSolver.second == 2)
602 {
603 info('-') << "gmresTheta = " << numericalSchemes.gmresTheta << std::endl;
604 info('-') << "gmresMultipoleOrder = " << numericalSchemes.gmresMultipoleOrder << std::endl;
605 }
606 }
607
608 info('-') << "velocityComputation = " << numericalSchemes.velocityComputation.first << std::endl;
609 if (numericalSchemes.velocityComputation.second == 1)
610 {
611 info('-') << "nbodyTheta = " << numericalSchemes.nbodyTheta << std::endl;
612 info('-') << "nbodyMultipoleOrder = " << numericalSchemes.nbodyMultipoleOrder << std::endl;
613 }
614
615 //info('-') << "wakeMotionIntegrator = " << numericalSchemes.wakeMotionIntegrator << std::endl;
616 info('_') << "boundaryCondition = " << numericalSchemes.boundaryCondition.first << std::endl;
617
618 info('-') << "airfoilsDir = " << airfoilsDir << std::endl;
619 info('-') << "wakesDir = " << wakesDir << std::endl;
620
621 //Для обдува ветром, когда углы считаются по компасу
622 //info('-') << "geographicalAngles = " << geographicalAngles << std::endl;
623 info('-') << "rotateForces = " << rotateForces << std::endl;
624 info('-') << "calcCoefficients = " << calcCoefficients << std::endl;
625 info('-') << "rotateVpPoints = " << rotateAngleVpPoints << std::endl;
626
627
628
629 info('-') << "number of airfoils = " << airfoilParams.size() << std::endl;
630 for (size_t q = 0; q < airfoilParams.size(); ++q)
631 {
632 info('_') << "airfoil[" << q << "]_file = " << airfoilParams[q].fileAirfoil << std::endl;
633 info('_') << "airfoil[" << q << "]_requiredNPanels = " << airfoilParams[q].requiredNPanels << std::endl;
634 info('_') << "airfoil[" << q << "]_basePoint = " << airfoilParams[q].basePoint << std::endl;
635 info('_') << "airfoil[" << q << "]_scale = " << airfoilParams[q].scale << std::endl;
636 info('_') << "airfoil[" << q << "]_angle = " << airfoilParams[q].angle << std::endl;
637 info('_') << "airfoil[" << q << "]_chord = " << airfoilParams[q].chord << std::endl;
638 info('_') << "airfoil[" << q << "]_inverse = " << (airfoilParams[q].inverse ? "true": "false") << std::endl;
639 info('_') << "airfoil[" << q << "]_mechanicalSystem = " << airfoilParams[q].mechanicalSystem << std::endl;
640 info('_') << "airfoil[" << q << "]_addedMass = " << airfoilParams[q].addedMass << std::endl;
641 }
642
643 info('-') << "fileWake = " << wakeDiscretizationProperties.fileWake << std::endl;
644 info('-') << "fileSource = " << wakeDiscretizationProperties.fileSource << std::endl;
645}//PrintAllParams()
Заголовочный файл с описанием класса Passport (двумерный) и cоответствующими структурами
Заголовочный файл с описанием класса Preprocessor.
Заголовочный файл с описанием класса StreamParser.
const double PI
Число .
Definition defs.h:76
bool rotateForces
Признак работы в "географической" системе координат
Definition Passport2D.h:294
std::string wakesDir
Каталог с файлами вихревых следов
Definition Passport2D.h:276
PhysicalProperties physicalProperties
Структура с физическими свойствами задачи
Definition Passport2D.h:304
std::string defaultsFileFullName
Definition Passport2D.h:284
bool calcCoefficients
Признак вычисления коэффициентов вместо сил
Definition Passport2D.h:297
double rotateAngleVpPoints
Угол поворота точек VP.
Definition Passport2D.h:300
WakeDiscretizationProperties wakeDiscretizationProperties
Структура с параметрами дискретизации вихревого следа
Definition Passport2D.h:307
std::vector< std::string > varLine
Definition Passport2D.h:286
std::string airfoilsDir
Каталог с файлами профилей
Definition Passport2D.h:273
virtual void GetParamsFromParser(std::istream &mainStream, std::istream &mechanicsStream, std::istream &defaultStream, std::istream &switcherStream, std::istream &varsStream, const std::vector< std::string > paramList) override
Считывание всех параметров расчета из соответствующих потоков
virtual void PrintAllParams() override
Печать всех параметров расчета в поток логов
std::vector< AirfoilParams > airfoilParams
Список структур с параметрами профилей
Definition Passport2D.h:279
std::string switchersFileFullName
Definition Passport2D.h:285
std::string mechanicsFileFullName
Definition Passport2D.h:283
std::string fileFullName
Имена файлов
Definition Passport2D.h:282
void GetReviseParamsFromParser(const Passport &newPassport, const std::vector< std::string > paramList)
Считывание измененных параметров
Passport(VMlib::LogStream &infoStream, const std::string &_problemName, const size_t _problemNumber, const std::string &_filePassport, const std::string &_mechanics, const std::string &_defaults, const std::string &_switchers, const std::vector< std::string > &vars, const std::vector< std::string > &paramList)
Конструктор
NumericalSchemes numericalSchemes
Структура с используемыми численными схемами
Definition Passport2D.h:310
Класс, определяющий работу с потоком логов
Definition LogStream.h:57
TimeDiscretizationProperties timeDiscretizationProperties
Структура с параметрами процесса интегрирования по времени
LogStream info
Поток для вывода логов и сообщений об ошибках
PassportGen(LogStream &infoStream, const std::string &_problemName, const size_t _problemNumber, const std::string &_filePassport, const std::string &_mechanics, const std::string &_defaults, const std::string &_switchers, const std::vector< std::string > &vars)
Конструктор
Класс, позволяющий выполнять предварительную обработку файлов
std::string resultString
Строка, содержащая окончательный результат обработки файла
Класс, позволяющий выполнять разбор файлов и строк с настройками и параметрами
static std::vector< std::string > StringToVector(std::string line, char openBracket='(', char closeBracket=')')
Pазбор строки, содержащей запятые, на отдельные строки
static std::pair< std::string, std::string > SplitString(LogStream &info, std::string line, bool upcase=true)
Разбор строки на пару ключ-значение
static std::string VectorStringToString(const std::vector< std::string > &_vecString)
Объединение вектора (списка) из строк в одну строку
static std::string UpperCase(const std::string &line)
Перевод строки в верхний регистр
const int defaultRevisePassportStep
Шаг обновления паспорта и перечень перечитываемых параметров
Definition defs.h:117
const VMlib::Point2D defaultBasePoint
Базовое смещение профиля
Definition defs.h:193
const double defaultDistFar
Радиус убивания дальнего следа
Definition defs.h:133
const bool defaultCalcCoefficients
Признак расчета безразмерных коэффициентов вместо сил
Definition defs.h:166
const std::string defaultWakesDir
Каталог с файлами вихревых следов
Definition defs.h:176
const int defaultSaveVisStress
Шаг подсчета поля скорости и давления
Definition defs.h:111
const size_t defaultRequiredNPanels
Желаемое число панелей для разбиения геометрии
Definition defs.h:148
const double defaultVRef
Референсная скорость, равная нулю, что означает ее равенство скорости набегающего потока
Definition defs.h:145
const Point2D defaultScale
Коэффициент масштабирования профиля
Definition defs.h:197
const double defaultDelta
Расстояние, на которое рождаемый вихрь отодвигается от профиля
Definition defs.h:136
const bool defaultRotateForces
Признак работы в "географической" системе координат
Definition defs.h:163
const Point2D defaultAddedMass
Присоединенная масса
Definition defs.h:206
const bool defaultInverse
Признак разворота нормалей (для расчета внутреннего течения).
Definition defs.h:209
const int defaultSaveVPstep
Definition defs.h:104
const double defaultEpsCol
Радиус вихря по умолчанию
Definition defs.h:130
const double defaultTimeAccel
Definition defs.h:100
const double defaultChord
Хорда
Definition defs.h:203
const std::pair< std::string, int > defaultVelocityComputation
Способ вычисления скоростей вихрей
Definition defs.h:157
const std::string defaultFileSource("")
Файл с источниками
const std::vector< std::string > defaultAirfoil({})
Список профилей
const double defaultAngle
Угол атаки
Definition defs.h:200
const double defaultMaxGamma
Число вихрей, рождаемых на одной панели
Definition defs.h:142
const int defaultVortexPerPanel
Число вихрей, рождаемых на одной панели
Definition defs.h:139
const int defaultNameLength
Число разрядов в имени файла
Definition defs.h:121
const double rotateAngleVpPoints
Угол поворота точек VP.
Definition defs.h:169
const std::string defaultAirfoilsDir
Каталог с файлами профилей
Definition defs.h:172
const std::pair< std::pair< std::string, int >, std::string > defaultSaveVtx
Шаг подсчета поля скорости и давления
Definition defs.h:107
const std::pair< std::pair< std::string, int >, std::string > defaultVelAccel
Время разгона
Definition defs.h:99
const double defaultTimeStart
Начало расчета
Definition defs.h:96
const std::string defaultMechanicalSystem
Definition defs.h:213
const std::vector< std::string > defaultReviseParameters
Definition defs.h:118
const int defaultSaveVtxStep
Definition defs.h:108
const double defaultCoefEpsAst
Коэффициент при вычислении eps_ast по умолчанию
Definition defs.h:127
const std::pair< std::string, int > defaultBoundaryCondition
Способ удовлетворения граничного условия
Definition defs.h:151
const std::pair< std::string, int > defaultLinearSystemSolver
Способ решения линейной системы
Definition defs.h:154
const double defaultSigma0
Радиус вихря по умолчанию
Definition defs.h:124
const std::pair< std::pair< std::string, int >, std::string > defaultSaveVP
Шаг подсчета поля скорости и давления
Definition defs.h:103
const std::string defaultFileWake("")
Файл со следом
Структура, задающая параметры профиля
Definition Passport2D.h:208
Point2D addedMass
Присоединенная масса
Definition Passport2D.h:231
double chord
Хорда
Definition Passport2D.h:225
std::string mechanicalSystem
Definition Passport2D.h:238
Point2D basePoint
Смещение центра масс (перенос профиля).
Definition Passport2D.h:219
int mechanicalSystemType
Тип механической системы
Definition Passport2D.h:237
std::string fileAirfoil
Имя файла с начальным состоянием профилей (без полного пути).
Definition Passport2D.h:210
double angle
Угол поворота (угол атаки).
Definition Passport2D.h:228
std::string mechanicalSystemParameters
Definition Passport2D.h:239
Point2D scale
Коэффициент масштабирования
Definition Passport2D.h:222
size_t requiredNPanels
Желаемое число панелей для разбиения геометрии
Definition Passport2D.h:216
bool inverse
Признак разворота нормалей (для расчета внутреннего течения).
Definition Passport2D.h:234
std::pair< std::string, int > typeAccel
Способ разгона потока
Definition Passport2D.h:84
double accelCft(double currentTime) const
Функция-множитель, позволяющая моделировать разгон
double vRef
Референсная скорость
Definition Passport2D.h:81
double timeAccel
Время разгона потока
Definition Passport2D.h:87
Point2D vInf
Скоростью набегающего потока
Definition Passport2D.h:78
double coefEpsAst
Коэффициент для вычислекния eps_ast.
Definition Passport2D.h:153
double dt
Шаг по времени
Definition PassportGen.h:67
std::pair< std::string, int > fileTypeVtx
Тип файлов для сохранения скорости и давления
Definition PassportGen.h:79
int saveVPstep
Шаг вычисления и сохранения скорости и давления
Definition PassportGen.h:86
int saveVtxStep
Шаг сохранения кадров в бинарные файлы
Definition PassportGen.h:81
int nameLength
Число разрядов в имени файла
Definition PassportGen.h:76
double timeStop
Конечное время
Definition PassportGen.h:64
std::pair< std::string, int > fileTypeVP
Тип файлов для сохранения скорости и давления
Definition PassportGen.h:84