118 lines
3.5 KiB
Plaintext
118 lines
3.5 KiB
Plaintext
|
|
within AIDAModelica;
|
||
|
|
|
||
|
|
model WindProfile
|
||
|
|
parameter Real rho = 1.225
|
||
|
|
"Air density [kg/m3].";
|
||
|
|
parameter Real Cd = 1.0
|
||
|
|
"Equivalent drag coefficient.";
|
||
|
|
parameter Real A = 0.05
|
||
|
|
"Equivalent lateral reference area [m2].";
|
||
|
|
parameter Real eps = 1e-6
|
||
|
|
"Regularization term for wind magnitude.";
|
||
|
|
|
||
|
|
parameter Real Wmean = 8
|
||
|
|
"Mean wind speed [m/s].";
|
||
|
|
parameter Real windDir = 0
|
||
|
|
"Mean wind direction [rad].";
|
||
|
|
|
||
|
|
parameter Real WgustAmpX = 3
|
||
|
|
"Amplitude of smooth gust component along X [m/s].";
|
||
|
|
parameter Real WgustAmpY = 3
|
||
|
|
"Amplitude of smooth gust component along Y [m/s].";
|
||
|
|
parameter Real fg1 = 0.03
|
||
|
|
"Low gust modulation frequency 1 [Hz].";
|
||
|
|
parameter Real fg2 = 0.11
|
||
|
|
"Low gust modulation frequency 2 [Hz].";
|
||
|
|
parameter Real fg3 = 0.04
|
||
|
|
"Low gust modulation frequency 3 [Hz].";
|
||
|
|
parameter Real fg4 = 0.09
|
||
|
|
"Low gust modulation frequency 4 [Hz].";
|
||
|
|
|
||
|
|
parameter Real At1 = 0.6
|
||
|
|
"Turbulence amplitude X1 [m/s].";
|
||
|
|
parameter Real At2 = 0.25
|
||
|
|
"Turbulence amplitude X2 [m/s].";
|
||
|
|
parameter Real Bt1 = 0.6
|
||
|
|
"Turbulence amplitude Y1 [m/s].";
|
||
|
|
parameter Real Bt2 = 0.25
|
||
|
|
"Turbulence amplitude Y2 [m/s].";
|
||
|
|
|
||
|
|
parameter Real f1 = 0.15
|
||
|
|
"Turbulence frequency X1 [Hz].";
|
||
|
|
parameter Real f2 = 0.7
|
||
|
|
"Turbulence frequency X2 [Hz].";
|
||
|
|
parameter Real f3 = 0.21
|
||
|
|
"Turbulence frequency Y1 [Hz].";
|
||
|
|
parameter Real f4 = 0.9
|
||
|
|
"Turbulence frequency Y2 [Hz].";
|
||
|
|
|
||
|
|
parameter Real phi1 = 0
|
||
|
|
"Phase X1 [rad].";
|
||
|
|
parameter Real phi2 = 0.8
|
||
|
|
"Phase X2 [rad].";
|
||
|
|
parameter Real phi3 = 1.3
|
||
|
|
"Phase Y1 [rad].";
|
||
|
|
parameter Real phi4 = 2.1
|
||
|
|
"Phase Y2 [rad].";
|
||
|
|
|
||
|
|
Modelica.Blocks.Interfaces.RealOutput Fx "Aerodynamic X wind force in ground frame [N]" annotation(
|
||
|
|
Placement(transformation(origin = {10, -10}, extent = {{-90, 50}, {-110, 70}}, rotation = 90), iconTransformation(origin = {2, -10}, extent = {{-90, 50}, {-110, 70}}, rotation = 90)));
|
||
|
|
Modelica.Blocks.Interfaces.RealOutput Fy "Aerodynamic Y wind force in ground frame [N]" annotation(
|
||
|
|
Placement(transformation(origin = {98, -10}, extent = {{-90, 20}, {-110, 40}}, rotation = 90), iconTransformation(origin = {96, -10}, extent = {{-90, 20}, {-110, 40}}, rotation = 90)));
|
||
|
|
|
||
|
|
Modelica.Blocks.Interfaces.RealOutput windVelX
|
||
|
|
"Wind velocity component in X direction [m/s]";
|
||
|
|
Modelica.Blocks.Interfaces.RealOutput windVelY
|
||
|
|
"Wind velocity component in Y direction [m/s]";
|
||
|
|
|
||
|
|
protected
|
||
|
|
Real wx_mean;
|
||
|
|
Real wy_mean;
|
||
|
|
Real wx_turb;
|
||
|
|
Real wy_turb;
|
||
|
|
Real wx_gust;
|
||
|
|
Real wy_gust;
|
||
|
|
Real wx;
|
||
|
|
Real wy;
|
||
|
|
Real windSpeed;
|
||
|
|
|
||
|
|
equation
|
||
|
|
|
||
|
|
|
||
|
|
wx_mean = Wmean * cos(windDir);
|
||
|
|
wy_mean = Wmean * sin(windDir);
|
||
|
|
|
||
|
|
wx_turb =
|
||
|
|
At1 * sin(2 * Modelica.Constants.pi * f1 * time + phi1)
|
||
|
|
+ At2 * sin(2 * Modelica.Constants.pi * f2 * time + phi2);
|
||
|
|
|
||
|
|
wy_turb =
|
||
|
|
Bt1 * sin(2 * Modelica.Constants.pi * f3 * time + phi3)
|
||
|
|
+ Bt2 * sin(2 * Modelica.Constants.pi * f4 * time + phi4);
|
||
|
|
|
||
|
|
wx_gust =
|
||
|
|
WgustAmpX
|
||
|
|
* sin(2 * Modelica.Constants.pi * fg1 * time)
|
||
|
|
* sin(2 * Modelica.Constants.pi * fg2 * time);
|
||
|
|
|
||
|
|
wy_gust =
|
||
|
|
WgustAmpY
|
||
|
|
* sin(2 * Modelica.Constants.pi * fg3 * time)
|
||
|
|
* sin(2 * Modelica.Constants.pi * fg4 * time);
|
||
|
|
|
||
|
|
wx = wx_mean + wx_turb + wx_gust;
|
||
|
|
wy = wy_mean + wy_turb + wy_gust;
|
||
|
|
|
||
|
|
windVelX = wx;
|
||
|
|
windVelY = wy;
|
||
|
|
|
||
|
|
windSpeed = sqrt(wx * wx + wy * wy + eps);
|
||
|
|
|
||
|
|
Fx = 0.5 * rho * Cd * A * windSpeed * wx;
|
||
|
|
Fy = 0.5 * rho * Cd * A * windSpeed * wy;
|
||
|
|
|
||
|
|
annotation(
|
||
|
|
Diagram,
|
||
|
|
Icon(graphics = {Rectangle(extent = {{-100, 100}, {100, -100}})}));
|
||
|
|
end WindProfile;
|