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

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

#include <Mechanics2DRigidRotatePart.h>

Inheritance diagram for VM2D::MechanicsRigidRotatePart:
Collaboration diagram for VM2D::MechanicsRigidRotatePart:

Public Member Functions

double & getW ()
 текущая скорость профиля
 
double & getWOld ()
 
double & getPhi ()
 текущее отклонение профиля
 
double & getPhiOld ()
 
 MechanicsRigidRotatePart (const World2D &W_, size_t numberInPassport_)
 Конструктор
 
 ~MechanicsRigidRotatePart ()
 Деструктор
 
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 J
 начальная угловая скорость профиля
 
double wAccel
 скорость, до которой профиль принудительно разгоняется
 
double tAccel
 время, за которое профиль принудительно разгоняется
 
double externalTorque
 внешний момент, который "снимается"
 

Detailed Description

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

Вращающееся тело, метод расщепления

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

Definition at line 65 of file Mechanics2DRigidRotatePart.h.

Constructor & Destructor Documentation

◆ MechanicsRigidRotatePart()

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

Конструктор

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

Definition at line 54 of file Mechanics2DRigidRotatePart.cpp.

55 : Mechanics(W_, numberInPassport_, true, false)
56 //w0(0.0),
57 //phi0(W_.getAirfoil(numberInPassport_).phiAfl)
58{
59 Vcm0 = { 0.0, 0.0 };
60 Rcm0 = { W_.getAirfoil(numberInPassport_).rcm[0], W_.getAirfoil(numberInPassport_).rcm[1] };
61 Vcm = Vcm0;
62 Rcm = Rcm0;
63 VcmOld = Vcm0;
64 RcmOld = Rcm;
65
67 Initialize({ 0.0, 0.0 }, W_.getAirfoil(numberInPassport_).rcm, 0.0, W_.getAirfoil(numberInPassport_).phiAfl);
68};
double phiAfl
Поворот профиля
Definition Airfoil2D.h:100
Point2D rcm
Положение центра масс профиля
Definition Airfoil2D.h:97
Абстрактный класс, определяющий вид механической системы
Definition Mechanics2D.h:72
Point2D Vcm0
Начальная скорость центра и угловая скорость
Point2D RcmOld
Текущие положение профиля
Point2D VcmOld
Скорость и отклонение с предыдущего шага
void Initialize(Point2D Vcm0_, Point2D Rcm0_, double Wcm0_, double Phi0_)
Задание начального положения и начальной скорости
Point2D Rcm
Текущие положение профиля
Point2D Rcm0
Начальное положение профиля
Point2D Vcm
Текущие скорость центра и угловая скорость
virtual void ReadSpecificParametersFromDictionary() override
Чтение параметров конкретной механической системы
const Airfoil & getAirfoil(size_t i) const
Возврат константной ссылки на объект профиля
Definition World2D.h:163
Here is the call graph for this function:

◆ ~MechanicsRigidRotatePart()

VM2D::MechanicsRigidRotatePart::~MechanicsRigidRotatePart ( )
inline

Деструктор

Definition at line 120 of file Mechanics2DRigidRotatePart.h.

120{};

Member Function Documentation

◆ AngleOfAirfoil()

double MechanicsRigidRotatePart::AngleOfAirfoil ( double  currTime)
overridevirtual

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

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

Implements VM2D::Mechanics.

Definition at line 155 of file Mechanics2DRigidRotatePart.cpp.

156{
157 return afl.phiAfl;
158}//AngleOfAirfoil(...)
Airfoil & afl
Definition Mechanics2D.h:87

◆ AngularVelocityOfAirfoil()

double MechanicsRigidRotatePart::AngularVelocityOfAirfoil ( double  currTime)
overridevirtual

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

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

Implements VM2D::Mechanics.

Definition at line 150 of file Mechanics2DRigidRotatePart.cpp.

151{
152 return Wcm;
153}//AngularVelocityOfAirfoil(...)

◆ GenerateForcesHeader()

void Mechanics::GenerateForcesHeader ( )
inherited

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

Definition at line 126 of file Mechanics2D.cpp.

127{
128 std::stringstream forceFileName, forceFileNameCsv;
129 forceFileName << W.getPassport().dir << "forces-airfoil-" << numberInPassport;
130 forceFileNameCsv << W.getPassport().dir << "forces-airfoil-" << numberInPassport << ".csv";
131
132 std::ofstream newForcesFile(forceFileName.str());
133 std::ofstream newForcesFileCsv(forceFileNameCsv.str());
134
135 VMlib::PrintLogoToTextFile(newForcesFile, forceFileName.str(), "Hydrodynamic loads for the airfoil " + W.getPassport().airfoilParams[numberInPassport].fileAirfoil);
136
138 VMlib::PrintHeaderToTextFile(newForcesFile, "currentStep currentTime Fx Fy Mz Ftaux Ftauy Mtau");
139 else
140 VMlib::PrintHeaderToTextFile(newForcesFile, "currentStep currentTime CFx CFy CMz CFtaux CFtauy CMtau");
141
143 newForcesFileCsv << "step,time,Fx,Fy,Mz,Ftaux,Ftauy,Mtau";
144 else
145 newForcesFileCsv << "step,time,CFx,CFy,CMz,CFtaux,CFtauy,CMtau";
146
147 newForcesFile.close();
148 newForcesFile.clear();
149
150 newForcesFileCsv.close();
151 newForcesFileCsv.clear();
152
153}//GenerateForcesHeader()
const size_t numberInPassport
Номер профиля в паспорте
Definition Mechanics2D.h:82
const World2D & W
Константная ссылка на решаемую задачу
Definition Mechanics2D.h:79
bool calcCoefficients
Признак вычисления коэффициентов вместо сил
Definition Passport2D.h:294
std::vector< AirfoilParams > airfoilParams
Список структур с параметрами профилей
Definition Passport2D.h:276
const Passport & getPassport() const
Возврат константной ссылки на паспорт
Definition World2D.h:263
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 184 of file Mechanics2D.cpp.

185{
186 std::stringstream forceFileName, forceFileNameCsv;
187 forceFileName << W.getPassport().dir << "forces-airfoil-" << numberInPassport;
188 forceFileNameCsv << W.getPassport().dir << "forces-airfoil-" << numberInPassport << ".csv";
189
190 //double cShock = (W.getPassport().physicalProperties.getCurrTime() > W.getPassport().physicalProperties.timeAccel + 2.0 * W.getPassport().timeDiscretizationProperties.dt) ? 1.0 : 0.0;
191 double cShock = 1.0;
192
193 Point2D cartesianHydroForce = cShock * hydroDynamForce;
194 Point2D cartesianViscoForce = cShock * viscousForce;
195
196 double cartesianHydroMoment = cShock * hydroDynamMoment;
197 double cartesianViscoMoment = cShock * viscousMoment;
198
199 double rotationAngle = W.getPassport().airfoilParams[numberInPassport].angle;
200
201 //Для обдува ветром, когда углы считаются по компасу
202 //if (W.getPassport().geographicalAngles)
203 //{
204 // cartesianHydroForce = cartesianHydroForce.rotated(-0.5 * PI - W.getPassport().airfoilParams[numberInPassport].angle);
205 // cartesianViscoForce = cartesianViscoForce.rotated(-0.5 * PI - W.getPassport().airfoilParams[numberInPassport].angle);
206 // //rotationAngle += 0.5 * PI;
207 //}
208
209 //if (W.getPassport().rotateForces)
210 //{
211 // cartesianHydroForce = cartesianHydroForce.rotated(rotationAngle);
212 // cartesianViscoForce = cartesianViscoForce.rotated(rotationAngle);
213 //}
214
217 {
218 const double& chord = W.getPassport().airfoilParams[numberInPassport].chord;
219 cartesianHydroForce /= (flowPress * chord);
220 cartesianViscoForce /= (flowPress * chord);
221
222 cartesianHydroMoment /= (flowPress * sqr(chord));
223 cartesianViscoMoment /= (flowPress * sqr(chord));
224 }
225
226
227 std::ofstream forcesFile(forceFileName.str(), std::ios::app);
228 forcesFile << std::endl << W.getCurrentStep() << " " << W.getCurrentTime() << " " << cartesianHydroForce[0] << " " << cartesianHydroForce[1] << " " << cartesianHydroMoment << " " << cartesianViscoForce[0] << " " << cartesianViscoForce[1] << " " << cartesianViscoMoment;
229 forcesFile.close();
230
231 std::ofstream forcesFileCsv(forceFileNameCsv.str(), std::ios::app);
232 forcesFileCsv << std::endl << W.getCurrentStep() << "," << W.getCurrentTime() << "," << cartesianHydroForce[0] << "," << cartesianHydroForce[1] << "," << cartesianHydroMoment << "," << cartesianViscoForce[0] << "," << cartesianViscoForce[1] << "," << cartesianViscoMoment;
233 forcesFileCsv.close();
234
235}//GenerateForcesString()
Point2D hydroDynamForce
Вектор гидродинамической силы и момент, действующие на профиль
Point2D viscousForce
Вектор силы и момент вязкого трения, действующие на профиль
double hydroDynamMoment
PhysicalProperties physicalProperties
Структура с физическими свойствами задачи
Definition Passport2D.h:301
double getCurrentTime() const
Definition WorldGen.h:100
size_t getCurrentStep() const
Возврат константной ссылки на параметры распараллеливания по MPI.
Definition WorldGen.h:99
T sqr(T x)
Возведение числа в квадрат
Definition defs.h:455
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 157 of file Mechanics2D.cpp.

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

◆ GeneratePositionString()

void Mechanics::GeneratePositionString ( )
inherited

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

Definition at line 239 of file Mechanics2D.cpp.

240{
241 if (isMoves)
242 {
243 std::stringstream positionFileName, positionFileNameCsv;
244 positionFileName << W.getPassport().dir << "position-airfoil-" << numberInPassport;
245 positionFileNameCsv << W.getPassport().dir << "position-airfoil-" << numberInPassport << ".csv";
246
247 std::ofstream positionFile(positionFileName.str(), std::ios::app);
248 positionFile << std::endl << W.getCurrentStep() << " " << W.getCurrentTime() << " " << afl.rcm[0] << " " << afl.rcm[1] << " " << Phi << " " << Vcm[0] << " " << Vcm[1] << " " << Wcm;
249 positionFile.close();
250
251 std::ofstream positionFileCsv(positionFileNameCsv.str(), std::ios::app);
252 positionFileCsv << std::endl << W.getCurrentStep() << "," << W.getCurrentTime() << "," << afl.rcm[0] << "," << afl.rcm[1] << "," << Phi << "," << Vcm[0] << "," << Vcm[1] << "," << Wcm;
253 positionFileCsv.close();
254 }
255}
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHydroDynamForce()

void MechanicsRigidRotatePart::GetHydroDynamForce ( )
overridevirtual

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

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

Implements VM2D::Mechanics.

Definition at line 71 of file Mechanics2DRigidRotatePart.cpp.

72{
73 W.getTimers().start("Force");
74
75 const double& dt = W.getPassport().timeDiscretizationProperties.dt;
76
77 hydroDynamForce = { 0.0, 0.0 };
78 hydroDynamMoment = 0.0;
79
80 viscousForce = { 0.0, 0.0 };
81 viscousMoment = 0.0;
82
83 Point2D hDFGam = { 0.0, 0.0 }; //гидродинамические силы, обусловленные присоед.завихренностью
84 Point2D hDFdelta = { 0.0, 0.0 }; //гидродинамические силы, обусловленные приростом завихренности
85 Point2D hDFQ = { 0.0, 0.0 }; //гидродинамические силы, обусловленные присоед.источниками
86
87 double hDMGam = 0.0; //гидродинамический момент, обусловленный присоед.завихренностью
88 double hDMdelta = 0.0; //гидродинамический момент, обусловленный приростом завихренности
89 double hDMQ = 0.0; //гидродинамический момент, обусловленный присоед.источниками
90
91
92
93
94 for (size_t i = 0; i < afl.getNumberOfPanels(); ++i)
95 {
96 Point2D rK = 0.5 * (afl.getR(i + 1) + afl.getR(i)) - afl.rcm;
97
98 Point2D velK = { -Wcm * rK[1], Wcm * rK[0] };
99
100 double gAtt = Wcm * (rK ^ afl.tau[i]);
101 double gAttOld = WcmOld * (rK ^ afl.tau[i]);
102 double deltaGAtt = gAtt - gAttOld;
103
104 double qAtt = Wcm * (rK ^ afl.nrm[i]);
105
107 double deltaK = boundary.sheets.freeVortexSheet(i, 0) * afl.len[i] - afl.gammaThrough[i] + deltaGAtt * afl.len[i];
108
109 /*1*/
110 hDFdelta += deltaK * Point2D({ -rK[1], rK[0] });
111 hDMdelta += 0.5 * deltaK * rK.length2();
112
113 /*2*/
114 hDFGam += 0.25 * (afl.getV(i) + afl.getV(i + 1)).kcross() * gAtt * afl.len[i];
115 hDMGam += 0.25 * rK ^ (afl.getV(i) + afl.getV(i + 1)).kcross() * gAtt * afl.len[i];
116
117 /*3*/
118 hDFQ -= 0.25 * (afl.getV(i) + afl.getV(i + 1)) * qAtt * afl.len[i];
119 hDMQ -= 0.25 * rK ^ (afl.getV(i) + afl.getV(i + 1)) * qAtt * afl.len[i];
120 }
121
122 const double rho = W.getPassport().physicalProperties.rho;
123
124 hydroDynamForce = rho * (hDFGam + hDFdelta * (1.0 / dt) + hDFQ);
125 hydroDynamMoment = rho * (hDMGam + hDMdelta / dt + hDMQ);
126
127 if ((W.getPassport().physicalProperties.nu > 0.0)/* && (W.currentStep > 0)*/)
128 for (size_t i = 0; i < afl.getNumberOfPanels(); ++i)
129 {
130 Point2D rK = 0.5 * (afl.getR(i + 1) + afl.getR(i)) - afl.rcm;
131 viscousForce += rho * afl.viscousStress[i] * afl.tau[i];
132 viscousMoment += rho * (afl.viscousStress[i] * afl.tau[i]) & rK;
133 }
134
135 W.getTimers().stop("Force");
136}// 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
const Boundary & boundary
Definition Mechanics2D.h:91
const double & freeVortexSheet(size_t n, size_t moment) const
Definition Sheet2D.h:100
VMlib::TimersGen & getTimers() const
Возврат ссылки на временную статистику выполнения шага расчета по времени
Definition World2D.h:288
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:

◆ getPhi()

double & VM2D::MechanicsRigidRotatePart::getPhi ( )
inline

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

Definition at line 109 of file Mechanics2DRigidRotatePart.h.

109{ return Phi; };

◆ getPhiOld()

double & VM2D::MechanicsRigidRotatePart::getPhiOld ( )
inline

Definition at line 110 of file Mechanics2DRigidRotatePart.h.

110{ return PhiOld; };

◆ getW()

double & VM2D::MechanicsRigidRotatePart::getW ( )
inline

текущая скорость профиля

Definition at line 105 of file Mechanics2DRigidRotatePart.h.

105{ return Wcm; };

◆ getWOld()

double & VM2D::MechanicsRigidRotatePart::getWOld ( )
inline

Definition at line 106 of file Mechanics2DRigidRotatePart.h.

106{ return WcmOld; };

◆ 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 93 of file Mechanics2D.cpp.

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

◆ Move()

void MechanicsRigidRotatePart::Move ( )
overridevirtual

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

Implements VM2D::Mechanics.

Definition at line 176 of file Mechanics2DRigidRotatePart.cpp.

177{
178 double Jeff = J;
179
180 //Point2D F = hydroDynamForce + viscousForce;
181 double M = hydroDynamMoment + viscousMoment;
182
183 PhiOld = Phi;
184 WcmOld = Wcm;
185
186
187 Point2D dr, dV;
188 double dphi, dw;
189
190 //W.getInfo('t') << "k = " << k << std::endl;
191
192
193 dr[1] = 0.0;
194 dV[1] = 0.0;
195
196 dr[0] = 0.0;
197 dV[0] = 0.0;
198
199 double bw = 0.0;
200 double kw = 0.0;
201
202
204 double t = W.getCurrentTime();
205
206
207 double addMom = (t > 3.0 * tAccel) ? externalTorque : 0.0;
208
209 if (t > 1.0 * tAccel)
210 {
211 Point2D kk[4];
212 kk[0] = { Wcm, (M - 2.0 * bw * Wcm - kw * Phi - addMom) / Jeff };
213 kk[1] = { Wcm + 0.5 * dt * kk[0][1], (M - 2.0 * bw * (Wcm + 0.5 * dt * kk[0][1]) - kw * (Phi + 0.5 * dt * kk[0][0]) - addMom) / Jeff };
214 kk[2] = { Wcm + 0.5 * dt * kk[1][1], (M - 2.0 * bw * (Wcm + 0.5 * dt * kk[1][1]) - kw * (Phi + 0.5 * dt * kk[1][0]) - addMom) / Jeff };
215 kk[3] = { Wcm + dt * kk[2][1], (M - 2.0 * bw * (Wcm + dt * kk[2][1]) - kw * (Phi + dt * kk[2][0]) - addMom) / Jeff };
216
217 dphi = dt * (kk[0][0] + 2. * kk[1][0] + 2. * kk[2][0] + kk[3][0]) / 6.0;
218 dw = dt * (kk[0][1] + 2. * kk[1][1] + 2. * kk[2][1] + kk[3][1]) / 6.0;
219 }
220 else
221 {
222 double a = wAccel / tAccel;
223 dw = dt * a;
224 dphi = 0.5 * a * sqr(t) - 0.5 * a * sqr(t - dt);
225 }
226
227
228 afl.Move(dr);
229 afl.Rotate(dphi);
230
231 Rcm += dr;
232 Vcm += dV;
233
234 Phi += dphi;
235
236 //std::cout << "Phi = " << Phi << ", afl.Phi = " << afl.phiAfl << std::endl;
237
238 Wcm += dw;
239
240}//Move()
double externalTorque
внешний момент, который "снимается"
double J
начальная угловая скорость профиля
double tAccel
время, за которое профиль принудительно разгоняется
double wAccel
скорость, до которой профиль принудительно разгоняется
Here is the call graph for this function:

◆ PositionOfAirfoilRcm()

Point2D MechanicsRigidRotatePart::PositionOfAirfoilRcm ( double  currTime)
overridevirtual

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

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

Implements VM2D::Mechanics.

Definition at line 145 of file Mechanics2DRigidRotatePart.cpp.

146{
147 return Rcm;
148}//PositionOfAirfoilRcm(...)

◆ ReadParametersFromDictionary()

void Mechanics::ReadParametersFromDictionary ( )
privateinherited

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

Definition at line 117 of file Mechanics2D.cpp.

118{
119 std::stringstream ss(W.getPassport().airfoilParams[afl.numberInPassport].mechanicalSystemParameters);
120
121 mechParamsParser.reset(new VMlib::StreamParser(W.getInfo(), "mechanical parser", ss));
122}//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 MechanicsRigidRotatePart::ReadSpecificParametersFromDictionary ( )
overridevirtual

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

Implements VM2D::Mechanics.

Definition at line 244 of file Mechanics2DRigidRotatePart.cpp.

245{
246 mechParamsParser->get("J", J);
247
248 W.getInfo('i') << "moment of inertia " << "J = " << J << std::endl;
249
250 mechParamsParser->get("wAccel", wAccel);
251
252 W.getInfo('i') << "wAccel = " << wAccel << std::endl;
253
254 mechParamsParser->get("tAccel", tAccel);
255
256 W.getInfo('i') << "tAccel = " << tAccel << std::endl;
257
258 mechParamsParser->get("externalTorque", externalTorque);
259
260 W.getInfo('i') << "externalTorque = " << externalTorque << std::endl;
261
262}//ReadSpecificParametersFromDictionary()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ VeloOfAirfoilPanels()

void MechanicsRigidRotatePart::VeloOfAirfoilPanels ( double  currTime)
overridevirtual

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

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

Implements VM2D::Mechanics.

Definition at line 161 of file Mechanics2DRigidRotatePart.cpp.

162{
163 Point2D veloRcm = VeloOfAirfoilRcm(currTime);
164
165 std::vector<Point2D> veloW(afl.getNumberOfPanels());
166 for (size_t i = 0; i < afl.getNumberOfPanels(); ++i)
167 veloW[i] = veloRcm + Wcm * (afl.getR(i) - Rcm).kcross();
168
169 afl.setV(veloW);
170
172 circulation = 2.0 * afl.area * Wcm;
173}//VeloOfAirfoilPanels(...)
void setV(const Point2D &vel)
Установка постоянной скорости всех вершин профиля
Definition Airfoil2D.h:145
virtual Point2D VeloOfAirfoilRcm(double currTime) override
Вычисление скорости центра масс профиля
Here is the call graph for this function:

◆ VeloOfAirfoilRcm()

Point2D MechanicsRigidRotatePart::VeloOfAirfoilRcm ( double  currTime)
overridevirtual

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

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

Implements VM2D::Mechanics.

Definition at line 139 of file Mechanics2DRigidRotatePart.cpp.

140{
141 return Point2D{0.0, 0.0};
142}//VeloOfAirfoilRcm(...)
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.

◆ 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.

◆ externalTorque

double VM2D::MechanicsRigidRotatePart::externalTorque
private

внешний момент, который "снимается"

Definition at line 98 of file Mechanics2DRigidRotatePart.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.

◆ 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.

◆ J

double VM2D::MechanicsRigidRotatePart::J
private

начальная угловая скорость профиля

начальный угол отклонения профиля момент инерции профиля

Definition at line 89 of file Mechanics2DRigidRotatePart.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.

◆ 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.

◆ tAccel

double VM2D::MechanicsRigidRotatePart::tAccel
private

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

Definition at line 95 of file Mechanics2DRigidRotatePart.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.

◆ 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.

◆ wAccel

double VM2D::MechanicsRigidRotatePart::wAccel
private

скорость, до которой профиль принудительно разгоняется

Definition at line 92 of file Mechanics2DRigidRotatePart.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: