Skip to content

Commit 9f4a4d2

Browse files
authored
Aeroframe with new framAT version, compatible with python 3.11 (#316)
New framat version and related libraries updated, added aeroframe_new with integration test
1 parent 90a7da1 commit 9f4a4d2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+324
-8381
lines changed

CEASIOMpy_docker_Installation

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ RUN /bin/bash -c "source $CONDA_DIR/etc/profile.d/conda.sh && conda activate cea
100100
# Automatically activate the Conda environment in new shells
101101
RUN echo "source $CONDA_DIR/etc/profile.d/conda.sh" >> ~/.bashrc && \
102102
echo "conda activate ceasiompy" >> ~/.bashrc && \
103-
echo "ceasiompy_run --gui" >> ~/.bashrc
103+
echo "python src/bin/ceasiompy_run --gui" >> ~/.bashrc
104104

105105
# Move the content of /INSTALLDIR to the mounted /CEASIOMpy/INSTALLDIR folder at runtime
106106
CMD ["/bin/bash", "-c", "rm -rf /CEASIOMpy/INSTALLDIR && mkdir -p /CEASIOMpy/INSTALLDIR && mv /INSTALLDIR/* /CEASIOMpy/INSTALLDIR/ && exec bash"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ There are many different modules available in CEASIOMpy that can be combined to
173173
174174
#### Structure
175175
176-
- [AeroFrame](./ceasiompy/AeroFrame_new/README.md) :heavy_check_mark:
176+
- [AeroFrame](./ceasiompy/AeroFrame/README.md) :heavy_check_mark:
177177
178178
#### Data Analysis and Storage
179179
File renamed without changes.

ceasiompy/AeroFrame_new/__init__.py renamed to ceasiompy/AeroFrame/__init__.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland
55
66
Initialization for AeroFrame new module.
7-
8-
| Author: Leon Deligny
9-
| Creation: 18-Mar-2025
10-
117
"""
128

139
# ==============================================================================
@@ -16,7 +12,7 @@
1612

1713
from pathlib import Path
1814

19-
from ceasiompy import log
15+
from ceasiompy.utils.commonxpaths import CEASIOMPY_XPATH
2016

2117
# ==============================================================================
2218
# INITIALIZATION
@@ -35,10 +31,15 @@
3531
MODULE_DIR = Path(__file__).parent
3632
MODULE_NAME = MODULE_DIR.name
3733

34+
# ===== xPaths =====
3835

39-
# =================================================================================================
40-
# MAIN
41-
# =================================================================================================
36+
# FramAT
37+
FRAMAT_XPATH = CEASIOMPY_XPATH + "/structure/FramAT"
38+
FRAMAT_MATERIAL_XPATH = FRAMAT_XPATH + "/MaterialProperties"
39+
FRAMAT_SECTION_XPATH = FRAMAT_XPATH + "/SectionProperties"
40+
FRAMAT_MESH_XPATH = FRAMAT_XPATH + "/BeamMesh"
41+
FRAMAT_RESULTS_XPATH = FRAMAT_XPATH + "/Results"
4242

43-
if __name__ == "__main__":
44-
log.info("Nothing to be executed.")
43+
# AeroFrame
44+
AEROFRAME_XPATH = CEASIOMPY_XPATH + "/aeroelasticity/AeroFrame"
45+
AEROFRAME_SETTINGS = AEROFRAME_XPATH + "/Settings"
Lines changed: 45 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,43 @@
1+
"""
2+
CEASIOMpy: Conceptual Aircraft Design Software
3+
4+
Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland
5+
6+
GUI Interface of Aeroframe.
7+
"""
8+
9+
# ==============================================================================
10+
# IMPORTS
11+
# ==============================================================================
12+
13+
import streamlit as st
14+
115
from ceasiompy.utils.moduleinterfaces import CPACSInOut
216

3-
from ceasiompy import log
417
from ceasiompy.PyAVL import (
518
AVL_PLOT_XPATH,
6-
AVL_VORTEX_DISTR_XPATH,
19+
AVL_DISTR_XPATH,
720
AVL_AEROMAP_UID_XPATH,
21+
AVL_NCHORDWISE_XPATH,
22+
AVL_NSPANWISE_XPATH,
823
)
9-
from ceasiompy.utils.commonxpaths import (
10-
CEASIOMPY_XPATH,
11-
AEROPERFORMANCE_XPATH,
24+
from ceasiompy.AeroFrame import (
25+
INCLUDE_GUI,
1226
FRAMAT_MATERIAL_XPATH,
1327
FRAMAT_SECTION_XPATH,
1428
FRAMAT_MESH_XPATH,
15-
AEROFRAME_SETTINGS
29+
AEROFRAME_SETTINGS,
1630
)
17-
from pathlib import Path
18-
19-
import streamlit as st
20-
# ===== Module Status =====
21-
# True if the module is active
22-
# False if the module is disabled (not working or not ready)
23-
MODULE_STATUS = True
2431

25-
RESULTS_DIR = Path("Results", "AeroFrame_new")
26-
27-
# ===== CPACS inputs and outputs =====
32+
# ==============================================================================
33+
# VARIABLE
34+
# ==============================================================================
2835

2936
cpacs_inout = CPACSInOut()
3037

31-
# ----- Input -----
38+
# ==============================================================================
39+
# CALL
40+
# ==============================================================================
3241

3342
cpacs_inout.add_input(
3443
var_name="aeromap_uid",
@@ -37,7 +46,7 @@
3746
unit=None,
3847
descr="Name of the aero map to calculate",
3948
xpath=AVL_AEROMAP_UID_XPATH,
40-
gui=True,
49+
gui=INCLUDE_GUI,
4150
gui_name="__AEROMAP_SELECTION",
4251
gui_group="Aeromap settings",
4352
)
@@ -48,8 +57,8 @@
4857
default_value=["equal", "cosine", "sine"],
4958
unit=None,
5059
descr=("Select the type of distribution"),
51-
xpath=AVL_VORTEX_DISTR_XPATH + "/Distribution",
52-
gui=True,
60+
xpath=AVL_DISTR_XPATH,
61+
gui=INCLUDE_GUI,
5362
gui_name="Choice of distribution",
5463
gui_group="AVL: Vortex Lattice Spacing Distributions",
5564
)
@@ -60,8 +69,8 @@
6069
default_value=8,
6170
unit=None,
6271
descr="Select the number of chordwise vortices",
63-
xpath=AVL_VORTEX_DISTR_XPATH + "/Nchordwise",
64-
gui=True,
72+
xpath=AVL_NCHORDWISE_XPATH,
73+
gui=INCLUDE_GUI,
6574
gui_name="Number of chordwise vortices",
6675
gui_group="AVL: Vortex Lattice Spacing Distributions",
6776
)
@@ -72,8 +81,8 @@
7281
default_value=30,
7382
unit=None,
7483
descr="Select the number of spanwise vortices",
75-
xpath=AVL_VORTEX_DISTR_XPATH + "/Nspanwise",
76-
gui=True,
84+
xpath=AVL_NSPANWISE_XPATH,
85+
gui=INCLUDE_GUI,
7786
gui_name="Number of spanwise vortices",
7887
gui_group="AVL: Vortex Lattice Spacing Distributions",
7988
)
@@ -85,9 +94,11 @@
8594
unit=None,
8695
descr="Select to save geometry and results plots",
8796
xpath=AVL_PLOT_XPATH,
88-
gui=True,
97+
gui=INCLUDE_GUI,
8998
gui_name="Save AVL plots",
9099
gui_group="Plots",
100+
test_value=False,
101+
expanded=False,
91102
)
92103

93104
cpacs_inout.add_input(
@@ -97,7 +108,7 @@
97108
unit=None,
98109
descr="Enter number of nodes for the beam mesh.",
99110
xpath=FRAMAT_MESH_XPATH + "/NumberNodes",
100-
gui=True,
111+
gui=INCLUDE_GUI,
101112
gui_name="Number of beam nodes",
102113
gui_group="FramAT: Mesh properties",
103114
)
@@ -109,7 +120,7 @@
109120
unit=None,
110121
descr="Enter the Young modulus of the wing material in GPa.",
111122
xpath=FRAMAT_MATERIAL_XPATH + "/YoungModulus",
112-
gui=True,
123+
gui=INCLUDE_GUI,
113124
gui_name="Young modulus [GPa]",
114125
gui_group="FramAT: Material properties",
115126
)
@@ -121,7 +132,7 @@
121132
unit=None,
122133
descr="Enter the shear modulus of the wing material in GPa.",
123134
xpath=FRAMAT_MATERIAL_XPATH + "/ShearModulus",
124-
gui=True,
135+
gui=INCLUDE_GUI,
125136
gui_name="Shear modulus [GPa]",
126137
gui_group="FramAT: Material properties",
127138
)
@@ -133,7 +144,7 @@
133144
unit=None,
134145
descr="Enter the density of the wing material in kg/m³.",
135146
xpath=FRAMAT_MATERIAL_XPATH + "/Density",
136-
gui=True,
147+
gui=INCLUDE_GUI,
137148
gui_name="Material density [kg/m³]",
138149
gui_group="FramAT: Material properties",
139150
)
@@ -145,7 +156,7 @@
145156
unit=None,
146157
descr="Enter the area of the cross-section in m².",
147158
xpath=FRAMAT_SECTION_XPATH + "/Area",
148-
gui=True,
159+
gui=INCLUDE_GUI,
149160
gui_name="Cross-section area [m²]",
150161
gui_group="FramAT: Cross-section properties",
151162
)
@@ -158,7 +169,7 @@
158169
descr="Enter the second moment of area of the cross-section \
159170
about the horizontal axis, in m⁴.",
160171
xpath=FRAMAT_SECTION_XPATH + "/Ix",
161-
gui=True,
172+
gui=INCLUDE_GUI,
162173
gui_name="Second moment of area Ix [m⁴]",
163174
gui_group="FramAT: Cross-section properties",
164175
)
@@ -171,7 +182,7 @@
171182
descr="Enter the second moment of area of the cross-section \
172183
about the vertical axis, in m⁴",
173184
xpath=FRAMAT_SECTION_XPATH + "/Iy",
174-
gui=True,
185+
gui=INCLUDE_GUI,
175186
gui_name="Second moment of area Iy [m⁴]",
176187
gui_group="FramAT: Cross-section properties",
177188
)
@@ -183,7 +194,7 @@
183194
unit=None,
184195
descr="Enter the maximum number of iterations of the aeroelastic-loop.",
185196
xpath=AEROFRAME_SETTINGS + "/MaxNumberIterations",
186-
gui=True,
197+
gui=INCLUDE_GUI,
187198
gui_name="Maximum number of iterations",
188199
gui_group="AeroFrame: Convergence settings",
189200
)
@@ -195,33 +206,7 @@
195206
unit=None,
196207
descr="Enter the tolerance for convergence of the wing deformation.",
197208
xpath=AEROFRAME_SETTINGS + "/Tolerance",
198-
gui=True,
209+
gui=INCLUDE_GUI,
199210
gui_name="Tolerance",
200211
gui_group="AeroFrame: Convergence settings",
201212
)
202-
203-
# ----- Output -----
204-
205-
cpacs_inout.add_output(
206-
var_name="output",
207-
default_value=None,
208-
unit="1",
209-
descr="Description of the output",
210-
xpath=CEASIOMPY_XPATH + "/test/myOutput",
211-
)
212-
213-
cpacs_inout.add_output(
214-
var_name="aeromap_avl", # name to change...
215-
# var_type=CPACS_aeroMap, # no type pour output, would it be useful?
216-
default_value=None,
217-
unit="-",
218-
descr="aeroMap with aero coefficients calculated by AVL",
219-
xpath=AEROPERFORMANCE_XPATH + "/aeroMap/aeroPerformanceMap",
220-
)
221-
222-
# =================================================================================================
223-
# MAIN
224-
# =================================================================================================
225-
226-
if __name__ == "__main__":
227-
log.info("Nothing to be executed.")

0 commit comments

Comments
 (0)