Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVL Command Fix #151

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,3 +303,7 @@ If you use AeroSandbox, attribution is appreciated.
## Stargazers over time

[![Stargazers over time](https://starchart.cc/peterdsharpe/AeroSandbox.svg)](https://starchart.cc/peterdsharpe/AeroSandbox)

## Supported by

<a href="https://jb.gg/OpenSourceSupport"><img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg" alt="JetBrains logo."></a>
21 changes: 8 additions & 13 deletions aerosandbox/aerodynamics/aero_3D/avl.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
from aerosandbox.common import ExplicitAnalysis
import aerosandbox.numpy as np
import subprocess
from pathlib import Path
from aerosandbox.geometry import Airplane, Wing, WingXSec, Fuselage, ControlSurface
from aerosandbox.performance import OperatingPoint
from typing import Union, List, Dict
import tempfile
import warnings
from pathlib import Path
from typing import Dict, List, Union

import aerosandbox.numpy as np
from aerosandbox.common import ExplicitAnalysis
from aerosandbox.geometry import Airplane, ControlSurface, Fuselage, Wing, WingXSec
from aerosandbox.performance import OperatingPoint


class AVL(ExplicitAnalysis):
Expand Down Expand Up @@ -244,7 +245,7 @@ def run(

keystrokes = "\n".join(keystroke_file_contents)

command = f"{self.avl_command} {airplane_file}"
command = [self.avl_command, airplane_file]

### Execute
try:
Expand Down Expand Up @@ -341,7 +342,6 @@ def run(
return res

def _default_keystroke_file_contents(self) -> List[str]:

run_file_contents = []

# Disable graphics
Expand Down Expand Up @@ -441,7 +441,6 @@ def clean(s):
airfoil_counter = 0

for wing in airplane.wings:

wing_options = self.get_options(wing)

spacing_line = f"{wing_options['chordwise_resolution']} {self.AVL_spacing_parameters[wing_options['chordwise_spacing']]}"
Expand Down Expand Up @@ -533,7 +532,6 @@ def clean(s):

### Write the commands for each wing section
for i, xsec in enumerate(wing.xsecs):

xsec_options = self.get_options(xsec)

xsec_def_line = f"{xsec.xyz_le[0]:.8g} {xsec.xyz_le[1]:.8g} {xsec.xyz_le[2]:.8g} {xsec.chord:.8g} {xsec.twist:.8g}"
Expand Down Expand Up @@ -743,7 +741,6 @@ def parse_unformatted_data_output(
index = s.find(data_identifier)

while index != -1: # While there are still data identifiers:

key = "" # start with a blank key, which we will build up as we read

i = index - 1 # Starting from the left of the identifier
Expand Down Expand Up @@ -804,10 +801,8 @@ def parse_unformatted_data_output(


if __name__ == "__main__":

### Import Vanilla Airplane
import aerosandbox as asb

from aerosandbox.aerodynamics.aero_3D.test_aero_3D.geometries.vanilla import (
airplane as vanilla,
)
Expand Down
Loading