Skip to content

Commit

Permalink
aeromap generation improved
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Oct 12, 2023
1 parent 9f179dd commit 6729586
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ceasiompy/CPACS2GMSH/__specs__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
cpacs_inout.add_input(
var_name="fuselage_mesh_size",
var_type=float,
default_value=0.4,
default_value=0.3,
unit="[m]",
descr="Value assigned for the fuselage surfaces mesh size",
xpath=GMSH_MESH_SIZE_FUSELAGE_XPATH,
Expand Down Expand Up @@ -194,7 +194,7 @@
cpacs_inout.add_input(
var_name="auto_refine",
var_type=bool,
default_value=True,
default_value=False,
unit="1",
descr="Automatically refine the mesh on surfaces that are small compare to the chosen mesh"
"size, this option increase the mesh generation time",
Expand Down
27 changes: 16 additions & 11 deletions ceasiompy/SU2Run/func/su2config.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,21 @@ def generate_su2_cfd_config(cpacs_path, cpacs_out_path, wkdir):

if fixed_cl == "NO":
# Get the first aeroMap as default one or create automatically one
if not cpacs.tixi.checkElement(SU2_AEROMAP_UID_XPATH):

aeromap_list = cpacs.get_aeromap_uid_list()

if aeromap_list:
aeromap_default = aeromap_list[0]
log.info(f'The aeromap is {aeromap_default}')

aeromap_uid = get_value_or_default(cpacs.tixi, SU2_AEROMAP_UID_XPATH, aeromap_default)

activate_aeromap = cpacs.get_aeromap_by_uid(aeromap_uid)
alt_list = activate_aeromap.get("altitude").tolist()
mach_list = activate_aeromap.get("machNumber").tolist()
aoa_list = activate_aeromap.get("angleOfAttack").tolist()
aos_list = activate_aeromap.get("angleOfSideslip").tolist()

else:
default_aeromap = cpacs.create_aeromap("DefaultAeromap")
default_aeromap.description = "AeroMap created automatically"

Expand All @@ -354,15 +367,7 @@ def generate_su2_cfd_config(cpacs_path, cpacs_out_path, wkdir):
aos_list = [0.0]

aeromap_uid = "DefaultAeromap"
else:
aeromap_uid = get_value(cpacs.tixi, SU2_AEROMAP_UID_XPATH)

active_aeromap = cpacs.get_aeromap_by_uid(aeromap_uid)

alt_list = active_aeromap.get("altitude").tolist()
mach_list = active_aeromap.get("machNumber").tolist()
aoa_list = active_aeromap.get("angleOfAttack").tolist()
aos_list = active_aeromap.get("angleOfSideslip").tolist()
log.info(f"{aeromap_uid} has been created")

else: # if fixed_cl == 'YES':
log.info("Configuration file for fixed CL calculation will be created.")
Expand Down

0 comments on commit 6729586

Please sign in to comment.