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< AirfoilParamsairfoilParams
 Список структур с параметрами профилей
 
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 252 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:301
std::string defaultsFileFullName
Definition Passport2D.h:281
std::vector< std::string > varLine
Definition Passport2D.h:283
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:282
std::string mechanicsFileFullName
Definition Passport2D.h:280
std::string fileFullName
Имена файлов
Definition Passport2D.h:279
Класс, определяющий работу с потоком логов
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(std::string &fileName, LogStream &info, bool exitKey=false, const std::list< std::string > &extList={})
Проверка существования файла
Definition defs.h:340
Here is the call graph for this function:

◆ ~Passport()

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

Деструктор

Definition at line 335 of file Passport2D.h.

335{ };

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("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
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(...)
const double PI
Число .
Definition defs.h:76
bool rotateForces
Признак работы в "географической" системе координат
Definition Passport2D.h:291
std::string wakesDir
Каталог с файлами вихревых следов
Definition Passport2D.h:273
bool calcCoefficients
Признак вычисления коэффициентов вместо сил
Definition Passport2D.h:294
double rotateAngleVpPoints
Угол поворота точек VP.
Definition Passport2D.h:297
WakeDiscretizationProperties wakeDiscretizationProperties
Структура с параметрами дискретизации вихревого следа
Definition Passport2D.h:304
std::string airfoilsDir
Каталог с файлами профилей
Definition Passport2D.h:270
std::vector< AirfoilParams > airfoilParams
Список структур с параметрами профилей
Definition Passport2D.h:276
NumericalSchemes numericalSchemes
Структура с используемыми численными схемами
Definition Passport2D.h:307
Класс, позволяющий выполнять разбор файлов и строк с настройками и параметрами
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:22
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 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
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 475 of file Passport2D.cpp.

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
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 552 of file Passport2D.cpp.

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 = {";
572 for (const auto& s : timeDiscretizationProperties.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}
Here is the caller graph for this function:

Member Data Documentation

◆ airfoilParams

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

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

Definition at line 276 of file Passport2D.h.

◆ airfoilsDir

std::string VM2D::Passport::airfoilsDir

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

Definition at line 270 of file Passport2D.h.

◆ calcCoefficients

bool VM2D::Passport::calcCoefficients

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

Definition at line 294 of file Passport2D.h.

◆ defaultsFileFullName

std::string VM2D::Passport::defaultsFileFullName

Definition at line 281 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 279 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 280 of file Passport2D.h.

◆ numericalSchemes

NumericalSchemes VM2D::Passport::numericalSchemes

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

Definition at line 307 of file Passport2D.h.

◆ physicalProperties

PhysicalProperties VM2D::Passport::physicalProperties

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

Definition at line 301 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 297 of file Passport2D.h.

◆ rotateForces

bool VM2D::Passport::rotateForces

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

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

Definition at line 291 of file Passport2D.h.

◆ switchersFileFullName

std::string VM2D::Passport::switchersFileFullName

Definition at line 282 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 283 of file Passport2D.h.

◆ wakeDiscretizationProperties

WakeDiscretizationProperties VM2D::Passport::wakeDiscretizationProperties

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

Definition at line 304 of file Passport2D.h.

◆ wakesDir

std::string VM2D::Passport::wakesDir

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

Definition at line 273 of file Passport2D.h.


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