Include time varying gusts
@@ -28,6 +28,9 @@ class GustVelocityField(generator_interface.BaseGenerator):
- continuous_sin: Continuous sinusoidal gust model
.. math:: U_z = \frac{u_{de}}{2}\sin\left(\frac{2\pi x}{S}\right)
+ - time varying: The inflow velocity changes with time but it is uniform in space. It is read from a 4 column file:
+ .. math:: time[s] \Delta U_x \Delta U_y \Delta U_z
+
where, :math:`u_{de}` is the gust intensity, :math:`S` is the gust length and :math:`b` is the wing span.
:math:`x` and :math:`y` refer to the chordwise and spanwise distance penetrated into the gust, respectively.
@@ -44,6 +47,7 @@ class GustVelocityField(generator_interface.BaseGenerator):
``gust_intensity`` ``float`` Intensity of the gust ``0.0``
``offset`` ``float`` Spatial offset of the gust with respect to origin ``0.0``
``span`` ``float`` Wing span ``0.0``
+ ``file`` ``str`` File with the information (only for time varying) ``None``
=================== =============== ================================================= ===================
Attributes:
@@ -90,14 +94,20 @@ class GustVelocityField(generator_interface.BaseGenerator):
self.settings_types['span'] = 'float'
self.settings_default['span'] = 0.
+ self.settings_types['file'] = 'str'
+ self.settings_default['file'] = None
+
self.u_inf = 0.
self.u_inf_direction = None
+ self.file_info = None
+
self.implemented_gusts = []
self.implemented_gusts.append('1-cos')
self.implemented_gusts.append('DARPA')
self.implemented_gusts.append('continuous_sin')
self.implemented_gusts.append('lateral 1-cos')
+ self.implemented_gusts.append('time varying')
self.settings = dict()
@@ -113,6 +123,11 @@ class GustVelocityField(generator_interface.BaseGenerator):
self.u_inf = self.in_dict['u_inf'].value
self.u_inf_direction = self.in_dict['u_inf_direction']
+ if self.settings['gust_shape'] == 'time varying':
+ self.file_info = np.loadtxt(self.settings['file'])
+
+ print(self.file_info)
+
def generate(self, params, uext):
zeta = params['zeta']
override = params['override']
@@ -154,6 +169,16 @@ class GustVelocityField(generator_interface.BaseGenerator):
vel[1] = (1.0 - np.cos(2.0*np.pi*x/gust_length))*gust_intensity*0.5
return vel
+ elif self.settings['gust_shape'] == 'time varying':
+ def gust_shape(x, y, z, gust_length, gust_intensity, span=0):
+ vel = np.zeros((3,))
+ if x > 0.0:
+ return vel
+
+ vel[0] = np.interp(x, -self.file_info[:,0]*self.u_inf, self.file_info[:,1])
+ vel[1] = np.interp(x, -self.file_info[:,0]*self.u_inf, self.file_info[:,2])
+ vel[2] = np.interp(x, -self.file_info[:,0]*self.u_inf, self.file_info[:,3])
+ return vel
for i_surf in range(len(zeta)):
if override:
@@ -169,4 +194,3 @@ class GustVelocityField(generator_interface.BaseGenerator):
self.settings['gust_intensity'].value,
self.settings['span'].value
)
-
