Skip to content

Commit

Permalink
mesh settings for gmsh changed
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Jun 3, 2024
1 parent ce46961 commit 0486efe
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 62 deletions.
121 changes: 61 additions & 60 deletions ceasiompy/CPACS2GMSH/__specs__.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,67 @@
gui_group="Euler options",
)

cpacs_inout.add_input(
var_name="n_power_factor",
var_type=float,
default_value=2,
unit="1",
descr="Value that changes the number of cells near the aircraft parts",
xpath=GMSH_N_POWER_FACTOR_XPATH,
gui=True,
gui_name="n power factor",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="n_power_field",
var_type=float,
default_value=0.9,
unit="1",
descr="Value that changes the measure of fist cells near aircraft parts",
xpath=GMSH_N_POWER_FIELD_XPATH,
gui=True,
gui_name="n power field",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="refine_factor",
var_type=float,
default_value=2.0,
unit="1",
descr="Refinement factor of wing leading/trailing edge mesh",
xpath=GMSH_REFINE_FACTOR_XPATH,
gui=True,
gui_name="LE/TE refinement factor",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="refine_truncated",
var_type=bool,
default_value=False,
unit="1",
descr="Enable the refinement of truncated trailing edge",
xpath=GMSH_REFINE_TRUNCATED_XPATH,
gui=True,
gui_name="Refine truncated TE",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="auto_refine",
var_type=bool,
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",
xpath=GMSH_AUTO_REFINE_XPATH,
gui=True,
gui_name="Auto refine",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="n_layer",
var_type=int,
Expand Down Expand Up @@ -252,66 +313,6 @@
gui_group="General options",
)

cpacs_inout.add_input(
var_name="n_power_factor",
var_type=float,
default_value=2,
unit="1",
descr="Value that changes the number of cells near the aircraft parts",
xpath=GMSH_N_POWER_FACTOR_XPATH,
gui=True,
gui_name="n power factor",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="n_power_field",
var_type=float,
default_value=0.9,
unit="1",
descr="Value that changes the measure of fist cells near aircraft parts",
xpath=GMSH_N_POWER_FIELD_XPATH,
gui=True,
gui_name="n power field",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="refine_factor",
var_type=float,
default_value=2.0,
unit="1",
descr="Refinement factor of wing leading/trailing edge mesh",
xpath=GMSH_REFINE_FACTOR_XPATH,
gui=True,
gui_name="LE/TE refinement factor",
gui_group="Advanced Euler mesh parameters",
)
cpacs_inout.add_input(
var_name="refine_truncated",
var_type=bool,
default_value=False,
unit="1",
descr="Enable the refinement of truncated trailing edge",
xpath=GMSH_REFINE_TRUNCATED_XPATH,
gui=True,
gui_name="Refine truncated TE",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="auto_refine",
var_type=bool,
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",
xpath=GMSH_AUTO_REFINE_XPATH,
gui=True,
gui_name="Auto refine",
gui_group="Advanced Euler mesh parameters",
)

cpacs_inout.add_input(
var_name="intake_percent",
var_type=float,
Expand Down
4 changes: 2 additions & 2 deletions ceasiompy/CPACS2GMSH/func/generategmesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -931,14 +931,14 @@ def generate_gmsh(
# the size of the points on boundaries.

fuselage_maxlen, fuselage_minlen = fuselage_size(cpacs_path)
mesh_size_fuselage = fuselage_mesh_size_factor * fuselage_minlen
mesh_size_fuselage = ((fuselage_maxlen + fuselage_minlen) / 2) / fuselage_mesh_size_factor
log.info(f"Mesh size fuselage={mesh_size_fuselage:.3f} m")

create_branch(cpacs.tixi, GMSH_MESH_SIZE_FUSELAGE_XPATH)
cpacs.tixi.updateDoubleElement(GMSH_MESH_SIZE_FUSELAGE_XPATH, mesh_size_fuselage, "%.3f")

wing_maxlen, wing_minlen = wings_size(cpacs_path)
mesh_size_wing = wing_mesh_size_factor * wing_minlen
mesh_size_wing = ((wing_maxlen * 0.8 + wing_minlen) / 2) / wing_mesh_size_factor
log.info(f"Mesh size wing={mesh_size_wing:.3f} m")

create_branch(cpacs.tixi, GMSH_MESH_SIZE_WINGS_XPATH)
Expand Down

0 comments on commit 0486efe

Please sign in to comment.