VM2D 1.14
Vortex methods for 2D flows simulation
Loading...
Searching...
No Matches
Mechanics2DRigidGivenLaw.h
Go to the documentation of this file.
1/*--------------------------------*- VM2D -*-----------------*---------------*\
2| ## ## ## ## #### ##### | | Version 1.14 |
3| ## ## ### ### ## ## ## ## | VM2D: Vortex Method | 2026/03/06 |
4| ## ## ## # ## ## ## ## | for 2D Flow Simulation *----------------*
5| #### ## ## ## ## ## | Open Source Code |
6| ## ## ## ###### ##### | https://www.github.com/vortexmethods/VM2D |
7| |
8| Copyright (C) 2017-2026 I. Marchevsky, K. Sokol, E. Ryatina, A. Kolganova |
9*-----------------------------------------------------------------------------*
10| File name: Mechanics2DRigidGivenLaw.h |
11| Info: Source code of VM2D |
12| |
13| This file is part of VM2D. |
14| VM2D is free software: you can redistribute it and/or modify it |
15| under the terms of the GNU General Public License as published by |
16| the Free Software Foundation, either version 3 of the License, or |
17| (at your option) any later version. |
18| |
19| VM2D is distributed in the hope that it will be useful, but WITHOUT |
20| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
21| FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
22| for more details. |
23| |
24| You should have received a copy of the GNU General Public License |
25| along with VM2D. If not, see <http://www.gnu.org/licenses/>. |
26\*---------------------------------------------------------------------------*/
27
28
40#ifndef MECHANICS2DRIGIDGIVENLAW_H
41#define MECHANICS2DRIGIDGIVENLAW_H
42
43#include <functional>
44
45#include "Mechanics2D.h"
46
47namespace VM2D
48{
49
50 class World2D;
51
68 public Mechanics
69 {
70 private:
71
72 double timeAccel;
76
77 std::function<Point2D(double)> PositionOfCenterOfMass = [=](double t) -> Point2D
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 };
90
91 std::function<Point2D(double)> VelocityOfCenterOfMass = [=](double t) -> Point2D
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 };
103
104 std::function<double(double)> RotationAngle = [=](double t) -> double
105 {
106 return 0.0;
107 };
108
109 std::function<double(double)> AngularVelocity = [=](double t) -> double
110 {
111 return 0.0;
112 };
113
114
115 public:
120 MechanicsRigidGivenLaw(const World2D& W_, size_t numberInPassport_);
121
122
125
126
127
128 //далее -- реализации виртуальных функций
129 virtual void GetHydroDynamForce() override;
130 virtual Point2D VeloOfAirfoilRcm(double currTime) override;
131 virtual Point2D PositionOfAirfoilRcm(double currTime) override;
132 virtual double AngularVelocityOfAirfoil(double currTime) override;
133 virtual double AngleOfAirfoil(double currTime) override;
134 virtual void VeloOfAirfoilPanels(double currTime) override;
135 virtual void ReadSpecificParametersFromDictionary() override;
136
137 virtual void Move() override;
138 };
139
140}//namespace VM2D
141
142#endif
Заголовочный файл с описанием класса Mechanics.
Абстрактный класс, определяющий вид механической системы
Definition Mechanics2D.h:72
Класс, определяющий вид механической системы
std::function< Point2D(double)> PositionOfCenterOfMass
std::function< double(double)> AngularVelocity
virtual void GetHydroDynamForce() override
Вычисление гидродинамической силы, действующей на профиль
virtual Point2D VeloOfAirfoilRcm(double currTime) override
Вычисление скорости центра масс профиля
std::function< double(double)> RotationAngle
~MechanicsRigidGivenLaw()
Деструктор
virtual Point2D PositionOfAirfoilRcm(double currTime) override
Вычисление положения центра масс профиля
virtual void Move() override
Перемещение профиля в соответствии с законом
virtual double AngularVelocityOfAirfoil(double currTime) override
Вычисление угловой скорости профиля
virtual void VeloOfAirfoilPanels(double currTime) override
Вычисление скоростей начал панелей
std::function< Point2D(double)> VelocityOfCenterOfMass
virtual double AngleOfAirfoil(double currTime) override
Вычисление угла поворота профиля
virtual void ReadSpecificParametersFromDictionary() override
Чтение параметров конкретной механической системы
Класс, опеделяющий текущую решаемую задачу
Definition World2D.h:74