Skip to content
Snippets Groups Projects
Commit 41da8cd4 authored by Adrien Crovato's avatar Adrien Crovato
Browse files

Coorected bug. Added test case

parent 6482f55a
No related branches found
No related tags found
1 merge request!1Version 1.0
Pipeline #3247 failed
Showing
with 133 additions and 2 deletions
*.dat filter=lfs diff=lfs merge=lfs -text
*.vtk filter=lfs diff=lfs merge=lfs -text
*.vtu filter=lfs diff=lfs merge=lfs -text
......@@ -86,8 +86,8 @@ class Aero:
nf = 2 * self.nh + 1 # number of flow modes
harmonics = np.zeros(nf) # sequence of harmonic factors (3 modes: [0, 1, -1])
for i in range(self.nh):
harmonics[2*(i+1)-1] = 1 / (i+1)
harmonics[2*(i+1)] = -1 / (i+1)
harmonics[2*(i+1)-1] = i+1
harmonics[2*(i+1)] = -(i+1)
instances = 2 * np.pi * np.arange(0, nf, 1) / nf # sequence of instances (3 modes: 2pi/N*[0, 1, 2])
dft = 1 / nf * np.exp(-1j * np.outer(harmonics, instances)) # DFT[k,n] = 1/N * exp(-j*2pi/N*k*n)
# Read the aerodynamic grid
......
#!/usr/bin/env python3
# -*- coding: utf8 -*-
# test encoding: à-é-è-ô-ï-€
# Copyright 2021 University of Liège
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os.path
import numpy as np
from iops import asciireader as ardr
from iops import vtkreader as vrdr
from iops import asciiwriter as awrt
from flutter import pk
from flutter import unmatchedfluid as flu
from flutter import structural as sa
from flutter import aero as aa
from utils import testing as tst
def main():
"""3D Agard445.6
from Hüseyin Güner thesis, chapter 5, pp87 (http://hdl.handle.net/2268/245578)
"""
# Geometric and structural parameters
ndim = 3 # dimension
c = 0.470 # aerodynamic chord
cr = 0.559 # root chord
mu = 68.8 # mass ratio
nmodes = 4 # number of structural modes
omegan = 2 * np.pi * np.array([9.5444, 40.3511, 50.2203, 97.6740]) # wind-off natural angular frequencies
amp = np.ones(nmodes) # amplitude of modes
pf = [-1, -1, -1, 1]; # modal participation factor
# Flight and flutter parameters
rho = 0.2082 # density
machs = [0.678] # Mach numbers
krefs = [0.05, 0.2] # reference reduced frequencies
ui = np.arange(0.2, 0.51, 0.01) # speed index
# I/O
matreadr = ardr.AsciiReader(os.path.join(os.path.dirname(__file__), 'data', os.path.basename(__file__)[:-3], 'structural')) # matrices
modreadr = vrdr.VtkReader(os.path.join(os.path.dirname(__file__), 'data', os.path.basename(__file__)[:-3], 'structural'), 'vtk') # modes
prsreadr = vrdr.VtkReader(os.path.join(os.path.dirname(__file__), 'data', os.path.basename(__file__)[:-3], 'aero'), 'vtu') # pressure
writer = awrt.AsciiWriter()
# Structural model
struct = sa.Structural(nmodes, 0.5*c, omegan, amp, pf)
struct.readMatrices(matreadr) # mass and stiffness matrices
struct.readModes(modreadr, 'dZ') # vertical modal displacement
# Aerodynamic model
fluid = flu.UnmatchedFluid(rho, ui, 0.5*cr, struct.omega[1], mu) # density and airspeed
aero = aa.Aero(machs, krefs)
aero.fromTime(prsreadr, 'Pressure_Coefficient', ndim, struct) # modal loads matrix from time instances
# Flutter solution using p-k method
sol = pk.Pk(struct, aero, fluid)
sol.run() # compute frequencies and damping and find flutter speed
sol.write(writer) # save to disk
if parse().fig:
sol.plot() # display results
# Testing
tests = tst.Tests()
tests.add(tst.Test('Flutter speed index (Mach 0.678)', ui[sol.fidx[0]], 0.38, 1e-2))
tests.run()
if __name__ == "__main__":
main()
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment