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

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

#include <Mechanics2DRigidGivenLaw.h>

Inheritance diagram for VM2D::MechanicsRigidGivenLaw:
Collaboration diagram for VM2D::MechanicsRigidGivenLaw:

Public Member Functions

 MechanicsRigidGivenLaw (const World2D &W_, size_t numberInPassport_)
 Конструктор
 
 ~MechanicsRigidGivenLaw ()
 Деструктор
 
virtual void GetHydroDynamForce () override
 Вычисление гидродинамической силы, действующей на профиль
 
virtual Point2D VeloOfAirfoilRcm (double currTime) override
 Вычисление скорости центра масс профиля
 
virtual Point2D PositionOfAirfoilRcm (double currTime) override
 Вычисление положения центра масс профиля
 
virtual double AngularVelocityOfAirfoil (double currTime) override
 Вычисление угловой скорости профиля
 
virtual double AngleOfAirfoil (double currTime) override
 Вычисление угла поворота профиля
 
virtual void VeloOfAirfoilPanels (double currTime) override
 Вычисление скоростей начал панелей
 
virtual void ReadSpecificParametersFromDictionary () override
 Чтение параметров конкретной механической системы
 
virtual void Move () override
 Перемещение профиля в соответствии с законом
 
void Initialize (Point2D Vcm0_, Point2D Rcm0_, double Wcm0_, double Phi0_)
 Задание начального положения и начальной скорости
 
void GenerateForcesHeader ()
 Генерация заголовка файла нагрузок
 
void GeneratePositionHeader ()
 Генерация заголовка файла положения профиля
 
void GenerateForcesString ()
 Сохранение строки со статистикой в файл нагрузок
 
void GeneratePositionString ()
 Сохранение строки со статистикой в файл нагрузок
 

Public Attributes

Point2D Vcm0
 Начальная скорость центра и угловая скорость
 
double Wcm0
 
Point2D Rcm0
 Начальное положение профиля
 
double Phi0
 
Point2D Vcm
 Текущие скорость центра и угловая скорость
 
double Wcm
 
Point2D Rcm
 Текущие положение профиля
 
double Phi
 
Point2D VcmOld
 Скорость и отклонение с предыдущего шага
 
double WcmOld
 
Point2D RcmOld
 Текущие положение профиля
 
double PhiOld
 
double circulation
 Текущая циркуляция скорости по границе профиля
 
double circulationOld
 Циркуляция скорости по границе профиля с предыдущего шага
 
const bool isMoves
 Переменная, отвечающая за то, двигается профиль или нет
 
const bool isDeform
 Переменная, отвечающая за то, деформируется профиль или нет
 
Point2D hydroDynamForce
 Вектор гидродинамической силы и момент, действующие на профиль
 
double hydroDynamMoment
 
Point2D viscousForce
 Вектор силы и момент вязкого трения, действующие на профиль
 
double viscousMoment
 

Protected Attributes

const World2DW
 Константная ссылка на решаемую задачу
 
const size_t numberInPassport
 Номер профиля в паспорте
 
Airfoilafl
 
const Boundaryboundary
 
const VortexesParamsvirtVortParams
 
std::unique_ptr< VMlib::StreamParsermechParamsParser
 Умный указатель на парсер параметров механической системы
 

Private Member Functions

void ReadParametersFromDictionary ()
 Парсинг списка параметров механической системы
 

Private Attributes

double timeAccel
 
Point2D initPosition
 
Point2D targetVelocity
 
Point2D targetAmplitude
 
std::function< Point2D(double)> PositionOfCenterOfMass
 
std::function< Point2D(double)> VelocityOfCenterOfMass
 
std::function< double(double)> RotationAngle
 
std::function< double(double)> AngularVelocity
 

Detailed Description

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

Жесткое тело, движущееся по заданному закону

Author
Марчевский Илья Константинович
Сокол Ксения Сергеевна
Рятина Евгения Павловна
Колганова Александра Олеговна

\Version 1.14

Date
6 марта 2026 г.

Definition at line 67 of file Mechanics2DRigidGivenLaw.h.

Constructor & Destructor Documentation

◆ MechanicsRigidGivenLaw()

MechanicsRigidGivenLaw::MechanicsRigidGivenLaw ( const World2D W_,
size_t  numberInPassport_ 
)

Конструктор

Parameters
[in]W_константная ссылка на решаемую задачу
[in]numberInPassport_номер профиля в паспорте задачи

Definition at line 56 of file Mechanics2DRigidGivenLaw.cpp.

57 : Mechanics(W_, numberInPassport_, true, false)
58{
61};
Абстрактный класс, определяющий вид механической системы
Definition Mechanics2D.h:72
void Initialize(Point2D Vcm0_, Point2D Rcm0_, double Wcm0_, double Phi0_)
Задание начального положения и начальной скорости
std::function< Point2D(double)> PositionOfCenterOfMass
std::function< double(double)> AngularVelocity
std::function< double(double)> RotationAngle
std::function< Point2D(double)> VelocityOfCenterOfMass
virtual void ReadSpecificParametersFromDictionary() override
Чтение параметров конкретной механической системы
Here is the call graph for this function:

◆ ~MechanicsRigidGivenLaw()

VM2D::MechanicsRigidGivenLaw::~MechanicsRigidGivenLaw ( )
inline

Деструктор

Definition at line 124 of file Mechanics2DRigidGivenLaw.h.

124{ };

Member Function Documentation

◆ AngleOfAirfoil()

double MechanicsRigidGivenLaw::AngleOfAirfoil ( double  currTime)
overridevirtual

Вычисление угла поворота профиля

Parameters
[in]currTimeтекущее время

Implements VM2D::Mechanics.

Definition at line 190 of file Mechanics2DRigidGivenLaw.cpp.

191{
192 return RotationAngle(currTime);
193}//AngleOfAirfoil(...)
Here is the caller graph for this function:

◆ AngularVelocityOfAirfoil()

double MechanicsRigidGivenLaw::AngularVelocityOfAirfoil ( double  currTime)
overridevirtual

Вычисление угловой скорости профиля

Parameters
[in]currTimeтекущее время

Implements VM2D::Mechanics.

Definition at line 169 of file Mechanics2DRigidGivenLaw.cpp.

170{
171 if (W.getPassport().physicalProperties.typeAccel.second == 3)
172 {
173 switch ((int)(W.getPassport().physicalProperties.timeAccel))
174 {
175 case 0:
176 return 0.0;
177 case 1:
178 return 0.0;
179 case 2:
180 return -1.0;
181 default:
182 return 0.0;
183 }
184 }
185
186 return AngularVelocity(currTime);
187}//AngularVelocityOfAirfoil(...)
const World2D & W
Константная ссылка на решаемую задачу
Definition Mechanics2D.h:79
PhysicalProperties physicalProperties
Структура с физическими свойствами задачи
Definition Passport2D.h:289
const Passport & getPassport() const
Возврат константной ссылки на паспорт
Definition World2D.h:251
std::pair< std::string, int > typeAccel
Способ разгона потока
Definition Passport2D.h:84
double timeAccel
Время разгона потока
Definition Passport2D.h:87
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GenerateForcesHeader()

void Mechanics::GenerateForcesHeader ( )
inherited

Генерация заголовка файла нагрузок

Definition at line 125 of file Mechanics2D.cpp.

126{
127 std::stringstream forceFileName, forceFileNameCsv;
128 forceFileName << W.getPassport().dir << "forces-airfoil-" << numberInPassport;
129 forceFileNameCsv << W.getPassport().dir << "forces-airfoil-" << numberInPassport << ".csv";
130
131 std::ofstream newForcesFile(forceFileName.str());
132 std::ofstream newForcesFileCsv(forceFileNameCsv.str());
133
134 VMlib::PrintLogoToTextFile(newForcesFile, forceFileName.str(), "Hydrodynamic loads for the airfoil " + W.getPassport().airfoilParams[numberInPassport].fileAirfoil);
135
137 VMlib::PrintHeaderToTextFile(newForcesFile, "currentStep currentTime Fx Fy Mz Ftaux Ftauy Mtau");
138 else
139 VMlib::PrintHeaderToTextFile(newForcesFile, "currentStep currentTime CFx CFy CMz CFtaux CFtauy CMtau");
140
142 newForcesFileCsv << "step,time,Fx,Fy,Mz,Ftaux,Ftauy,Mtau";
143 else
144 newForcesFileCsv << "step,time,CFx,CFy,CMz,CFtaux,CFtauy,CMtau";
145
146 newForcesFile.close();
147 newForcesFile.clear();
148
149 newForcesFileCsv.close();
150 newForcesFileCsv.clear();
151
152}//GenerateForcesHeader()
const size_t numberInPassport
Номер профиля в паспорте
Definition Mechanics2D.h:82
bool calcCoefficients
Признак вычисления коэффициентов вместо сил
Definition Passport2D.h:282
std::vector< AirfoilParams > airfoilParams
Список структур с параметрами профилей
Definition Passport2D.h:273
std::string dir
Рабочий каталог задачи
void PrintHeaderToTextFile(std::ofstream &str, const std::string &header)
Формирование подзаголовка в текстовом файле вывода программы VM2D/VM3D.
Definition defs.cpp:175
void PrintLogoToTextFile(std::ofstream &str, const std::string &fileName, const std::string &descr)
Формирование заголовка файла программы VM2D/VM3D.
Definition defs.cpp:139
Here is the call graph for this function:

◆ GenerateForcesString()

void Mechanics::GenerateForcesString ( )
inherited

Сохранение строки со статистикой в файл нагрузок

Definition at line 183 of file Mechanics2D.cpp.

184{
185 std::stringstream forceFileName, forceFileNameCsv;
186 forceFileName << W.getPassport().dir << "forces-airfoil-" << numberInPassport;
187 forceFileNameCsv << W.getPassport().dir << "forces-airfoil-" << numberInPassport << ".csv";
188
189 //double cShock = (W.getPassport().physicalProperties.getCurrTime() > W.getPassport().physicalProperties.timeAccel + 2.0 * W.getPassport().timeDiscretizationProperties.dt) ? 1.0 : 0.0;
190 double cShock = 1.0;
191
192 Point2D cartesianHydroForce = cShock * hydroDynamForce;
193 Point2D cartesianViscoForce = cShock * viscousForce;
194
195 double cartesianHydroMoment = cShock * hydroDynamMoment;
196 double cartesianViscoMoment = cShock * viscousMoment;
197
198 double rotationAngle = W.getPassport().airfoilParams[numberInPassport].angle;
199
200 //Для обдува ветром, когда углы считаются по компасу
201 //if (W.getPassport().geographicalAngles)
202 //{
203 // cartesianHydroForce = cartesianHydroForce.rotated(-0.5 * PI - W.getPassport().airfoilParams[numberInPassport].angle);
204 // cartesianViscoForce = cartesianViscoForce.rotated(-0.5 * PI - W.getPassport().airfoilParams[numberInPassport].angle);
205 // //rotationAngle += 0.5 * PI;
206 //}
207
208 //if (W.getPassport().rotateForces)
209 //{
210 // cartesianHydroForce = cartesianHydroForce.rotated(rotationAngle);
211 // cartesianViscoForce = cartesianViscoForce.rotated(rotationAngle);
212 //}
213
216 {
217 const double& chord = W.getPassport().airfoilParams[numberInPassport].chord;
218 cartesianHydroForce /= (flowPress * chord);
219 cartesianViscoForce /= (flowPress * chord);
220
221 cartesianHydroMoment /= (flowPress * sqr(chord));
222 cartesianViscoMoment /= (flowPress * sqr(chord));
223 }
224
225
226 std::ofstream forcesFile(forceFileName.str(), std::ios::app);
227 forcesFile << std::endl << W.getCurrentStep() << " " << W.getCurrentTime() << " " << cartesianHydroForce[0] << " " << cartesianHydroForce[1] << " " << cartesianHydroMoment << " " << cartesianViscoForce[0] << " " << cartesianViscoForce[1] << " " << cartesianViscoMoment;
228 forcesFile.close();
229
230 std::ofstream forcesFileCsv(forceFileNameCsv.str(), std::ios::app);
231 forcesFileCsv << std::endl << W.getCurrentStep() << "," << W.getCurrentTime() << "," << cartesianHydroForce[0] << "," << cartesianHydroForce[1] << "," << cartesianHydroMoment << "," << cartesianViscoForce[0] << "," << cartesianViscoForce[1] << "," << cartesianViscoMoment;
232 forcesFileCsv.close();
233
234}//GenerateForcesString()
Point2D hydroDynamForce
Вектор гидродинамической силы и момент, действующие на профиль
Point2D viscousForce
Вектор силы и момент вязкого трения, действующие на профиль
double hydroDynamMoment
double getCurrentTime() const
Definition WorldGen.h:100
size_t getCurrentStep() const
Возврат константной ссылки на параметры распараллеливания по MPI.
Definition WorldGen.h:99
T sqr(T x)
Умножение a на комплексно сопряженноe к b.
Definition defsBH.h:101
double vRef
Референсная скорость
Definition Passport2D.h:81
double rho
Плотность потока
Definition Passport2D.h:75
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GeneratePositionHeader()

void Mechanics::GeneratePositionHeader ( )
inherited

Генерация заголовка файла положения профиля

Definition at line 156 of file Mechanics2D.cpp.

157{
158 if (isMoves)
159 {
160 std::stringstream positionFileName, positionFileNameCsv;
161 positionFileName << W.getPassport().dir << "position-airfoil-" << numberInPassport;
162 positionFileNameCsv << W.getPassport().dir << "position-airfoil-" << numberInPassport << ".csv";
163
164 std::ofstream newPositionFile(positionFileName.str());
165 std::ofstream newPositionFileCsv(positionFileNameCsv.str());
166
167 VMlib::PrintLogoToTextFile(newPositionFile, positionFileName.str(), "Position of the airfoil " + W.getPassport().airfoilParams[numberInPassport].fileAirfoil);
168
169 VMlib::PrintHeaderToTextFile(newPositionFile, "currentStep currentTime x y phi Vx Vy w");
170
171 newPositionFileCsv << "step,time,x,y,phi,Vx,Vy,w";
172
173 newPositionFile.close();
174 newPositionFile.clear();
175
176 newPositionFileCsv.close();
177 newPositionFileCsv.clear();
178 }
179}//GeneratePositionHeader()
const bool isMoves
Переменная, отвечающая за то, двигается профиль или нет
Here is the call graph for this function:

◆ GeneratePositionString()

void Mechanics::GeneratePositionString ( )
inherited

Сохранение строки со статистикой в файл нагрузок

Definition at line 238 of file Mechanics2D.cpp.

239{
240 if (isMoves)
241 {
242 std::stringstream positionFileName, positionFileNameCsv;
243 positionFileName << W.getPassport().dir << "position-airfoil-" << numberInPassport;
244 positionFileNameCsv << W.getPassport().dir << "position-airfoil-" << numberInPassport << ".csv";
245
246 std::ofstream positionFile(positionFileName.str(), std::ios::app);
247 positionFile << std::endl << W.getCurrentStep() << " " << W.getCurrentTime() << " " << afl.rcm[0] << " " << afl.rcm[1] << " " << Phi << " " << Vcm[0] << " " << Vcm[1] << " " << Wcm;
248 positionFile.close();
249
250 std::ofstream positionFileCsv(positionFileNameCsv.str(), std::ios::app);
251 positionFileCsv << std::endl << W.getCurrentStep() << "," << W.getCurrentTime() << "," << afl.rcm[0] << "," << afl.rcm[1] << "," << Phi << "," << Vcm[0] << "," << Vcm[1] << "," << Wcm;
252 positionFileCsv.close();
253 }
254}
Point2D rcm
Положение центра масс профиля
Definition Airfoil2D.h:97
Airfoil & afl
Definition Mechanics2D.h:87
Point2D Vcm
Текущие скорость центра и угловая скорость
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHydroDynamForce()

void MechanicsRigidGivenLaw::GetHydroDynamForce ( )
overridevirtual

Вычисление гидродинамической силы, действующей на профиль

Todo:
Учитываем только нулевой момент решения. Надо ли учитывать остальные?

Implements VM2D::Mechanics.

Definition at line 65 of file Mechanics2DRigidGivenLaw.cpp.

66{
67 W.getTimers().start("Force");
68
69 const double& dt = W.getPassport().timeDiscretizationProperties.dt;
70
71 hydroDynamForce = { 0.0, 0.0 };
72 hydroDynamMoment = 0.0;
73
74 viscousForce = { 0.0, 0.0 };
75 viscousMoment = 0.0;
76
77 Point2D hDFGam = { 0.0, 0.0 }; //гидродинамические силы, обусловленные присоед.завихренностью
78 Point2D hDFdelta = { 0.0, 0.0 }; //гидродинамические силы, обусловленные приростом завихренности
79 Point2D hDFQ = { 0.0, 0.0 }; //гидродинамические силы, обусловленные присоед.источниками
80
81 double hDMGam = 0.0; //гидродинамический момент, обусловленный присоед.завихренностью
82 double hDMdelta = 0.0; //гидродинамический момент, обусловленный приростом завихренности
83 double hDMQ = 0.0; //гидродинамический момент, обусловленный присоед.источниками
84
85
86 for (size_t i = 0; i < afl.getNumberOfPanels(); ++i)
87 {
88 /*Point2D*/ Vcm = VeloOfAirfoilRcm(W.getCurrentStep() * dt);
89 /*Point2D*/ VcmOld = VeloOfAirfoilRcm((std::max(W.getCurrentStep(), (size_t)1) - 1) * dt);
90
91 /*double*/ Wcm = AngularVelocityOfAirfoil(W.getCurrentStep() * dt);
92 /*double*/ WcmOld = AngularVelocityOfAirfoil((std::max(W.getCurrentStep(), (size_t)1) - 1) * dt);
93
94 Point2D rK = 0.5 * (afl.getR(i + 1) + afl.getR(i));
95
96 Point2D dr = rK - afl.rcm;
97
98 Point2D velK = { -Wcm * dr[1], Wcm * dr[0] };
99 velK += Vcm;
100
101 double gAtt = Wcm * (dr ^ afl.tau[i]) + (Vcm & afl.tau[i]);
102 double gAttOld = WcmOld * (dr ^ afl.tau[i]) + (VcmOld & afl.tau[i]);
103 double deltaGAtt = gAtt - gAttOld;
104
105 double qAtt = Wcm * (dr ^ afl.nrm[i]) + (Vcm & afl.nrm[i]);
106
108 double deltaK = boundary.sheets.freeVortexSheet(i, 0) * afl.len[i] - afl.gammaThrough[i] + deltaGAtt * afl.len[i];
109
110 /*1*/
111 hDFdelta += deltaK * Point2D({ -dr[1], dr[0] });
112 hDMdelta += 0.5 * deltaK * dr.length2();
113
114 /*2*/
115 hDFGam += 0.25 * (afl.getV(i) + afl.getV(i+1)).kcross() * gAtt * afl.len[i];
116 hDMGam += 0.25 * dr ^ (afl.getV(i) + afl.getV(i + 1)).kcross() * gAtt * afl.len[i];
117
118 /*3*/
119 hDFQ -= 0.25 * (afl.getV(i) + afl.getV(i + 1)) * qAtt * afl.len[i];
120 hDMQ -= 0.25 * dr ^ (afl.getV(i) + afl.getV(i + 1)) * qAtt * afl.len[i];
121 }
122
123 const double rho = W.getPassport().physicalProperties.rho;
124
125 hydroDynamForce = rho * (hDFGam + hDFdelta * (1.0 / dt) + hDFQ);
126 hydroDynamMoment = rho * (hDMGam + hDMdelta / dt + hDMQ);
127
128 if ((W.getPassport().physicalProperties.nu > 0.0) && (W.getCurrentStep() > 0))
129 for (size_t i = 0; i < afl.getNumberOfPanels(); ++i)
130 {
131 Point2D rK = 0.5 * (afl.getR(i + 1) + afl.getR(i)) - afl.rcm;
132 viscousForce += rho * (afl.viscousStress[i] * afl.tau[i]);
133 viscousMoment += rho * (afl.viscousStress[i] * afl.tau[i]) & rK;
134 }
135
136 W.getTimers().stop("Force");
137}// GetHydroDynamForce()
std::vector< double > len
Длины панелей профиля
Definition Airfoil2D.h:94
const Point2D & getR(size_t q) const
Возврат константной ссылки на вершину профиля
Definition Airfoil2D.h:113
const Point2D & getV(size_t q) const
Возврат константной ссылки на скорость вершины профиля
Definition Airfoil2D.h:137
std::vector< Point2D > nrm
Нормали к панелям профиля
Definition Airfoil2D.h:81
std::vector< Point2D > tau
Касательные к панелям профиля
Definition Airfoil2D.h:91
size_t getNumberOfPanels() const
Возврат количества панелей на профиле
Definition Airfoil2D.h:163
std::vector< double > gammaThrough
Суммарные циркуляции вихрей, пересекших панели профиля на прошлом шаге
Definition Airfoil2D.h:276
std::vector< double > viscousStress
Нейросеть для коэффициентов I0 и I3 диффузионной скорости
Definition Airfoil2D.h:268
Sheet sheets
Слои на профиле
Definition Boundary2D.h:96
Point2D VcmOld
Скорость и отклонение с предыдущего шага
const Boundary & boundary
Definition Mechanics2D.h:91
virtual Point2D VeloOfAirfoilRcm(double currTime) override
Вычисление скорости центра масс профиля
virtual double AngularVelocityOfAirfoil(double currTime) override
Вычисление угловой скорости профиля
const double & freeVortexSheet(size_t n, size_t moment) const
Definition Sheet2D.h:100
VMlib::TimersGen & getTimers() const
Возврат ссылки на временную статистику выполнения шага расчета по времени
Definition World2D.h:276
TimeDiscretizationProperties timeDiscretizationProperties
Структура с параметрами процесса интегрирования по времени
void stop(const std::string &timerLabel)
Останов счетчика
Definition TimesGen.cpp:68
void start(const std::string &timerLabel)
Запуск счетчика
Definition TimesGen.cpp:55
auto length2() const -> typename std::remove_const< typename std::remove_reference< decltype(this->data[0])>::type >::type
Вычисление квадрата нормы (длины) вектора
Definition numvector.h:386
double nu
Коэффициент кинематической вязкости среды
Definition Passport2D.h:99
double dt
Шаг по времени
Definition PassportGen.h:67
Here is the call graph for this function:

◆ Initialize()

void Mechanics::Initialize ( Point2D  Vcm0_,
Point2D  Rcm0_,
double  Wcm0_,
double  Phi0_ 
)
inherited

Задание начального положения и начальной скорости

Parameters
[in]Vcm0_- скорость центра масс
[in]Rcm0_- положение центра масс
[in]Wcm0_- угловая скорость центра масс
[in]Phi0_- угол поворота центра масс

Definition at line 92 of file Mechanics2D.cpp.

93{
94 Vcm0 = Vcm0_;
95 Wcm0 = Wcm0_;
96 Rcm0 = Rcm0_;
97 Phi0 = Phi0_;
98
99 Vcm = Vcm0;
100 Wcm = Wcm0;
101 Rcm = Rcm0;
102 Phi = Phi0;
103 VcmOld = Vcm0;
104 WcmOld = Wcm0;
105 RcmOld = Rcm0;
106 PhiOld = Phi0;
107
108 circulation = 2.0 * afl.area * Wcm;
110
113}//Initialize(...)
double phiAfl
Поворот профиля
Definition Airfoil2D.h:100
double area
Площадь профиля
Definition Airfoil2D.h:103
virtual void Move(const Point2D &dr)
Перемещение профиля
virtual void Rotate(double alpha)
Поворот профиля
Point2D Vcm0
Начальная скорость центра и угловая скорость
Point2D RcmOld
Текущие положение профиля
Point2D Rcm
Текущие положение профиля
Point2D Rcm0
Начальное положение профиля
double circulationOld
Циркуляция скорости по границе профиля с предыдущего шага
double circulation
Текущая циркуляция скорости по границе профиля
const Airfoil & getAirfoil(size_t i) const
Возврат константной ссылки на объект профиля
Definition World2D.h:157
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Move()

void MechanicsRigidGivenLaw::Move ( )
overridevirtual

Перемещение профиля в соответствии с законом

Implements VM2D::Mechanics.

Definition at line 221 of file Mechanics2DRigidGivenLaw.cpp.

222{
223 double t = W.getCurrentTime();
225
226 //Point2D airfoilVelo = VeloOfAirfoilRcm(t);
227 Point2D aflRcmOld = afl.rcm;
228 double aflPhiOld = afl.phiAfl;
229 afl.Move(PositionOfAirfoilRcm(t + dt) - aflRcmOld);
230 afl.Rotate(AngleOfAirfoil(t + dt) - aflPhiOld);
231
232 Vcm = VeloOfAirfoilRcm(t + dt);
233 Phi = AngleOfAirfoil(t + dt);
235}//Move()
virtual Point2D PositionOfAirfoilRcm(double currTime) override
Вычисление положения центра масс профиля
virtual double AngleOfAirfoil(double currTime) override
Вычисление угла поворота профиля
Here is the call graph for this function:

◆ PositionOfAirfoilRcm()

Point2D MechanicsRigidGivenLaw::PositionOfAirfoilRcm ( double  currTime)
overridevirtual

Вычисление положения центра масс профиля

Parameters
[in]currTimeтекущее время

Implements VM2D::Mechanics.

Definition at line 163 of file Mechanics2DRigidGivenLaw.cpp.

164{
165 return PositionOfCenterOfMass(currTime);
166}//PositionOfAirfoilRcm(...)
Here is the caller graph for this function:

◆ ReadParametersFromDictionary()

void Mechanics::ReadParametersFromDictionary ( )
privateinherited

Парсинг списка параметров механической системы

Definition at line 116 of file Mechanics2D.cpp.

117{
118 std::stringstream ss(W.getPassport().airfoilParams[afl.numberInPassport].mechanicalSystemParameters);
119
120 mechParamsParser.reset(new VMlib::StreamParser(W.getInfo(), "mechanical parser", ss));
121}//ReadParametersFromDictionary()
const size_t numberInPassport
Номер профиля в паспорте
Definition Airfoil2D.h:188
std::unique_ptr< VMlib::StreamParser > mechParamsParser
Умный указатель на парсер параметров механической системы
Definition Mechanics2D.h:98
Класс, позволяющий выполнять разбор файлов и строк с настройками и параметрами
VMlib::LogStream & getInfo() const
Возврат ссылки на объект LogStream Используется в техничеcких целях для организации вывода
Definition WorldGen.h:82
Here is the call graph for this function:

◆ ReadSpecificParametersFromDictionary()

void MechanicsRigidGivenLaw::ReadSpecificParametersFromDictionary ( )
overridevirtual

Чтение параметров конкретной механической системы

Implements VM2D::Mechanics.

Definition at line 238 of file Mechanics2DRigidGivenLaw.cpp.

239{
240 /*
241 mechParamsParser->get("timeAccel", timeAccel);
242 W.getInfo('i') << "time of accelerated movement: " << "timeAccel = " << timeAccel << std::endl;
243
244 mechParamsParser->get("initPosition", initPosition);
245 W.getInfo('i') << "initial position: " << "initPosition = " << initPosition << std::endl;
246
247 //mechParamsParser->get("targetVelocity", targetVelocity);
248 //W.getInfo('i') << "target Velocity: " << "targetVelocity = " << targetVelocity << std::endl;
249
250 mechParamsParser->get("targetAmplitude", targetAmplitude);
251 W.getInfo('i') << "target Amplitude: " << "targetAmplitude = " << targetAmplitude << std::endl;
252 */
253
254 /*
255 mechParamsParser->get("Comega", Comega);
256
257 W.getInfo('i') << "frequency " << "Comega = " << Comega << std::endl;
258
259 mechParamsParser->get("CA", CA);
260
261 W.getInfo('i') << "Amplitude CA = " << CA << std::endl;
262 */
263}
Here is the caller graph for this function:

◆ VeloOfAirfoilPanels()

void MechanicsRigidGivenLaw::VeloOfAirfoilPanels ( double  currTime)
overridevirtual

Вычисление скоростей начал панелей

Parameters
[in]currTimeтекущее время

Implements VM2D::Mechanics.

Definition at line 202 of file Mechanics2DRigidGivenLaw.cpp.

203{
204 Point2D veloRcm = VeloOfAirfoilRcm(currTime);
205 double angVelo = AngularVelocityOfAirfoil(currTime);
206
207 std::vector<Point2D> vel(afl.getNumberOfPanels(), { 0.0, 0.0 });
208 for (size_t i = 0; i < afl.getNumberOfPanels(); ++i)
209 {
210 vel[i][0] = (afl.getR(i) - afl.rcm).kcross()[0] * angVelo;
211 vel[i][1] = (afl.getR(i) - afl.rcm).kcross()[1] * angVelo;
212 vel[i] += veloRcm;
213 }
214
215 afl.setV(vel);
216
217 circulation = 2.0 * afl.area * angVelo;
218 circulationOld = 2.0 * afl.area * WcmOld;
219}//VeloOfAirfoilPanels(...)
void setV(const Point2D &vel)
Установка постоянной скорости всех вершин профиля
Definition Airfoil2D.h:145
Here is the call graph for this function:

◆ VeloOfAirfoilRcm()

Point2D MechanicsRigidGivenLaw::VeloOfAirfoilRcm ( double  currTime)
overridevirtual

Вычисление скорости центра масс профиля

Parameters
[in]currTimeтекущее время

Implements VM2D::Mechanics.

Definition at line 141 of file Mechanics2DRigidGivenLaw.cpp.

142{
143 if (W.getPassport().physicalProperties.typeAccel.second == 3)
144 {
145 switch ((int)(W.getPassport().physicalProperties.timeAccel))
146 {
147 case 0:
148 return { -1.0, 0.0 };
149 case 1:
150 return { 0.0, -1.0 };
151 case 2:
152 return { 0.0, 0.0 };
153 default:
154 return { 0.0, 0.0 };
155 }
156 }
157
158 return VelocityOfCenterOfMass(currTime);
159}//VeloOfAirfoilRcm(...)
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ afl

Airfoil& VM2D::Mechanics::afl
protectedinherited

Константная ссылка на профиль
инициализируется автоматом в конструкторе, при помощи const_cast

Warning
использует const_cast для получения неконстантной ссылки

Definition at line 87 of file Mechanics2D.h.

◆ AngularVelocity

std::function<double(double)> VM2D::MechanicsRigidGivenLaw::AngularVelocity
private
Initial value:
= [=](double t) -> double
{
return 0.0;
}

Definition at line 109 of file Mechanics2DRigidGivenLaw.h.

110 {
111 return 0.0;
112 };

◆ boundary

const Boundary& VM2D::Mechanics::boundary
protectedinherited

Константная ссылка на граничное условие
инициализируется автоматом в конструкторе

Definition at line 91 of file Mechanics2D.h.

◆ circulation

double VM2D::Mechanics::circulation
inherited

Текущая циркуляция скорости по границе профиля

Definition at line 121 of file Mechanics2D.h.

◆ circulationOld

double VM2D::Mechanics::circulationOld
inherited

Циркуляция скорости по границе профиля с предыдущего шага

Definition at line 124 of file Mechanics2D.h.

◆ hydroDynamForce

Point2D VM2D::Mechanics::hydroDynamForce
inherited

Вектор гидродинамической силы и момент, действующие на профиль

Definition at line 134 of file Mechanics2D.h.

◆ hydroDynamMoment

double VM2D::Mechanics::hydroDynamMoment
inherited

Definition at line 135 of file Mechanics2D.h.

◆ initPosition

Point2D VM2D::MechanicsRigidGivenLaw::initPosition
private

Definition at line 73 of file Mechanics2DRigidGivenLaw.h.

◆ isDeform

const bool VM2D::Mechanics::isDeform
inherited

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

Definition at line 131 of file Mechanics2D.h.

◆ isMoves

const bool VM2D::Mechanics::isMoves
inherited

Переменная, отвечающая за то, двигается профиль или нет

Definition at line 128 of file Mechanics2D.h.

◆ mechParamsParser

std::unique_ptr<VMlib::StreamParser> VM2D::Mechanics::mechParamsParser
protectedinherited

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

Definition at line 98 of file Mechanics2D.h.

◆ numberInPassport

const size_t VM2D::Mechanics::numberInPassport
protectedinherited

Номер профиля в паспорте

Definition at line 82 of file Mechanics2D.h.

◆ Phi

double VM2D::Mechanics::Phi
inherited

Definition at line 112 of file Mechanics2D.h.

◆ Phi0

double VM2D::Mechanics::Phi0
inherited

Definition at line 106 of file Mechanics2D.h.

◆ PhiOld

double VM2D::Mechanics::PhiOld
inherited

Definition at line 118 of file Mechanics2D.h.

◆ PositionOfCenterOfMass

std::function<Point2D(double)> VM2D::MechanicsRigidGivenLaw::PositionOfCenterOfMass
private
Initial value:
= [=](double t) -> Point2D
{
return Point2D{ 0.0, 0.1 * t };
}

Definition at line 77 of file Mechanics2DRigidGivenLaw.h.

78 {
79 //if (t < timeAccel)
80 // return initPosition + 0.5 * (t * t / timeAccel) * targetVelocity;
81 //else
82 // return initPosition + (t - 0.5 * timeAccel) * targetVelocity;
83
84 /*return initPosition + Point2D{ targetAmplitude[0] * sin(DPI * t / timeAccel),
85 targetAmplitude[1] * sin(DPI * t / timeAccel) };*/
86
87 return Point2D{ 0.0, 0.1 * t };
88
89 };

◆ Rcm

Point2D VM2D::Mechanics::Rcm
inherited

Текущие положение профиля

Definition at line 112 of file Mechanics2D.h.

◆ Rcm0

Point2D VM2D::Mechanics::Rcm0
inherited

Начальное положение профиля

Definition at line 106 of file Mechanics2D.h.

◆ RcmOld

Point2D VM2D::Mechanics::RcmOld
inherited

Текущие положение профиля

Definition at line 118 of file Mechanics2D.h.

◆ RotationAngle

std::function<double(double)> VM2D::MechanicsRigidGivenLaw::RotationAngle
private
Initial value:
= [=](double t) -> double
{
return 0.0;
}

Definition at line 104 of file Mechanics2DRigidGivenLaw.h.

105 {
106 return 0.0;
107 };

◆ targetAmplitude

Point2D VM2D::MechanicsRigidGivenLaw::targetAmplitude
private

Definition at line 75 of file Mechanics2DRigidGivenLaw.h.

◆ targetVelocity

Point2D VM2D::MechanicsRigidGivenLaw::targetVelocity
private

Definition at line 74 of file Mechanics2DRigidGivenLaw.h.

◆ timeAccel

double VM2D::MechanicsRigidGivenLaw::timeAccel
private

Definition at line 72 of file Mechanics2DRigidGivenLaw.h.

◆ Vcm

Point2D VM2D::Mechanics::Vcm
inherited

Текущие скорость центра и угловая скорость

Definition at line 109 of file Mechanics2D.h.

◆ Vcm0

Point2D VM2D::Mechanics::Vcm0
inherited

Начальная скорость центра и угловая скорость

Definition at line 103 of file Mechanics2D.h.

◆ VcmOld

Point2D VM2D::Mechanics::VcmOld
inherited

Скорость и отклонение с предыдущего шага

Definition at line 115 of file Mechanics2D.h.

◆ VelocityOfCenterOfMass

std::function<Point2D(double)> VM2D::MechanicsRigidGivenLaw::VelocityOfCenterOfMass
private
Initial value:
= [=](double t) -> Point2D
{
return Point2D{ 0.0, 0.1 };
}

Definition at line 91 of file Mechanics2DRigidGivenLaw.h.

92 {
93 //if (t < timeAccel)
94 // return (t / timeAccel) * targetVelocity;
95 //else
96 // return targetVelocity;
97
98 /*return Point2D{ targetAmplitude[0] * DPI / timeAccel * cos(DPI * t / timeAccel),
99 targetAmplitude[1] * DPI / timeAccel * cos(DPI * t / timeAccel) };*/
100
101 return Point2D{ 0.0, 0.1 };
102 };

◆ virtVortParams

const VortexesParams& VM2D::Mechanics::virtVortParams
protectedinherited

Константная ссылка на структуру с параметрами виртуального вихревого слоя для профиля
инициализируется автоматом в конструкторе

Definition at line 95 of file Mechanics2D.h.

◆ viscousForce

Point2D VM2D::Mechanics::viscousForce
inherited

Вектор силы и момент вязкого трения, действующие на профиль

Definition at line 138 of file Mechanics2D.h.

◆ viscousMoment

double VM2D::Mechanics::viscousMoment
inherited

Definition at line 139 of file Mechanics2D.h.

◆ W

const World2D& VM2D::Mechanics::W
protectedinherited

Константная ссылка на решаемую задачу

Definition at line 79 of file Mechanics2D.h.

◆ Wcm

double VM2D::Mechanics::Wcm
inherited

Definition at line 109 of file Mechanics2D.h.

◆ Wcm0

double VM2D::Mechanics::Wcm0
inherited

Definition at line 103 of file Mechanics2D.h.

◆ WcmOld

double VM2D::Mechanics::WcmOld
inherited

Definition at line 115 of file Mechanics2D.h.


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