VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
VM2D::Passport Class Reference

Класс, опеделяющий паспорт двумерной задачи More...

#include <Passport2D.h>

Inheritance diagram for VM2D::Passport:
Collaboration diagram for VM2D::Passport:

Public Member Functions

 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)
 Конструктор
 
virtual ~Passport ()
 Деструктор
 
void GetReviseParamsFromParser (const Passport &newPassport, const std::vector< std::string > paramList)
 Считывание измененных параметров
 

Public Attributes

std::string airfoilsDir
 Каталог с файлами профилей
 
std::string wakesDir
 Каталог с файлами вихревых следов
 
std::vector< AirfoilParams > airfoilParams
 Список структур с параметрами профилей
 
std::string fileFullName
 Имена файлов
 
std::string mechanicsFileFullName
 
std::string defaultsFileFullName
 
std::string switchersFileFullName
 
std::vector< std::string > varLine
 
bool rotateForces
 Признак работы в "географической" системе координат
 
bool calcCoefficients
 Признак вычисления коэффициентов вместо сил
 
double rotateAngleVpPoints
 Угол поворота точек VP.
 
PhysicalProperties physicalProperties
 Структура с физическими свойствами задачи
 
WakeDiscretizationProperties wakeDiscretizationProperties
 Структура с параметрами дискретизации вихревого следа
 
NumericalSchemes numericalSchemes
 Структура с используемыми численными схемами
 
std::string dir
 Рабочий каталог задачи
 
std::string problemName
 Название задачи
 
size_t problemNumber
 Номер задачи
 
TimeDiscretizationProperties timeDiscretizationProperties
 Структура с параметрами процесса интегрирования по времени
 

Protected Attributes

LogStream info
 Поток для вывода логов и сообщений об ошибках
 

Private Member Functions

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
 Печать всех параметров расчета в поток логов
 

Detailed Description

Класс, опеделяющий паспорт двумерной задачи

Author
Марчевский Илья Константинович
Сокол Ксения Сергеевна
Рятина Евгения Павловна
Колганова Александра Олеговна
Version
1.14
Date
6 марта 2026 г.

Definition at line 255 of file Passport2D.h.

Constructor & Destructor Documentation

◆ Passport()

Passport::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 
)

Конструктор

Осуществляет чтение всех данных из соответствующих потоков, полностью инициализирует паспорт

Parameters
[in,out]infoStreamбазовый поток для вывода логов
[in]_problemNameконстантная ссылка наназвание задачи
[in]_problemNumberномер (по счету) решаемой задачи
[in]_filePassportконстантная ссылка на файл (без пути) с паспортом задачи
[in]_mechanicsконстантная ссылка на файл (c путем) со словарем механических систем
[in]_defaultsконстантная ссылка на имя файла (с путем) с параметрами по умолчанию
[in]_switchersконстантная ссылка на имя файла (с путем) со значениями параметров-переключателей
[in]varsконстантная ссылка на список переменных, заданных в виде строк

Definition at line 69 of file Passport2D.cpp.

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}
PhysicalProperties physicalProperties
Структура с физическими свойствами задачи
Definition Passport2D.h:304
std::string defaultsFileFullName
Definition Passport2D.h:284
std::vector< std::string > varLine
Definition Passport2D.h:286
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::string switchersFileFullName
Definition Passport2D.h:285
std::string mechanicsFileFullName
Definition Passport2D.h:283
std::string fileFullName
Имена файлов
Definition Passport2D.h:282
Класс, определяющий работу с потоком логов
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::string VectorStringToString(const std::vector< std::string > &_vecString)
Объединение вектора (списка) из строк в одну строку
bool fileExistTest(const std::string &fileName_, LogStream &info, bool exitKey=false, const std::list< std::string > &extList={})
Проверка существования файла
Definition defs.h:346
Here is the call graph for this function:

◆ ~Passport()

virtual VM2D::Passport::~Passport ( )
inlinevirtual

Деструктор

Definition at line 338 of file Passport2D.h.

338{ };

Member Function Documentation

◆ GetParamsFromParser()

void Passport::GetParamsFromParser ( std::istream &  mainStream,
std::istream &  mechanicsStream,
std::istream &  defaultStream,
std::istream &  switcherStream,
std::istream &  varsStream,
const std::vector< std::string >  paramList 
)
overrideprivatevirtual

Считывание всех параметров расчета из соответствующих потоков

Parameters
[in]mainStreamссылка на основной поток
[in]mechanicsStreamссылка на поток со словарем механических систем
[in]defaultStreamссылка на поток с параметрами по умолчанию
[in]switcherStreamссылка на поток со значениями параметров-переключателей
[in]varsStreamссылка на поток с параметрами конкретной задачи и переменными
Todo:
Удалить в следующих версиях. Добавлено для совместимости со старым синтаксисом задания разгона потока

Implements VMlib::PassportGen.

Definition at line 118 of file Passport2D.cpp.

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("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);
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
326
334 }
335
336 if (ifUpdate("coefEpsAst"))
337 parser->get("coefEpsAst", wakeDiscretizationProperties.coefEpsAst, &defaults::defaultCoefEpsAst, readAll);
338
339 if (readAll)
340 {
343 parser->get("gmresEps", numericalSchemes.gmresEps);
344
345 if (numericalSchemes.linearSystemSolver.second == 2)
346 {
347 parser->get("fastGmresTheta", numericalSchemes.gmresTheta);
348 parser->get("fastGmresMultipoleOrder", numericalSchemes.gmresMultipoleOrder);
349 }
350
352
354 {
355 parser->get("nbodyTheta", numericalSchemes.nbodyTheta);
356 parser->get("nbodyMultipoleOrder", numericalSchemes.nbodyMultipoleOrder);
357 }
358
359 //parser->get("wakeMotionIntegrator", numericalSchemes.wakeMotionIntegrator);
360 parser->get("boundaryConditionSatisfaction", numericalSchemes.boundaryCondition, &defaults::defaultBoundaryCondition);
361
362 parser->get("airfoilsDir", airfoilsDir, &defaults::defaultAirfoilsDir);
363 parser->get("wakesDir", wakesDir, &defaults::defaultWakesDir);
364
367
368 //Для обдува ветром, когда углы считаются по компасу
369 //parser->get("geographicalAngles", geographicalAngles, &defaults::defaultGeographicalAngles);
370 //if (geographicalAngles && (physicalProperties.vInf[1] != 0.0))
371 //{
372 // info('e') << "For geographical angles vInf should be horizontal; now vInf = " << physicalProperties.vInf << "." << std::endl;
373 // exit(1);
374 //}
375
376 parser->get("rotateForces", rotateForces, &defaults::defaultRotateForces);
377 parser->get("calcCoefficients", calcCoefficients, &defaults::defaultCalcCoefficients);
378 }
379
380 // 2. Разбор параметров профилей
381 if (readAll)
382 {
383 std::vector<std::string> airfoil;
384 parser->get("airfoil", airfoil, &defaults::defaultAirfoil);
385
386 //определяем число профилей и организуем цикл по ним
387 size_t nAirfoil = airfoil.size();
388 //*(defaults::defaultPinfo) << "Number of airfoils = " << nAirfoil << endl;
389 for (size_t i = 0; i < nAirfoil; ++i)
390 {
391 //делим имя файла + выражение в скобках на 2 подстроки
392 std::pair<std::string, std::string> airfoilLine = VMlib::StreamParser::SplitString(info, airfoil[i], false);
393
394 AirfoilParams prm;
395 //первая подстрока - имя файла
396 prm.fileAirfoil = airfoilLine.first;
397
398 //вторую подстроку разделяем на вектор из строк по запятым, стоящим вне фигурных скобок
399 std::vector<std::string> vecAirfoilLineSecond = VMlib::StreamParser::StringToVector(airfoilLine.second, '{', '}');
400
401 //создаем парсер и связываем его с параметрами профиля
402 std::stringstream aflStream(VMlib::StreamParser::VectorStringToString(vecAirfoilLineSecond));
403 std::unique_ptr<VMlib::StreamParser> parserAirfoil;
404
405 parserAirfoil.reset(new VMlib::StreamParser(info, "airfoil parser", aflStream, defaultStream, switcherStream, varsStream));
406
407 //считываем нужные параметры с учетом default-значений
408 parserAirfoil->get("nPanels", prm.requiredNPanels, &defaults::defaultRequiredNPanels);
409
410 parserAirfoil->get("basePoint", prm.basePoint, &defaults::defaultBasePoint);
411
412 std::vector<double> tmpScale, defaultTmpScale = { defaults::defaultScale[0], defaults::defaultScale[1] };
413
414 parserAirfoil->get("scale", tmpScale, &defaultTmpScale);
415 switch (tmpScale.size())
416 {
417 case 1:
418 prm.scale[0] = prm.scale[1] = tmpScale[0];
419 break;
420 case 2:
421 prm.scale[0] = tmpScale[0];
422 prm.scale[1] = tmpScale[1];
423 break;
424 default:
425 info('e') << "Error in _scale_ value for airfoil" << std::endl;
426 exit(1);
427 }
428 //parserAirfoil->get("scale", prm.scalexy, &defaults::defaultScale);
429
430
431 parserAirfoil->get("angle", prm.angle, &defaults::defaultAngle);
432 prm.angle *= PI / 180.0;
433
434 parserAirfoil->get("chord", prm.chord, &defaults::defaultChord);
435
436 parserAirfoil->get("addedMass", prm.addedMass, &defaults::defaultAddedMass);
437
438
439 parserAirfoil->get("inverse", prm.inverse, &defaults::defaultInverse);
440 parserAirfoil->get("mechanicalSystem", prm.mechanicalSystem, &defaults::defaultMechanicalSystem);
441
443 {
444 prm.mechanicalSystemType = 0;
446 }
447 else
448 {
449 std::unique_ptr<VMlib::StreamParser> parserMechanicsList;
450 std::unique_ptr<VMlib::StreamParser> parserSwitchers;
451 parserMechanicsList.reset(new VMlib::StreamParser(info, "mechanical parser", mechanicsStream, defaultStream, switcherStream, varsStream, { prm.mechanicalSystem }));
452 parserSwitchers.reset(new VMlib::StreamParser(info, "switchers parser", switcherStream));
453
454 std::string mechString;
455
456 parserMechanicsList->get(prm.mechanicalSystem, mechString);
457
458 //делим тип мех.системы + выражение в скобках (ее параметры) на 2 подстроки
459 std::pair<std::string, std::string> mechanicsLine = VMlib::StreamParser::SplitString(info, mechString);
460
461 std::string mechTypeAlias = mechanicsLine.first;
462 parserSwitchers->get(mechTypeAlias, prm.mechanicalSystemType);
463
464 //вторую подстроку разделяем на вектор из строк по запятым, стоящим вне фигурных скобок
465 std::vector<std::string> vecMechLineSecond = VMlib::StreamParser::StringToVector(mechanicsLine.second, '{', '}');
467 }
468
469 //отправляем считанные параметры профиля в структуру данных паспорта
470 airfoilParams.push_back(prm);
471
472 } //for i
473 }//readAll
474}//GetAllParamsFromParser(...)
const double PI
Число .
Definition defs.h:76
bool rotateForces
Признак работы в "географической" системе координат
Definition Passport2D.h:294
std::string wakesDir
Каталог с файлами вихревых следов
Definition Passport2D.h:276
bool calcCoefficients
Признак вычисления коэффициентов вместо сил
Definition Passport2D.h:297
double rotateAngleVpPoints
Угол поворота точек VP.
Definition Passport2D.h:300
WakeDiscretizationProperties wakeDiscretizationProperties
Структура с параметрами дискретизации вихревого следа
Definition Passport2D.h:307
std::string airfoilsDir
Каталог с файлами профилей
Definition Passport2D.h:273
std::vector< AirfoilParams > airfoilParams
Список структур с параметрами профилей
Definition Passport2D.h:279
NumericalSchemes numericalSchemes
Структура с используемыми численными схемами
Definition Passport2D.h:310
Класс, позволяющий выполнять разбор файлов и строк с настройками и параметрами
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 UpperCase(const std::string &line)
Перевод строки в верхний регистр
P length() const
Вычисление 2-нормы (длины) вектора
Definition numvector.h:374
if(currentStep % 1==0)
Definition gammaCirc.h:23
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 > boundaryCondition
Метод аппроксимации граничных условий
Definition Passport2D.h:193
std::pair< std::string, int > velocityComputation
Definition Passport2D.h:183
std::pair< std::string, int > linearSystemSolver
Definition Passport2D.h:177
std::pair< std::string, int > typeAccel
Способ разгона потока
Definition Passport2D.h:84
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 coefEpsAst
Коэффициент для вычислекния eps_ast.
Definition Passport2D.h:153
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
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetReviseParamsFromParser()

void Passport::GetReviseParamsFromParser ( const Passport &  newPassport,
const std::vector< std::string >  paramList 
)

Считывание измененных параметров

Definition at line 479 of file Passport2D.cpp.

484{
486
487 bool readAll = ((paramList.size() == 1) && (paramList[0] == ""));
488 std::vector<std::string> PR;
489 for (const auto& s : paramList)
490 PR.push_back(UP(s));
491
492
493 auto ifUpdate = [&](const std::string& checkString) {return (readAll || std::count(PR.begin(), PR.end(), UP(checkString))); };
494
495 if (ifUpdate("nameLength") && (this->timeDiscretizationProperties.nameLength != newPassport.timeDiscretizationProperties.nameLength))
496 {
498 info('i') << "updated nameLength = " << timeDiscretizationProperties.nameLength << std::endl;
499 }
500
501 if (ifUpdate("timeStop") && (timeDiscretizationProperties.timeStop != newPassport.timeDiscretizationProperties.timeStop))
502 {
504 info('i') << "updated timeStop = " << timeDiscretizationProperties.timeStop << std::endl;
505 }
506
507 if (ifUpdate("dt") && (timeDiscretizationProperties.dt != newPassport.timeDiscretizationProperties.dt))
508 {
510 info('i') << "updated dt = " << timeDiscretizationProperties.dt << std::endl;
511 }
512
513 if (ifUpdate("vInf") && (physicalProperties.vInf != newPassport.physicalProperties.vInf))
514 {
516 info('i') << "updated vInf = " << physicalProperties.vInf << std::endl;
517
519 {
521 info('i') << "updated vRef = " << physicalProperties.vRef << std::endl;
522 }
523 }
524
525 if (ifUpdate("vRef") && (physicalProperties.vRef != newPassport.physicalProperties.vRef))
526 {
528 info('i') << "updated vRef = " << physicalProperties.vRef << std::endl;
529 }
530
531 if (ifUpdate("coefEpsAst") && (wakeDiscretizationProperties.coefEpsAst != newPassport.wakeDiscretizationProperties.coefEpsAst))
532 {
534 info('i') << "updated coefEpsAst = " << wakeDiscretizationProperties.coefEpsAst << std::endl;
535 }
536
537
538 if (ifUpdate("saveVtx") &&
540 {
543
544 info('-') << "updated saveVtx = " << timeDiscretizationProperties.fileTypeVtx.first << "( " << timeDiscretizationProperties.saveVtxStep << " )" << std::endl;
545 }
546
547 if (ifUpdate("saveVP") &&
549 {
552
553 info('-') << "updated saveVtx = " << timeDiscretizationProperties.fileTypeVP.first << "( " << timeDiscretizationProperties.saveVPstep << " )" << std::endl;
554 }
555
556}//GetReviseParamsFromParser
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintAllParams()

void Passport::PrintAllParams ( )
overrideprivatevirtual

Печать всех параметров расчета в поток логов

Implements VMlib::PassportGen.

Definition at line 562 of file Passport2D.cpp.

563{
564 const std::string str = "passport info: ";
565
566 info('i') << "--- Passport info ---" << std::endl;
567 info('-') << "rho = " << physicalProperties.rho << std::endl;
568 info('-') << "vInf = " << physicalProperties.vInf << std::endl;
569 info('-') << "vRef = " << physicalProperties.vRef << std::endl;
570 info('-') << "velAccel = " << physicalProperties.typeAccel.first << "( " << physicalProperties.timeAccel << " )" << std::endl;
571
572 info('-') << "nu = " << physicalProperties.nu << std::endl;
573 info('-') << "timeStart = " << timeDiscretizationProperties.timeStart << std::endl;
574 info('-') << "timeStop = " << timeDiscretizationProperties.timeStop << std::endl;
575 info('-') << "dt = " << timeDiscretizationProperties.dt << std::endl;
576 info('-') << "nameLength = " << timeDiscretizationProperties.nameLength << std::endl;
577 info('-') << "saveVtx = " << timeDiscretizationProperties.fileTypeVtx.first << "( " << timeDiscretizationProperties.saveVtxStep << " )" << std::endl;
578 info('-') << "saveVP = " << timeDiscretizationProperties.fileTypeVP.first << "( " << timeDiscretizationProperties.saveVPstep << " )" << std::endl;
579
580 info('-') << "revisePassportStep = " << timeDiscretizationProperties.revisePassportStep << std::endl;
581 info('-') << "reviseParameters = {";
582 for (const auto& s : timeDiscretizationProperties.reviseParameters)
583 info('-') << s << "";
584 info('-') << "}" << std::endl;
585
586 info('-') << "saveVisStress = " << timeDiscretizationProperties.saveVisStress << std::endl;
587 info('-') << "sigma0 = " << wakeDiscretizationProperties.sigma0 << std::endl;
588 info('-') << "epscol = " << wakeDiscretizationProperties.epscol << std::endl;
589 info('-') << "coefEpsAst = " << wakeDiscretizationProperties.coefEpsAst << std::endl;
590
591 info('-') << "distFar = " << wakeDiscretizationProperties.distFar << std::endl;
592 info('-') << "delta = " << wakeDiscretizationProperties.delta << std::endl;
593 info('-') << "vortexPerPanel = " << wakeDiscretizationProperties.minVortexPerPanel << std::endl;
594 info('-') << "maxGamma = " << ((wakeDiscretizationProperties.maxGamma == 1e+10) ? 0.0 : wakeDiscretizationProperties.maxGamma) << std::endl;
595 info('-') << "linearSystemSolver = " << numericalSchemes.linearSystemSolver.first << std::endl;
597 {
598 info('-') << "gmresEps = " << numericalSchemes.gmresEps << std::endl;
599 if (numericalSchemes.linearSystemSolver.second == 2)
600 {
601 info('-') << "gmresTheta = " << numericalSchemes.gmresTheta << std::endl;
602 info('-') << "gmresMultipoleOrder = " << numericalSchemes.gmresMultipoleOrder << std::endl;
603 }
604 }
605
606 info('-') << "velocityComputation = " << numericalSchemes.velocityComputation.first << std::endl;
608 {
609 info('-') << "nbodyTheta = " << numericalSchemes.nbodyTheta << std::endl;
610 info('-') << "nbodyMultipoleOrder = " << numericalSchemes.nbodyMultipoleOrder << std::endl;
611 }
612
613 //info('-') << "wakeMotionIntegrator = " << numericalSchemes.wakeMotionIntegrator << std::endl;
614 info('_') << "boundaryCondition = " << numericalSchemes.boundaryCondition.first << std::endl;
615
616 info('-') << "airfoilsDir = " << airfoilsDir << std::endl;
617 info('-') << "wakesDir = " << wakesDir << std::endl;
618
619 //Для обдува ветром, когда углы считаются по компасу
620 //info('-') << "geographicalAngles = " << geographicalAngles << std::endl;
621 info('-') << "rotateForces = " << rotateForces << std::endl;
622 info('-') << "calcCoefficients = " << calcCoefficients << std::endl;
623 info('-') << "rotateVpPoints = " << rotateAngleVpPoints << std::endl;
624
625
626
627 info('-') << "number of airfoils = " << airfoilParams.size() << std::endl;
628 for (size_t q = 0; q < airfoilParams.size(); ++q)
629 {
630 info('_') << "airfoil[" << q << "]_file = " << airfoilParams[q].fileAirfoil << std::endl;
631 info('_') << "airfoil[" << q << "]_requiredNPanels = " << airfoilParams[q].requiredNPanels << std::endl;
632 info('_') << "airfoil[" << q << "]_basePoint = " << airfoilParams[q].basePoint << std::endl;
633 info('_') << "airfoil[" << q << "]_scale = " << airfoilParams[q].scale << std::endl;
634 info('_') << "airfoil[" << q << "]_angle = " << airfoilParams[q].angle << std::endl;
635 info('_') << "airfoil[" << q << "]_chord = " << airfoilParams[q].chord << std::endl;
636 info('_') << "airfoil[" << q << "]_inverse = " << (airfoilParams[q].inverse ? "true": "false") << std::endl;
637 info('_') << "airfoil[" << q << "]_mechanicalSystem = " << airfoilParams[q].mechanicalSystem << std::endl;
638 info('_') << "airfoil[" << q << "]_addedMass = " << airfoilParams[q].addedMass << std::endl;
639 }
640
641 info('-') << "fileWake = " << wakeDiscretizationProperties.fileWake << std::endl;
642 info('-') << "fileSource = " << wakeDiscretizationProperties.fileSource << std::endl;
643}
Here is the caller graph for this function:

Member Data Documentation

◆ airfoilParams

std::vector<AirfoilParams> VM2D::Passport::airfoilParams

Список структур с параметрами профилей

Definition at line 279 of file Passport2D.h.

◆ airfoilsDir

std::string VM2D::Passport::airfoilsDir

Каталог с файлами профилей

Definition at line 273 of file Passport2D.h.

◆ calcCoefficients

bool VM2D::Passport::calcCoefficients

Признак вычисления коэффициентов вместо сил

Definition at line 297 of file Passport2D.h.

◆ defaultsFileFullName

std::string VM2D::Passport::defaultsFileFullName

Definition at line 284 of file Passport2D.h.

◆ dir

std::string VMlib::PassportGen::dir
inherited

Рабочий каталог задачи

Definition at line 129 of file PassportGen.h.

◆ fileFullName

std::string VM2D::Passport::fileFullName

Имена файлов

Definition at line 282 of file Passport2D.h.

◆ info

LogStream VMlib::PassportGen::info
mutableprotectedinherited

Поток для вывода логов и сообщений об ошибках

Definition at line 122 of file PassportGen.h.

◆ mechanicsFileFullName

std::string VM2D::Passport::mechanicsFileFullName

Definition at line 283 of file Passport2D.h.

◆ numericalSchemes

NumericalSchemes VM2D::Passport::numericalSchemes

Структура с используемыми численными схемами

Definition at line 310 of file Passport2D.h.

◆ physicalProperties

PhysicalProperties VM2D::Passport::physicalProperties

Структура с физическими свойствами задачи

Definition at line 304 of file Passport2D.h.

◆ problemName

std::string VMlib::PassportGen::problemName
inherited

Название задачи

Definition at line 132 of file PassportGen.h.

◆ problemNumber

size_t VMlib::PassportGen::problemNumber
inherited

Номер задачи

Definition at line 135 of file PassportGen.h.

◆ rotateAngleVpPoints

double VM2D::Passport::rotateAngleVpPoints

Угол поворота точек VP.

Definition at line 300 of file Passport2D.h.

◆ rotateForces

bool VM2D::Passport::rotateForces

Признак работы в "географической" системе координат

Признак поворота вычисляемых сил в профильную систему координат

Definition at line 294 of file Passport2D.h.

◆ switchersFileFullName

std::string VM2D::Passport::switchersFileFullName

Definition at line 285 of file Passport2D.h.

◆ timeDiscretizationProperties

TimeDiscretizationProperties VMlib::PassportGen::timeDiscretizationProperties
inherited

Структура с параметрами процесса интегрирования по времени

Definition at line 138 of file PassportGen.h.

◆ varLine

std::vector<std::string> VM2D::Passport::varLine

Definition at line 286 of file Passport2D.h.

◆ wakeDiscretizationProperties

WakeDiscretizationProperties VM2D::Passport::wakeDiscretizationProperties

Структура с параметрами дискретизации вихревого следа

Definition at line 307 of file Passport2D.h.

◆ wakesDir

std::string VM2D::Passport::wakesDir

Каталог с файлами вихревых следов

Definition at line 276 of file Passport2D.h.


The documentation for this class was generated from the following files: