Some usefull scripts for the Nastran's 145 solution (Flutter Analysis) using the pyNastran package.

Overview

DeepSource

nastran-aero-flutter

This project is intended to analyse the Supersonic Panel Flutter using the NASTRAN software.

The project uses the pyNastran and the python scientific packeges (i.e scipy, numpy, matplotlib).

Currently, the focus is to use the aerodynamic Piston Theory, available on NASTRAN with the CAERO5 element. But it can be extended to use with any aerodynamic element.

This software is result of a research project of the Department of Mechanical Engineering at the Federal University of Minas Gerais (UFMG).

Use

An exemple of utilization is on the run_analysis.py script.

First it generates the plate structure and required properties.

import numpy as np
from nastran.structures.panel import LaminatedStructuralPlate
from nastran.structures.composite import OrthotropicMaterial

a, b = 100, 100

p1 = np.array([0, 0, 0])
p2 = p1 + np.array([a, 0, 0])
p3 = p1 + np.array([a, b, 0])
p4 = p1 + np.array([0, b, 0])

cfrp = OrthotropicMaterial(1, 54000., 18000., 0.3, 7200., 2.6e-9)

nchord, nspan = 10, 10

lam = LaminatedStructuralPlate.create_sawyer_plate(p1, p2, p3, p4, nspan, nchord, 1, 45, 6, 0.1, cfrp)

Then you can add the analysis properties for SOL 145 Aeroelastic Dynamic Flutter. The PanelFlutterPistonAnalysisModel class is a wrapper of the pyNastran's BDF class.

from nastran.aero.analysis.panel_flutter import PanelFlutterPistonAnalysisModel

config = {
    'vref': 1000.,                      # used to calculate the non-dimensional dynamic pressure must be the same in control case (mm/s in the case)
    'ref_rho': 1.225e-12,               # air density reference (ton/mm^3 in the case)
    'ref_chord': 300.,                  # reference chord (mm in the case)
    'n_modes': 15,                      # number searched modes in modal analysis
    'frequency_limits': 
        [.0, 3000.],                    # the range of frequency (Hz) in modal analysis
    'method': 'PK',                     # the method for solving flutter (it will determine the next parameters
    'densities_ratio': [.5],            # rho/rho_ref -> 1/2 simulates the "one side flow" of the panel (? reference ?)
    'machs': [3.5, 4.5, 5.5, 6.5],      # Mach numbers
    'alphas': [.0, .0, .0, .0],         # AoA (°) -> 0 is more conservative (? reference ?)
    'reduced_frequencies': 
        [.001, .01, .1, .2, .4, .8],    # reduced frequencies (k) (check influence)
    'velocities':                       # velocities (mm/s in the case)
        np.linspace(10, 100, 10)*1000,
}

params =  {
    'VREF': 1000.0,
    'COUPMASS': 1,
    'LMODES': 20,
    # 'POST': [-1]
}

analysis = PanelFlutterPistonAnalysisModel(lam.bdf, params=params)
analysis.set_global_case_from_dict(config)

You can add "super" panels, that is just a wrapper of CAEROx elements that make one element.

from nastran.aero.superpanels import SuperAeroPanel5

spanel_p = SuperAeroPanel5(1, p1, p2, p3, p4, nchord, nspan, theory='VANDYKE')
analysis.add_superpanel(spanel_p)

You can set multiple subcases for example varing the boundary conditions.

cases_labels = {
    1: "Loaded edges SS & unloaded edges SS",
    2: "Loaded edges SS & unloaded edges CP",
    3: "Loaded edges SS & unloaded edges SS/CP",
}

spc_cases = {
    1: ('123', '123', '123', '123'),             # loaded edges SS, unloaded edges SS
    2: ('123', '123', '123456', '123456'),       # loaded edges SS, unloaded edges CP
    3: ('123', '123', '123', '123456'),          # loaded edges SS, unloaded edges SS/CP
}

for i, spcs in spc_cases.items():
    spc_id = analysis.idutil.get_next_sid()
    for comp, nds in zip(list(spcs), lam.limit_nodes()):
        if comp == '':
            continue
        analysis.model.add_spc1(spc_id, comp, nds, comment=cases_labels[i])
    sub_config = {
        'LABEL': cases_labels[i],
        'SPC': spc_id,
    }
    analysis.create_subcase_from_dict(PanelFlutterSubcase, i, sub_config)

Then you must write all cards to the BDF object and export the file.

analysis.write_cards()
analysis.model.write_bdf('pflutter.bdf', enddata=True)

Then you can run the analysis and post-processes.

Outputs

The postprocessing generates DataFrames objects from the .f06 result files.

from nastran.aero.post import read_f06, get_critical_roots, plot_vf_vg

df = read_f06("pflutter.f06")

critic_df = get_critical_roots(df)

fig = plot_vf_vg(df.xs((1,3.5))) # Subcase, Mach
fig.show()

And Plots

V-f

V-g

You might also like...
A step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.
A step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

This project has a step-by-step tutorial for how to work with some of the most basic features of Nav2 using a Jupyter Notebook in a warehouse environment to create a basic application.

My solution for a MARL problem on a Grid Environment with Q-tables.

To run the project, run: conda create --name env python=3.7 pip install -r requirements.txt python run.py To-do: Add direction to the state space Take

LPCV Winner Solution of Spring Team

LPCV Winner Solution of Spring Team

A lightweight solution for local Particle development.
A lightweight solution for local Particle development.

neopo A lightweight solution for local Particle development. Features Builds Particle projects locally without any overhead. Compatible with Particle

Placeholders is a single-unit storage solution for your Frontend.
Placeholders is a single-unit storage solution for your Frontend.

Placeholder Placeholders is a single-unit file storage solution for your Frontend. Why Placeholder? Generally, when a website/service requests for fil

A simple solution for water overflow problem in Python

Water Overflow problem There is a stack of water glasses in a form of triangle as illustrated. Each glass has a 250ml capacity. When a liquid is poure

WildHack 2021 solution by Nuclear Foxes team (public version).

WildHack 2021 Nuclear Foxes Team This repo contains our project for the Wildberries Hackathon 2021. Task 2: Searching tags Implement an algorithm of r

Ballcone is a fast and lightweight server-side Web analytics solution.
Ballcone is a fast and lightweight server-side Web analytics solution.

Ballcone Ballcone is a fast and lightweight server-side Web analytics solution. It requires no JavaScript on your website. Screenshots Design Goals Si

Python solution of advent-of-code 2021

Advent of code 2021 Python solutions of Advent of Code 2021 written by Eric Bouteillon Requirements The solutions were developed and tested using Pyth

Comments
  • Bump pywin32 from 227 to 301

    Bump pywin32 from 227 to 301

    Bumps pywin32 from 227 to 301.

    Release notes

    Sourced from pywin32's releases.

    Release 301

    The changes

    If you use pip: pip install pywin32 --upgrade

    A number of things don't work via pip, so you may choose to install binaries - but you must choose both the correct Python version and "bittedness".

    Even if you have a 64bit computer, if you installed a 32bit version of Python you must install the 32bit version of pywin32.

    There is one binary per-version, per-bittedness. To determine what version of Python you have, start Python and look at the first line of the banner. Compare these 2:

    Python 2.7.2+ ... [MSC v.1500 32 bit (Intel)] on win32
    Python 2.7.2+ ... [MSC v.1500 64 bit (AMD64)] on win32
                                  ^^^^^^^^^^^^^^
    

    If the installation process informs you that Python is not found in the registry, it almost certainly means you have downloaded the wrong version - either for the wrong version of Python, or the wrong "bittedness".

    Release 300

    This is the first release to support only Python 3.5 and up - Python 2 is no longer supported. To celebrate, the build numbers have jumped to 300! There were significant changes in this release - you are encouraged to read CHANGES.txt carefully.

    To download pywin32 binaries you must choose both the correct Python version and "bittedness".

    Note that there is one download package for each supported version of Python - please check what version of Python you have installed and download the corresponding package.

    Some packages have a 32bit and a 64bit version available - you must download the one which corresponds to the Python you have installed. Even if you have a 64bit computer, if you installed a 32bit version of Python you must install the 32bit version of pywin32.

    To determine what version of Python you have, just start Python and look at the first line of the banner. A 32bit build will look something like

    Python 3.8.1+ ... [MSC v.1913 32 bit (Intel)] on win32

    While a 64bit build will look something like:

    Python 3.8.1+ ... [MSC v.1913 64 bit (AMD64)] on win32

    If the installation process informs you that Python is not found in the registry, it almost certainly means you have downloaded the wrong version - either for the wrong version of Python, or the wrong "bittedness".

    Release 228

    To download pywin32 binaries you must choose both the correct Python version and "bittedness".

    Note that there is one download package for each supported version of Python - please check what version of Python you have installed and download the corresponding package.

    Some packages have a 32bit and a 64bit version available - you must download the one which corresponds to the Python you have installed. Even if you have a 64bit computer, if you installed a 32bit version of Python you must install the 32bit version of pywin32.

    To determine what version of Python you have, just start Python and look at the first line of the banner. A 32bit build will look something like

    Python 2.7.2+ ... [MSC v.1500 32 bit (Intel)] on win32
    

    While a 64bit build will look something like:

    Python 2.7.2+ ... [MSC v.1500 64 bit (AMD64)] on win32
    

    ... (truncated)

    Changelog

    Sourced from pywin32's changelog.

    A changelog for recent builds as pasted into the sourceforge page.

    Generally created by hand after running: hg log -rb2xx: > log.out However contributors are encouraged to add their own entries for their work.

    Note that build 228 was the last version supporting Python 2.

    Since build 300:

    • Fix some confusion on how dynamic COM object properties work. The old code was confused, so there's a chance there will be some subtle regression here - please open a bug if you find anything, but this should fix #1427.

    • COM objects are now registered with the full path to pythoncomXX.dll, fixes #1704.

    • Creating a win32crypt.CRYPT_ATTRIBUTE object now correctly sets cbData.

    • Add wrap and unwrap operations defined in the GSSAPI to the sspi module and enhance the examples given in this module. (#1692, Emmanuel Coirier)

    • Fix a bug in win32profile.GetEnvironmentStrings() relating to environment variables with an equals sign (@​maxim-krikun in #1661)

    • Fixed a bug where certain COM dates would fail to be converted to a Python datetime object with ValueError: microsecond must be in 0..999999. Shoutout to @​hujiaxing for reporting and helping reproduce the issue (#1655)

    • Added win32com.shell.SHGetKnownFolderPath() and related constants.

    • CoClass objects should work better with special methods like len etc. (#1699)

    • Shifted work in win32.lib.pywin32_bootstrap to Python's import system from manual path manipulations (@​wkschwartz in #1651)

    • Fixed a bug where win32print.DeviceCapabilities would return strings containing the null character followed by junk characters. (#1654, #1660, Lincoln Puzey)

    Since build 228:

    • Fixed a bug where win32com.client.VARIANT params were returned in the reverse order. This only happened when win32com.client.VARIANT was explicitly used (ie, not when normal params were passed) For example:
          arg1 = VARIANT(pythoncom.VT_R4 | pythoncom.VT_BYREF, 2.0)
      

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump pyyaml from 5.3.1 to 5.4

    Bump pyyaml from 5.3.1 to 5.4

    Bumps pyyaml from 5.3.1 to 5.4.

    Changelog

    Sourced from pyyaml's changelog.

    5.4 (2021-01-19)

    Commits
    • 58d0cb7 5.4 release
    • a60f7a1 Fix compatibility with Jython
    • ee98abd Run CI on PR base branch changes
    • ddf2033 constructor.timezone: _copy & deepcopy
    • fc914d5 Avoid repeatedly appending to yaml_implicit_resolvers
    • a001f27 Fix for CVE-2020-14343
    • fe15062 Add 3.9 to appveyor file for completeness sake
    • 1e1c7fb Add a newline character to end of pyproject.toml
    • 0b6b7d6 Start sentences and phrases for capital letters
    • c976915 Shell code improvements
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Chordwise camber geometry (curved panel)

    Chordwise camber geometry (curved panel)

    Piston Theory on Nastran has a set of parameters called Thickness Integrals, which is to account for foil thickness in an aerodynamic sense, but it must retain the chord rigidity assumption. For a panel, which has a chord-wise flexibility one element could not represent the behavior of the panel. Instead, if a set of elements is utilized it can achieve representation of the model and comply with the rigidity of the chord of the element at the same time.

    Currently, only a flat panel (plate) is implemented, but in theory, we can in implement curved panels too.

    enhancement 
    opened by vsdsantos 0
Releases(v0.2.1-alpha)
Owner
zuckberj
open source, aerospace
zuckberj
A Python wrapper API for operating and working with the Neo4j Graph Data Science (GDS) library

gdsclient NOTE: This is a work in progress and many GDS features are known to be missing or not working properly. This repo hosts the sources for gdsc

Neo4j 100 Dec 20, 2022
Cloud Native sample microservices showcasing Full Stack Observability using AppDynamics and ThousandEyes

Cloud Native Sample Bookinfo App Observability Bookinfo is a sample application composed of four Microservices written in different languages.

Cisco DevNet 13 Jul 21, 2022
Modify the value and status of the records KoboToolbox

Modify the value and status of the records KoboToolbox (Modica el valor y status de los registros de KoboToolbox)

1 Oct 30, 2021
Persistent/Immutable/Functional data structures for Python

Pyrsistent Pyrsistent is a number of persistent collections (by some referred to as functional data structures). Persistent in the sense that they are

Tobias Gustafsson 1.8k Dec 31, 2022
Oblique Strategies for Python

Oblique Strategies for Python

Łukasz Langa 3 Feb 17, 2022
Generic NDJSON importer for hashlookup server

Generic NDJSON importer for hashlookup server Usage usage: hashlookup-json-importer.py [-h] [-v] [-s SOURCE] [-p PARENT] [--parent-meta PARENT_META [P

hashlookup 2 Jan 19, 2022
A tool for generating skill map/tree like diagram

skillmap A tool for generating skill map/tree like diagram. What is a skill map/tree? Skill tree is a term used in video games, and it can be used for

Yue 98 Jan 07, 2023
Simple python bot, that notifies about new manga chapters through Telegram.

Simple python bot, that notifies about new manga chapters through Telegram.

Dmitry Kopturov 1 Dec 05, 2021
Your Google Recon is Now Automated

GRecon : GRecon (Greei-Conn) is a simple python tool that automates the process of Google Based Recon AKA Google Dorking The current Version 1.0 Run 7

adnane-tebbaa 189 Dec 21, 2022
ToDo - A simple bot to keep track of things you need to do

ToDo A simple bot to keep track of things you need to do. Installation You will

3 Sep 18, 2022
Generate Gaussian 09 input files for the rotamers of an input compound.

Rotapy Purpose Generate Gaussian 09 input files for the rotamers of an input compound. Distance to the axis of rotation remains constant throughout th

1 Jul 16, 2021
Stocks Trading News Alert Using Python

Stocks-Trading-News-Alert-Using-Python Ever Thought of Buying Shares of your Dream Company, When their stock price got down? But It is not possible to

Ayush Verma 3 Jul 29, 2022
Virtual Assistant Using Python

-Virtual-Assistant-Using-Python Virtual desktop assistant is an awesome thing. If you want your machine to run on your command like Jarvis did for Ton

Bade om 1 Nov 13, 2021
A curses based mpd client with basic functionality and album art.

Miniplayer A curses based mpd client with basic functionality and album art. After installation, the player can be opened from the terminal with minip

Tristan Ferrua 102 Dec 24, 2022
Lectures for Udemy - Complete Python Bootcamp Course

Complete-Python-Bootcamp Welcome to the Repository for the Complete Python Bootcamp! This is the Repository for the Udemy course - "Complete Python Bo

Marci 2k Dec 28, 2022
A feed generator. Currently supports generating RSS feeds from Google, Bing, and Yahoo news.

A feed generator. Currently supports generating RSS feeds from Google, Bing, and Yahoo news.

Josh Cardenzana 0 Dec 13, 2021
GCP Scripts and API Client Toolss

GCP Scripts and API Client Toolss Script Authentication The scripts and CLI assume GCP Application Default Credentials are set. Credentials can be set

3 Feb 21, 2022
JupyterLite as a Datasette plugin

datasette-jupyterlite JupyterLite as a Datasette plugin Installation Install this plugin in the same environment as Datasette. $ datasette install dat

Simon Willison 11 Sep 19, 2022
An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to art and design.

Awesome AI for Art & Design An awesome list of AI for art and design - resources, and popular datasets and how we may apply computer vision tasks to a

Margaret Maynard-Reid 20 Dec 21, 2022
A telegram bot which programed to countdown.

countdown-vi this is a telegram bot which programed to countdown. usage well, first you should specify a exact interval. there is 5 column, very first

Arya Shabane 3 Feb 15, 2022