Skip to content

Commit

Permalink
cpacs2gmsh changed
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Feb 1, 2024
1 parent ab44112 commit 440c189
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
18 changes: 11 additions & 7 deletions ceasiompy/CPACS2GMSH/cpacs2gmsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@
from pathlib import Path

from ceasiompy.CPACS2GMSH.func.exportbrep import export_brep
from ceasiompy.CPACS2GMSH.func.generategmesh import generate_gmsh, generate_gmsh_pentagrow, penta
from ceasiompy.CPACS2GMSH.func.generategmesh import generate_gmsh
from ceasiompy.CPACS2GMSH.func.RANS_mesh_generator import (
generate_2d_for_pentagrow,
pentagrow_3d_mesh,
)
from ceasiompy.utils.ceasiomlogger import get_logger
from ceasiompy.utils.ceasiompyutils import get_results_directory
from ceasiompy.utils.moduleinterfaces import (
Expand Down Expand Up @@ -102,7 +106,7 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path):
exhaust_percent = get_value_or_default(cpacs.tixi, GMSH_EXHAUST_PERCENT_XPATH, 20)

# Run mesh generation
if type_mesh is "Euler":
if type_mesh == "Euler":
export_brep(cpacs, brep_dir, (intake_percent, exhaust_percent))
mesh_path, _ = generate_gmsh(
cpacs,
Expand All @@ -122,10 +126,11 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path):
refine_factor=refine_factor,
refine_truncated=refine_truncated,
auto_refine=auto_refine,
testing_gmsh=False,)
testing_gmsh=False,
)
else:
export_brep(cpacs, brep_dir, (intake_percent, exhaust_percent))
mesh_path, _ = generate_gmsh_pentagrow(
mesh_path, _ = generate_2d_for_pentagrow(
cpacs,
cpacs_path,
brep_dir,
Expand All @@ -144,14 +149,13 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path):
)

if mesh_path.exists():

mesh_3D_path = penta(results_dir, 5)
mesh_3D_path = pentagrow_3d_mesh(results_dir, 5)

create_branch(cpacs.tixi, SU2MESH_XPATH)
cpacs.tixi.updateTextElement(SU2MESH_XPATH, str(mesh_3D_path))
log.info("SU2 Mesh has been correctly generated.")

# Save CPACS
# Save CPACS
cpacs.save_cpacs(cpacs_out_path, overwrite=True)


Expand Down
6 changes: 3 additions & 3 deletions ceasiompy/CPACS2GMSH/func/RANS_mesh_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,9 @@ def generate_2d_for_pentagrow(
# Frontal-Delunay: 6 1: MeshAdapt, 2: Automatic, 3: Initial mesh only, 5: Delaunay, 6: Frontal-Delaunay, 7: BAMG, 8: Frontal-Delaunay for Quads, 9: Packing of Parallelograms, 11: Quasi-structured Quad
gmsh.option.setNumber("Mesh.Algorithm", 6)
gmsh.option.setNumber("Mesh.LcIntegrationPrecision", 1e-6)
msesh_size = model_dimensions[0] * 0.005
gmsh.option.set_number("Mesh.MeshSizeMin", msesh_size)
gmsh.option.set_number("Mesh.MeshSizeMax", msesh_size)
mesh_size = model_dimensions[0] * 0.005
gmsh.option.set_number("Mesh.MeshSizeMin", mesh_size)
gmsh.option.set_number("Mesh.MeshSizeMax", mesh_size)
gmsh.model.occ.synchronize()
gmsh.logger.start()
gmsh.model.mesh.generate(1)
Expand Down

0 comments on commit 440c189

Please sign in to comment.