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
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),
71physicalProperties(timeDiscretizationProperties)
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 }
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
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"))
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 {
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 {
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 {
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 {
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 {
296
297 const std::vector<std::string> varParams = { UP("nameLength"), UP("timeStop"), UP("dt"), UP("vInf"), UP("vRef"), UP("saveVtx"), UP("saveVP") };
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);
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
325
333 }
334
335 if (readAll)
336 {
339 parser->get("gmresEps", numericalSchemes.gmresEps);
340
341 if (numericalSchemes.linearSystemSolver.second == 2)
342 {
343 parser->get("fastGmresTheta", numericalSchemes.gmresTheta);
344 parser->get("fastGmresMultipoleOrder", numericalSchemes.gmresMultipoleOrder);
345 }
346
348
350 {
351 parser->get("nbodyTheta", numericalSchemes.nbodyTheta);
352 parser->get("nbodyMultipoleOrder", numericalSchemes.nbodyMultipoleOrder);
353 }
354
355 //parser->get("wakeMotionIntegrator", numericalSchemes.wakeMotionIntegrator);
356 parser->get("boundaryConditionSatisfaction", numericalSchemes.boundaryCondition, &defaults::defaultBoundaryCondition);
357
358 parser->get("airfoilsDir", airfoilsDir, &defaults::defaultAirfoilsDir);
359 parser->get("wakesDir", wakesDir, &defaults::defaultWakesDir);
360
363
364 //Для обдува ветром, когда углы считаются по компасу
365 //parser->get("geographicalAngles", geographicalAngles, &defaults::defaultGeographicalAngles);
366 //if (geographicalAngles && (physicalProperties.vInf[1] != 0.0))
367 //{
368 // info('e') << "For geographical angles vInf should be horizontal; now vInf = " << physicalProperties.vInf << "." << std::endl;
369 // exit(1);
370 //}
371
372 parser->get("rotateForces", rotateForces, &defaults::defaultRotateForces);
373 parser->get("calcCoefficients", calcCoefficients, &defaults::defaultCalcCoefficients);
374 }
375
376 // 2. Разбор параметров профилей
377 if (readAll)
378 {
379 std::vector<std::string> airfoil;
380 parser->get("airfoil", airfoil, &defaults::defaultAirfoil);
381
382 //определяем число профилей и организуем цикл по ним
383 size_t nAirfoil = airfoil.size();
384 //*(defaults::defaultPinfo) << "Number of airfoils = " << nAirfoil << endl;
385 for (size_t i = 0; i < nAirfoil; ++i)
386 {
387 //делим имя файла + выражение в скобках на 2 подстроки
388 std::pair<std::string, std::string> airfoilLine = VMlib::StreamParser::SplitString(info, airfoil[i], false);
389
390 AirfoilParams prm;
391 //первая подстрока - имя файла
392 prm.fileAirfoil = airfoilLine.first;
393
394 //вторую подстроку разделяем на вектор из строк по запятым, стоящим вне фигурных скобок
395 std::vector<std::string> vecAirfoilLineSecond = VMlib::StreamParser::StringToVector(airfoilLine.second, '{', '}');
396
397 //создаем парсер и связываем его с параметрами профиля
398 std::stringstream aflStream(VMlib::StreamParser::VectorStringToString(vecAirfoilLineSecond));
399 std::unique_ptr<VMlib::StreamParser> parserAirfoil;
400
401 parserAirfoil.reset(new VMlib::StreamParser(info, "airfoil parser", aflStream, defaultStream, switcherStream, varsStream));
402
403 //считываем нужные параметры с учетом default-значений
404 parserAirfoil->get("nPanels", prm.requiredNPanels, &defaults::defaultRequiredNPanels);
405
406 parserAirfoil->get("basePoint", prm.basePoint, &defaults::defaultBasePoint);
407
408 std::vector<double> tmpScale, defaultTmpScale = { defaults::defaultScale[0], defaults::defaultScale[1] };
409
410 parserAirfoil->get("scale", tmpScale, &defaultTmpScale);
411 switch (tmpScale.size())
412 {
413 case 1:
414 prm.scale[0] = prm.scale[1] = tmpScale[0];
415 break;
416 case 2:
417 prm.scale[0] = tmpScale[0];
418 prm.scale[1] = tmpScale[1];
419 break;
420 default:
421 info('e') << "Error in _scale_ value for airfoil" << std::endl;
422 exit(1);
423 }
424 //parserAirfoil->get("scale", prm.scalexy, &defaults::defaultScale);
425
426
427 parserAirfoil->get("angle", prm.angle, &defaults::defaultAngle);
428 prm.angle *= PI / 180.0;
429
430 parserAirfoil->get("chord", prm.chord, &defaults::defaultChord);
431
432 parserAirfoil->get("addedMass", prm.addedMass, &defaults::defaultAddedMass);
433
434
435 parserAirfoil->get("inverse", prm.inverse, &defaults::defaultInverse);
436 parserAirfoil->get("mechanicalSystem", prm.mechanicalSystem, &defaults::defaultMechanicalSystem);
437
439 {
440 prm.mechanicalSystemType = 0;
442 }
443 else
444 {
445 std::unique_ptr<VMlib::StreamParser> parserMechanicsList;
446 std::unique_ptr<VMlib::StreamParser> parserSwitchers;
447 parserMechanicsList.reset(new VMlib::StreamParser(info, "mechanical parser", mechanicsStream, defaultStream, switcherStream, varsStream, { prm.mechanicalSystem }));
448 parserSwitchers.reset(new VMlib::StreamParser(info, "switchers parser", switcherStream));
449
450 std::string mechString;
451
452 parserMechanicsList->get(prm.mechanicalSystem, mechString);
453
454 //делим тип мех.системы + выражение в скобках (ее параметры) на 2 подстроки
455 std::pair<std::string, std::string> mechanicsLine = VMlib::StreamParser::SplitString(info, mechString);
456
457 std::string mechTypeAlias = mechanicsLine.first;
458 parserSwitchers->get(mechTypeAlias, prm.mechanicalSystemType);
459
460 //вторую подстроку разделяем на вектор из строк по запятым, стоящим вне фигурных скобок
461 std::vector<std::string> vecMechLineSecond = VMlib::StreamParser::StringToVector(mechanicsLine.second, '{', '}');
463 }
464
465 //отправляем считанные параметры профиля в структуру данных паспорта
466 airfoilParams.push_back(prm);
467
468 } //for i
469 }//readAll
470}//GetAllParamsFromParser(...)
471
472
473
474
476(
477 const Passport& newPassport,
478 const std::vector<std::string> paramList
479)
480{
482
483 bool readAll = ((paramList.size() == 1) && (paramList[0] == ""));
484 std::vector<std::string> PR;
485 for (const auto& s : paramList)
486 PR.push_back(UP(s));
487
488
489 auto ifUpdate = [&](const std::string& checkString) {return (readAll || std::count(PR.begin(), PR.end(), UP(checkString))); };
490
491 if (ifUpdate("nameLength") && (this->timeDiscretizationProperties.nameLength != newPassport.timeDiscretizationProperties.nameLength))
492 {
494 info('i') << "updated nameLength = " << timeDiscretizationProperties.nameLength << std::endl;
495 }
496
497 if (ifUpdate("timeStop") && (timeDiscretizationProperties.timeStop != newPassport.timeDiscretizationProperties.timeStop))
498 {
500 info('i') << "updated timeStop = " << timeDiscretizationProperties.timeStop << std::endl;
501 }
502
503 if (ifUpdate("dt") && (timeDiscretizationProperties.dt != newPassport.timeDiscretizationProperties.dt))
504 {
506 info('i') << "updated dt = " << timeDiscretizationProperties.dt << std::endl;
507 }
508
509 if (ifUpdate("vInf") && (physicalProperties.vInf != newPassport.physicalProperties.vInf))
510 {
512 info('i') << "updated vInf = " << physicalProperties.vInf << std::endl;
513
515 {
517 info('i') << "updated vRef = " << physicalProperties.vRef << std::endl;
518 }
519 }
520
521 if (ifUpdate("vRef") && (physicalProperties.vRef != newPassport.physicalProperties.vRef))
522 {
524 info('i') << "updated vRef = " << physicalProperties.vRef << std::endl;
525 }
526
527
528 if (ifUpdate("saveVtx") &&
530 {
533
534 info('-') << "updated saveVtx = " << timeDiscretizationProperties.fileTypeVtx.first << "( " << timeDiscretizationProperties.saveVtxStep << " )" << std::endl;
535 }
536
537 if (ifUpdate("saveVP") &&
539 {
542
543 info('-') << "updated saveVtx = " << timeDiscretizationProperties.fileTypeVP.first << "( " << timeDiscretizationProperties.saveVPstep << " )" << std::endl;
544 }
545
546}//GetReviseParamsFromParser
547
548
549
550
551//Печать всех параметров расчета в поток логов
553{
554 const std::string str = "passport info: ";
555
556 info('i') << "--- Passport info ---" << std::endl;
557 info('-') << "rho = " << physicalProperties.rho << std::endl;
558 info('-') << "vInf = " << physicalProperties.vInf << std::endl;
559 info('-') << "vRef = " << physicalProperties.vRef << std::endl;
560 info('-') << "velAccel = " << physicalProperties.typeAccel.first << "( " << physicalProperties.timeAccel << " )" << std::endl;
561
562 info('-') << "nu = " << physicalProperties.nu << std::endl;
563 info('-') << "timeStart = " << timeDiscretizationProperties.timeStart << std::endl;
564 info('-') << "timeStop = " << timeDiscretizationProperties.timeStop << std::endl;
565 info('-') << "dt = " << timeDiscretizationProperties.dt << std::endl;
566 info('-') << "nameLength = " << timeDiscretizationProperties.nameLength << std::endl;
567 info('-') << "saveVtx = " << timeDiscretizationProperties.fileTypeVtx.first << "( " << timeDiscretizationProperties.saveVtxStep << " )" << std::endl;
568 info('-') << "saveVP = " << timeDiscretizationProperties.fileTypeVP.first << "( " << timeDiscretizationProperties.saveVPstep << " )" << std::endl;
569
570 info('-') << "revisePassportStep = " << timeDiscretizationProperties.revisePassportStep << std::endl;
571 info('-') << "reviseParameters = {";
573 info('-') << s << "";
574 info('-') << "}" << std::endl;
575
576 info('-') << "saveVisStress = " << timeDiscretizationProperties.saveVisStress << std::endl;
577 info('-') << "sigma0 = " << wakeDiscretizationProperties.sigma0 << std::endl;
578 info('-') << "epscol = " << wakeDiscretizationProperties.epscol << std::endl;
579 info('-') << "distFar = " << wakeDiscretizationProperties.distFar << std::endl;
580 info('-') << "delta = " << wakeDiscretizationProperties.delta << std::endl;
581 info('-') << "vortexPerPanel = " << wakeDiscretizationProperties.minVortexPerPanel << std::endl;
582 info('-') << "maxGamma = " << ((wakeDiscretizationProperties.maxGamma == 1e+10) ? 0.0 : wakeDiscretizationProperties.maxGamma) << std::endl;
583 info('-') << "linearSystemSolver = " << numericalSchemes.linearSystemSolver.first << std::endl;
585 {
586 info('-') << "gmresEps = " << numericalSchemes.gmresEps << std::endl;
587 if (numericalSchemes.linearSystemSolver.second == 2)
588 {
589 info('-') << "gmresTheta = " << numericalSchemes.gmresTheta << std::endl;
590 info('-') << "gmresMultipoleOrder = " << numericalSchemes.gmresMultipoleOrder << std::endl;
591 }
592 }
593
594 info('-') << "velocityComputation = " << numericalSchemes.velocityComputation.first << std::endl;
596 {
597 info('-') << "nbodyTheta = " << numericalSchemes.nbodyTheta << std::endl;
598 info('-') << "nbodyMultipoleOrder = " << numericalSchemes.nbodyMultipoleOrder << std::endl;
599 }
600
601 //info('-') << "wakeMotionIntegrator = " << numericalSchemes.wakeMotionIntegrator << std::endl;
602 info('_') << "boundaryCondition = " << numericalSchemes.boundaryCondition.first << std::endl;
603
604 info('-') << "airfoilsDir = " << airfoilsDir << std::endl;
605 info('-') << "wakesDir = " << wakesDir << std::endl;
606
607 //Для обдува ветром, когда углы считаются по компасу
608 //info('-') << "geographicalAngles = " << geographicalAngles << std::endl;
609 info('-') << "rotateForces = " << rotateForces << std::endl;
610 info('-') << "calcCoefficients = " << calcCoefficients << std::endl;
611 info('-') << "rotateVpPoints = " << rotateAngleVpPoints << std::endl;
612
613
614
615 info('-') << "number of airfoils = " << airfoilParams.size() << std::endl;
616 for (size_t q = 0; q < airfoilParams.size(); ++q)
617 {
618 info('_') << "airfoil[" << q << "]_file = " << airfoilParams[q].fileAirfoil << std::endl;
619 info('_') << "airfoil[" << q << "]_requiredNPanels = " << airfoilParams[q].requiredNPanels << std::endl;
620 info('_') << "airfoil[" << q << "]_basePoint = " << airfoilParams[q].basePoint << std::endl;
621 info('_') << "airfoil[" << q << "]_scale = " << airfoilParams[q].scale << std::endl;
622 info('_') << "airfoil[" << q << "]_angle = " << airfoilParams[q].angle << std::endl;
623 info('_') << "airfoil[" << q << "]_chord = " << airfoilParams[q].chord << std::endl;
624 info('_') << "airfoil[" << q << "]_inverse = " << (airfoilParams[q].inverse ? "true": "false") << std::endl;
625 info('_') << "airfoil[" << q << "]_mechanicalSystem = " << airfoilParams[q].mechanicalSystem << std::endl;
626 info('_') << "airfoil[" << q << "]_addedMass = " << airfoilParams[q].addedMass << std::endl;
627 }
628
629 info('-') << "fileWake = " << wakeDiscretizationProperties.fileWake << std::endl;
630 info('-') << "fileSource = " << wakeDiscretizationProperties.fileSource << std::endl;
631}//PrintAllParams()
Заголовочный файл с описанием класса Passport (двумерный) и cоответствующими структурами
Заголовочный файл с описанием класса Preprocessor.
Заголовочный файл с описанием класса StreamParser.
const double PI
Число .
Definition defs.h:76
Класс, опеделяющий паспорт двумерной задачи
Definition Passport2D.h:253
bool rotateForces
Признак работы в "географической" системе координат
Definition Passport2D.h:291
std::string wakesDir
Каталог с файлами вихревых следов
Definition Passport2D.h:273
PhysicalProperties physicalProperties
Структура с физическими свойствами задачи
Definition Passport2D.h:301
std::string defaultsFileFullName
Definition Passport2D.h:281
bool calcCoefficients
Признак вычисления коэффициентов вместо сил
Definition Passport2D.h:294
double rotateAngleVpPoints
Угол поворота точек VP.
Definition Passport2D.h:297
WakeDiscretizationProperties wakeDiscretizationProperties
Структура с параметрами дискретизации вихревого следа
Definition Passport2D.h:304
std::vector< std::string > varLine
Definition Passport2D.h:283
std::string airfoilsDir
Каталог с файлами профилей
Definition Passport2D.h:270
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:276
std::string switchersFileFullName
Definition Passport2D.h:282
std::string mechanicsFileFullName
Definition Passport2D.h:280
std::string fileFullName
Имена файлов
Definition Passport2D.h:279
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:307
Класс, определяющий работу с потоком логов
Definition LogStream.h:57
TimeDiscretizationProperties timeDiscretizationProperties
Структура с параметрами процесса интегрирования по времени
LogStream info
Поток для вывода логов и сообщений об ошибках
Класс, позволяющий выполнять предварительную обработку файлов
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)
Перевод строки в верхний регистр
P length() const
Вычисление 2-нормы (длины) вектора
Definition numvector.h:374
const int defaultRevisePassportStep
Шаг обновления паспорта и перечень перечитываемых параметров
Definition defs.h:114
const VMlib::Point2D defaultBasePoint
Базовое смещение профиля
Definition defs.h:187
const double defaultDistFar
Радиус убивания дальнего следа
Definition defs.h:127
const bool defaultCalcCoefficients
Признак расчета безразмерных коэффициентов вместо сил
Definition defs.h:160
const std::string defaultWakesDir
Каталог с файлами вихревых следов
Definition defs.h:170
const int defaultSaveVisStress
Шаг подсчета поля скорости и давления
Definition defs.h:111
const size_t defaultRequiredNPanels
Желаемое число панелей для разбиения геометрии
Definition defs.h:142
const double defaultVRef
Референсная скорость, равная нулю, что означает ее равенство скорости набегающего потока
Definition defs.h:139
const Point2D defaultScale
Коэффициент масштабирования профиля
Definition defs.h:191
const double defaultDelta
Расстояние, на которое рождаемый вихрь отодвигается от профиля
Definition defs.h:130
const bool defaultRotateForces
Признак работы в "географической" системе координат
Definition defs.h:157
const Point2D defaultAddedMass
Присоединенная масса
Definition defs.h:200
const bool defaultInverse
Признак разворота нормалей (для расчета внутреннего течения)
Definition defs.h:203
const int defaultSaveVPstep
Definition defs.h:104
const double defaultEpsCol
Радиус вихря по умолчанию
Definition defs.h:124
const double defaultTimeAccel
Definition defs.h:100
const double defaultChord
Хорда
Definition defs.h:197
const std::pair< std::string, int > defaultVelocityComputation
Способ вычисления скоростей вихрей
Definition defs.h:151
const std::string defaultFileSource("")
Файл с источниками
const std::vector< std::string > defaultAirfoil({})
Список профилей
const double defaultAngle
Угол атаки
Definition defs.h:194
const double defaultMaxGamma
Число вихрей, рождаемых на одной панели
Definition defs.h:136
const int defaultVortexPerPanel
Число вихрей, рождаемых на одной панели
Definition defs.h:133
const int defaultNameLength
Число разрядов в имени файла
Definition defs.h:118
const double rotateAngleVpPoints
Угол поворота точек VP.
Definition defs.h:163
const std::string defaultAirfoilsDir
Каталог с файлами профилей
Definition defs.h:166
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:207
const std::vector< std::string > defaultReviseParameters
Definition defs.h:115
const int defaultSaveVtxStep
Definition defs.h:108
const std::pair< std::string, int > defaultBoundaryCondition
Способ удовлетворения граничного условия
Definition defs.h:145
const std::pair< std::string, int > defaultLinearSystemSolver
Способ решения линейной системы
Definition defs.h:148
const double defaultSigma0
Радиус вихря по умолчанию
Definition defs.h:121
const std::pair< std::pair< std::string, int >, std::string > defaultSaveVP
Шаг подсчета поля скорости и давления
Definition defs.h:103
const std::string defaultFileWake("")
Файл со следом
Структура, задающая параметры профиля
Definition Passport2D.h:205
Point2D addedMass
Присоединенная масса
Definition Passport2D.h:228
double chord
Хорда
Definition Passport2D.h:222
std::string mechanicalSystem
Definition Passport2D.h:235
Point2D basePoint
Смещение центра масс (перенос профиля)
Definition Passport2D.h:216
int mechanicalSystemType
Тип механической системы
Definition Passport2D.h:234
std::string fileAirfoil
Имя файла с начальным состоянием профилей (без полного пути)
Definition Passport2D.h:207
double angle
Угол поворота (угол атаки)
Definition Passport2D.h:225
std::string mechanicalSystemParameters
Definition Passport2D.h:236
Point2D scale
Коэффициент масштабирования
Definition Passport2D.h:219
size_t requiredNPanels
Желаемое число панелей для разбиения геометрии
Definition Passport2D.h:213
bool inverse
Признак разворота нормалей (для расчета внутреннего течения)
Definition Passport2D.h:231
std::pair< std::string, int > boundaryCondition
Метод аппроксимации граничных условий
Definition Passport2D.h:190
std::pair< std::string, int > velocityComputation
Definition Passport2D.h:180
std::pair< std::string, int > linearSystemSolver
Definition Passport2D.h:174
std::pair< std::string, int > typeAccel
Способ разгона потока
Definition Passport2D.h:84
double accelCft(double currentTime) const
Функция-множитель, позволяющая моделировать разгон
double vRef
Референсная скорость
Definition Passport2D.h:81
double nu
Коэффициент кинематической вязкости среды
Definition Passport2D.h:99
double timeAccel
Время разгона потока
Definition Passport2D.h:87
double rho
Плотность потока
Definition Passport2D.h:75
Point2D vInf
Скоростью набегающего потока
Definition Passport2D.h:78
int minVortexPerPanel
Минимальное число вихрей, рождаемых на каждой панели профииля
Definition Passport2D.h:141
std::string fileSource
Имя файла с положениями источников (без полного пути)
Definition Passport2D.h:150
double delta
Расстояние, на которое рождаемый вихрь отодвигается от профиля
Definition Passport2D.h:138
double epscol
Радиус коллапса
Definition Passport2D.h:132
std::string fileWake
Имя файла с начальным состоянием вихревого следа (без полного пути)
Definition Passport2D.h:147
double sigma0
Радиус вихря
Definition Passport2D.h:126
double maxGamma
Максимально допустимая циркуляция вихря
Definition Passport2D.h:144
double distFar
Расстояние от центра самого подветренного (правого) профиля, на котором вихри уничтожаются
Definition Passport2D.h:135
double dt
Шаг по времени
Definition PassportGen.h:67
std::pair< std::string, int > fileTypeVtx
Тип файлов для сохранения скорости и давления
Definition PassportGen.h:79
double timeStart
Начальное время
Definition PassportGen.h:61
std::vector< std::string > reviseParameters
Список перечитываемых параметров
Definition PassportGen.h:73
int saveVPstep
Шаг вычисления и сохранения скорости и давления
Definition PassportGen.h:86
int revisePassportStep
Шаг перечитывания паспорта
Definition PassportGen.h:70
int saveVtxStep
Шаг сохранения кадров в бинарные файлы
Definition PassportGen.h:81
int saveVisStress
Шаг вычисления и сохранения скорости и давления
Definition PassportGen.h:89
int nameLength
Число разрядов в имени файла
Definition PassportGen.h:76
double timeStop
Конечное время
Definition PassportGen.h:64
std::pair< std::string, int > fileTypeVP
Тип файлов для сохранения скорости и давления
Definition PassportGen.h:84