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

add clcd and claf to written files #33

Merged
merged 2 commits into from
May 9, 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
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
project(
'pyavl',
'c',
version: '1.6.3',
version: '1.6.4',
license: 'GPL-2.0',
meson_version: '>= 0.64.0',
default_options: [
Expand Down
8 changes: 8 additions & 0 deletions pyavl/pyAVL.py
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,14 @@ def __write_data(key_list, newline: bool = True):
if afile:
fid.write(" AFILE\n")
fid.write(f" {afile}\n")
# output claf and clcd if not default
if data["claf"][idx_sec]!= 0.0:
fid.write(" CLAF\n")
fid.write(f" {data['claf'][idx_sec]}\n")

if (data["clcdsec"][idx_sec] != 0.0).any():
fid.write(" CLCD\n")
fid.write(f" {data['clcd'][idx_sec]}\n")

# check for control surfaces

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies = [
"numpy>=1.19",
]
readme = "README.md"
version = "1.6.3" # this automatically updates __init__.py
version = "1.6.4" # this automatically updates __init__.py


[tool.cibuildwheel]
Expand Down
6 changes: 6 additions & 0 deletions tests/supra.avl
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ aileron -1.00 0.75 0. 0. 0. -1.
#---------------------
SECTION
0.25 31.5 31.5 8.75 0.0 1 0

CLAF
1.3

CDCL
#CL1 CD1 CL2 CD2 CL3 CD3
0 0.01 0.5 0.02 1.0 0.5

CONTROL
flap 1.0 0.75 0. 0. 0. 1.
Expand Down
7 changes: 4 additions & 3 deletions tests/test_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ def test_coefs(self):
self.avl_solver.add_constraint("alpha", 5.00)
self.avl_solver.execute_run()
coef_data = self.avl_solver.get_case_total_data()
np.testing.assert_allclose(coef_data["CL"], 0.5974623446784538, rtol=1e-8)
np.testing.assert_allclose(coef_data["CD"], 0.02198757641085098, rtol=1e-8)
np.testing.assert_allclose(coef_data["CM"],-0.020404687950051428, rtol=1e-8)
print(coef_data)
np.testing.assert_allclose(coef_data["CL"], 0.636031170179549, rtol=1e-8)
np.testing.assert_allclose(coef_data["CD"], 0.022842500250874982, rtol=1e-8)
np.testing.assert_allclose(coef_data["CM"], 0.00139609360952168, rtol=1e-8)

class TestHingeMom(unittest.TestCase):
def setUp(self):
Expand Down
Loading