From f8eb3bfc38da2b178ac7ff28fc9f22f67bdcd560 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 6 Dec 2023 09:04:15 +0100 Subject: [PATCH 01/80] add medge as output mesh --- ceasiompy/SUMOAutoMesh/__specs__.py | 19 ++++++++++++- ceasiompy/SUMOAutoMesh/sumoautomesh.py | 38 +++++++++++++++----------- ceasiompy/utils/commonxpath.py | 1 + src/bin/ceasiompy_exec.py | 25 ++++++++++++----- 4 files changed, 59 insertions(+), 24 deletions(-) diff --git a/ceasiompy/SUMOAutoMesh/__specs__.py b/ceasiompy/SUMOAutoMesh/__specs__.py index 407eab0d2..753d6c1d6 100644 --- a/ceasiompy/SUMOAutoMesh/__specs__.py +++ b/ceasiompy/SUMOAutoMesh/__specs__.py @@ -1,6 +1,11 @@ from pathlib import Path -from ceasiompy.utils.commonxpath import SU2MESH_XPATH, SUMO_REFINE_LEVEL_XPATH, SUMOFILE_XPATH +from ceasiompy.utils.commonxpath import ( + SU2MESH_XPATH, + SUMO_REFINE_LEVEL_XPATH, + SUMOFILE_XPATH, + SUMO_OUTPUT_MESH_FORMAT_XPATH, +) from ceasiompy.utils.moduleinterfaces import CPACSInOut # ===== Module Status ===== @@ -43,6 +48,18 @@ gui_group="SUMO options", ) +cpacs_inout.add_input( + var_name="output_format", + var_type=list, + default_value=["SU2", "M-Edge"], + unit="1", + descr="chose the output mesh format", + xpath=SUMO_OUTPUT_MESH_FORMAT_XPATH, + gui=True, + gui_name="Output mesh format", + gui_group="SUMO options", +) + # ----- Output ----- diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index 964d7846f..3a6bc9615 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -112,7 +112,7 @@ def add_mesh_parameters(sumo_file_path, refine_level=0.0): REFINE_RATIO = 0.6 # to get approx. double mesh cell when +1 on "refine_level" refine_factor = REFINE_RATIO**refine_level - log.info("Refinement factor is {}".format(refine_factor)) + log.info(f"Refinement factor is {refine_factor:.3f}") # Open SUMO (.smx) with tixi library sumo = open_tixi(sumo_file_path) @@ -209,7 +209,7 @@ def add_mesh_parameters(sumo_file_path, refine_level=0.0): sumo.save(str(sumo_file_path)) -def create_SU2_mesh(cpacs_path, cpacs_out_path): +def create_mesh(cpacs_path, cpacs_out_path, output): """Function to create a simple SU2 mesh form an SUMO file (.smx) Function 'create_mesh' is used to generate an unstructured mesh with SUMO @@ -228,8 +228,15 @@ def create_SU2_mesh(cpacs_path, cpacs_out_path): tixi = open_tixi(cpacs_path) + if output == "su2": + file_extension = "su2" + elif output == "edge": + file_extension = "bmsh" + else: + raise ValueError("Unsupported output format. Use 'su2' or 'edge'") + sumo_results_dir = get_results_directory("SUMOAutoMesh") - su2_mesh_path = Path(sumo_results_dir, "ToolOutput.su2") + mesh_path = Path(sumo_results_dir, f"ToolOutput.{file_extension}") sumo_file_path = Path(get_value_or_default(tixi, SUMOFILE_XPATH, "")) if not sumo_file_path.exists(): @@ -241,7 +248,7 @@ def create_SU2_mesh(cpacs_path, cpacs_out_path): add_mesh_parameters(sumo_file_path, refine_level) # Tetgen option, see the help for more options - output = "su2" + # output = "su2" options = "pq1.16VY" arguments = [ "-batch", @@ -284,17 +291,17 @@ def create_SU2_mesh(cpacs_path, cpacs_out_path): raise OSError("OS not recognize!") # Copy the mesh in the MESH directory - su2_mesh_name = aircraft_name(tixi) + "_baseline.su2" - su2_mesh_out_path = Path(sumo_results_dir, su2_mesh_name) - shutil.copyfile(su2_mesh_path, su2_mesh_out_path) + mesh_name = aircraft_name(tixi) + f"_baseline.{file_extension}" + mesh_out_path = Path(sumo_results_dir, mesh_name) + shutil.copyfile(mesh_path, mesh_out_path) - if not su2_mesh_out_path.exists(): - raise ValueError("No SU2 Mesh file has been generated!") + if not mesh_out_path.exists(): + raise ValueError("No mesh file has been generated!") - log.info("An SU2 Mesh has been correctly generated.") + log.info(f"A {output} mesh has been correctly generated.") create_branch(tixi, SU2MESH_XPATH) - tixi.updateTextElement(SU2MESH_XPATH, str(su2_mesh_out_path)) - su2_mesh_path.unlink() + tixi.updateTextElement(SU2MESH_XPATH, str(mesh_out_path)) + mesh_path.unlink() tixi.save(str(cpacs_out_path)) @@ -304,17 +311,16 @@ def create_SU2_mesh(cpacs_path, cpacs_out_path): # ================================================================================================= -def main(cpacs_path, cpacs_out_path): - +def main(cpacs_path, cpacs_out_path, output_format="edge"): log.info("----- Start of " + MODULE_NAME + " -----") - create_SU2_mesh(cpacs_path, cpacs_out_path) + # Call create_mesh with the desired output format + create_mesh(cpacs_path, cpacs_out_path, output=output_format) log.info("----- End of " + MODULE_NAME + " -----") if __name__ == "__main__": - cpacs_path = get_toolinput_file_path(MODULE_NAME) cpacs_out_path = get_tooloutput_file_path(MODULE_NAME) diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 0b9e28a57..23e139866 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -84,6 +84,7 @@ TURBOPROP_XPATH = PROP_XPATH + "/turboprop" # SUMO +SUMO_OUTPUT_MESH_FORMAT_XPATH = MESH_XPATH + "sumoOptions/format" SUMO_REFINE_LEVEL_XPATH = MESH_XPATH + "/sumoOptions/refinementLevel" SUMO_INCLUDE_PYLON_XPATH = CEASIOMPY_XPATH + "/engine/includePylon" SUMO_INCLUDE_ENGINE_XPATH = CEASIOMPY_XPATH + "/engine/includeEngine" diff --git a/src/bin/ceasiompy_exec.py b/src/bin/ceasiompy_exec.py index 66b83ed58..3c531de8f 100755 --- a/src/bin/ceasiompy_exec.py +++ b/src/bin/ceasiompy_exec.py @@ -63,7 +63,6 @@ def run_testcase(testcase_nb): """Run a test case.""" if testcase_nb == 1: - testcase_message(1) test_case_1_path = Path(TEST_CASES_PATH, "test_case_1") @@ -174,13 +173,18 @@ def run_gui(): os.system(f"cd {STREAMLIT_PATH} && streamlit run CEASIOMpy.py") +def run_output(format): + """Chose the format for the output mesh""" + + log.info() + + # ================================================================================================= # MAIN # ================================================================================================= def main(): - parser = argparse.ArgumentParser( description="CEASIOMpy: Conceptual Aircraft Design Environment", usage=argparse.SUPPRESS, @@ -215,34 +219,41 @@ def main(): metavar="NB", help="run a test case [1, 2, or 3]", ) + parser.add_argument( + "-o", + "--output", + type=str, + metavar="", + default="su2", + help="chose to generate a mesh for SU2 or m-Edge [su2, edge]", + ) args = parser.parse_args() if args.testcase: - run_testcase(args.testcase) return if args.modules: - run_modules_list(args.modules) return if args.cfg: - run_config_file(args.cfg) return if args.gui: - run_gui() return + if args.output: + run_output(args.output) + return + # If no argument is given, print the help parser.print_help() if __name__ == "__main__": - main() From c5f97cf4d5d1b8c7405886957b543c6b601300c8 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 6 Dec 2023 11:08:06 +0100 Subject: [PATCH 02/80] improvement --- ceasiompy/SUMOAutoMesh/__specs__.py | 2 +- ceasiompy/SUMOAutoMesh/sumoautomesh.py | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ceasiompy/SUMOAutoMesh/__specs__.py b/ceasiompy/SUMOAutoMesh/__specs__.py index 753d6c1d6..d6421d079 100644 --- a/ceasiompy/SUMOAutoMesh/__specs__.py +++ b/ceasiompy/SUMOAutoMesh/__specs__.py @@ -51,7 +51,7 @@ cpacs_inout.add_input( var_name="output_format", var_type=list, - default_value=["SU2", "M-Edge"], + default_value=["su2", "edge"], unit="1", descr="chose the output mesh format", xpath=SUMO_OUTPUT_MESH_FORMAT_XPATH, diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index 3a6bc9615..b083728f8 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -29,7 +29,12 @@ from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.ceasiompyutils import aircraft_name, get_results_directory, run_software -from ceasiompy.utils.commonxpath import SU2MESH_XPATH, SUMO_REFINE_LEVEL_XPATH, SUMOFILE_XPATH +from ceasiompy.utils.commonxpath import ( + SU2MESH_XPATH, + SUMO_REFINE_LEVEL_XPATH, + SUMOFILE_XPATH, + SUMO_OUTPUT_MESH_FORMAT_XPATH, +) from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path from cpacspy.cpacsfunctions import create_branch, get_value_or_default, open_tixi @@ -209,7 +214,7 @@ def add_mesh_parameters(sumo_file_path, refine_level=0.0): sumo.save(str(sumo_file_path)) -def create_mesh(cpacs_path, cpacs_out_path, output): +def create_mesh(cpacs_path, cpacs_out_path): """Function to create a simple SU2 mesh form an SUMO file (.smx) Function 'create_mesh' is used to generate an unstructured mesh with SUMO @@ -228,6 +233,8 @@ def create_mesh(cpacs_path, cpacs_out_path, output): tixi = open_tixi(cpacs_path) + output = get_value_or_default(tixi, SUMO_OUTPUT_MESH_FORMAT_XPATH, "su2") + if output == "su2": file_extension = "su2" elif output == "edge": @@ -235,6 +242,8 @@ def create_mesh(cpacs_path, cpacs_out_path, output): else: raise ValueError("Unsupported output format. Use 'su2' or 'edge'") + log.info(f"The output mesh format is {file_extension}") + sumo_results_dir = get_results_directory("SUMOAutoMesh") mesh_path = Path(sumo_results_dir, f"ToolOutput.{file_extension}") @@ -311,11 +320,11 @@ def create_mesh(cpacs_path, cpacs_out_path, output): # ================================================================================================= -def main(cpacs_path, cpacs_out_path, output_format="edge"): +def main(cpacs_path, cpacs_out_path): log.info("----- Start of " + MODULE_NAME + " -----") # Call create_mesh with the desired output format - create_mesh(cpacs_path, cpacs_out_path, output=output_format) + create_mesh(cpacs_path, cpacs_out_path) log.info("----- End of " + MODULE_NAME + " -----") From 2affe82419ed376799e26d37c44c31f3f00c3e53 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 14 Dec 2023 10:22:05 +0100 Subject: [PATCH 03/80] add some lines --- src/bin/ceasiompy_exec.py | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/bin/ceasiompy_exec.py b/src/bin/ceasiompy_exec.py index 3c531de8f..0e588561d 100755 --- a/src/bin/ceasiompy_exec.py +++ b/src/bin/ceasiompy_exec.py @@ -114,9 +114,9 @@ def run_testcase(testcase_nb): def run_modules_list(args_list): """Run a workflow from a CPACS file and a list of modules.""" - if len(args_list) < 2: + if len(args_list) < 3: print( - "\nAt least 2 arguments are required to run a CEASIOMpy, the first onw must be the" + "\nAt least 3 arguments are required to run a CEASIOMpy, the first onw must be the" "CPACS file and the modules to run. You can add as many modules as you want." ) return @@ -133,7 +133,8 @@ def run_modules_list(args_list): print(f"The CPACS file {cpacs_path} does not exist.") return - modules_list = args_list[1:] + output_format = args_list[1] + modules_list = args_list[2:] log.info("CEASIOMpy as been started from a command line") @@ -141,6 +142,7 @@ def run_modules_list(args_list): workflow.cpacs_in = cpacs_path workflow.modules_list = modules_list workflow.module_optim = ["NO"] * len(modules_list) + workflow.output_format = output_format workflow.write_config_file() workflow.set_workflow() @@ -173,10 +175,17 @@ def run_gui(): os.system(f"cd {STREAMLIT_PATH} && streamlit run CEASIOMpy.py") -def run_output(format): +def run_output(output): """Chose the format for the output mesh""" - log.info() + if output == "su2": + file_extension = "su2" + elif output == "edge": + file_extension = "bmsh" + else: + raise ValueError("Unsupported output format. Use 'su2' or 'edge'") + + log.info(f"The chosen output format is: {file_extension}") # ================================================================================================= @@ -225,7 +234,8 @@ def main(): type=str, metavar="", default="su2", - help="chose to generate a mesh for SU2 or m-Edge [su2, edge]", + choices=["su2", "cgns", "edge"], + help="chose to generate a mesh for SU2 or m-Edge [su2, cgns, edge]", ) args = parser.parse_args() From ac007d1a0e2fac9515a76bc865e3725aa3502236 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Mon, 8 Jan 2024 11:59:34 +0100 Subject: [PATCH 04/80] no FF for pentagrow --- ceasiompy/CPACS2GMSH/__specs__.py | 13 ++++++++++ ceasiompy/CPACS2GMSH/cpacs2gmsh.py | 3 +++ ceasiompy/CPACS2GMSH/func/generategmesh.py | 30 ++++++++++++++-------- ceasiompy/utils/commonxpath.py | 1 + ceasiompy/utils/workflowclasses.py | 19 +++++++++----- 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/ceasiompy/CPACS2GMSH/__specs__.py b/ceasiompy/CPACS2GMSH/__specs__.py index cdefcd57c..9edbd0349 100644 --- a/ceasiompy/CPACS2GMSH/__specs__.py +++ b/ceasiompy/CPACS2GMSH/__specs__.py @@ -16,6 +16,7 @@ GMSH_OPEN_GUI_XPATH, GMSH_REFINE_TRUNCATED_XPATH, GMSH_REFINE_FACTOR_XPATH, + GMSH_EULER_XPATH, GMSH_SYMMETRY_XPATH, SU2MESH_XPATH, GMSH_MESH_SIZE_FACTOR_FUSELAGE_XPATH, @@ -63,6 +64,18 @@ gui_group="General options", ) +cpacs_inout.add_input( + var_name="euler", + var_type=bool, + default_value=True, + unit="1", + descr="Create a farfield", + xpath=GMSH_EULER_XPATH, + gui=True, + gui_name="Domain for euler calculation", + gui_group="Domain", +) + cpacs_inout.add_input( var_name="symmetry", var_type=bool, diff --git a/ceasiompy/CPACS2GMSH/cpacs2gmsh.py b/ceasiompy/CPACS2GMSH/cpacs2gmsh.py index 648a849da..7a2a80e01 100644 --- a/ceasiompy/CPACS2GMSH/cpacs2gmsh.py +++ b/ceasiompy/CPACS2GMSH/cpacs2gmsh.py @@ -44,6 +44,7 @@ GMSH_OPEN_GUI_XPATH, GMSH_REFINE_FACTOR_XPATH, GMSH_REFINE_TRUNCATED_XPATH, + GMSH_EULER_XPATH, GMSH_SYMMETRY_XPATH, SU2MESH_XPATH, ) @@ -78,6 +79,7 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path): # Retrieve value from the GUI Setting open_gmsh = get_value_or_default(cpacs.tixi, GMSH_OPEN_GUI_XPATH, False) farfield_factor = get_value_or_default(cpacs.tixi, GMSH_FARFIELD_FACTOR_XPATH, 6) + euler = get_value_or_default(cpacs.tixi, GMSH_EULER_XPATH, True) symmetry = get_value_or_default(cpacs.tixi, GMSH_SYMMETRY_XPATH, False) farfield_size_factor = get_value_or_default(cpacs.tixi, GMSH_MESH_SIZE_FARFIELD_XPATH, 17) n_power_factor = get_value_or_default(cpacs.tixi, GMSH_N_POWER_FACTOR_XPATH, 2) @@ -105,6 +107,7 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path): results_dir, open_gmsh=open_gmsh, farfield_factor=farfield_factor, + euler=euler, symmetry=symmetry, farfield_size_factor=farfield_size_factor, n_power_factor=n_power_factor, diff --git a/ceasiompy/CPACS2GMSH/func/generategmesh.py b/ceasiompy/CPACS2GMSH/func/generategmesh.py index 1b644bb89..1a809c0ab 100644 --- a/ceasiompy/CPACS2GMSH/func/generategmesh.py +++ b/ceasiompy/CPACS2GMSH/func/generategmesh.py @@ -567,6 +567,7 @@ def generate_gmsh( results_dir, open_gmsh=False, farfield_factor=6, + euler=False, symmetry=False, farfield_size_factor=10, n_power_factor=2, @@ -692,10 +693,12 @@ def generate_gmsh( ] domain_length = farfield_factor * max(model_dimensions) - farfield = gmsh.model.occ.addSphere(*model_center, domain_length) - gmsh.model.occ.synchronize() - ext_domain = [(3, farfield)] + if euler: + farfield = gmsh.model.occ.addSphere(*model_center, domain_length) + gmsh.model.occ.synchronize() + + ext_domain = [(3, farfield)] if symmetry: log.info("Preparing: symmetry operation") @@ -712,10 +715,14 @@ def generate_gmsh( log.info("Start fragment operation between the aircraft and the farfield") - _, children_dimtag = gmsh.model.occ.fragment(ext_domain, parts_parent_dimtag) - gmsh.model.occ.synchronize() + if euler: + _, children_dimtag = gmsh.model.occ.fragment(ext_domain, parts_parent_dimtag) + gmsh.model.occ.synchronize() + + log.info("Fragment operation finished") - log.info("Fragment operation finished") + else: + _, child_dimtag = parts_parent_dimtag # fragment produce fragments_dimtag and children_dimtag @@ -912,12 +919,13 @@ def generate_gmsh( symmetry_group = gmsh.model.addPhysicalGroup(2, symmetry_surfaces_tags) gmsh.model.setPhysicalName(2, symmetry_group, "symmetry") - farfield = gmsh.model.addPhysicalGroup(2, farfield_surfaces_tags) - gmsh.model.setPhysicalName(2, farfield, "Farfield") + if euler: + farfield = gmsh.model.addPhysicalGroup(2, farfield_surfaces_tags) + gmsh.model.setPhysicalName(2, farfield, "Farfield") - # Fluid domain - ps = gmsh.model.addPhysicalGroup(3, final_domain.volume_tag) - gmsh.model.setPhysicalName(3, ps, final_domain.uid) + # Fluid domain + ps = gmsh.model.addPhysicalGroup(3, final_domain.volume_tag) + gmsh.model.setPhysicalName(3, ps, final_domain.uid) gmsh.model.occ.synchronize() log.info("Markers for SU2 generated") diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 23e139866..2ef7e05f7 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -92,6 +92,7 @@ # GMSH GMSH_XPATH = MESH_XPATH + "/gmshOptions" GMSH_OPEN_GUI_XPATH = GMSH_XPATH + "/open_gui" +GMSH_EULER_XPATH = GMSH_XPATH + "/euler" GMSH_SYMMETRY_XPATH = GMSH_XPATH + "/symmetry" GMSH_EXPORT_PROP_XPATH = GMSH_XPATH + "/exportPropellers" GMSH_FARFIELD_FACTOR_XPATH = GMSH_XPATH + "/farfield_factor" diff --git a/ceasiompy/utils/workflowclasses.py b/ceasiompy/utils/workflowclasses.py index eb2bc2252..fb90c58a2 100644 --- a/ceasiompy/utils/workflowclasses.py +++ b/ceasiompy/utils/workflowclasses.py @@ -43,7 +43,6 @@ class ModuleToRun: def __init__( self, name: str, wkflow_dir: Path, cpacs_in: Path = None, cpacs_out: Path = None ) -> None: - # Check module name validity accepted_names = get_module_list(only_active=False) + OPTIM_METHOD if name not in accepted_names: @@ -69,7 +68,6 @@ def __init__( self.optim_related_modules = [] def create_module_wkflow_dir(self, cnt: int) -> None: - if self.is_optim_module and self.optim_method: module_wkflow_name = str(cnt).rjust(2, "0") + "_" + self.optim_method else: @@ -85,7 +83,6 @@ class OptimSubWorkflow: def __init__( self, subworkflow_dir: Path, cpacs_in: Path, optim_method: str, modules_list: list ) -> None: - self.subworkflow_dir = subworkflow_dir self.cpacs_in = cpacs_in self.optim_method = optim_method @@ -103,7 +100,6 @@ def set_subworkflow(self) -> None: """Set input and output for subworkflow.""" for m, module in enumerate(self.modules): - # Create the module directory in the subworkflow directory with change_working_dir(self.subworkflow_dir): self.modules[m].create_module_wkflow_dir(m + 1) @@ -148,7 +144,6 @@ class Workflow: """Class to define and run CEASIOMpy workflow.""" def __init__(self) -> None: - self.working_dir = Path().cwd() self.cpacs_in = Path(CPACS_FILES_PATH, "D150_simple.xml").resolve() self.current_wkflow_dir = None @@ -158,6 +153,11 @@ def __init__(self) -> None: self.optim_method = None self.module_optim = [] + self.output_format = [] + + def set_output_format(self, output_format: str) -> None: + """Set the mesh extension.""" + self.output_format = output_format def from_config_file(self, cfg_file: Path) -> None: """Get parameters from a config file @@ -202,6 +202,8 @@ def write_config_file(self) -> None: cfg["comment_module_optim"] = "MODULE_OPTIM = ( )" cfg["comment_optim_method"] = "OPTIM_METHOD = NONE" + cfg["MESH_OUTPUT_FORMAT"] = self.output_format + cfg_file = Path(self.working_dir, "ceasiompy.cfg") cfg.write_file(cfg_file, overwrite=True) @@ -255,7 +257,6 @@ def set_workflow(self) -> None: module_optim_idx = None for m, module_name in enumerate(self.modules_list): - # Check if it is the first module (to know where the cpacs input file should come from) if m == 0: cpacs_in = wkflow_cpacs_in @@ -266,6 +267,7 @@ def set_workflow(self) -> None: if self.module_optim[m] == "NO": module = ModuleToRun(module_name, self.current_wkflow_dir, cpacs_in) + module.output_format = self.output_format skip_create_module = False # Check if should be included in Optim/DoE @@ -317,6 +319,10 @@ def run_workflow(self) -> None: # log.info(f" -> {module.name}") for module in self.modules: + if module.name == "SUMOAutomesh": + command_with_output_format = f"{module.name} --output={self.output_format}" + module.name = command_with_output_format + if module.is_optim_module: self.subworkflow.run_subworkflow() else: @@ -342,5 +348,4 @@ def run_workflow(self) -> None: # ================================================================================================= if __name__ == "__main__": - print("Nothing to execute!") From 99aebefd9a4ba57888ff558c23650ce46e4785fc Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 8 Jan 2024 19:16:12 +0100 Subject: [PATCH 05/80] new file: EdgeRun/files/default.ainp.tmp new file: EdgeRun/func/edgeconfig.py new file: EdgeRun/tests/tests_edgeconfig/test_edgerun.py modified: utils/commonnames.py modified: utils/commonxpath.py new file: utils/create_ainpfile.py --- ceasiompy/EdgeRun/files/default.ainp.tmp | 4857 +++++++++++++++++ ceasiompy/EdgeRun/func/edgeconfig.py | 257 + .../tests/tests_edgeconfig/test_edgerun.py | 64 + ceasiompy/utils/commonnames.py | 4 + ceasiompy/utils/commonxpath.py | 11 + ceasiompy/utils/create_ainpfile.py | 76 + src/bin/ceasiompy_exec.py | 1 + src/bin/ceasiompy_run.bat | 3 +- 8 files changed, 5271 insertions(+), 2 deletions(-) create mode 100755 ceasiompy/EdgeRun/files/default.ainp.tmp create mode 100644 ceasiompy/EdgeRun/func/edgeconfig.py create mode 100644 ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py create mode 100644 ceasiompy/utils/create_ainpfile.py diff --git a/ceasiompy/EdgeRun/files/default.ainp.tmp b/ceasiompy/EdgeRun/files/default.ainp.tmp new file mode 100755 index 000000000..979ac7f8e --- /dev/null +++ b/ceasiompy/EdgeRun/files/default.ainp.tmp @@ -0,0 +1,4857 @@ +DEFAULT,N ,0,0,165 +* +*************************************************************************** +* * +* Edge input parameter file * +* This file uses the so called FFA-format * +* * +MODIFICATIONS,L ,61,1,0 +'Date Version Programmer Description ' +'19991214 P.Eliasson Change def. VIS4,VIS2 ' +'20010503 S.Wallin Introduced TURB_MOD_LIST ' +'20010918 P.Eliasson Introduced IRESMO=2 ' +'20020123 2.3 P.Eliasson Removed IFOOUT ' +'20020430 2.3 A.Jiracsek Added KOK k-OMEGA turb. model ' +'20020528 2.3 I.Karlsson Introduced COLTYPE and COLMAX ' +'20020528 2.3 P.Eliasson CRATIOB set to 4 as default ' +' ASTRAT, CRATIO, CFISGL removed; ' +' added CRDIM ' +'20020613 2.3 I.Karlsson Adaption parameters added ' +'20021022 3.1 P.Eliasson Post processing flag IPOST added, ' +' file name given in CFIPOST ' +' NINIGR,LEVTOP,IWRRES removed ' +'20021120 3.1 P.Eliasson Removed GAMNM1 ' +'20021218 3.1 P.Eliasson ISVIFL removed ' +'20030107 3.1 P.Eliasson VIS4=0.03 made default ' +'20030224 3.1 P.Eliasson Introduced multi species ' +'20030227 3.1 P.Eliasson Put SMCOR=1.5 as default ' +'20030306 3.1 P.Eliasson IFSTEP, SX-ZFACT removed ' +'20030430 3.1 P.Eliasson Added transition spec. option ' +'20030818 3.2 J.Smith AEROELASTICS subset added ' +' and CFIEDGPER subset removed ' +'20030828 3.2 P.Eliasson Post option to output gradients ' +'20030915 3.2 P.Eliasson Added partitioning option PTYPE ' +'20030922 3.2 S.Wallin Added lots of turbulence model opts. ' +' Changed default TURFIX, PRT ' +'20030929 3.2 S.-H. Peng Added a LRN k-omega model ' +'20030929 3.2 S.-H. Peng Correction of model constants for ' +' Menters models. The WALL constant ' +' adapted to FBCWAL.F ' +'20030930 3.2 S.-H. Peng Added Wilcoxs LRN model ' +'20030930 3.2 P.Eliasson Variable ITHEDA removed ' +'20031110 3.2 M.Franke Added Rung LLR-model ' +'20040102 3.2 J.Smith PERT_CONST & IMOVGR inputs removed ' +'20040210 3.2 S.-H. Peng Added S-A DES model ' +'20040220 3.2 S.-H. Peng Added Smagorinsky LES model ' +'20040225 3.2 S.-H. Peng Added SA LES model ' +'20040303 3.2 S.-H. Peng Added Yoshizawa LES model ' +'20040315 3.2 S.-H. Peng Added parameters for time-averaging ' +' in unsteady computations ' +'20040316 3.2 S.-H. Peng Added parameters for time-recording ' +'20040317 3.2 L.Tysell IPROJ adaption parameter added ' +'20040413 3.2 P.Eliasson Removed viscous time scale CTAU ' +'20040414 3.2 P.Eliasson Introduced IMANEUV for maneuver options ' +' IMOVGR removed ' +'20040414 3.3 O.Grundestam Generalized EARSM added ' +'20040702 3.2 Y. Le Moigne SENSOR,THRESHOLD,RADIUS,BOXCOOR added ' +'20040702 3.2 A.Jirasek Vortex generator input added ' +'20040922 3.3 O.Amoignon Adjoint solver for inviscid flows ' +'20041214 3.3 P.Eliasson Propeller file name added ' +'20050929 3.3 S.-H. Peng Added hybrid HYB0 model ' +'20090909 4.1 P.Eliasson SA DES,LES model parameter changes ' +'20090916 4.1 P.Eliasson Line-implicit time marching ' +' Weak boundary conditions ' +'20091012 4.1 P.Eliasson Laminar areas supplied in separate file ' +'20091015 4.1 T. Berglind Trajectory computations ' +'20091108 4.1 L. Cavagna AERO-ELASTIC/THERMALS mostly uniformed ' +'20091125 4.1 M. Tormalm Probe and inlet analysis in history file' +'20100223 4.1 P.Eliasson Regional data supplied by file ' +'20100315 5.0 M.Tomac Added kw-sst + transition model ' +* +*************************************************************************** +* * +* NAME,TYPE(I,R,L),NDIM(=1),NSIZE(=# ELEMENTS),NSUB(=0) * +* * +VERSION,S ,1,1,0 +'5.0.0 ' +* +TITLE,L ,1,1,0 +'Edge, an edge-based flow-solver from FFA. ( www.foi.se/edge ) ' +* +*************************************************************************** +* * +* ---------------- Initialization ---------------- * +* * +*************************************************************************** +* Initial solution option : +* 0 = Not available (created in code) +* 1 = Available (if full multigrid on coarsest level) +* 2 = Restart of previous run +* (solution available finest level incompatible with full MG) +* +INPRES,I ,1,1,0 +0 +* +*************************************************************************** +* * +* ---------------- Gas data ---------------- * +* * +*************************************************************************** +* Governing equations : +* 0 = *DEFAULT = Euler +* 1 = N-S +* +INSEUL,I ,1,1,0 +__INSEUL__ +* +*************************************************************************** +* Gas model : +* 1 = *DEFAULT = Calorically perfect gas +* 2 = Thermally perfect gas +* +ITYGAS,I ,1,1,0 +1 +* +*************************************************************************** +* Gamma +* +GAMMA,R ,1,1,0 +1.4 +* +*************************************************************************** +* Cp +* +CP,R ,1,1,0 +1004.5 +* +*************************************************************************** +* * +* -------------- Thermally perfect gas options (ITYGAS=2) --------------* +* * +*************************************************************************** +* Number of species NSPEC. Used with ITYGAS=2 and +* active if NSPEC>1 +* +NSPEC,I ,1,1,0 +1 +* +*************************************************************************** +* Schmidt number for species diffusion, NSPEC>1 +* +SCHMID,R ,1,1,0 +0.5 +* +*************************************************************************** +* Turbulent Schmidt number for species diffusion, NSPEC>1 +* +SCHMTU,R ,1,1,0 +0.9 +* +*************************************************************************** +* Input table size +* +NGTAB,I ,1,1,0 +2 +* +*************************************************************************** +* Temperatures (the first temperature has to be 0) +* IGTAB contains the corresponding GAMMAS +* IRTAB contains the corresponding gas constants +* +IGTTAB,R ,1,10,0 +0.0 10000.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +* +*************************************************************************** +* See IGTTAB for help +* Must be (at least) NSPEC lines +* +IGTAB,R ,5,10,0 +1.4 1.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +1.4 1.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +1.4 1.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +1.4 1.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +1.4 1.4 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +* +*************************************************************************** +* See IGTTAB for help +* Must be (at least) NSPEC lines +* +IRTAB,R ,5,10,0 +287.0 287.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +287.0 287.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +287.0 287.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +287.0 287.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +287.0 287.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 +* +*************************************************************************** +* Entropy fix for upwind species equations (NSPEC>1) : +* |SPEFIX| < 1. : Not valid (equivalent to SPEFIX=0) +* |SPEFIX| > 1. : Entropy fix scaled isotropically with the spectral +* radius (SR), = (SPEFIX-1.)*SR +* SPEFIX > 0 Spectral radius SR = U*N + A +* SPEFIX < 0 Spectral radius SR = U*N + |U| +* where A is the speed of sound. SPEFIX < 0 is used for low Mach +* numbers to decrease the numerical dissipation. +* +SPEFIX,R ,1,1,0 +1.01 +* +*************************************************************************** +* * +* --------------- Viscous data --------------- * +* * +*************************************************************************** +* Model of laminar dynamic viscosity : +* 0 = *DEFAULT = Variable viscosity +* 1 = Constant viscosity +* +ICOVIC,I ,1,1,0 +0 +* +*************************************************************************** +* Viscosity at TFREE +* +RMU,R ,1,1,0 +1.7894E-5 +* +*************************************************************************** +* Prandtl number +* +PRREF,R ,1,1,0 +0.72 +* +*************************************************************************** +* Thin layer approximation or full N-S : +* 0 = Thin layer +* 1 = Full N-S +* +IFULNS,I ,1,1,0 +1 +* +*************************************************************************** +* * +* --------------- Freestream values --------------- * +* * +*************************************************************************** +* Freestream pressure +* +PFREE,R ,1,1,0 +__PFREE__ +* +*************************************************************************** +* Freestream temperature T_inf +* +TFREE,R ,1,1,0 +__TFREE__ +* +*************************************************************************** +* Freestream velocity in x-direction +* +UFREE,R ,1,1,0 +__UFREE__ +* +*************************************************************************** +* Freestream velocity in y-direction +* +VFREE,R ,1,1,0 +-0.0 +* +*************************************************************************** +* Freestream velocity in z-direction +* +WFREE,R ,1,1,0 +__WFREE__ +* +*************************************************************************** +* Freestream turbulence intensity +* (In DES and LES, this TUFREE and VRFREE can be set as being 1% of +* the values used in RANS computation) +* +TUFREE,R ,1,1,0 +0.0010 +* +*************************************************************************** +* Freestream viscosity ratio. +* For SA model VRFREE<=0.1 recommended +* +VRFREE,R ,1,1,0 +1.0 +* +*************************************************************************** +* Freestream values for the species +* +SPMFFREE,R ,5,1,0 +0.2 +0.2 +0.2 +0.2 +0.2 +* +*************************************************************************** +* * +* --------------- Spatial discretization --------------- * +* * +*************************************************************************** +* Central scheme, discretization type : +* 0 = Central (F_ij=F( [ U_i + U_j ]/2 ) +* + Jameson type art. diss.) +* 1 = Upwind (F_ij=[ F_i + F_j ]/2 + upwinding) +* 2 = CENTRAL-2 (F_ij=[ F_i + F_j ]/2 +* + Jameson type art. diss.) +* (discrete adjoint implemented) +* +IUPWIN,I ,1,1,0 +0 +* +*************************************************************************** +* 2nd order dissipation coefficients (central schemes only) +* +VIS2,R ,1,1,0 +0.5 +* +*************************************************************************** +* 4th order dissipation coefficients (central schemes only) +* +VIS4,R ,1,1,0 +0.02 +* +*************************************************************************** +* Dissipation type (upwind schemes) : +* 1 = FDS TVD +* 2 = Symm. TVD +* +IARDIS,I ,1,1,0 +2 +* +*************************************************************************** +* Order of upwind scheme : +* 1 = 1st order +* 2 = 2nd order +* +IORDER,I ,1,1,0 +2 +* +*************************************************************************** +* Limiter for FDS schemes (IARDIS=1) : Classical limiters +* for symm. TVD (IARDIS=2) : Limiters based on +* effective ratios +* The first value corresponds to limiter applied to linear field +* The second value corresponds to limiter applied to nonlinear field +* The following choices are available : +* 1 = MINMOD +* 2 = VAN LEER +* 3 = SUPERBEE +* +LIMITE,I ,1,2,0 +1 1 +* +*************************************************************************** +* 1 = *DEFAULT = ROE averaging in upwind scheme +* 0 = Arithmetic averaging in upwind scheme +* +IROEAV,I ,1,1,0 +1 +* +*************************************************************************** +* The first value corresponds to the limiter applied +* to the linear field +* The second value corresponds to the limiter applied +* to the non-linear field +* > 1. : ENTROPY FIX scaled isotropically with the spectral +* radius (SR), = (ENTFIX-1.)*SR +* +ENTRFX,R ,1,2,0 +1.2 1.05 +* +*************************************************************************** +* * +* --------------- Multigrid options --------------- * +* * +*************************************************************************** +* Number of grids : > 1 --> multigrid +* +NGRID,I ,1,1,0 +__NGRID__ +* +*************************************************************************** +* Multigrid strategy : +* 1 = V-cycle +* 2 = *DEFAULT = W-cycle +* 3 = F-cycle +* 4 = V-sawtooth cycle +* 5 = W-sawtooth cycle +* 6 = F-sawtooth cycle +* +MGRSTR,I ,1,1,0 +2 +* +*************************************************************************** +* Full multigrid : +* 0 = No full multigrid +* 1 = *DEFAULT = Full multigrid +* +IFULMG,I ,1,1,0 +1 +* +*************************************************************************** +* Maximum number of full multigrid cycles (*DEFAULT = 500) +* +NFMGCY,I ,1,1,0 +500 +* +*************************************************************************** +* Number of sweeps (relaxation or Runge-Kutta) in +* fine-to-coarse (FC) and coarse-to-fine sweep of the MG cycle +* +NSWPFC,I ,1,10,0 +1 1 1 1 1 1 1 1 1 1 +* +*************************************************************************** +* Number of sweeps (relaxation or Runge-Kutta) in +* coarse-to-fine (CF) sweep of the MG cycle +* +NSWPCF,I ,1,10,0 +1 1 1 1 1 1 1 1 1 1 +* +*************************************************************************** +* Coarser grid simplification for multigrid : +* 0 = No simplifications +* 1 = Central scheme : +* Coarser grids : 4th-order dissipation added on solid walls +* 2nd-order upwind scheme : +* Coarser grids : 1st-order upwind scheme +* 2 = Like MGSIMP=1 plus viscous terms and source terms +* neglected on coarser grids +* In hypersonics MGSIMP might work even better to +* avoid oscillation in the vicinity of strong shocks +* +MGSIMP,I ,1,1,0 +1 +* +*************************************************************************** +* Coarse grid dissipation coefficient (if MGSIMP = 1) +* (central schemes only) +* +VIS0,R ,1,1,0 +0.15 +* +*************************************************************************** +* Reduction factor for CFL on coarser grids +* (0. < RFCORR < 1.) 1. = No reduction +* CFL := CFL * ( CFLREF **(IGRID - 1) ) +* +CFLREF,R ,1,1,0 +0.8 +* +*************************************************************************** +* Parameter for smoothing corrections in multigrid +* 0. = No smoothing +* +SMCOR,R ,1,1,0 +1.5 +* +*************************************************************************** +* Indicates whether zero or first order prolongation +* 0 = Zero order +* 1 = First order +* +IPROLO,I ,1,1,0 +0 +* +*************************************************************************** +* Indicates whether linear or quadratic order restriction +* 0 = Linear +* 1 = Quadratic +* +IRESTR,I ,1,1,0 +0 +* +*************************************************************************** +* * +* ---------------- Steady state time integrator ---------------- * +* * +*************************************************************************** +* Number of stages > 0 <=10 +* +NSTAGE,I ,1,1,0 +3 +* +*************************************************************************** +* Viscous terms recalculated (1) or not (0) at each stage +* *DEFAULT = 1 , 0 , 0 , 0 ..... +* +ISWV,I ,1,10,0 +1 0 0 0 0 0 0 0 0 0 +* +*************************************************************************** +* Source terms recalculated (1) or not (0) at each stage +* *DEFAULT = 1 , 0 , 0 , 0 ..... +* +ISWS,I ,1,10,0 +1 0 0 0 0 0 0 0 0 0 +* +*************************************************************************** +* 0 = ISWV applies to physical, viscous diss. only +* the artificial/upwind dissipation is then always recalculated +* 1 = ISWV applies to both the artificial/upwind +* dissipation and the physical, viscous diss. +* *DEFAULT = 1 which is less expensive +* +IBOTH,I ,1,1,0 +1 +* +*************************************************************************** +* Runge-Kutta coefficients +* *DEFAULT = 2./3. , 2./3. , 1. (3 stage RK) +* +IRKCO,R ,1,10,0 +0.66667 0.66667 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 +* +*************************************************************************** +* Combined line-implicit and explicit time integration +* 0 = DEFAULT = Explicit +* 1 = Line-implicit/explicit on finest grid level +* +LINEIM,I ,1,1,0 +0 +* +*************************************************************************** +* Line-implicit Runge-Kutta coefficients +* *DEFAULT = 1. , 1. , 0.8 (3 stage RK) +* +IRKCOLI,R ,1,10,0 +1.0 1.0 0.8 1.0 1.0 1.0 1.0 1.0 1.0 1.0 +* +*************************************************************************** +* * +* ---------------- Implicit residual smoothing ---------------- * +* * +*************************************************************************** +* Residual smoothing parameter, CFL/CFL* >1 if used +* *DEFAULT = 1.3 +* +RSMPAR,R ,1,1,0 +1.3 +* +*************************************************************************** +* 0 = Standard residual smoothing +* 1 = Distance weighted residual smoothing +* +IRESMO,I ,1,1,0 +1 +* +*************************************************************************** +* >=1 : Number of Jacobi implicit residual smoothing sweeps +* +NSMCYC,I ,1,1,0 +2 +* +*************************************************************************** +* * +* ---------------- Time accurate options ---------------- * +* * +*************************************************************************** +* 0 = Ordinary with explicit or implicit time marching +* 1 = Implicit time accurate acc. to Jameson/Arnone +* 2 = Explicit time accurate with global time step +* +ITIMAQ,I ,1,1,0 +0 +* +*************************************************************************** +* 0 = Compute global time step +* 1 = Set global time step (DELTAT) when ITIMAQ = 2 +* +ISGLTS,I ,1,1,0 +0 +* +*************************************************************************** +* Implicit (ITIMAQ = 1) or +* Explicit (ITIMAQ = 2) global time step +* +DELTAT,R ,1,1,0 +0.005 +* +*************************************************************************** +* Convergence criteria, stop when MAX(LOG(RES)) < RESTAQ +* +RESTAQ,R ,1,1,0 +1.0 +* +*************************************************************************** +* Maximum number of inner iterations when implicit time accurate +* +ITMXAQ,I ,1,1,0 +100 +* +*************************************************************************** +* Minimum number of inner iterations when implicit time accurate +* +ITMNAQ,I ,1,1,0 +3 +* +*************************************************************************** +* Three constant for the unknowns, default backward difference +* BETNP1*U^n+1 + BETN*U^n + BETNM1*U^n-1 +* +BETNP1,R ,1,1,0 +1.5 +* +BETN,R ,1,1,0 +-2.0 +* +BETNM1,R ,1,1,0 +0.5 +* +*************************************************************************** +* Two constant for the residuals +* GAMNP1*R^n+1 + GAMN*R^n +* +GAMNP1,R ,1,1,0 +1.0 +* +GAMN,R ,1,1,0 +0.0 +* +*************************************************************************** +* 0 = Switch off time-averaging for steady computations +* 1 = Set for time-averaging for unsteady calculations (ITIMAQ/=0) +* This parameter can be used in update.ainp to intermediately +* start time-averaging during the running course without +* interruption by setting ITMEAN = 1 +* If INPRES=2 and T-averaging also restarts with a previous +* field, then one should set ITMEAN = 1 +* +ITMEAN,I ,1,1,0 +0 +* +*************************************************************************** +* Time step at which time-averaging starts, function only if ITMEAN=1 +* NOTE: If INPRES=2 and ITMEAN=1, indicates that time-averaging +* restarts from a previous run. In this case, ITERM < ITER. +* +ITERM,I ,1,1,0 +2000 +* +*************************************************************************** +* Specification of points where time-series is recorded for unsteady +* computations. Specify a number of points NPTHIS each defined with +* coordinates and their local identities (boundary or interior points) +* Example: (p1,p2,p3,p4,p5) +* The data is specified in T_HIS_INFO +* +NPTHIS,I ,1,1,0 +0 +* +T_HIS_INFO,N ,0,0,2 +* +POINT_COOD,R ,5,3,0 +0.6858 0.0 -0.0254 +0.7874 -0.0254 0.0381 +1.2954 -0.01905 0.04445 +0.8128 -0.1016 -0.0254 +1.0414 0.0 0.0 +* +POINT_INDEX,L ,5,2,0 +'point1 ' 'bound_point ' +'point2 ' 'bound_point ' +'point3 ' 'bound_point ' +'point4 ' 'bound_point ' +'point5 ' 'inter_point ' +* +*************************************************************************** +* * +* ---------- Computing in a rotating frame of reference ---------- * +* * +*************************************************************************** +* 0 = No rotation +* 1 = Rotation +* +IROT,I ,1,1,0 + 0 +* +*************************************************************************** +* Angular velocity and direction when rotation +* The absolute value is the angular velocity +* +OMGROT,R ,1,3,0 +0.0 0.0 0.0 +* +*************************************************************************** +* Coordinates for one point on axis off rotation +* +OMGCOO,R ,1,3,0 +0.0 0.0 0.0 +* +*************************************************************************** +* * +* ---------------- Maneuver option ---------------- * +* * +*************************************************************************** +* 0 = No maneuvers +* 1 = For specification of arbitrary maneuvers +* +IMANEUV,I ,1,1,0 +0 +* +*************************************************************************** +* Input data format for the maneuver data given in MOVDAT +* 0 = Time, v1, v2, v3, w1, w2, w3 +* 1 = Time, v1, v2, v3, w1, w2, w3, W1, W2, W3 +* 2 = Time, v1, v2, v3, w1, w2, w3, O11, O12, O13, O21.... O33 +* +IMVDTF,I ,1,1,0 +1 +* +MOVDAT,R ,2,10,0 +0.0 0.0 0.0 0.0 0.0 0.0 125.664 0.0 0.0 0.0 +1.0 0.0 0.0 0.0 0.0 0.0 125.664 0.0 0.0 125.664 +* +*************************************************************************** +* * +* ---------------- On-line mesh-deformation ---------------- * +* * +MSHD_CONSTANTS,N ,0,0,4 +* +*************************************************************************** +* Convergence tolerance : dimensionless +* +RELTOL,R ,1,1,0 +1.0E-6 +* +*************************************************************************** +* Convergence tolerance : length +* +ABSTOL,R ,1,1,0 +0.0 +* +*************************************************************************** +* Iteration limiter +* +MAXIT,I ,1,1,0 +1000 +* +*************************************************************************** +* Initialisation : +* 0 = Reference grid +* 1 = Previous timestep +* +INICO,I ,1,1,0 +0 +* +*************************************************************************** +* * +* ---------------- Aeroelastics and related options ---------------- * +* * +*************************************************************************** +* Diagnostic dry run option for coupled / aeroelastic solutions +* 0 = Standard solution +* 1 = Flow-solver switched off +* +ISDRY,I ,1,1,0 +0 +* +AEROELASTICS,N ,0,0,13 +* +*************************************************************************** +* Aeroelastic solution options : +* 0 = Rigid grids (no aeroelastics) +* 100 = Modal fixed rigid +* 101 = Modal prescribed motion +* 102 = Modal coupled : orthogonal modes central difference +* 112 = Modal externally coupled +* +ISOOPT,I ,1,1,0 +0 +* +*************************************************************************** +* Mode type options : +* 0 = None, non-modal solutions PLACEHOLDER +* 1 = Grid perturbation +* 2 = Boundary surface +* 3 = Structural nodes PLACEHOLDER +* +MODOPT,I ,1,1,0 +0 +* +*************************************************************************** +* External force input on/off (coupled solutions only) : +* 0 = No external forces +* 1 = Input from CFIMOT (mot) file (ignored for ISOOPT= 0, 100, 101, 112) +* +IFORCED,I ,1,1,0 +0 +* +*************************************************************************** +* Controls where in the inner, ITIN, loop the AE functions are active : +* 0 = Never +* N>0 = Every N inner iterations (ignored for ISOOPT= 0, 100, 101) +* +NITIN,I ,1,1,0 +1 +* +*************************************************************************** +* Optional : subtract initial modal force (INPRES==2 only) +* 0 = No force offset at all +* 1 = Force offset from last point in res time history +* >1 = Force offset from specified time-point in "res" history +* +IFOFFSET,I ,1,1,0 +0 +* +*************************************************************************** +* 0 = *DEFAULT = Modal forces computed with DYNAMIC (t) wall normals +* 1 = Modal forces computed with FIXED (t=0) wall normals +* +IFIX_B_SURFS,I ,1,1,0 +0 +* +*************************************************************************** +* 0 = *DEFAULT = POFFSET = 0 +* !=0 = Aerodynamic forces computed with (P - POFFSET) +* +POFFSET,R ,1,1,0 +0.0 +* +*************************************************************************** +* File CFIPRM (inp) is the update/comunication file for AEROELASTICS +* - required to modify internal parameters and data +* +CFIPRM,L ,1,1,0 +'Edge_at.ainp ' +* +*************************************************************************** +* File CFIMOD (amod) is the structural input file +* - required only when the H coupling matrix is stored (in .bedg) +* - contains structural data : nodes, label, coordinates and modal shapes +* +CFIMOD,L ,1,1,0 +'Edge_ae.amod ' +* +*************************************************************************** +* File CFIMOT (mot) contains a tabulated modal timeseries : +* - either modal coordinates q(t) for prescribed motion +* - or modal force input Q(t) for coupled simulation +* +CFIMOT,L ,1,1,0 +'Edge_ae.amot ' +* +*************************************************************************** +* File CFIMOP (mop) is the modal parameters input file : +* - required for modal coupled options only (102) +* - contains modal parameters : frequency, damping, generalised_mass +* and initial state : q(t=0), q_dot(t=0) +* +CFIMOP,L ,1,1,0 +'Edge_ae.amop ' +* +*************************************************************************** +* File CFIMOS (mos) contains modes in grid perturbation form MODOPT: 1. +* Required for all modal options. +* +CFIMOS,L ,1,1,0 +'Edge.bmos ' +* +*************************************************************************** +* Filenames for surface-displacement modes MODOPT: 2 or 3. +* Format: prefix.suffix / imin imax istep +* +CFIDIS,L ,1,1,0 +'bdis/Edge.bdis / 1001 1006 1 ' +* +*************************************************************************** +* * +* ---------------- Aero-thermal solution options ---------------- * +* * +AEROTHERMALS,N ,0,0,13 +* +*************************************************************************** +* Thermal coupling option : +* 0 = No thermal coupling +* 100 = Modal fixed temperature surface +* 101 = Modal prescribed temperature +* 102 = Modal coupled +* 112 = Modal externally coupled +* 202 = Coupled to external solver (full model) +* +ISOOPT,I ,1,1,0 +0 +* +*************************************************************************** +* Controls where in the inner loop the thermal coupling is active : +* 0 = Never +* N>0 = Every N inner iterations (ignored for ISOOPT= 0, 100, 101) +* +NITIN,I ,1,1,0 +1 +* +*************************************************************************** +* External modal force input on/off (coupled solutions only) : +* 0 = No external forces +* 1 = Input from CFIMOT (mot) file (ignored for ISOOPT= 0, 100, 101, 112) +* +IFORCED,I ,1,1,0 +0 +* +*************************************************************************** +* File CFIPRM (inp) is the update/comunication file for AEROTHERMALS +* - required to modify internal parameters and data +* +CFIPRM,L ,1,1,0 +'Edge_at.ainp ' +* +*************************************************************************** +* File CFIMOD (amod) is the structural thermal input file +* - required only when the H coupling matrix is stored (in .bedg) +* - contains structural data : nodes, label, coordinates and modal shapes +* +CFIMOD,L ,1,1,0 +'Edge_at.amod ' +* +*************************************************************************** +* File CFIMOP (mop) is the modal parameters input file : +* - required for modal coupled options only +* - contains modal parameters : frequency, damping, generalised_mass +* and initial state : q(t=0), q_dot(t=0) +* +CFIMOP,L ,1,1,0 +'Edge_at.amop ' +* +*************************************************************************** +* File CFIMOT (mot) contains a tabulated modal timeseries : +* - either modal coordinates q(t) for prescribed motion +* - or modal force input Q(t) for coupled simulation +* +CFIMOT,L ,1,1,0 +'Edge_at.amot ' +* +*************************************************************************** +* Filenames for thermal modes +* format: prefix.suffix / imin imax istep +* +CFIDIS,L ,1,1,0 +'bdis/thermal_modes.bdis / 2001 2012 1 ' +* +*************************************************************************** +* Specify numerical scheme for heat implicit integration : +* 0.5 = Crank-Nicolson (suggested, no numerical damping) +* 2/3 = Galerkin +* 1.0 = Backward Euler +* Any value can be given to provide numerical damping, despite accuracy +* (ignored for ISOOPT= 0, 100, 101, 202) +* +NDAMPT,R ,1,1,0 +0.5 +* +*************************************************************************** +* Surface constant emissivity for radiation bc +* If 0.0, radiation is not considered +* +WALL_EMISSIVITY,R ,1,1,0 +0.0 +* +*************************************************************************** +* Background temperature for radiative heat transfer +* +BACK_TEMPERATURE,R ,1,1,0 +0.0 +* +*************************************************************************** +* Stefan-Boltzmann constant for radiation +* +STEF_BOLTZ,R ,1,1,0 +5.67E-8 +* +*************************************************************************** +* Specify coupling formulation with the thermal model : +* 0.0 = Neumann (through fluxes, fully explicit) +* 1.0 = Dirichlet (through temperatures, fully implicit) +* < 1.0 = Robyn (mixed formulation) +* (used for ISOOPT= 102, 112, 202) +* +RELAXT,R ,1,1,0 +0.5 +* +*************************************************************************** +* * +* ------------- Trajectory solution options ---------------- * +* * +TRAJECTORY_DATA,N ,0,0,7 +* +*************************************************************************** +* Trajectory solution options : +* 0 = No trajectory computations +* 1 = Quasi-steady trajectory computations +* 2 = Unsteady trajectory computations +* +ITRAJEC,I ,1,1,0 +0 +* +*************************************************************************** +* Total number of iterations for trajectory computations +* +ITMXTRA,I ,1,1,0 +1 +* +*************************************************************************** +* If ITRAJEC = 1, time step for trajectory computations +* +DELTAT_QS,R ,1,1,0 +0.005 +* +*************************************************************************** +* Gravitational acceleration vector in main frame coordinates +* +GRAV,R ,3,1,0 +0.0 +0.0 +9.80665 +* +*************************************************************************** +* Number of substeps for 6DoF computations +* +NSUBST,I ,1,1,0 +1 +* +*************************************************************************** +* Parameter controlling the grid check ( > 1.) +* +CHKMAX,R ,1,1,0 +10.0 +* +*************************************************************************** +* The trajectory file ( .atra ) +* +CFITRA,L ,1,1,0 +'Edge.atra ' +* +*************************************************************************** +* * +* ---------------- Propeller options ---------------- * +* * +*************************************************************************** +* File CFIDISK contains the input to the propeller disk model +* The model is used as a boundary condition +* The data file is not in FFA-format, it is copied from Multnas +* +CFIDISK,L ,1,1,0 +'prin.dat ' +* +*************************************************************************** +* * +* --------------- Preconditioning options --------------- * +* * +*************************************************************************** +* 0 = No preconditioning +* 1 = Preconditioning for low Mach numbers used +* +IPREPA,I ,1,1,0 +0 +* +*************************************************************************** +* RKBET2 preconditioning parameter, +* RKBET1 = 1, ALPHAP = 0 as default in Euranus +* +RKBET2,R ,1,1,0 +4.0 +* +*************************************************************************** +* RM0 preconditioning parameter, +* RKBET1=1, ALPHAP=0 as default in Euranus +* +RM0,R ,1,1,0 +1.0 +* +*************************************************************************** +* 1 = Add the viscous correction to beta, +* 0 = DEFAULT, dont add it +* +IPREVIS,I ,1,1,0 +0 +* +*************************************************************************** +* * +* --------------- Number of iterations, CFL etc. --------------- * +* * +*************************************************************************** +* Number of iterations and type of time step +* +ITMAX,I ,1,1,0 +1000 +* +*************************************************************************** +* Convergence criteria (orders of magnitude of reduction) +* +RESRED,R ,1,1,0 +-6.0 +* +*************************************************************************** +* Convergence criteria full multigrid (orders of magnitude +* of reduction required before including new grid level) +* +RESFMG,R ,1,1,0 +-4.5 +* +*************************************************************************** +* Inviscid CFL number +* +CFL,R ,1,1,0 +__CFL__ +* +*************************************************************************** +* Viscous CFL number : If > 0 --> Time step is minimum of inviscid +* and viscous time step +* If <= 0 --> Only inviscid CFL is used, and time +* step is harmonic average of inviscid +* and viscous time step +* +CFLVIS,R ,1,1,0 +-1.0 +* +*************************************************************************** +* Line-implicit CFL number >=1 +* CFLLI = 1 --> Explicit local time step +* CFLLI -> inf --> Line-implicit local time step +* +CFLLI,R ,1,1,0 +10000.0 +* +*************************************************************************** +* Line-implicit LHS artificial dissipation >0 +* Increase slightly if convergence problems encountered +* Too high values will degrade rate of convergence +* +EPS2LI,R ,1,1,0 +0.2 +* +*************************************************************************** +* * +* --------------- Miscellaneous options --------------- * +* * +*************************************************************************** +* Post processing options. Additional fields written to +* a separate solution file name in CFIPOST +* 0 = No post processing, default +* 1 = Cf, q, yplus for viscous calc. (INPRES=1) +* 2 = Mach number, Cp, energy, temperature and local time step +* 4 = Distance to the wall and laminar/turbulent field +* 8 = Residuals to all unknowns +* 16 = Reynolds stresses +* 32 = Gradients of the dependent variables +* 64 = Flow curvature vector +* For several options sum up (1+4=5 for cf and wall distance etc.) +* +IPOST,I ,1,1,0 +15 +* +*************************************************************************** +* EPS is used to avoid division by zero +* +EPS,R ,1,1,0 +1.0E-28 +* +*************************************************************************** +* Save the solution (.bout) and residual (.bres) files every IWRSOL +* iterations. These files are used for restarts. See also INPRES. +* +IWRSOL,I ,1,1,0 +500 +* +*************************************************************************** +* Output solution to file, runtime parameter +* +IOUTPT,I ,1,1,0 +0 +* +*************************************************************************** +* Sample the solution to multiple (_it.bout) files every IMULOU +* iterations. These files are for analysis only, not restarts. +* +IMULOU,I ,1,1,0 +0 +* +*************************************************************************** +* Output convergence stuff every ISTOUT iteration +* +ISTOUT,I ,1,1,0 +1 +* +*************************************************************************** +* Number of the residual on standard output every ISTOUT iteration +* 1 = *DEFAULT (density) +* +NRRES,I ,1,1,0 +1 +* +*************************************************************************** +* Region data file supplied (CFIREG) with regional data +* 0 = No data file supplied +* 1 = Data file supplied +* +IREGIONDATA,I ,1,1,0 +0 +* +*************************************************************************** +* Direction for lift force +* Direction for force 1 +* +IDCLP,R ,1,3,0 +__IDCLP__ +* +*************************************************************************** +* Direction for drag force +* Direction for force 2 +* +IDCDP,R ,1,3,0 +__IDCDP__ +* +*************************************************************************** +* Direction for side force +* Direction for force 3 +* +IDCCP,R ,1,3,0 +__IDCCP__ +* +*************************************************************************** +* Direction for pitch moment +* Direction for moment 1 +* +IDCMP,R ,1,3,0 +__IDCMP__ +* +*************************************************************************** +* Direction for yaw moment +* Direction for moment 2 +* +IDCNP,R ,1,3,0 +__IDCNP__ +* +*************************************************************************** +* Direction for roll moment +* Direction for moment 3 +* +IDCRP,R ,1,3,0 +__IDCRP__ +* +*************************************************************************** +* Point for moment +* +IXMP,R ,1,3,0 +__IXMP__ +* +*************************************************************************** +* Reference area to non-dimensionalize forces and moments +* +SREF,R ,1,1,0 +__SREF__ +* +*************************************************************************** +* Reference chord for non-dimensionalizing moment +* +CREF,R ,1,1,0 +__CREF__ +* +*************************************************************************** +* Reference width for non-dimensionalizing moment +* +BREF,R ,1,1,0 +__BREF__ +* +*************************************************************************** +* * +* --------------- Vortex generator options --------------- * +* * +*************************************************************************** +* Number of vortex generator (VG) configuration to be used +* If no VG model is applied VGCONFIG = 0 +* +VGCONFIG,I ,1,1,0 +0 +* +*************************************************************************** +* Parameter file with jBAY and/or RANS vortex generator input +* Used by program under program/VG_identify where an example file +* can be found +* +CFVGNAME,L ,1,1,0 +'vg_config.adat ' +* +*************************************************************************** +* Scaling factor for KCONST, KCONST=VGKCONSTSCALE*PI, used by RANS VG +* +VGKCONSTSCALE,R ,1,1,0 +1.8 +* +*************************************************************************** +* * +* --------------- File names --------------- * +* * +*************************************************************************** +* The mesh file ( .bmsh ) +* +CFIMSH,L ,1,1,0 +'Edge.bmsh' +* +*************************************************************************** +* Edge file name from the preprocessor ( .bedg ) +* +CFIEDG,L ,1,1,0 +'Edge.bedg' +* +*************************************************************************** +* The boundary condition file ( .aboc ) +* +CFIBOC,L ,1,1,0 +'Edge.aboc' +* +*************************************************************************** +* The residual file ( .bres ) +* +CFIRES,L ,1,1,0 +'Edge.bres ' +* +*************************************************************************** +* The solution file ( .bout ) +* Also initial solution for restart (INPRES = 2) +* +CFIOUT,L ,1,1,0 +'Edge.bout ' +* +*************************************************************************** +* CFIMEAN is the OUTPUT file for time-averaging(_mean.bout) +* +CFIMEAN,L ,1,1,0 +'Edge_mean.bout ' +* +*************************************************************************** +* The initial solution file (INPRES = 1) ( .bini ) +* +CFIINI,L ,1,1,0 +'Edge.bini ' +* +*************************************************************************** +* Post processing solution file (IPOST > 0) ( .bout ) +* +CFIPOST,L ,1,1,0 +'Post.bout ' +* +*************************************************************************** +* History recording file (PROBE_RECORD > 0 or AIP_RECORD=1) +* +CFIHIS,L ,1,1,0 +'history.bhis ' +* +*************************************************************************** +* Regional data file (IREGIONDATA = 1) (.areg, .breg) +* +CFIREG,L ,1,1,0 +'Edge.areg ' +* +*************************************************************************** +* * +* ---------------- Turbulence models ---------------- * +* * +*************************************************************************** +* 0 = Laminar +* 2 = RANS models +* 3 = DES models +* 4 = LES models +* +ITURB,I ,1,1,0 +2 +* +*************************************************************************** +* Choice of turbulence model : +* --------------------------------------- +* Default RANS model: +* W&J EARSM + Hellsten k-omega +* Other recommended RANS models: +* Spalart-Allmaras one-eq model +* Menter SST k-omega +* Menter SST k-omega + Transition +* W&J DRSM + Hellsten k-omega +* Other RANS models: +* std Wilcox k-omega +* Kok_TNT k-omega +* Menter BSL k-omega +* Wilcox LRN k-omega +* PDH LRN k-omega +* W&J EARSM + std k-omega +* GWJ Generalized EARSM + std k-omega +* W&J EARSM + Kok_TNT k-omega +* W&J EARSM + Menter BSL k-omega 2009 +* W&J CC-EARSM + std k-omega +* W&J CC-EARSM + Menter BSL k-omega +* W&J CC-EARSM + Hellsten k-omega +* W&J DRSM + std k-omega +* SSG DRSM + std k-omega +* SSG DRSM + Hellsten k-omega +* --------------------------------------- +* DES and hybrid RANS-LES models : +* Spalart-Allmaras DES model +* Peng hybrid HYB0 model +* --------------------------------------- +* LES models : +* Smagorinsky SGS model +* Spalart-Allmaras SGS model +* Yoshizawa k-eq SGS model +* +TURB_MOD_NAME,L ,1,1,0 +'W&J EARSM + Hellsten k-omega' +* +*************************************************************************** +* 2-eq. turb. discretization type : +* 0 = Central +* 1 = Upwind +* +IUPWKZ,I ,1,1,0 +1 +* +*************************************************************************** +* 2nd order dissipation coefficient +* For K-E turbulence model (central schemes only) +* +VIS2KZ,R ,1,1,0 +0.5 +* +*************************************************************************** +* 4th order dissipation coefficient +* For K-E turbulence model (central schemes only) +* +VIS4KZ,R ,1,1,0 +0.02 +* +*************************************************************************** +* Entropy fix for upwind 2-eq. turbulence : +* |TURFIX| < 1. : Not valid (equivalent to TURFIX=0) +* |TURFIX| > 1. : Entropy fix scaled isotropically with the spectral +* radius (SR), = (TURFIX-1.)*SR +* TURFIX > 0 Spectral radius SR = U*N + A +* TURFIX < 0 Spectral radius SR = U*N + |U| +* Where A is the speed of sound. TURFIX < 0 is used for low Mach +* numbers to decrease the numerical dissipation. +* +TURFIX,R ,1,1,0 +-1.1 +* +*************************************************************************** +* Order of turbulent upwind scheme : +* 1 = 1st order +* 2 = 2nd order +* +IORDKZ,I ,1,1,0 +2 +* +*************************************************************************** +* * +* --------------- Turbulence model definitions --------------- * +* * +TURB_MOD_LIST,N ,0,0,26 +* +*************************************************************************** +* * +* --------------- Peng hybrid HYB0 model ---------- * +* * +TURB_MOD,L ,1,1,12 +'Peng hybrid HYB0 model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +0 +* +NAME_UNK,S ,1,1,0 +'zero_equation ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +3 +* +NAME_EX,S ,1,3,0 +'turb_viscosity ' 'turb_kin_energy ' 'rans_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CSGS,R ,1,1,0 +0.12 +* +CKSGS,R ,1,1,0 +0.0 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.4 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXHYB0P ' +* +*************************************************************************** +* * +* --------------- Spalart-Allmaras DES model ---------- * +* * +TURB_MOD,L ,1,1,20 +'Spalart-Allmaras DES model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'turb_kin_energy ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDESSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXDESSA ' +* +*************************************************************************** +* * +* --------------- Smagorinsky model ---------- * +* * +TURB_MOD,L ,1,1,11 +'Smagorinsky SGS model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +0 +* +NAME_UNK,S ,1,1,0 +'zero_equation ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'turb_kin_energy ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CSMAG,R ,1,1,0 +0.2 +* +CKSMG,R ,1,1,0 +0.0 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.4 +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity and kin. energy) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSGSSMG ' +* +*************************************************************************** +* * +* --------------- Spalart-Allmaras SGS model ---------- * +* * +TURB_MOD,L ,1,1,20 +'Spalart-Allmaras SGS model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'turb_kin_energy ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSLESSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSGSSA ' +* +*************************************************************************** +* * +* --------------- Yoshizawa SGS model ---------- * +* * +TURB_MOD,L ,1,1,14 +'Yoshizawa k-eq SGS model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_kin_energy ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CKMU,R ,1,1,0 +0.07 +* +CEPS,R ,1,1,0 +1.05 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.4 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISLESYO ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSLESYO ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSGSYO ' +* +*************************************************************************** +* * +* --------------- Spalart-Allmaras one-eq. model ---------- * +* * +TURB_MOD,L ,1,1,23 +'Spalart-Allmaras one-eq model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'turb_kin_energy ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACT1,R ,1,1,0 +1.0 +* +SACT2,R ,1,1,0 +2.0 +* +SACT3,R ,1,1,0 +1.1 +* +SACT4,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSAM ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- std Wilcox k-omega --------------- * +* * +TURB_MOD,L ,1,1,15 +'std Wilcox k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTKW ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSTKW ' +* +*************************************************************************** +* * +* --------------- Wilcox LRN k-omega --------------- * +* * +TURB_MOD,L ,1,1,15 +'Wilcox LRN k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.56 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSLRKWW ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXLRKWW ' +* +*************************************************************************** +* * +* --------------- Rung LLR k-omega --------------- * +* * +TURB_MOD,L ,1,1,15 +'Rung LLR k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.43 +* +BETA,R ,1,1,0 +0.83 +* +BETAS,R ,1,1,0 +0.27667 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +1.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTLLR ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXLLR ' +* +*************************************************************************** +* * +* --------------- PDH LRN k-omega --------------- * +* * +TURB_MOD,L ,1,1,16 +'PDH LRN k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.42 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +1.25 0.7407 +* +SIGMAD_CROSS,R ,1,1,0 +0.75 +* +WALL,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSLRKWP ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXLRKWP ' +* +*************************************************************************** +* * +* --------------- Kok_TNT k-omega --------------- * +* * +TURB_MOD,L ,1,1,16 +'Kok_TNT k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.553 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.66666 0.5 +* +SIGMAD_CROSS,R ,1,1,0 +0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTCD ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSTKW ' +* +*************************************************************************** +* * +* --------------- W&J EARSM + std k-omega --------------- * +* * +TURB_MOD,L ,1,1,18 +'W&J EARSM + std k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +C1,R ,1,1,0 +1.8 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTKW ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* ------------ GWJ Generalized EARSM + std k-omega ------------ * +* * +TURB_MOD,L ,1,1,19 +'GWJ Generalized EARSM + std k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +C1,R ,1,1,0 +1.8 +* +C,R ,1,1,0 +0.56 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTKW ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXGWJA ' +* +*************************************************************************** +* * +* --------------- W&J EARSM + Kok_TNT k-omega --------------- * +* * +TURB_MOD,L ,1,1,19 +'W&J EARSM + Kok_TNT k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.525 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.66666 0.55 +* +SIGMAD_CROSS,R ,1,1,0 +0.3 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +C1,R ,1,1,0 +1.8 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTCD ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* --------------- MENTER BSL k-omega --------------- * +* * +TURB_MOD,L ,1,1,20 +'Menter BSL k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 +* +BETA,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSKWBSL ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSTKW ' +* +*************************************************************************** +* * +* --------------- MENTER SST k-omega --------------- * +* * +TURB_MOD,L ,1,1,21 +'Menter SST k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 +* +BETA,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.85 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSKWSST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSST ' +* +*************************************************************************** +* * +* --------------- MENTER SST k-omega + Transition --------------- * +* * +TURB_MOD,L ,1,1,41 +'Menter SST k-omega + Transition ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- Transition model options ----- * +* * +*************************************************************************** +* Governing correlation functions: +* 0 = *DEFAULT = Tomac-Pettersson +* 1 = Menter-Langtry +* +ICORRF,I ,1,1,0 +0 +* +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +4 +* +NAME_UNK,S ,1,4,0 +'turb_kin_energy ' 'turb_omega ' 'intermittency ' 're_tetha_t ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'laminar_turbulen' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 +* +BETA,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,4,0 +0.85 0.5 1.0 2.0 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* * +* ----- Transition model constants ----- * +* * +CA1,R ,1,1,0 +2.0 +* +CA2,R ,1,1,0 +0.06 +* +CE1,R ,1,1,0 +1.0 +* +CE2,R ,1,1,0 +50.0 +* +CALPHA,R ,1,1,0 +0.5 +* +CTT,R ,1,1,0 +0.03 +* +S1,R ,1,1,0 +2.0 +* +FLTC1,R ,1,1,0 +0.3188 +* +FLTC2,R ,1,1,0 +100.0 +* +FLTC3,R ,1,1,0 +0.0 +* +FLTC4,R ,1,1,0 +73000.0 +* +RETCC1,R ,1,1,0 +0.92345 +* +RETCC2,R ,1,1,0 +187.0 +* +RETCC3,R ,1,1,0 +0.615 +* +RETCC4,R ,1,1,0 +30000.0 +* +RETCC5,R ,1,1,0 +0.0080 +* +LTLIM,R ,1,2,0 +-0.1 0.1 +* +TULIM,R ,1,1,0 +0.027 +* +RETTLIM,R ,1,1,0 +20.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKBSLT ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSKWSSTT ' 'HSINTRETT ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,2,0 +'FXSST ' 'FXINTRETT ' +* +*************************************************************************** +* * +* --------------- W&J EARSM + MENTER BSL k-omega 2009 ---------- * +* * +TURB_MOD,L ,1,1,26 +'W&J EARSM + Menter BSL k-omega 2009 ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'mut_simp_diff ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +ALPHA2,R ,1,1,0 +0.44035 +* +BETA,R ,1,1,0 +0.075 +* +BETA1,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +A1,R ,1,1,0 +1.245 +* +A3,R ,1,1,0 +1.8 +* +A4,R ,1,1,0 +2.25 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSKWBSL ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* --------------- W&J CC-EARSM + std k-omega --------------- * +* * +TURB_MOD,L ,1,1,20 +'W&J CC-EARSM + std k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +*************************************************************************** +* * +* ----- If curvature correction ----- * +* * +CURV_CORR,I ,1,0,0 +* +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +C1,R ,1,1,0 +1.8 +* +A0,R ,1,1,0 +-0.72 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSTKW ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* --------------- W&J CC-EARSM + Menter BSL k-omega --------------- * +* * +TURB_MOD,L ,1,1,26 +'W&J CC-EARSM + Menter BSL k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- If curvature correction ----- * +* * +CURV_CORR,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +ALPHA2,R ,1,1,0 +0.44035 +* +BETA,R ,1,1,0 +0.075 +* +BETA1,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +C1,R ,1,1,0 +1.8 +* +A0,R ,1,1,0 +-0.72 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSKWBSL ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* --------------- W&J EARSM + Hellsten k-omega --------------- * +* * +TURB_MOD,L ,1,1,27 +'W&J EARSM + Hellsten k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.518 +* +ALPHA2,R ,1,1,0 +0.44 +* +BETA,R ,1,1,0 +0.0747 +* +BETA1,R ,1,1,0 +0.0747 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +1.1 0.53 +* +SIGMA2,R ,1,2,0 +1.1 1.0 +* +SIGMAD1,R ,1,1,0 +1.0 +* +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +2.2 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +C1,R ,1,1,0 +1.8 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZHELLST ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSHELLST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* --------------- W&J-CC EARSM + Hellsten k-omega --------------- * +* * +TURB_MOD,L ,1,1,29 +'W&J CC-EARSM + Hellsten k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Turb_extra_anis exists ----- * +* * +AEX_AVAIL,I ,1,0,0 +* +*************************************************************************** +* * +* ----- If curvature correction ----- * +* * +CURV_CORR,I ,1,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +1 +* +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.518 +* +ALPHA2,R ,1,1,0 +0.44 +* +BETA,R ,1,1,0 +0.0747 +* +BETA1,R ,1,1,0 +0.0747 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +1.1 0.53 +* +SIGMA2,R ,1,2,0 +1.1 1.0 +* +SIGMAD1,R ,1,1,0 +1.0 +* +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +2.2 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +C1,R ,1,1,0 +1.8 +* +A0,R ,1,1,0 +-0.72 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZHELLST ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,1,0 +'HSSHELLST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXWJAR ' +* +*************************************************************************** +* * +* --------------- W&J DRSM + std k-omega --------------- * +* * +TURB_MOD,L ,1,1,23 +'W&J DRSM + std k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Reynolds_stress exists ----- * +* * +RS_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,2,0 +5 7 +* +NAME_UNK,S ,1,12,0 +'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_kin_energy ' 'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,12,0 +0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Pressure-strain model constants ----- * +* * +PSC10,R ,1,1,0 +4.6 +* +PSC11,R ,1,1,0 +1.24 +* +PSC2,R ,1,1,0 +0.47 +* +PSC2S,R ,1,1,0 +0.0 +* +PSC3,R ,1,1,0 +2.0 +* +PSC4,R ,1,1,0 +0.56 +* +PSC5,R ,1,1,0 +0.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSSTKW ' 'HSSRST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXXRST ' +* +*************************************************************************** +* * +* --------------- W&J DRSM + Hellsten k-omega --------------- * +* * +TURB_MOD,L ,1,1,31 +'W&J DRSM + Hellsten k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Reynolds_stress exists ----- * +* * +RS_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,2,0 +5 7 +* +NAME_UNK,S ,1,12,0 +'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_kin_energy ' 'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.518 +* +ALPHA2,R ,1,1,0 +0.44 +* +BETA,R ,1,1,0 +0.0747 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,12,0 +1.1 1.1 1.1 1.1 0.53 1.1 1.1 1.1 1.1 1.1 1.1 0.53 +* +SIGMA2,R ,1,12,0 +1.1 1.1 1.1 1.1 1.0 1.1 1.1 1.1 1.1 1.1 1.1 1.0 +* +SIGMAD1,R ,1,1,0 +1.0 +* +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Pressure-strain model constants ----- * +* * +PSC10,R ,1,1,0 +4.6 +* +PSC11,R ,1,1,0 +1.24 +* +PSC2,R ,1,1,0 +0.47 +* +PSC2S,R ,1,1,0 +0.0 +* +PSC3,R ,1,1,0 +2.0 +* +PSC4,R ,1,1,0 +0.56 +* +PSC5,R ,1,1,0 +0.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZHELLST ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSSHELLST ' 'HSSRST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXXRST ' +* +*************************************************************************** +* * +* --------------- SSG DRSM + std k-omega --------------- * +* * +TURB_MOD,L ,1,1,23 +'SSG DRSM + std k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Reynolds_stress exists ----- * +* * +RS_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs (2D and 3D) ----- * +* * +NTEQ,I ,1,2,0 +5 7 +* +NAME_UNK,S ,1,12,0 +'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_kin_energy ' 'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.556 +* +BETA,R ,1,1,0 +0.075 +* +BETAS,R ,1,1,0 +0.09 +* +*************************************************************************** +* * +* ----- One for each equation first in 2D and then in 3D ----- * +* * +SIGMA,R ,1,12,0 +0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Pressure-strain model constants ----- * +* * +PSC10,R ,1,1,0 +3.4 +* +PSC11,R ,1,1,0 +1.8 +* +PSC2,R ,1,1,0 +0.8 +* +PSC2S,R ,1,1,0 +1.3 +* +PSC3,R ,1,1,0 +1.25 +* +PSC4,R ,1,1,0 +0.4 +* +PSC5,R ,1,1,0 +4.2 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSSTKW ' 'HSSRST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity and K) ----- * +* * +EXTRVA,S ,1,1,0 +'FXXRST ' +* +*************************************************************************** +* * +* --------------- SSG DRSM + Hellsten k-omega --------------- * +* * +TURB_MOD,L ,1,1,31 +'SSG DRSM + Hellsten k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If MUT exists ----- * +* * +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Reynolds_stress exists ----- * +* * +RS_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs (2D and 3D) ----- * +* * +NTEQ,I ,1,2,0 +5 7 +* +NAME_UNK,S ,1,12,0 +'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Number and names of additional turb fields ----- * +* * +NTEX,I ,1,1,0 +2 +* +NAME_EX,S ,1,2,0 +'turb_kin_energy ' 'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.518 +* +ALPHA2,R ,1,1,0 +0.44 +* +BETA,R ,1,1,0 +0.0747 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,12,0 +1.1 1.1 1.1 1.1 0.53 1.1 1.1 1.1 1.1 1.1 1.1 0.53 +* +SIGMA2,R ,1,12,0 +1.1 1.1 1.1 1.1 1.0 1.1 1.1 1.1 1.1 1.1 1.1 1.0 +* +SIGMAD1,R ,1,1,0 +1.0 +* +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Pressure-strain model constants ----- * +* * +PSC10,R ,1,1,0 +3.4 +* +PSC11,R ,1,1,0 +1.8 +* +PSC2,R ,1,1,0 +0.8 +* +PSC2S,R ,1,1,0 +1.3 +* +PSC3,R ,1,1,0 +1.25 +* +PSC4,R ,1,1,0 +0.4 +* +PSC5,R ,1,1,0 +4.2 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZHELLST ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSSHELLST ' 'HSSRST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity and K) ----- * +* * +EXTRVA,S ,1,1,0 +'FXXRST ' +* +*************************************************************************** +* * +* --------------- Preprocessor -------------- * +* * +*************************************************************************** +* Coarsening ratio in each dimension ( 1 < CRDIM ) +* +CRDIM,R ,1,1,0 +2.0 +* +*************************************************************************** +* Maximum number of coarser grid levels to be generated +* +NLEVEL,I ,1,1,0 +5 +* +*************************************************************************** +* Removement of singletons (YES = 1, NO = 0) +* +RMSING,I ,1,1,0 +1 +* +*************************************************************************** +* Number of prismatic layers +* +NPLAYER,I ,1,1,0 +40 +* +*************************************************************************** +* Coarsening ratio in the prismatic layer ( CRATIOB > 1.0) +* +CRATIOB,R ,1,1,0 +4.0 +* +*************************************************************************** +* Number of partitions. NPART > 1 specifies a parallel calculation. +* Used by both flow solver and preprocessor +* +NPART,I ,1,1,0 +__NPART__ +* +*************************************************************************** +* Partitioning option +* 1 = Original option with algorithm based on agglomeration +* 2 = Partitioning based on METIS +* +PTYPE,I ,1,1,0 +2 +* +*************************************************************************** +* Flag for printing the dual grid (YES = 1, NO = 0) +* +PDUAL,I ,1,1,0 +0 +* +*************************************************************************** +* Type of edge coloring : +* 0 = No coloring +* 1 = *DEFAULT = Cache reordering trying all algorithms choosing the best +* 2 = Vector coloring +* 3 = Cache reordering using saw1 algorithm +* 4 = Cache reordering using saw2 algorithm +* 5 = Cache reordering using bfs1 algorithm +* 6 = Cache reordering using bfs2 algorithm +* 7 = Cache reordering using bfs3 algorithm +* +COLTYPE,I ,1,1,0 +1 +* +*************************************************************************** +* Parameter for specifying laminar areas +* 0 = No laminar areas +* 1 = Laminar areas specified in the file name of CFILAM +* +LAMAREAS,I ,1,1,0 +0 +* +*************************************************************************** +* The file containing laminar areas ( .alam, .blam ) +* +CFILAM,L ,1,1,0 +'Edge.alam ' +* +*************************************************************************** +* 0 = No wall distance field +* 1 = Generate wall distance field +* +IWALLDIS,I ,1,1,0 +0 +* +*************************************************************************** +* * +* --------------- Adaption parameters -------------- * +* * +*************************************************************************** +* Adaption parameters taken from file: refinement_data.aref +* 0 = Data in this file used +* 1 = Data in refinement_data.aref used +* +EXTADAPT,I ,1,1,0 +0 +* +*************************************************************************** +* Maximum cell size (dimensional) +* +CELMAX,R ,1,1,0 +0.7 +* +*************************************************************************** +* Minimum cell size (dimensional) +* +CELMIN,R ,1,1,0 +0.1 +* +*************************************************************************** +* Maximum indicator change in one cell +* +CELFLO,R ,1,1,0 +0.05 +* +*************************************************************************** +* Change number of nodes maximum by this factor +* +RMAGNI,R ,1,1,0 +4.0 +* +*************************************************************************** +* Surface projection parameter +* 0 = No projection +* 1 = Projection +* +IPROJ,I ,1,1,0 +1 +* +*************************************************************************** +* 0 = Previous default adaption (with/without yplus adaption) +* 1 = Default (difference in velocity, density, pressure +* between two nodes) +* 2 = Ratio of total pressures (po/po_inf) +* 3 = Creation of entropy +* 4 = Vortex identification +* +SENSOR,I ,1,1,0 +1 +* +*************************************************************************** +* H-adaption and/or y+ adaption for SENSOR=0 +* 1 = Only h-refinement +* 2 = Only y+ adaption of prismatic layer +* 3 = Both h-refinement and y+ adaption, this is the same as +* alternative 1 for a grid without a prismatic layer +* +ADAPTCASE,I ,1,1,0 +1 +* +*************************************************************************** +* Desired y+ value for the first prismatic cell +* +YPLUS,R ,1,1,0 +1.0 +* +*************************************************************************** +* Threshold value to start refining the mesh : +* 0 = Not used +* 1 = Not used +* 2 = Ratio of total pressures +* 3 = Creation of entropy +* 4 = Reduced velocity +* +THRESHOLD,R ,1,1,0 +0.8 +* +*************************************************************************** +* Adaption box : +* 0. = BOXCOOR defines an hexahedral box +* >0. = Radius of a cylinder whose centerline is given by BOXCOOR +* +* NSIZE for RADIUS gives the number of boxes specified +* +RADIUS,R ,1,1,0 +0.0 +* +*************************************************************************** +* If RADIUS = 0. : Coordinates of two diagonal points in an +* hexahedral box +* If RADIUS > 0. : Coordinates of the two points defining the +* centerline of a cylinder +* Xmin Xmax Ymin Ymax [Zmin Zmax] +* (Xmin=Xmax & Ymin=Ymax & Zmin= Zmax)=>No adaption box +* +BOXCOOR,R ,1,6,0 +0.0 0.0 0.0 0.0 0.0 0.0 +* +*************************************************************************** +* * +* --------------- Adjoint calculation -------------- * +* Notation : * +* We use here pdJ/pdx, respectively, pdJ/pdw, for * +* the partial derivatives of J with respect to the variable x, * +* respectively, w. * +* * +* Context : * +* Compute gradient of J(w,X) subject to E(w,X)=0, * +* where X is the set of nodal coordinates and w the set * +* of nodal values of the vector of conservative variables. * +* J is one of the functionals described by FUNTYP below. * +* Here E symbolizes the discretized flow equations in Edge. * +* The associated discrete adjoint problem is * +* [(dE/dw)prime]z=pdJ/pdwprime * +* where prime is the transpose or adjoint * +* and z is the adjoint state associated with the calculation * +* of the gradient of J with respect to X. * +* * +* Important note : * +* z is computed by Edge as well as * +* a postprocessing, see below ADJOPT. * +* In order to compute the gradient w.r.t. all nodes * +* (if below ADJOPT=2), the edge file is required to * +* contain extra data. This is done by running the preprocessor * +* on the edge input for the adjoint case with ADJOPT=2. * +* * +*************************************************************************** +* 0 = Flow solution +* 1 = Calculate/save adjoint solution (z) only in CFIOUT (*.bout file) +* 2 = ----------------------------------- and gradient (dJ/dX) in output +* Requires a flow solution CFIEUL (*.bout file). +* +ADJOPT,I ,1,1,0 +0 +* +*************************************************************************** +* The solution file for the current flow (w, see above), (.****) +* +CFIEUL,L ,1,1,0 +'Edge.bout ' +* +*************************************************************************** +* Description of objective function +* I - INVISCID AERODYNAMIC COEFFICIENTS +* Note : direction vectors are normalized at initialization +* and the integrated forces are non-dimensionalized +* by division by free-stream energy +* drag : pressure force on part of the wall boundaries +* projected in the direction IDCDP +* lift : pressure force on part of the wall boundaries +* projected in the direction IDCLP +* side : pressure force on part of the wall boundaries +* projected in the direction IDCCP +* pitch: pressure moment on part of the wall boundaries +* projected in the direction IDCMP +* yaw : pressure moment on part of the wall boundaries +* projected in the direction IDCNP +* roll : pressure moment on part of the wall boundaries +* projected in the direction IDCRP +* II - NATURAL LAMINAR FLOW DESIGN +* blsa : J=J(p(X)) where J is computed by external programs +* for the boundary layer analysis and the +* propagation of disturbances. +* Requires the file CFIBLAD (FFA-format) where +* subsets GRADP, GRADX, GRADY give pdJ/pdp_i, +* pdJ/pdx_i, pdJ/pdy_i and a subset +* BNOD gives the global index i of the nodes +* i at which the pressure p_i is used in the +* coupling between the flow solver (Edge) and +* the analysis of the boundary layer. +* +FUNTYP,L ,1,1,0 +'lift ' +* +CFIBLAD,L ,1,1,0 +'databl.adbl ' +* +*************************************************************************** +* * +* --------------- Probe analysis options --------------- * +* * +* Records primitive variables and turbulence data at a * +* specified point in the volume or on a boundary * +* * +*************************************************************************** +* Number of active probes if >0 +* +PROBE_RECORD,I ,1,1,3 +0 +* +*************************************************************************** +* Coordinates of probes +* +PROBE_COORD,R ,8,3,0 +0.8939345 0.0105114 0.0759227 +0.8939345 -0.0299341 0.0678775 +0.8939345 -0.0528447 0.0335895 +0.8939345 -0.0447995 -0.006856 +0.8939345 -0.0105114 -0.0297666 +0.8939345 0.0299341 -0.0217215 +0.8939345 0.0528447 0.0125665 +0.8939345 0.0447995 0.0530121 +* +*************************************************************************** +* Name and location of probes: +* interior = inside the volume +* boundary = on boundary surface +* +PROBE_NAME,L ,8,2,0 +'PD1 ' 'interior ' +'PD2 ' 'interior ' +'PD3 ' 'interior ' +'PD4 ' 'interior ' +'PD5 ' 'interior ' +'PD6 ' 'interior ' +'PD7 ' 'interior ' +'PD8 ' 'interior ' +* +*************************************************************************** +* Write probe info to a mesh file: 1=yes,0=no +* +PMESH,I ,1,1,1 +1 +* +*************************************************************************** +* Name of mesh file +* +CFIPROBE,L ,1,1,0 +'Probe.bmsh ' +* +*************************************************************************** +* * +* --------------- Inlet analysis options --------------- * +* * +*************************************************************************** +* 0 = No inlet analysis +* 1 = Calculate pressure recovery and distortion at specified AIP location +* (AIP=Aerodynamic Interface Plane must be circular) +* +* Note: Extra data is added to the bedg-file in the preprocessor step. +* If any setting is changed, make sure to run the preprocessor again. +* +AIP_RECORD,I ,1,1,7 +0 +* +*************************************************************************** +* Write Aip mesh to file: 1=yes,0=no +* +AIPMESH,I ,1,1,1 +1 +* +*************************************************************************** +* Name of mesh file +* +CFIAIP,L ,1,1,0 +'Aip.bmsh ' +* +*************************************************************************** +* Mid-point of AIP and probe rake +* +AIP_POINT,R ,1,3,0 +4.7217 0.0 2.1 +* +*************************************************************************** +* Radius of AIP and probe rake +* +AIP_RADIUS,R ,1,1,0 +0.33 +* +*************************************************************************** +* AIP and probe rake plane normal direction +* +AIP_NORM,R ,1,3,0 +1.0 0.0 0.0 +* +*************************************************************************** +* Start distortion analysis from this direction and rotate +* clockwise looking from the AIP_NORM vector. This will determine +* the angle of maximum distortion. +* +AIP_ROT,R ,1,3,0 +0.0 0.0 1.0 +* +*************************************************************************** +* Pos 1: Number of radial position of AIP rake +* Pos 2: Number of arms of AIP rake +* Pos 3: Full circle=1, half circle=0 (if using a symmetry plane at AIP) +* +AIP_GRID,I ,1,3,0 +5 5 0 +* +*************************************************************************** +* Evaluate freestream total pressure for AIP reference +* 1 = At specified point in volume (PT_POINT) +* 2 = At specified boundary name (PT_BC, mean values evaluated) +* 3 = Use Free stream values from this input file (PFREE,TFREE...) +* +PT_PROBE,I ,1,1,2 +1 +* +*************************************************************************** +* Coordinates of points for free stream references +* +PT_POINT,R ,1,3,0 +3.0717 0.15 2.4 +* +*************************************************************************** +* Boundary condition name for free stream reference +* +PT_BC,L ,1,1,0 +'BC1_on_INLET ' +* +*************************************************************************** +* * +* ---------------- The end of regular Edge parameters ---------------- * +* * diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py new file mode 100644 index 000000000..28b0d5275 --- /dev/null +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -0,0 +1,257 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by Airinnova AB, Stockholm, Sweden + +Function generate or modify M-Edge ainp files + +Python version: >=3.8 + +| Author: Mengmeng Zhang +| Creation: 2024-01-05 + +TODO: + + * + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import math + +from pathlib import Path +from shutil import copyfile + +from ambiance import Atmosphere +#from ceasiompy.SU2Run.func.su2actuatordiskfile import ( +# get_advanced_ratio, +# get_radial_stations, +# save_plots, +# thrust_calculator, +# write_actuator_disk_data, +# write_header, +#) +from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template +from ceasiompy.utils.ceasiomlogger import get_logger +from ceasiompy.utils.commonnames import ( +AINP_CFD_NAME, +) +from ceasiompy.utils.commonxpath import ( + GMSH_SYMMETRY_XPATH, + PROP_XPATH, + RANGE_XPATH, + EdgeMESH_XPATH, + Edge_AEROMAP_UID_XPATH, + Edge_CFL_NB_XPATH, + Edge_MAX_ITER_XPATH, + Edge_MG_LEVEL_XPATH, + Edge_NB_CPU_XPATH, + Edge_FIXED_CL_XPATH, + +) +#from ceasiompy.utils.configfiles import ConfigFile +from ceasiompy.utils.create_ainpfile import CreateAinp +from cpacspy.cpacsfunctions import ( + create_branch, + get_string_vector, + get_value, + get_value_or_default, +) +from cpacspy.cpacspy import CPACS +#import cpacs + +log = get_logger() + +MODULE_DIR = Path(__file__).parent + + +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +# ================================================================================================= +# FUNCTIONS +# ================================================================================================= + + +def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): + #output_path = Path(case_dir_path, AINP_CFD_NAME) + """Function to create Edge input (*.ainp) file. + + Function 'generate_edge_cfd_ainp' reads data in the CPACS file and generate configuration + files for one or multiple flight conditions (alt,mach,aoa,aos) + + Source: + * M-Edge ainp template: + + Args: + cpacs_path (Path): Path to CPACS file + cpacs_out_path (Path):Path to CPACS output file + wkdir (Path): Path to the working directory + + """ + + cpacs = CPACS(cpacs_path) + + edge_mesh = Path(get_value(cpacs.tixi, EdgeMESH_XPATH)) + if not edge_mesh.is_file(): + raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") + + # Get the fixedCL value from CPACS + fixed_cl = get_value_or_default(cpacs.tixi, Edge_FIXED_CL_XPATH, "NO") + if fixed_cl == "NO": + # Get the first aeroMap as default one or create automatically one + 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, Edge_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" + + mach = get_value_or_default(cpacs.tixi, RANGE_XPATH + "/cruiseMach", 0.3) + alt = get_value_or_default(cpacs.tixi, RANGE_XPATH + "/cruiseAltitude", 10000) + + default_aeromap.add_row(alt=alt, mach=mach, aos=0.0, aoa=0.0) + default_aeromap.save() + + alt_list = [alt] + mach_list = [mach] + aoa_list = [0.0] + aos_list = [0.0] + + aeromap_uid = get_value_or_default(cpacs.tixi, Edge_AEROMAP_UID_XPATH, "DefaultAeromap") + log.info(f"{aeromap_uid} has been created") + + else: # if fixed_cl == 'YES': + log.info("Configuration file for fixed CL calculation will be created.") + + fixed_cl_aeromap = cpacs.create_aeromap("aeroMap_fixedCL_SU2") + fixed_cl_aeromap.description = f"AeroMap created for SU2 fixed CL value of {target_cl}" + + mach = get_value_or_default(cpacs.tixi, RANGE_XPATH + "/cruiseMach", 0.78) + alt = get_value_or_default(cpacs.tixi, RANGE_XPATH + "/cruiseAltitude", 12000) + + fixed_cl_aeromap.add_row(alt=alt, mach=mach, aos=0.0, aoa=0.0) + fixed_cl_aeromap.save() + + alt_list = [alt] + mach_list = [mach] + aoa_list = [0.0] + aos_list = [0.0] + + #cfg = ConfigFile(get_su2_config_template()) + + # Check if symmetry plane is defined (Default: False) + sym_factor = 1.0 + if get_value_or_default(cpacs.tixi, GMSH_SYMMETRY_XPATH, False): + log.info("Symmetry plane is defined. The reference area will be divided by 2.") + sym_factor = 2.0 + + # General parameters +# cfg["RESTART_SOL"] = "NO" + CREF = cpacs.aircraft.ref_length + SREF = cpacs.aircraft.ref_area / sym_factor + BREF = SREF / CREF + IXMP = [cpacs.aircraft.ref_point_x, cpacs.aircraft.ref_point_y, cpacs.aircraft.ref_point_z] + + # Settings + + ITMAX = int(get_value_or_default(cpacs.tixi, Edge_MAX_ITER_XPATH, 200)) + CFL = get_value_or_default(cpacs.tixi, Edge_CFL_NB_XPATH, 1.5) + NGRID = int(get_value_or_default(cpacs.tixi, Edge_MG_LEVEL_XPATH, 3)) + NPART = int(get_value_or_default(cpacs.tixi,Edge_NB_CPU_XPATH,32)) + INSEUL = 0 + + + # Parameters which will vary for the different cases (alt,mach,aoa,aos) + for case_nb in range(len(alt_list)): + #cfg["MESH_FILENAME"] = str(su2_mesh) + + alt = alt_list[case_nb] + mach = mach_list[case_nb] + aoa = aoa_list[case_nb] + aos = aos_list[case_nb] + + Atm = Atmosphere(alt) + + PFREE = Atm.pressure[0] + TFREE = Atm.temperature[0] + speedofsound = Atm.speed_of_sound[0] + airspeed = mach*speedofsound + + aoa_rad = math.radians(aoa) + aos_rad = math.radians(aos) + + UFREE = airspeed * math.cos(aos) * math.cos(aoa) + WFREE = airspeed * math.cos(aos) * math.sin(aoa) + VFREE = airspeed * math.sin(aos) * (-1) + + IDCDP1 = math.cos(aos) * math.cos(aoa) + IDCDP2 = math.sin(aos) + IDCDP3 = math.cos(aos) * math.sin(aoa) + + IDCLP1 = math.sin(aoa) * (-1) + IDCLP2 = 0 + IDCLP3 = math.cos(aoa) + + IDCCP1 = math.cos(aoa) * math.sin(aos) * (-1) + IDCCP2 = math.cos(aos) * (-1) + IDCCP3 = math.sin(aoa) * math.sin(aos) * (-1) + IDCMP1 = IDCCP1 + IDCMP2 = IDCCP2 + IDCMP3 = IDCCP3 + IDCNP1 = IDCLP1 + IDCNP2 = IDCLP2 + IDCNP3 = IDCLP3 + IDCRP1 = IDCDP1 + IDCRP2 = IDCDP2 + IDCRP3 = IDCDP3 + + IDCLP = f"{IDCLP1} {IDCLP2} {IDCLP3}" + IDCDP = f"{IDCDP1} {IDCDP2} {IDCDP3}" + IDCMP = f"{IDCMP1} {IDCMP2} {IDCMP3}" + IDCCP = f"{IDCCP1} {IDCCP2} {IDCCP3}" + IDCNP = f"{IDCNP1} {IDCNP2} {IDCNP3}" + IDCRP = f"{IDCRP1} {IDCRP2} {IDCRP3}" + + case_dir_name = ( + f"Case{str(case_nb).zfill(2)}_alt{alt}_mach{round(mach, 2)}" + f"_aoa{round(aoa, 1)}_aos{round(aos, 1)}" + ) + + case_dir_path = Path(wkdir, case_dir_name) + if not case_dir_path.exists(): + case_dir_path.mkdir() + output_path = Path(case_dir_path, AINP_CFD_NAME) + #template_path = get_edge_ainp_template() + create_ainp_instance = CreateAinp() + #create_ainp_instance = CreateAinp(get_edge_ainp_template()) + + create_ainp_instance.create_ainp(UFREE, VFREE, WFREE, TFREE, PFREE, SREF, CREF, BREF, IXMP, IDCLP, IDCDP, IDCCP, IDCMP, IDCNP, IDCRP, NPART, ITMAX, INSEUL, NGRID, CFL, output_path) + + #cfg.write_file(config_output_path, overwrite=True) + + cpacs.save_cpacs(cpacs_out_path, overwrite=True) + + + # ================================================================================================= + # MAIN + # ================================================================================================= + + if __name__ == "__main__": + log.info("Nothing to execute!") \ No newline at end of file diff --git a/ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py b/ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py new file mode 100644 index 000000000..44ce5c506 --- /dev/null +++ b/ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py @@ -0,0 +1,64 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by Airinnova AB, Stockholm, Sweden + +Test functions of 'ceasiompy/EdgeRun/func/edgeconfig.py' + +Python version: >=3.8 + + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import unittest + +import sys +from pathlib import Path + +# Add the ceasiompy module to the PYTHONPATH +ceasiompy_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy') +sys.path.append(str(ceasiompy_path)) + +# Now you can import and use the ceasiompy module +#import ceasiompy +from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp +import os +#from ceasiompy.utils.create_ainpfile import CreateAinp + +MODULE_DIR = Path(__file__).parent + +# ================================================================================================= +# CLASSES +# ================================================================================================= + +class TestEdgeConfig(unittest.TestCase): + """Test class for 'ceasiompy/EdgeRun/func/edgerun.py'""" + + def test_generate_edge_cfd_ainp(self): + """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" + cpacs_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') + cpacs_out_path = MODULE_DIR / 'ToolOutput' + wkdir = MODULE_DIR / 'ToolOutput' + + if not os.path.exists(wkdir): + os.makedirs(wkdir) + + generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir) + + +# ================================================================================================= +# MAIN +# ================================================================================================= + +if __name__ == "__main__": + + print("Test configfile.py") + print("To run test use the following command:") + print(">> pytest -v") diff --git a/ceasiompy/utils/commonnames.py b/ceasiompy/utils/commonnames.py index 2fcdabd97..1b3f8b704 100644 --- a/ceasiompy/utils/commonnames.py +++ b/ceasiompy/utils/commonnames.py @@ -9,6 +9,7 @@ | Author: Aidan jungo | Creation: 2022-05-13 +| Last modifiction: 2024-01-05 (Mengmeng Zhang, added M-Edge AINP_CFD_NAME ) TODO: @@ -41,5 +42,8 @@ ACTUATOR_DISK_INLET_SUFFIX = "_AD_Inlet" ACTUATOR_DISK_OUTLET_SUFFIX = "_AD_Outlet" +# M-Edge +AINP_CFD_NAME = "Edge.ainp" + # WEIGHT & BALANCE MTOM_FIGURE_NAME = "MTOM_Prediction.png" diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 23e139866..625cae0ee 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -12,6 +12,7 @@ | Author: Aidan jungo | Creation: 2021-10-21 +| Last modifiction: 2024-01-05 (Mengmeng Zhang, added M-Edge XPATHs ) TODO: @@ -77,6 +78,7 @@ OPTWKDIR_XPATH = CEASIOMPY_XPATH + "/filesPath/optimPath" SMFILE_XPATH = CEASIOMPY_XPATH + "/filesPath/SMpath" SU2MESH_XPATH = CEASIOMPY_XPATH + "/filesPath/su2Mesh" +EdgeMESH_XPATH = CEASIOMPY_XPATH + "/filesPath/edgeMesh" SUMOFILE_XPATH = CEASIOMPY_XPATH + "/filesPath/sumoFilePath" WKDIR_XPATH = CEASIOMPY_XPATH + "/filesPath/wkdirPath" @@ -140,6 +142,15 @@ SU2_ACTUATOR_DISK_XPATH = SU2_XPATH + "/options/includeActuatorDisk" +# m-Edge +Edge_XPATH = CEASIOMPY_XPATH + "/aerodynamics/m-edge" +Edge_AEROMAP_UID_XPATH = Edge_XPATH + "/aeroMapUID" +Edge_NB_CPU_XPATH = Edge_XPATH + "/settings/nbCPU" +Edge_MAX_ITER_XPATH = Edge_XPATH + "/settings/maxIter" +Edge_CFL_NB_XPATH = Edge_XPATH + "/settings/cflNumber/value" +Edge_MG_LEVEL_XPATH = Edge_XPATH + "/settings/multigridLevel" +Edge_FIXED_CL_XPATH = Edge_XPATH + "/fixedCL" + # RANGE RANGE_LD_RATIO_XPATH = CEASIOMPY_XPATH + "/ranges/lDRatio" diff --git a/ceasiompy/utils/create_ainpfile.py b/ceasiompy/utils/create_ainpfile.py new file mode 100644 index 000000000..1d26a8df6 --- /dev/null +++ b/ceasiompy/utils/create_ainpfile.py @@ -0,0 +1,76 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by Airinnova AB, Stockholm, Sweden + +Module to run M-Edge Calculation in CEASIOMpy +Create M-Edge ainp file from template + +Python version: >=3.8 + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 + +TODO: + + + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import re +from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template + +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +class CreateAinp: + def __init__(self): + self.template_file = get_edge_ainp_template() + + def _write_file(self,content,output_file_path): + #output_file_path = os.path.join(output_folder, 'Edge.ainp') + with open(output_file_path,'w') as f: + f.write(content) + + + def create_ainp(self,UFREE, VFREE, WFREE, TFREE, PFREE, SREF, CREF, BREF, IXMP, IDCLP, IDCDP, IDCCP, IDCMP, IDCNP, IDCRP, NPART, ITMAX, INSEUL, NGRID, CFL,output_folder): + #template_file_path = get_edge_ainp_template() + with open(self.template_file,'r') as f: + template_content = f.read() + + # Define a dictionary for keyword-value pairs + replacements = { + '__UFREE__': str(UFREE), + '__VFREE__': str(VFREE), + '__WFREE__': str(WFREE), + '__TFREE__': str(TFREE), + '__PFREE__': str(PFREE), + '__SREF__': str(SREF), + '__CREF__': str(CREF), + '__BREF__': str(BREF), + '__IXMP__': f"{IXMP[0]} {IXMP[1]} {IXMP[2]}", + '__IDCLP__': IDCLP, + '__IDCDP__': IDCDP, + '__IDCCP__': IDCCP, + '__IDCMP__': IDCMP, + '__IDCNP__': IDCNP, + '__IDCRP__': IDCRP, + '__NPART__': str(NPART), + '__ITMAX__': str(ITMAX), + '__INSEUL__': str(INSEUL), + '__NGRID__': str(NGRID), + '__CFL__': str(CFL) + } + + # Use regular expression to replace keywords with their corresponding values + edge_content = template_content + for keyword, value in replacements.items(): + edge_content = re.sub(re.escape(keyword), value, edge_content) + + self._write_file(edge_content, output_folder) diff --git a/src/bin/ceasiompy_exec.py b/src/bin/ceasiompy_exec.py index 0e588561d..d376cafe7 100755 --- a/src/bin/ceasiompy_exec.py +++ b/src/bin/ceasiompy_exec.py @@ -231,6 +231,7 @@ def main(): parser.add_argument( "-o", "--output", + dest="output", type=str, metavar="", default="su2", diff --git a/src/bin/ceasiompy_run.bat b/src/bin/ceasiompy_run.bat index dfd1caa4f..aacd1f415 100644 --- a/src/bin/ceasiompy_run.bat +++ b/src/bin/ceasiompy_run.bat @@ -39,5 +39,4 @@ :: Turn off command echoing feature @echo off - -python ceasiompy_exec.py %* +python3 ceasiompy_exec.py %* From bc500c88fc3aa4940a5f91f8d9ec341e0d8caff9 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Tue, 9 Jan 2024 18:54:54 +0100 Subject: [PATCH 06/80] updated the default.ainp.tmp file to the latest version, which allows the implicit scheme more efficient than the old multigrid scheme. Usage: NGRID=1 (multigrid not needed) STSTCONV=3 (turn on implicit) KSP_TOL, KSP_TOL_TURB=0.01 (convergence of the linear solver) --- ceasiompy/EdgeRun/files/default.ainp.tmp | 3943 +++++++++++++++------- 1 file changed, 2668 insertions(+), 1275 deletions(-) mode change 100755 => 100644 ceasiompy/EdgeRun/files/default.ainp.tmp diff --git a/ceasiompy/EdgeRun/files/default.ainp.tmp b/ceasiompy/EdgeRun/files/default.ainp.tmp old mode 100755 new mode 100644 index 979ac7f8e..30abac877 --- a/ceasiompy/EdgeRun/files/default.ainp.tmp +++ b/ceasiompy/EdgeRun/files/default.ainp.tmp @@ -1,11 +1,11 @@ -DEFAULT,N ,0,0,165 +DEFAULT,N ,0,0,216 * *************************************************************************** * * * Edge input parameter file * * This file uses the so called FFA-format * * * -MODIFICATIONS,L ,61,1,0 +MODIFICATIONS,L ,73,1,0 'Date Version Programmer Description ' '19991214 P.Eliasson Change def. VIS4,VIS2 ' '20010503 S.Wallin Introduced TURB_MOD_LIST ' @@ -39,7 +39,7 @@ MODIFICATIONS,L ,61,1,0 ' adapted to FBCWAL.F ' '20030930 3.2 S.-H. Peng Added Wilcoxs LRN model ' '20030930 3.2 P.Eliasson Variable ITHEDA removed ' -'20031110 3.2 M.Franke Added Rung LLR-model ' +'20031110 3.2 M.Franke Added Rung LLR-model (2D) ' '20040102 3.2 J.Smith PERT_CONST & IMOVGR inputs removed ' '20040210 3.2 S.-H. Peng Added S-A DES model ' '20040220 3.2 S.-H. Peng Added Smagorinsky LES model ' @@ -58,6 +58,12 @@ MODIFICATIONS,L ,61,1,0 '20040922 3.3 O.Amoignon Adjoint solver for inviscid flows ' '20041214 3.3 P.Eliasson Propeller file name added ' '20050929 3.3 S.-H. Peng Added hybrid HYB0 model ' +'20090630 4.1 St.Schmidt Added Spalart-Allmaras DDES/IDDES model ' +'20090630 4.1 St.Schmidt Added wall damping to Smagorinsky model ' +'20090630 4.1 St.Schmidt Added SST DES/DDES/IDDES models ' +'20090630 4.1 St.Schmidt Added Spalart-Allmaras Edwards model ' +'20090630 3.2 St.Schmidt Added Rung LLR-model (3D) ' +'20090630 4.1 St.Schmidt Added Rung SALSA RANS + DES/DDES/IDDES m' '20090909 4.1 P.Eliasson SA DES,LES model parameter changes ' '20090916 4.1 P.Eliasson Line-implicit time marching ' ' Weak boundary conditions ' @@ -66,17 +72,23 @@ MODIFICATIONS,L ,61,1,0 '20091108 4.1 L. Cavagna AERO-ELASTIC/THERMALS mostly uniformed ' '20091125 4.1 M. Tormalm Probe and inlet analysis in history file' '20100223 4.1 P.Eliasson Regional data supplied by file ' -'20100315 5.0 M.Tomac Added kw-sst + transition model ' +'20100630 4.1 St.Schmidt Added HD model ' +'20110911 5.2 St.Schmidt Added Rung RQEVM model ' +'20100315 5.2 M.Tomac Added kw-sst + transition model ' +'20160118 5.3 P.Eliasson Added option IPOSTMUL ' +'20170112 6.0 P.Eliasson Preprocessor variables updated ' +'20170905 6.0 P.Eliasson Low dispersion scheme introduced ' +'20180119 1.1 P.Eliasson M-Edge ' * *************************************************************************** * * * NAME,TYPE(I,R,L),NDIM(=1),NSIZE(=# ELEMENTS),NSUB(=0) * * * VERSION,S ,1,1,0 -'5.0.0 ' +'3.2.0 ' * TITLE,L ,1,1,0 -'Edge, an edge-based flow-solver from FFA. ( www.foi.se/edge ) ' +'M-Edge, an edge-based flow solver ' * *************************************************************************** * * @@ -84,13 +96,13 @@ TITLE,L ,1,1,0 * * *************************************************************************** * Initial solution option : -* 0 = Not available (created in code) +* 0 = Not available (created freestream in code) * 1 = Available (if full multigrid on coarsest level) * 2 = Restart of previous run * (solution available finest level incompatible with full MG) * INPRES,I ,1,1,0 -0 +0 * *************************************************************************** * * @@ -102,7 +114,7 @@ INPRES,I ,1,1,0 * 1 = N-S * INSEUL,I ,1,1,0 -__INSEUL__ +__INSEUL__ * *************************************************************************** * Gas model : @@ -184,6 +196,14 @@ IRTAB,R ,5,10,0 287.0 287.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 * *************************************************************************** +* Species discretization type : +* 0 = Central +* 1 = Upwind +* +IUPWMS,I ,1,1,0 +1 +* +*************************************************************************** * Entropy fix for upwind species equations (NSPEC>1) : * |SPEFIX| < 1. : Not valid (equivalent to SPEFIX=0) * |SPEFIX| > 1. : Entropy fix scaled isotropically with the spectral @@ -197,6 +217,28 @@ SPEFIX,R ,1,1,0 1.01 * *************************************************************************** +* Order of species equations upwind scheme : +* 1 = 1st order +* 2 = 2nd order +* +IORDMS,I ,1,1,0 +2 +* +*************************************************************************** +* 2nd order dissipation coefficient +* For species equations using central scheme only +* +VIS2MS,R ,1,1,0 +0.1 +* +*************************************************************************** +* 4th order dissipation coefficient +* For species equations using central scheme only +* +VIS4MS,R ,1,1,0 +0.1 +* +*************************************************************************** * * * --------------- Viscous data --------------- * * * @@ -212,7 +254,7 @@ ICOVIC,I ,1,1,0 * Viscosity at TFREE * RMU,R ,1,1,0 -1.7894E-5 +1.8478E-5 * *************************************************************************** * Prandtl number @@ -221,12 +263,13 @@ PRREF,R ,1,1,0 0.72 * *************************************************************************** -* Thin layer approximation or full N-S : -* 0 = Thin layer -* 1 = Full N-S +* Viscous type of operator : +* 1 = Original compact operator for normal derivatives +* 2 = Edge normal operator to account for skewness +* 3 = Coarse operator based on nodal gradients * -IFULNS,I ,1,1,0 -1 +IVISCOP,I ,1,1,0 +1 * *************************************************************************** * * @@ -248,19 +291,19 @@ __TFREE__ * Freestream velocity in x-direction * UFREE,R ,1,1,0 -__UFREE__ +__UFREE__ * *************************************************************************** * Freestream velocity in y-direction * VFREE,R ,1,1,0 --0.0 +__VFREE__ * *************************************************************************** * Freestream velocity in z-direction * WFREE,R ,1,1,0 -__WFREE__ +__WFREE__ * *************************************************************************** * Freestream turbulence intensity @@ -268,7 +311,7 @@ __WFREE__ * the values used in RANS computation) * TUFREE,R ,1,1,0 -0.0010 +0.001 * *************************************************************************** * Freestream viscosity ratio. @@ -301,19 +344,51 @@ SPMFFREE,R ,5,1,0 * (discrete adjoint implemented) * IUPWIN,I ,1,1,0 -0 +0 +* +*************************************************************************** +* Convection type of scheme +* 0 = *DEFAULT = conventional scheme according to IUPWIN +* 1 = Dispersion scheme, provide dispersion constant DISPCONST +* +CONVTYPE,I ,1,1,0 +0 +* +*************************************************************************** +* Dispersion constant >=0 if CONVTYPE=1 +* Default 1/3 which can increase accuracy & dispersion +* +DISPCONST,R ,1,1,0 +0.33333334 +* +*************************************************************************** +* Artificial dissipation type +* 0 = *DEFAULT = scalar dissipation +* 1 = Matrix dissipation; may require high VIS2 for good shock capturing +* 2 = Langer scalar dissipation; default values VIS2 = 8.0, VIS4 = 1/64 +* 3 = Langer matrix dissipation; default values VIS2 = 8.0, VIS4 = 1/64 +* +DISSTYPE,I ,1,1,0 +0 * *************************************************************************** * 2nd order dissipation coefficients (central schemes only) * VIS2,R ,1,1,0 -0.5 +0.5 * *************************************************************************** * 4th order dissipation coefficients (central schemes only) * VIS4,R ,1,1,0 -0.02 +0.02 +* +*************************************************************************** +* Damping coefficient of 4th order dissipation at different element types +* 1 = *DEFAULT = no damping. 0 = full damping +* +DAMPVIS4,R ,1,1,0 +1.0 * *************************************************************************** * Dissipation type (upwind schemes) : @@ -343,7 +418,7 @@ IORDER,I ,1,1,0 * 3 = SUPERBEE * LIMITE,I ,1,2,0 -1 1 +1 1 * *************************************************************************** * 1 = *DEFAULT = ROE averaging in upwind scheme @@ -361,7 +436,17 @@ IROEAV,I ,1,1,0 * radius (SR), = (ENTFIX-1.)*SR * ENTRFX,R ,1,2,0 -1.2 1.05 +1.2 1.05 +* +*************************************************************************** +* Method for gradient calculation +* 0 = *DEFAULT = Green-Gauss +* 1 = Weighted least squares +* 2 = LQ-factorization, Hessian second order. 27 weights(3d) stored/node +* Only applied on the finest grid, Green-Gauss on coarser +* +GRADTYPE,I ,1,1,0 +0 * *************************************************************************** * * @@ -371,7 +456,7 @@ ENTRFX,R ,1,2,0 * Number of grids : > 1 --> multigrid * NGRID,I ,1,1,0 -__NGRID__ +__NGRID__ * *************************************************************************** * Multigrid strategy : @@ -389,19 +474,20 @@ MGRSTR,I ,1,1,0 * Full multigrid : * 0 = No full multigrid * 1 = *DEFAULT = Full multigrid +* 2 = Grid sequencing * IFULMG,I ,1,1,0 -1 +1 * *************************************************************************** * Maximum number of full multigrid cycles (*DEFAULT = 500) * NFMGCY,I ,1,1,0 -500 +500 * *************************************************************************** * Number of sweeps (relaxation or Runge-Kutta) in -* fine-to-coarse (FC) and coarse-to-fine sweep of the MG cycle +* fine-to-coarse (FC) sweep of the MG cycle * NSWPFC,I ,1,10,0 1 1 1 1 1 1 1 1 1 1 @@ -433,7 +519,7 @@ MGSIMP,I ,1,1,0 * (central schemes only) * VIS0,R ,1,1,0 -0.15 +0.15 * *************************************************************************** * Reduction factor for CFL on coarser grids @@ -471,6 +557,177 @@ IRESTR,I ,1,1,0 * ---------------- Steady state time integrator ---------------- * * * *************************************************************************** +* Iterative approach towards steady state +* 1 = DEFAULT, Runge-Kutta explicit time marching with local time steps +* 2 = LU-SGS with global time steps +* 3 = Implicit Scheme: preconditioned Krylov method with local time steps +* +STSTCONV,I ,1,1,0 +3 +* +*************************************************************************** +* Number of LU-SGS sweeps/iteration >=1 +* +NSWPSGS,I ,1,1,0 +1 +* +*************************************************************************** +* Amount of LHS numerical dissipation for LU-SGS and GMRES +* LU-SGS, EPS2SGS>0: Fraction added to eigenvalues >= 0.15 recommended +* LU-SGS, EPS2SGS<0: Scalar LHS dissipation, <= -0.5 +* GMRES, EPS2SGS>0: Entropy fix for eigenvalues of first order upwind LHS +* GMRES, EPS2SGS<0: Scalar LHS dissipation, <= -0.3 recommended +* +EPS2SGS,R ,1,1,0 +0.3 +* +*************************************************************************** +* 0 LU-SGS, standard +* 1 LU-SGS combined with line-implicit +* +SGSLINES,I ,1,1,0 +1 +* +*************************************************************************** +* Node order for LU-SGS sweeps +* 1 original node ordering +* 2 neighbor to neighbor +* 3 implcit lines first + original ordering +* +SGSORDER,I ,1,1,0 +1 +* +*************************************************************************** +* Output LU-SGS convergence if NSWPSGS >=2 +* 0 Do not output linear convergene to screen +* 1 Output linear convergence to screen +* +SGSCONVOUT,I ,1,1,0 +0 +* +*************************************************************************** +* PETSc Krylov subspace solver +* 1 GMRES : Better convergence than BI-CGSTAB, higher memory usage +* 2 BI-CGSTAB : Slightly worse convergence than GMRES, lower memory usage +* +KSP_TYPE,I ,1,1,0 +1 +* +*************************************************************************** +* Convergence tolerance for the mean flow equations +* Reduce if non-linear iterations have convergence problems, e.g. 1.0E-2 +* A smaller value will increase the computational cost +* +KSP_TOL,R ,1,1,0 +0.01 +* +*************************************************************************** +* Convergence tolerance for the turbulence equations +* +KSP_TOL_TURB,R ,1,1,0 +0.01 +* +*************************************************************************** +* Maximum number of iterations of the Krylov subspace solver +* +KSP_MAXITER,I ,1,1,0 +100 +* +*************************************************************************** +* Minimum number of iterations of the mean flow +* +KSP_MINITER_M,I ,1,1,0 +1 +* +*************************************************************************** +* Minimum number of iterations of the turbulence +* +KSP_MINITER_T,I ,1,1,0 +1 +* +*************************************************************************** +* Minimum number of iterations of the turbulence omega equation +* +KSP_MINITER_TW,I ,1,1,0 +3 +* +*************************************************************************** +* To save memory, one can interrupt the GMRES iteration and make a restart +* Helps to reduce memory requirements, but can lead to worse convergence +* of the linear solver. Typically, a restart after around 30 iterations +* is used. With GMRES_RESTART=100, restart is basically not employed +* +GMRES_RESTART,I ,1,1,0 +100 +* +*************************************************************************** +* Level of fill-in for ILU(p) preconditioning, for the mean flow +* ILU(0) means: The preconditioning matrix has the same non-zero pattern +* as the original matrix +* ILU(p), p>0: Compared to the original matrix +* - new elements are allowed to be added to the preconditioning matrix +* - the preconditioning matrix has a more dense non-zero pattern +* More levels increase memory consumption. Dont go beyond 2 in 3d +* +ILU_LEVELS,I ,1,1,0 +0 +* +*************************************************************************** +* Level of fill-in for ILU(p) preconditioning, for the turbulence equation +* +ILU_LEVELS_TURB,I ,1,1,0 +0 +* +*************************************************************************** +* Iteration interval to update the KSP Jacobian and Preconditioner +* 1 : Update the Jacobian and the Preconditioner at every time step +* : Update the Jacobian and the Preconditioner at every time step +* Steady state: second value used when residuals reduced to JAC_PC_SWITCH +* Unsteady: only the second value used +* +JAC_PC_UPDATE,I ,1,2,0 +1 3 +* +*************************************************************************** +* Residual, when to switch the update interval JAC_PC_UPDATE +* of the Jacobian and Preconditioner Computation +* Used for steady state calculations only +* +JAC_PC_SWITCH,R ,1,1,0 +-4.0 +* +*************************************************************************** +* Additive Schwarz Overlap of domains for parallel ILU preconditioning +* Typical values: 1 or larger (1=PETSc default) +* +ASM_OVERLAP,I ,1,1,0 +1 +* +*************************************************************************** +* KSP_AUTO_DAMPING: Try to automatically dampen the Newton update +* (solution update of the linear Krylov solver) +* Damping is only applied for turbulent flow simulations +* +KSP_AUTO_DAMPING,I ,1,1,0 +0 +* +*************************************************************************** +* Update factor (damping) of the the Newton update for the mean flow +* (solution update of the linear Krylov solver) +* Only applied for turbulent flow simulations and KSP_AUTO_DAMPING=0 +* Range: 0 no damping +* +UPD_FACTOR_M,R ,1,1,0 +0.5 +* +*************************************************************************** +* Corresponding update factor (damping) for the turbulence equations +* (solution update of the linear Krylov solver) +* +UPD_FACTOR_T,R ,1,1,0 +0.5 +* +*************************************************************************** * Number of stages > 0 <=10 * NSTAGE,I ,1,1,0 @@ -523,6 +780,30 @@ IRKCOLI,R ,1,10,0 1.0 1.0 0.8 1.0 1.0 1.0 1.0 1.0 1.0 1.0 * *************************************************************************** +* Steady-state stabilization +* 0 = DEFAULT = No stabilization +* 1 = Stabilisation +* +ITSTAB,I ,1,1,0 +0 +* +*************************************************************************** +* Mean integration coefficient +* = + CSTM*(q-) +* DEFAULT = 0.01 +* +CSTM,R ,1,1,0 +0.01 +* +*************************************************************************** +* Feed-back stabilization coefficient +* dq/dt + (1-C)*R(q) = 0, where C=CSTS if R(q)*(q-)<0 else C=0 +* DEFAULT = 0.01 +* +CSTS,R ,1,1,0 +0.01 +* +*************************************************************************** * * * ---------------- Implicit residual smoothing ---------------- * * * @@ -556,7 +837,7 @@ NSMCYC,I ,1,1,0 * 2 = Explicit time accurate with global time step * ITIMAQ,I ,1,1,0 -0 +0 * *************************************************************************** * 0 = Compute global time step @@ -570,7 +851,7 @@ ISGLTS,I ,1,1,0 * Explicit (ITIMAQ = 2) global time step * DELTAT,R ,1,1,0 -0.005 +0.005 * *************************************************************************** * Convergence criteria, stop when MAX(LOG(RES)) < RESTAQ @@ -614,19 +895,27 @@ GAMN,R ,1,1,0 0.0 * *************************************************************************** -* 0 = Switch off time-averaging for steady computations -* 1 = Set for time-averaging for unsteady calculations (ITIMAQ/=0) -* This parameter can be used in update.ainp to intermediately -* start time-averaging during the running course without -* interruption by setting ITMEAN = 1 -* If INPRES=2 and T-averaging also restarts with a previous -* field, then one should set ITMEAN = 1 +* Extrapolation scheme for startguess for each global timestep +* 0 = *DEFAULT = No extrapolation +* 1 = Linear extrapolation +* 2 = Quadratic extrapolation +* +EXTPOLTA,I ,1,1,0 +0 +* +*************************************************************************** +* 0 = Switch off time-averaging +* 1 = Set for time-averaging for steady or unsteady calculations +* Ouputs primitive variables and mean of velocity squares +* plus pressure square. Intended for LES type calculations +* 2 = Time averaging but only output of primitive variables +* Restart will read in old mean flow file * ITMEAN,I ,1,1,0 0 * *************************************************************************** -* Time step at which time-averaging starts, function only if ITMEAN=1 +* Time step at which time-averaging starts, function only if ITMEAN>0 * NOTE: If INPRES=2 and ITMEAN=1, indicates that time-averaging * restarts from a previous run. In this case, ITERM < ITER. * @@ -634,30 +923,18 @@ ITERM,I ,1,1,0 2000 * *************************************************************************** -* Specification of points where time-series is recorded for unsteady -* computations. Specify a number of points NPTHIS each defined with -* coordinates and their local identities (boundary or interior points) -* Example: (p1,p2,p3,p4,p5) -* The data is specified in T_HIS_INFO +* Sample the mean solution to multiple (_it.bout) files every ITMULOU +* iterations * -NPTHIS,I ,1,1,0 +ITMULOU,I ,1,1,0 0 * -T_HIS_INFO,N ,0,0,2 -* -POINT_COOD,R ,5,3,0 -0.6858 0.0 -0.0254 -0.7874 -0.0254 0.0381 -1.2954 -0.01905 0.04445 -0.8128 -0.1016 -0.0254 -1.0414 0.0 0.0 +*************************************************************************** +* Specification of NPTHIS points where time-series is recorded for +* unsteady computations. Points input data file under CFIPOINTS * -POINT_INDEX,L ,5,2,0 -'point1 ' 'bound_point ' -'point2 ' 'bound_point ' -'point3 ' 'bound_point ' -'point4 ' 'bound_point ' -'point5 ' 'inter_point ' +NPTHIS,I ,1,1,0 +0 * *************************************************************************** * * @@ -668,50 +945,91 @@ POINT_INDEX,L ,5,2,0 * 1 = Rotation * IROT,I ,1,1,0 - 0 +0 * *************************************************************************** * Angular velocity and direction when rotation * The absolute value is the angular velocity * OMGROT,R ,1,3,0 -0.0 0.0 0.0 +0.0 0.0 0.0 * *************************************************************************** * Coordinates for one point on axis off rotation * OMGCOO,R ,1,3,0 -0.0 0.0 0.0 +0.0 0.0 0.0 * *************************************************************************** * * * ---------------- Maneuver option ---------------- * * * +MANEUVERS,N ,0,0,6 +* *************************************************************************** -* 0 = No maneuvers -* 1 = For specification of arbitrary maneuvers +* Maneuver solution options : +* 0 = No maneuver +* 1,2,3 = Prescribed motion through MOVDAT +* 202 = Coupled to external solver (full model) * -IMANEUV,I ,1,1,0 +ISOOPT,I ,1,1,0 0 * *************************************************************************** +* Coordinates for body reference point +* +CMGCOO,R ,1,3,0 +0.0 0.0 0.0 +* +*************************************************************************** * Input data format for the maneuver data given in MOVDAT * 0 = Time, v1, v2, v3, w1, w2, w3 * 1 = Time, v1, v2, v3, w1, w2, w3, W1, W2, W3 * 2 = Time, v1, v2, v3, w1, w2, w3, O11, O12, O13, O21.... O33 * -IMVDTF,I ,1,1,0 -1 -* MOVDAT,R ,2,10,0 0.0 0.0 0.0 0.0 0.0 0.0 125.664 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 125.664 0.0 0.0 125.664 * *************************************************************************** +* Controls where in the inner, ITIN, loop the maneuver functions +* are active : +* 0 = Never +* N>0 = Every N inner iterations (ignored for ISOOPT= 0, 1, 2, 3) +* +NITIN,I ,1,1,0 +1 +* +*************************************************************************** +* File CFIPRM (inp) is the update/comunication file for MANEUVERS +* - required to modify internal parameters and data +* +CFIPRM,L ,1,1,0 +'Edge_mv.ainp ' +* +*************************************************************************** +* Controls IO format for external coupled solution +* 0 = use same file +* 1 = append _in and _out to filename +* +IPRM,I ,1,1,0 +0 +* +*************************************************************************** * * * ---------------- On-line mesh-deformation ---------------- * * * -MSHD_CONSTANTS,N ,0,0,4 +MSHD_CONSTANTS,N ,0,0,11 +* +*************************************************************************** +* Mesh deformation method +* 1 = Laplacian smoothing, diagonal preconditioner +* 2 = Spring analogy, diagonal preconditioner +* 3 = Radial basis functions (RBF) +* 4 = Translation/rotation/scaling (TRS) +* +METHOD,I ,1,1,0 +1 * *************************************************************************** * Convergence tolerance : dimensionless @@ -732,12 +1050,46 @@ MAXIT,I ,1,1,0 1000 * *************************************************************************** -* Initialisation : -* 0 = Reference grid -* 1 = Previous timestep +* Exponent for Laplace edge length denominator * -INICO,I ,1,1,0 -0 +DEXP,R ,1,1,0 +2.0 +* +*************************************************************************** +* Exponent for spring analogy stiffness definition +* +BETA,R ,1,1,0 +1.0 +* +*************************************************************************** +* RBF function: 1(Gaussian), 2(IQ), 3(IMQ), 4(Wennland), 5(3rd poly.) +* +RBF_OPT,I ,1,1,0 +1 +* +*************************************************************************** +* RBF shape factor. Default 0.8 +* +RBF_SF_REL,R ,1,1,0 +0.8 +* +*************************************************************************** +* TRS inboard distance to start deformation decay. Estimated if <0 +* +TRS_DIST_IN,R ,1,1,0 +-1.0 +* +*************************************************************************** +* TRS outboard distance to end deformation decay. Estimated if <0 +* +TRS_DIST_OUT,R ,1,1,0 +-1.0 +* +*************************************************************************** +* TRS damping to damp out scaling/rotation. 0-not damped, 1-all damped +* +TRS_DAMP,R ,1,1,0 +0.0 * *************************************************************************** * * @@ -751,7 +1103,7 @@ INICO,I ,1,1,0 ISDRY,I ,1,1,0 0 * -AEROELASTICS,N ,0,0,13 +AEROELASTICS,N ,0,0,14 * *************************************************************************** * Aeroelastic solution options : @@ -760,19 +1112,20 @@ AEROELASTICS,N ,0,0,13 * 101 = Modal prescribed motion * 102 = Modal coupled : orthogonal modes central difference * 112 = Modal externally coupled +* 202 = Coupled to external solver (full model) * ISOOPT,I ,1,1,0 0 * *************************************************************************** * Mode type options : -* 0 = None, non-modal solutions PLACEHOLDER -* 1 = Grid perturbation -* 2 = Boundary surface -* 3 = Structural nodes PLACEHOLDER +* 0 = None, non-modal solutions PLACEHOLDER +* 1 = Volume grid perturbation +* 2 = Grid boundary surface - on-line mesh deformation +* 3 = Structural nodes PLACEHOLDER * MODOPT,I ,1,1,0 -0 +0 * *************************************************************************** * External force input on/off (coupled solutions only) : @@ -821,6 +1174,14 @@ CFIPRM,L ,1,1,0 'Edge_at.ainp ' * *************************************************************************** +* Controls IO format for external coupled solution +* 0 = use same file +* 1 = append _in and _out to filename +* +IPRM,I ,1,1,0 +0 +* +*************************************************************************** * File CFIMOD (amod) is the structural input file * - required only when the H coupling matrix is stored (in .bedg) * - contains structural data : nodes, label, coordinates and modal shapes @@ -857,13 +1218,13 @@ CFIMOS,L ,1,1,0 * Format: prefix.suffix / imin imax istep * CFIDIS,L ,1,1,0 -'bdis/Edge.bdis / 1001 1006 1 ' +'bdis/Edge.bdis / 1001 1006 1 ' * *************************************************************************** * * * ---------------- Aero-thermal solution options ---------------- * * * -AEROTHERMALS,N ,0,0,13 +AEROTHERMALS,N ,0,0,14 * *************************************************************************** * Thermal coupling option : @@ -901,6 +1262,14 @@ CFIPRM,L ,1,1,0 'Edge_at.ainp ' * *************************************************************************** +* Controls IO format for external coupled solution +* 0 = use same file +* 1 = append _in and _out to filename +* +IPRM,I ,1,1,0 +0 +* +*************************************************************************** * File CFIMOD (amod) is the structural thermal input file * - required only when the H coupling matrix is stored (in .bedg) * - contains structural data : nodes, label, coordinates and modal shapes @@ -974,90 +1343,205 @@ RELAXT,R ,1,1,0 * *************************************************************************** * * -* ------------- Trajectory solution options ---------------- * +* ---------------- Gusts options ---------------- * * * -TRAJECTORY_DATA,N ,0,0,7 +GUSTS,N ,0,0,6 * *************************************************************************** -* Trajectory solution options : -* 0 = No trajectory computations -* 1 = Quasi-steady trajectory computations -* 2 = Unsteady trajectory computations +* Gust option : +* 0 = No gust +* 1 = 1-cos gust * -ITRAJEC,I ,1,1,0 +ISOOPT,I ,1,1,0 0 * *************************************************************************** -* Total number of iterations for trajectory computations -* -ITMXTRA,I ,1,1,0 -1 -* -*************************************************************************** -* If ITRAJEC = 1, time step for trajectory computations +* Vector normal to gust plane +* cross-product of GUST_NORM x FREE_STREAM velocity vector +* determines direction of perturbation velocity * -DELTAT_QS,R ,1,1,0 -0.005 +GUST_NORM,R ,1,3,0 +0.0 1.0 0.0 * *************************************************************************** -* Gravitational acceleration vector in main frame coordinates +* Gust initial coordinate * -GRAV,R ,3,1,0 -0.0 -0.0 -9.80665 +ORIG,R ,1,3,0 +0.0 0.0 0.0 * *************************************************************************** -* Number of substeps for 6DoF computations +* Gust spatial length * -NSUBST,I ,1,1,0 -1 +LENGTH,R ,1,1,0 +1.0 * *************************************************************************** -* Parameter controlling the grid check ( > 1.) +* Gust perturbation velocity along PERT_DIR * -CHKMAX,R ,1,1,0 -10.0 +PERT_VEL,R ,1,1,0 +1.0 * *************************************************************************** -* The trajectory file ( .atra ) +* Initial time delay * -CFITRA,L ,1,1,0 -'Edge.atra ' +T_DELAY,R ,1,1,0 +0.0 * *************************************************************************** * * -* ---------------- Propeller options ---------------- * +* ---------------- MRF options ---------------- * * * +MRFS,N ,0,0,8 +* *************************************************************************** -* File CFIDISK contains the input to the propeller disk model -* The model is used as a boundary condition -* The data file is not in FFA-format, it is copied from Multnas +* MRF option : +* 0 = No moving reference frame +* 1 = Grid velocity from file +* 2 = Sinusoidal grid velocity +* 3 = Sinusoidal angular velocity * -CFIDISK,L ,1,1,0 -'prin.dat ' +IMRFOPT,I ,1,1,0 +0 * *************************************************************************** -* * -* --------------- Preconditioning options --------------- * -* * -*************************************************************************** -* 0 = No preconditioning -* 1 = Preconditioning for low Mach numbers used +* Normal to sinusodial grid veloctiy +* +SIN_NORM,R ,1,3,0 +0.0 1.0 0.0 +* +*************************************************************************** +* Frequency in hertz +* +SIN_FREQ,R ,1,1,0 +1.0 +* +*************************************************************************** +* Velocity amplitude of sinusoidal grid velocity +* +SIN_VEL,R ,1,1,0 +1.0 +* +*************************************************************************** +* Amplitude of sinusoidal motion in degrees +* +SIN_AMP,R ,1,1,0 +1.0 +* +*************************************************************************** +* Coordinates for one point on axis off rotation +* +OMGCOO_MRF,R ,1,3,0 +0.0 1.0 0.0 +* +*************************************************************************** +* Name of farfield BC to updated velocities for rotational motion +* +BNAME,L ,1,1,0 +'outer ' +* +*************************************************************************** +* Axis of rotation : +* 0 = x-axis +* 1 = y-axis +* 2 = z-axis +* +IAXIS,I ,1,1,0 +0 +* +*************************************************************************** +* * +* ------------- Trajectory solution options ---------------- * +* * +TRAJECTORY_DATA,N ,0,0,8 +* +*************************************************************************** +* Trajectory solution options : +* 0 = No trajectory computations +* 1 = Quasi-steady trajectory computations +* 2 = Unsteady trajectory computations +* +ITRAJEC,I ,1,1,0 +0 +* +*************************************************************************** +* Total number of iterations for trajectory computations +* +ITMXTRA,I ,1,1,0 +1 +* +*************************************************************************** +* If ITRAJEC = 1, time step for trajectory computations +* +DELTAT_QS,R ,1,1,0 +0.0 +* +*************************************************************************** +* Gravitational acceleration vector in main frame coordinates +* +GRAV,R ,3,1,0 +0.0 +0.0 +9.80665 +* +*************************************************************************** +* Number of substeps for 6DoF computations +* +NSUBST,I ,1,1,0 +1 +* +*************************************************************************** +* Increment for mesh modifications in the inner loop +* +NITIN,I ,1,1,0 +1 +* +*************************************************************************** +* Parameter controlling the grid check ( > 1.) +* +CHKMAX,R ,1,1,0 +10.0 +* +*************************************************************************** +* The trajectory file ( .atra ) +* +CFITRA,L ,1,1,0 +'Edge.atra ' +* +*************************************************************************** +* * +* ---------------- Propeller options ---------------- * +* * +*************************************************************************** +* File CFIDISK contains the input to the propeller disk model +* The model is used as a boundary condition +* The data file is not in FFA-format, it is copied from Multnas +* +CFIDISK,L ,1,1,0 +'prin.dat ' +* +*************************************************************************** +* * +* ----------- Low speed preconditioning options ----------- * +* * +*************************************************************************** +* 0 = No preconditioning +* 1 = Preconditioning for low Mach numbers used, Turkel/Choi&Merkle +* 2 = Preconditioning with art. diss. based on conservative variables +* Values fixed: RM0=1, RKBET1=1, RKBET2=1, ALPHAP=0, DELTA=0 * IPREPA,I ,1,1,0 -0 +0 * *************************************************************************** * RKBET2 preconditioning parameter, -* RKBET1 = 1, ALPHAP = 0 as default in Euranus +* RKBET1=1, ALPHAP=0, DELTA=1 as default in Euranus * RKBET2,R ,1,1,0 4.0 * *************************************************************************** * RM0 preconditioning parameter, -* RKBET1=1, ALPHAP=0 as default in Euranus +* RKBET1=1, ALPHAP=0, DELTA=1 as default in Euranus * RM0,R ,1,1,0 1.0 @@ -1077,13 +1561,13 @@ IPREVIS,I ,1,1,0 * Number of iterations and type of time step * ITMAX,I ,1,1,0 -1000 +__ITMAX__ * *************************************************************************** * Convergence criteria (orders of magnitude of reduction) * RESRED,R ,1,1,0 --6.0 +-7.0 * *************************************************************************** * Convergence criteria full multigrid (orders of magnitude @@ -1094,9 +1578,46 @@ RESFMG,R ,1,1,0 * *************************************************************************** * Inviscid CFL number +* <= 1.5 for explicit iterations (STSTCONV=1) +* Large for LU-SGS iterations (STSTCONV=2) +* Not used for implicit Krylov method (STSCONV=3) * CFL,R ,1,1,0 -__CFL__ +1.25 +* +*************************************************************************** +* Initial CFL number for implicit GMRES calculations (STSCONV=3) +* Applied at first iteration, then increased with factor CFL_FACTOR_KSP +* +CFL_MIN_KSP,R ,1,1,0 +1.5 +* +*************************************************************************** +* Factor to increase CFL for implicit Krylov calculations (STSCONV=3) +* +CFL_FACTOR_KSP,R ,1,1,0 +1.2 +* +*************************************************************************** +* Maximum CFL number for implicit Krylov calculations (STSCONV=3) +* First value applied for residuals >= CFL_MAX_SWITCH +* Second value applied for residuals < CFL_MAX_SWITCH +* +CFL_MAX_KSP,R ,1,2,0 +10000.0 10000.0 +* +*************************************************************************** +* Residual, when to switch the maximum allowed CFL number (STSCONV=3) +* +CFL_MAX_SWITCH,R ,1,1,0 +-4.0 +* +*************************************************************************** +* Maximum CFL number in largest cell for implicit calculations (STSCONV=3) +* Reduction -> 1 often required for supersonic calculations +* +CFL_MAX_MAXVOL,R ,1,1,0 +10000.0 * *************************************************************************** * Viscous CFL number : If > 0 --> Time step is minimum of inviscid @@ -1122,7 +1643,7 @@ CFLLI,R ,1,1,0 * Too high values will degrade rate of convergence * EPS2LI,R ,1,1,0 -0.2 +0.3 * *************************************************************************** * * @@ -1131,18 +1652,26 @@ EPS2LI,R ,1,1,0 *************************************************************************** * Post processing options. Additional fields written to * a separate solution file name in CFIPOST -* 0 = No post processing, default -* 1 = Cf, q, yplus for viscous calc. (INPRES=1) -* 2 = Mach number, Cp, energy, temperature and local time step -* 4 = Distance to the wall and laminar/turbulent field -* 8 = Residuals to all unknowns -* 16 = Reynolds stresses -* 32 = Gradients of the dependent variables -* 64 = Flow curvature vector +* 0 = No post processing, default +* 1 = Cf, q, yplus for viscous calc. (INPRES=1) +* 2 = Mach, Cp, energy, temperature, total states and local time step +* 4 = Distance to the wall and laminar/turbulent field +* 8 = Residuals to all unknowns +* 16 = Reynolds stresses +* 32 = Gradients of the dependent variables +* 64 = Flow curvature vector +* 128 = Q criterion and abs(rograd) * For several options sum up (1+4=5 for cf and wall distance etc.) * IPOST,I ,1,1,0 -15 +1 +* +*************************************************************************** +* Sample post solution files (IPOST>0) to multiple (_it.bout) +* files every IPMULOU iterations. +* +IPMULOU,I ,1,1,0 +0 * *************************************************************************** * EPS is used to avoid division by zero @@ -1155,7 +1684,7 @@ EPS,R ,1,1,0 * iterations. These files are used for restarts. See also INPRES. * IWRSOL,I ,1,1,0 -500 +100 * *************************************************************************** * Output solution to file, runtime parameter @@ -1177,6 +1706,13 @@ ISTOUT,I ,1,1,0 1 * *************************************************************************** +* Check the existence of new data in file update.ainp +* each BEDITFREQ iteration +* +BEDITFREQ,I ,1,1,0 +1 +* +*************************************************************************** * Number of the residual on standard output every ISTOUT iteration * 1 = *DEFAULT (density) * @@ -1185,8 +1721,8 @@ NRRES,I ,1,1,0 * *************************************************************************** * Region data file supplied (CFIREG) with regional data -* 0 = No data file supplied -* 1 = Data file supplied +* 0 = No data file supplied +* 1 = Data file supplied * IREGIONDATA,I ,1,1,0 0 @@ -1196,66 +1732,66 @@ IREGIONDATA,I ,1,1,0 * Direction for force 1 * IDCLP,R ,1,3,0 -__IDCLP__ +__IDCLP__ * *************************************************************************** * Direction for drag force * Direction for force 2 * IDCDP,R ,1,3,0 -__IDCDP__ +__IDCDP__ * *************************************************************************** * Direction for side force * Direction for force 3 * IDCCP,R ,1,3,0 -__IDCCP__ +__IDCCP__ * *************************************************************************** * Direction for pitch moment * Direction for moment 1 * IDCMP,R ,1,3,0 -__IDCMP__ +__IDCMP__ * *************************************************************************** * Direction for yaw moment * Direction for moment 2 * IDCNP,R ,1,3,0 -__IDCNP__ +__IDCNP__ * *************************************************************************** * Direction for roll moment * Direction for moment 3 * IDCRP,R ,1,3,0 -__IDCRP__ +__IDCRP__ * *************************************************************************** * Point for moment * IXMP,R ,1,3,0 -__IXMP__ +__IXMP__ * *************************************************************************** * Reference area to non-dimensionalize forces and moments * SREF,R ,1,1,0 -__SREF__ +__SREF__ * *************************************************************************** * Reference chord for non-dimensionalizing moment * CREF,R ,1,1,0 -__CREF__ +__CREF__ * *************************************************************************** * Reference width for non-dimensionalizing moment * BREF,R ,1,1,0 -__BREF__ +__BREF__ * *************************************************************************** * * @@ -1290,19 +1826,19 @@ VGKCONSTSCALE,R ,1,1,0 * The mesh file ( .bmsh ) * CFIMSH,L ,1,1,0 -'Edge.bmsh' +'../grid/Edge.bmsh ' * *************************************************************************** * Edge file name from the preprocessor ( .bedg ) * CFIEDG,L ,1,1,0 -'Edge.bedg' +'../grid/Edge.bedg ' * *************************************************************************** * The boundary condition file ( .aboc ) * CFIBOC,L ,1,1,0 -'Edge.aboc' +'../grid/Edge.aboc ' * *************************************************************************** * The residual file ( .bres ) @@ -1336,7 +1872,7 @@ CFIPOST,L ,1,1,0 'Post.bout ' * *************************************************************************** -* History recording file (PROBE_RECORD > 0 or AIP_RECORD=1) +* History recording file (IACHIS=1, IPROBEHIS=1, IAIPHIS=1 or ISAMMSH>=1) * CFIHIS,L ,1,1,0 'history.bhis ' @@ -1348,6 +1884,42 @@ CFIREG,L ,1,1,0 'Edge.areg ' * *************************************************************************** +* Boundary sampling input file (ISAMP = 1) +* +CFIBSI,L ,1,1,0 +'Edge_bsm.asmp ' +* +*************************************************************************** +* Aerodynamic coeff history input file (IACHIS = 1) +* +CFIACI,L ,1,1,0 +'Edge_ach.asmp ' +* +*************************************************************************** +* Probe coeff history input file (IPROBEHIS = 1) +* +CFIPRB,L ,1,1,0 +'Edge_probe.asmp ' +* +*************************************************************************** +* Inlet coeff history input file (IAIPHIS = 1) +* +CFIAIP,L ,1,1,0 +'Edge_aip.asmp ' +* +*************************************************************************** +* Points history input file (NPTHIS >= 1) +* +CFIPOINTS,L ,1,1,0 +'Edge_points.asmp ' +* +*************************************************************************** +* Embedded mesh file for sampling (ISAMMSH >= 1) +* +CFISAMMSH,L ,1,1,0 +'Edge_mshsamp.bmsh ' +* +*************************************************************************** * * * ---------------- Turbulence models ---------------- * * * @@ -1358,46 +1930,61 @@ CFIREG,L ,1,1,0 * 4 = LES models * ITURB,I ,1,1,0 -2 +2 * *************************************************************************** -* Choice of turbulence model : +* Choice of turbulence model : (*=DEFAULT , !=recommended) * --------------------------------------- -* Default RANS model: -* W&J EARSM + Hellsten k-omega -* Other recommended RANS models: +* One-equation models: * Spalart-Allmaras one-eq model -* Menter SST k-omega -* Menter SST k-omega + Transition -* W&J DRSM + Hellsten k-omega -* Other RANS models: +* Spalart-Allmaras Edwards +* Rung SALSA (!) +* Two-equation models: +* W&J EARSM + Hellsten k-omega (*) * std Wilcox k-omega -* Kok_TNT k-omega * Menter BSL k-omega +* Menter SST k-omega (!) +* Menter SST k-omega + Transition +* Kok_TNT k-omega * Wilcox LRN k-omega * PDH LRN k-omega -* W&J EARSM + std k-omega +* Rung LLR k-omega +* Rung RQEVM + std k-omega +* Algebraic Reynolds-Stress models: * GWJ Generalized EARSM + std k-omega +* W&J EARSM + std k-omega * W&J EARSM + Kok_TNT k-omega * W&J EARSM + Menter BSL k-omega 2009 * W&J CC-EARSM + std k-omega * W&J CC-EARSM + Menter BSL k-omega * W&J CC-EARSM + Hellsten k-omega -* W&J DRSM + std k-omega +* Reynolds-Stress Transport models: * SSG DRSM + std k-omega * SSG DRSM + Hellsten k-omega +* W&J DRSM + std k-omega +* W&J DRSM + Hellsten k-omega +* W&J DAMPED DRSM + Hellsten k-omega * --------------------------------------- * DES and hybrid RANS-LES models : * Spalart-Allmaras DES model +* Spalart-Allmaras DDES (!) +* Spalart-Allmaras IDDES +* Rung SALSA-DES +* Rung SALSA-DDES (!) +* Rung SALSA-IDDES +* Menter SST-DES k-omega +* Menter SST-DDES k-omega (!) +* Menter SST-IDDES k-omega * Peng hybrid HYB0 model * --------------------------------------- * LES models : * Smagorinsky SGS model +* Smagorinsky SGS with wall damping * Spalart-Allmaras SGS model * Yoshizawa k-eq SGS model * TURB_MOD_NAME,L ,1,1,0 -'W&J EARSM + Hellsten k-omega' +'Spalart-Allmaras one-eq model ' * *************************************************************************** * 2-eq. turb. discretization type : @@ -1405,21 +1992,21 @@ TURB_MOD_NAME,L ,1,1,0 * 1 = Upwind * IUPWKZ,I ,1,1,0 -1 +0 * *************************************************************************** * 2nd order dissipation coefficient -* For K-E turbulence model (central schemes only) +* For turbulence models using central scheme only * VIS2KZ,R ,1,1,0 -0.5 +1.0 * *************************************************************************** * 4th order dissipation coefficient -* For K-E turbulence model (central schemes only) +* For turbulence models using central scheme only * VIS4KZ,R ,1,1,0 -0.02 +0.05 * *************************************************************************** * Entropy fix for upwind 2-eq. turbulence : @@ -1432,7 +2019,7 @@ VIS4KZ,R ,1,1,0 * numbers to decrease the numerical dissipation. * TURFIX,R ,1,1,0 --1.1 +-1.1 * *************************************************************************** * Order of turbulent upwind scheme : @@ -1446,14 +2033,14 @@ IORDKZ,I ,1,1,0 * * * --------------- Turbulence model definitions --------------- * * * -TURB_MOD_LIST,N ,0,0,26 +TURB_MOD_LIST,N ,0,0,39 * *************************************************************************** * * -* --------------- Peng hybrid HYB0 model ---------- * +* --------------- Spalart-Allmaras one-eq model ---------- * * * -TURB_MOD,L ,1,1,12 -'Peng hybrid HYB0 model ' +TURB_MOD,L ,1,1,20 +'Spalart-Allmaras one-eq model ' * *************************************************************************** * * @@ -1467,51 +2054,67 @@ WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 -0 +1 * NAME_UNK,S ,1,1,0 -'zero_equation ' +'turb_work_vt ' * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -3 -* -NAME_EX,S ,1,3,0 -'turb_viscosity ' 'turb_kin_energy ' 'rans_viscosity ' +NAME_EX,S ,1,1,0 +'turb_viscosity ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * -CSGS,R ,1,1,0 -0.12 +SACB1,R ,1,1,0 +0.1355 * -CKSGS,R ,1,1,0 -0.0 +SACB2,R ,1,1,0 +0.622 * -SIGMA,R ,1,1,0 +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACT1,R ,1,1,0 1.0 * +SACT2,R ,1,1,0 +2.0 +* +SACT3,R ,1,1,0 +1.1 +* +SACT4,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* PRT,R ,1,1,0 -0.4 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 * *************************************************************************** * * @@ -1519,39 +2122,41 @@ PRT,R ,1,1,0 * * *************************************************************************** * * -* ----- Extra fields (turbulent viscosity) ----- * +* ----- Viscous terms ----- * * * -EXTRVA,S ,1,1,0 -'FXHYB0P ' +FVISF,S ,1,1,0 +'GVISSA ' * *************************************************************************** * * -* --------------- Spalart-Allmaras DES model ---------- * +* ----- Source terms ----- * * * -TURB_MOD,L ,1,1,20 -'Spalart-Allmaras DES model ' +GSOUKZ,S ,1,1,0 +'HSSAM ' * *************************************************************************** * * -* ----- Turbulence model program logics ----- * +* ----- Extra fields (turbulent viscosity) ----- * * * +EXTRVA,S ,1,1,0 +'FXSAM ' +* *************************************************************************** * * -* ----- If wall distance required ----- * +* --------------- Spalart-Allmaras Edwards ---------- * * * -WALL_DIST,N ,0,0,0 +TURB_MOD,L ,1,1,18 +'Spalart-Allmaras Edwards ' * *************************************************************************** * * -* ----- If MUT exists ----- * +* ----- Turbulence model program logics ----- * * * -MUT_AVAIL,N ,0,0,0 -* *************************************************************************** * * -* ----- turb_kin_energy exists ----- * +* ----- If wall distance required ----- * * * -K_AVAIL,N ,0,0,0 +WALL_DIST,N ,0,0,0 * *************************************************************************** * * @@ -1565,21 +2170,15 @@ NAME_UNK,S ,1,1,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* -NAME_EX,S ,1,2,0 -'turb_viscosity ' 'turb_kin_energy ' +NAME_EX,S ,1,1,0 +'turb_viscosity ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * -CDES,R ,1,1,0 -0.65 -* SACB1,R ,1,1,0 0.1355 * @@ -1595,6 +2194,12 @@ SACW2,R ,1,1,0 SACW3,R ,1,1,0 2.0 * +SACT1,R ,1,1,0 +1.0 +* +SACT2,R ,1,1,0 +2.0 +* SACV1,R ,1,1,0 7.1 * @@ -1626,88 +2231,22 @@ FVISF,S ,1,1,0 * * * ----- Source terms ----- * * * -GSOULDES,S ,1,1,0 -'HSDESSA ' +GSOUKZ,S ,1,1,0 +'HSSAE ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXDESSA ' -* -*************************************************************************** -* * -* --------------- Smagorinsky model ---------- * -* * -TURB_MOD,L ,1,1,11 -'Smagorinsky SGS model ' -* -*************************************************************************** -* * -* ----- Turbulence model program logics ----- * -* * -*************************************************************************** -* * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Number and names of turb eqs ----- * -* * -NTEQ,I ,1,1,0 -0 -* -NAME_UNK,S ,1,1,0 -'zero_equation ' -* -*************************************************************************** -* * -* ----- Number and names of additional turb fields ----- * -* * -NTEX,I ,1,1,0 -2 -* -NAME_EX,S ,1,2,0 -'turb_viscosity ' 'turb_kin_energy ' -* -*************************************************************************** -* * -* ----- Turbulence model constants ----- * -* * -CSMAG,R ,1,1,0 -0.2 -* -CKSMG,R ,1,1,0 -0.0 -* -SIGMA,R ,1,1,0 -1.0 -* -PRT,R ,1,1,0 -0.4 -* -*************************************************************************** -* * -* ----- Extra fields (turbulent viscosity and kin. energy) ----- * -* * -EXTRVA,S ,1,1,0 -'FXSGSSMG ' +'FXSAM ' * *************************************************************************** * * -* --------------- Spalart-Allmaras SGS model ---------- * +* --------------- Rung SALSA ---------- * * * -TURB_MOD,L ,1,1,20 -'Spalart-Allmaras SGS model ' +TURB_MOD,L ,1,1,16 +'Rung SALSA ' * *************************************************************************** * * @@ -1715,24 +2254,12 @@ TURB_MOD,L ,1,1,20 * * *************************************************************************** * * -* ----- If wall distance required ----- * +* ----- If wall distance required ----- * * * WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 @@ -1743,21 +2270,15 @@ NAME_UNK,S ,1,1,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* -NAME_EX,S ,1,2,0 -'turb_viscosity ' 'turb_kin_energy ' +NAME_EX,S ,1,1,0 +'turb_viscosity ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * -CDES,R ,1,1,0 -0.65 -* SACB1,R ,1,1,0 0.1355 * @@ -1804,22 +2325,22 @@ FVISF,S ,1,1,0 * * * ----- Source terms ----- * * * -GSOULDES,S ,1,1,0 -'HSLESSA ' +GSOUKZ,S ,1,1,0 +'HSSALSA ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXSGSSA ' +'FXSAM ' * *************************************************************************** * * -* --------------- Yoshizawa SGS model ---------- * +* --------------- std Wilcox k-omega --------------- * * * -TURB_MOD,L ,1,1,14 -'Yoshizawa k-eq SGS model ' +TURB_MOD,L ,1,1,12 +'std Wilcox k-omega ' * *************************************************************************** * * @@ -1827,33 +2348,18 @@ TURB_MOD,L ,1,1,14 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 -1 +2 * -NAME_UNK,S ,1,1,0 -'turb_kin_energy ' +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -1861,17 +2367,23 @@ NAME_EX,S ,1,1,0 * * * ----- Turbulence model constants ----- * * * -CKMU,R ,1,1,0 -0.07 +ALPHA,R ,1,1,0 +0.556 * -CEPS,R ,1,1,0 -1.05 +BETA,R ,1,1,0 +0.075 * -SIGMA,R ,1,1,0 -1.0 +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.5 0.5 +* +WALL,R ,1,1,0 +10.0 * PRT,R ,1,1,0 -0.4 +0.9 * *************************************************************************** * Coefficient to multiply the limit of the turbulent production @@ -1886,31 +2398,24 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * -* ----- Viscous terms ----- * -* * -FVISF,S ,1,1,0 -'GVISLESYO ' -* -*************************************************************************** -* * * ----- Source terms ----- * * * -GSOULDES,S ,1,1,0 -'HSLESYO ' +GSOUKZ,S ,1,1,0 +'HSSTKW ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXSGSYO ' +'FXSTKW ' * *************************************************************************** * * -* --------------- Spalart-Allmaras one-eq. model ---------- * +* --------------- Wilcox LRN k-omega --------------- * * * -TURB_MOD,L ,1,1,23 -'Spalart-Allmaras one-eq model ' +TURB_MOD,L ,1,1,12 +'Wilcox LRN k-omega ' * *************************************************************************** * * @@ -1918,79 +2423,40 @@ TURB_MOD,L ,1,1,23 * * *************************************************************************** * * -* ----- If wall distance required ----- * -* * -WALL_DIST,N ,0,0,0 -* -*************************************************************************** -* * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 -1 +2 * -NAME_UNK,S ,1,1,0 -'turb_work_vt ' +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* -NAME_EX,S ,1,2,0 -'turb_viscosity ' 'turb_kin_energy ' +NAME_EX,S ,1,1,0 +'turb_viscosity ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * -SACB1,R ,1,1,0 -0.1355 -* -SACB2,R ,1,1,0 -0.622 +ALPHA,R ,1,1,0 +0.56 * -SACW1,R ,1,1,0 -3.24 +BETA,R ,1,1,0 +0.075 * -SACW2,R ,1,1,0 -0.3 +BETAS,R ,1,1,0 +0.09 * -SACW3,R ,1,1,0 -2.0 +SIGMA,R ,1,2,0 +0.5 0.5 * -SACT1,R ,1,1,0 +WALL,R ,1,1,0 1.0 * -SACT2,R ,1,1,0 -2.0 -* -SACT3,R ,1,1,0 -1.1 -* -SACT4,R ,1,1,0 -2.0 -* -SACV1,R ,1,1,0 -7.1 -* -SIGMA,R ,1,1,0 -1.5 -* PRT,R ,1,1,0 0.9 * @@ -2007,31 +2473,24 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * -* ----- Viscous terms ----- * -* * -FVISF,S ,1,1,0 -'GVISSA ' -* -*************************************************************************** -* * * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSSAM ' +'HSLRKWW ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXSAM ' +'FXLRKWW ' * *************************************************************************** * * -* --------------- std Wilcox k-omega --------------- * +* --------------- Rung LLR k-omega --------------- * * * -TURB_MOD,L ,1,1,15 -'std Wilcox k-omega ' +TURB_MOD,L ,1,1,11 +'Rung LLR k-omega ' * *************************************************************************** * * @@ -2039,19 +2498,7 @@ TURB_MOD,L ,1,1,15 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Number and names of turb eqs ----- * +* ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 2 @@ -2061,11 +2508,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2073,14 +2517,11 @@ NAME_EX,S ,1,1,0 * * * ----- Turbulence model constants ----- * * * -ALPHA,R ,1,1,0 -0.556 -* BETA,R ,1,1,0 -0.075 +1.83 * BETAS,R ,1,1,0 -0.09 +0.27777 * SIGMA,R ,1,2,0 0.5 0.5 @@ -2089,7 +2530,7 @@ WALL,R ,1,1,0 10.0 * PRT,R ,1,1,0 -0.9 +1.0 * *************************************************************************** * Coefficient to multiply the limit of the turbulent production @@ -2107,21 +2548,21 @@ PROLIM,R ,1,1,0 * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSSTKW ' +'HSSTLLR ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXSTKW ' +'FXLLR ' * *************************************************************************** * * -* --------------- Wilcox LRN k-omega --------------- * +* --------------- Rung RQEVM + std k-omega --------------- * * * -TURB_MOD,L ,1,1,15 -'Wilcox LRN k-omega ' +TURB_MOD,L ,1,1,12 +'Rung RQEVM + std k-omega ' * *************************************************************************** * * @@ -2129,18 +2570,6 @@ TURB_MOD,L ,1,1,15 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 @@ -2151,11 +2580,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2164,7 +2590,7 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.56 +0.556 * BETA,R ,1,1,0 0.075 @@ -2176,10 +2602,10 @@ SIGMA,R ,1,2,0 0.5 0.5 * WALL,R ,1,1,0 -1.0 +10.0 * PRT,R ,1,1,0 -0.9 +1.0 * *************************************************************************** * Coefficient to multiply the limit of the turbulent production @@ -2197,21 +2623,21 @@ PROLIM,R ,1,1,0 * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSLRKWW ' +'HSSTRQEVM ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXLRKWW ' +'FXRQEVM ' * *************************************************************************** * * -* --------------- Rung LLR k-omega --------------- * +* --------------- PDH LRN k-omega --------------- * * * -TURB_MOD,L ,1,1,15 -'Rung LLR k-omega ' +TURB_MOD,L ,1,1,13 +'PDH LRN k-omega ' * *************************************************************************** * * @@ -2219,18 +2645,6 @@ TURB_MOD,L ,1,1,15 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 @@ -2241,11 +2655,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2254,22 +2665,25 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.43 +0.42 * BETA,R ,1,1,0 -0.83 +0.075 * BETAS,R ,1,1,0 -0.27667 +0.09 * SIGMA,R ,1,2,0 -0.5 0.5 +1.25 0.7407 +* +SIGMAD_CROSS,R ,1,1,0 +0.75 * WALL,R ,1,1,0 -10.0 +1.0 * PRT,R ,1,1,0 -1.0 +0.9 * *************************************************************************** * Coefficient to multiply the limit of the turbulent production @@ -2287,21 +2701,21 @@ PROLIM,R ,1,1,0 * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSSTLLR ' +'HSLRKWP ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXLLR ' +'FXLRKWP ' * *************************************************************************** * * -* --------------- PDH LRN k-omega --------------- * +* --------------- Kok_TNT k-omega --------------- * * * -TURB_MOD,L ,1,1,16 -'PDH LRN k-omega ' +TURB_MOD,L ,1,1,13 +'Kok_TNT k-omega ' * *************************************************************************** * * @@ -2309,18 +2723,6 @@ TURB_MOD,L ,1,1,16 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 @@ -2331,11 +2733,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2344,7 +2743,7 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.42 +0.553 * BETA,R ,1,1,0 0.075 @@ -2353,13 +2752,13 @@ BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 -1.25 0.7407 +0.66666 0.5 * SIGMAD_CROSS,R ,1,1,0 -0.75 +0.5 * WALL,R ,1,1,0 -1.0 +10.0 * PRT,R ,1,1,0 0.9 @@ -2380,21 +2779,21 @@ PROLIM,R ,1,1,0 * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSLRKWP ' +'HSSTCD ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXLRKWP ' +'FXSTKW ' * *************************************************************************** * * -* --------------- Kok_TNT k-omega --------------- * +* --------------- Menter BSL k-omega --------------- * * * -TURB_MOD,L ,1,1,16 -'Kok_TNT k-omega ' +TURB_MOD,L ,1,1,17 +'Menter BSL k-omega ' * *************************************************************************** * * @@ -2402,15 +2801,9 @@ TURB_MOD,L ,1,1,16 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * +* ----- If wall distance required ----- * * * -K_AVAIL,N ,0,0,0 +WALL_DIST,N ,0,0,0 * *************************************************************************** * * @@ -2424,11 +2817,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2437,19 +2827,25 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.553 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 * BETA,R ,1,1,0 0.075 * +BETA2,R ,1,1,0 +0.0828 +* BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 -0.66666 0.5 +0.5 0.5 * -SIGMAD_CROSS,R ,1,1,0 -0.5 +SIGMA2,R ,1,2,0 +1.0 0.856 * WALL,R ,1,1,0 10.0 @@ -2470,10 +2866,17 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZBSL ' +* +*************************************************************************** +* * * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSSTCD ' +'HSKWBSL ' * *************************************************************************** * * @@ -2484,10 +2887,10 @@ EXTRVA,S ,1,1,0 * *************************************************************************** * * -* --------------- W&J EARSM + std k-omega --------------- * +* --------------- Menter SST k-omega --------------- * * * TURB_MOD,L ,1,1,18 -'W&J EARSM + std k-omega ' +'Menter SST k-omega ' * *************************************************************************** * * @@ -2495,21 +2898,9 @@ TURB_MOD,L ,1,1,18 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- If Turb_extra_anis exists ----- * +* ----- If wall distance required ----- * * * -AEX_AVAIL,I ,1,0,0 +WALL_DIST,N ,0,0,0 * *************************************************************************** * * @@ -2523,11 +2914,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2536,16 +2924,28 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.556 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 * BETA,R ,1,1,0 0.075 * +BETA2,R ,1,1,0 +0.0828 +* BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 -0.5 0.5 +0.85 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 * WALL,R ,1,1,0 10.0 @@ -2553,21 +2953,12 @@ WALL,R ,1,1,0 PRT,R ,1,1,0 0.9 * -C1,R ,1,1,0 -1.8 -* -*************************************************************************** -* Diffusion correction of EARSM model -* -CD,R ,1,1,0 -0.0 -* *************************************************************************** * Coefficient to multiply the limit of the turbulent production * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) * PROLIM,R ,1,1,0 -1.0E20 +1.0 * *************************************************************************** * * @@ -2575,24 +2966,31 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZBSL ' +* +*************************************************************************** +* * * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSSTKW ' +'HSKWSST ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXWJAR ' +'FXSST ' * *************************************************************************** * * -* ------------ GWJ Generalized EARSM + std k-omega ------------ * +* --------------- MENTER SST k-omega + Transition --------------- * * * -TURB_MOD,L ,1,1,19 -'GWJ Generalized EARSM + std k-omega ' +TURB_MOD,L ,1,1,40 +'Menter SST k-omega + Transition ' * *************************************************************************** * * @@ -2600,57 +2998,77 @@ TURB_MOD,L ,1,1,19 * * *************************************************************************** * * -* ----- If MUT exists ----- * +* ----- Transition model options ----- * * * -MUT_AVAIL,N ,0,0,0 +*************************************************************************** +* Governing correlation functions: +* 1 = *DEFAULT = Tomac-Pettersson +* +ICORRF,I ,1,1,0 +1 * *************************************************************************** * * -* ----- Turb_kin_energy exists ----- * +* ----- If wall distance required ----- * * * -K_AVAIL,N ,0,0,0 +WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If Turb_extra_anis exists ----- * +* ----- If MUT exists ----- * * * -AEX_AVAIL,I ,1,0,0 +MUT_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Turb_kin_energy exists ----- * +* * +K_AVAIL,N ,0,0,0 * *************************************************************************** * * * ----- Number and names of turb eqs ----- * * * NTEQ,I ,1,1,0 -2 +4 * -NAME_UNK,S ,1,2,0 -'turb_kin_energy ' 'turb_omega ' +NAME_UNK,S ,1,4,0 +'turb_kin_energy ' 'turb_omega ' 'intermittency ' 're_theta_t ' * *************************************************************************** * * * ----- Number and names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* -NAME_EX,S ,1,1,0 -'turb_viscosity ' +NAME_EX,S ,1,4,0 +'turb_viscosity ' 'laminar_turbulen' 'flt ' 'retc ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.556 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 * BETA,R ,1,1,0 0.075 * +BETA2,R ,1,1,0 +0.0828 +* BETAS,R ,1,1,0 0.09 * -SIGMA,R ,1,2,0 -0.5 0.5 +SIGMA,R ,1,4,0 +0.85 0.5 1.0 2.0 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 * WALL,R ,1,1,0 10.0 @@ -2658,24 +3076,73 @@ WALL,R ,1,1,0 PRT,R ,1,1,0 0.9 * -C1,R ,1,1,0 -1.8 +*************************************************************************** +* * +* ----- Transition model constants ----- * +* * +CA1,R ,1,1,0 +2.0 * -C,R ,1,1,0 -0.56 +CA2,R ,1,1,0 +0.06 * -*************************************************************************** -* Diffusion correction of EARSM model +CE1,R ,1,1,0 +1.0 * -CD,R ,1,1,0 +CE2,R ,1,1,0 +50.0 +* +CALPHA,R ,1,1,0 +0.5 +* +CTT,R ,1,1,0 +0.03 +* +S1,R ,1,1,0 +2.0 +* +FLTC1,R ,1,1,0 +0.3 +* +FLTC2,R ,1,1,0 +60.0 +* +FLTC3,R ,1,1,0 +53000.0 +* +FLTC4,R ,1,1,0 0.0 * +RETCC1,R ,1,1,0 +0.9 +* +RETCC2,R ,1,1,0 +0.1 +* +RETCC3,R ,1,1,0 +490.0 +* +RETCC4,R ,1,1,0 +390.0 +* +RETCC5,R ,1,1,0 +150.0 +* +LTLIM,R ,1,2,0 +-0.1 0.1 +* +TULIM,R ,1,1,0 +0.027 +* +RETTLIM,R ,1,2,0 +20.0 1450.0 +* *************************************************************************** * Coefficient to multiply the limit of the turbulent production * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) * PROLIM,R ,1,1,0 -1.0E20 +1.0 * *************************************************************************** * * @@ -2683,41 +3150,36 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * -* ----- Source terms ----- * +* ----- Viscous terms ----- * * * -GSOUKZ,S ,1,1,0 -'HSSTKW ' +FVISF,S ,1,1,0 +'GVISKBSLT ' * *************************************************************************** * * -* ----- Extra fields (turbulent viscosity) ----- * +* ----- Source terms ----- * * * -EXTRVA,S ,1,1,0 -'FXGWJA ' +GSOUKZ,S ,1,2,0 +'HSKWSST ' 'HSINTRETT ' * *************************************************************************** * * -* --------------- W&J EARSM + Kok_TNT k-omega --------------- * +* ----- Extra fields (turbulent viscosity) ----- * * * -TURB_MOD,L ,1,1,19 -'W&J EARSM + Kok_TNT k-omega ' +EXTRVA,S ,1,2,0 +'FXSST ' 'FXINTRETT ' * *************************************************************************** * * -* ----- Turbulence model program logics ----- * -* * -*************************************************************************** -* * -* ----- If MUT exists ----- * +* --------------- GWJ Generalized EARSM + std k-omega --------------- * * * -MUT_AVAIL,N ,0,0,0 +TURB_MOD,L ,1,1,16 +'GWJ Generalized EARSM + std k-omega ' * *************************************************************************** * * -* ----- Turb_kin_energy exists ----- * +* ----- Turbulence model program logics ----- * * * -K_AVAIL,N ,0,0,0 -* *************************************************************************** * * * ----- If Turb_extra_anis exists ----- * @@ -2736,11 +3198,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2749,7 +3208,7 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.525 +0.556 * BETA,R ,1,1,0 0.075 @@ -2758,10 +3217,7 @@ BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 -0.66666 0.55 -* -SIGMAD_CROSS,R ,1,1,0 -0.3 +0.5 0.5 * WALL,R ,1,1,0 10.0 @@ -2772,6 +3228,9 @@ PRT,R ,1,1,0 C1,R ,1,1,0 1.8 * +C,R ,1,1,0 +0.56 +* *************************************************************************** * Diffusion correction of EARSM model * @@ -2794,21 +3253,21 @@ PROLIM,R ,1,1,0 * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSSTCD ' +'HSSTKW ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXWJAR ' +'FXGWJA ' * *************************************************************************** * * -* --------------- MENTER BSL k-omega --------------- * +* --------------- W&J EARSM + std k-omega --------------- * * * -TURB_MOD,L ,1,1,20 -'Menter BSL k-omega ' +TURB_MOD,L ,1,1,15 +'W&J EARSM + std k-omega ' * *************************************************************************** * * @@ -2816,21 +3275,9 @@ TURB_MOD,L ,1,1,20 * * *************************************************************************** * * -* ----- If wall distance required ----- * -* * -WALL_DIST,N ,0,0,0 -* -*************************************************************************** -* * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * +* ----- If Turb_extra_anis exists ----- * * * -K_AVAIL,N ,0,0,0 +AEX_AVAIL,I ,1,0,0 * *************************************************************************** * * @@ -2844,11 +3291,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2857,38 +3301,38 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.55317 -* -ALPHA2,R ,1,1,0 -0.4403547 +0.556 * BETA,R ,1,1,0 0.075 * -BETA2,R ,1,1,0 -0.0828 -* BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 0.5 0.5 * -SIGMA2,R ,1,2,0 -1.0 0.856 -* WALL,R ,1,1,0 10.0 * PRT,R ,1,1,0 0.9 * +C1,R ,1,1,0 +1.8 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* *************************************************************************** * Coefficient to multiply the limit of the turbulent production * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) * PROLIM,R ,1,1,0 -1.0 +1.0E20 * *************************************************************************** * * @@ -2896,31 +3340,24 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * -* ----- Viscous terms ----- * -* * -FVISF,S ,1,1,0 -'GVISKBSL ' -* -*************************************************************************** -* * * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSKWBSL ' +'HSSTKW ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXSTKW ' +'FXWJAR ' * *************************************************************************** * * -* --------------- MENTER SST k-omega --------------- * +* --------------- W&J EARSM + Kok_TNT k-omega --------------- * * * -TURB_MOD,L ,1,1,21 -'Menter SST k-omega ' +TURB_MOD,L ,1,1,16 +'W&J EARSM + Kok_TNT k-omega ' * *************************************************************************** * * @@ -2928,21 +3365,9 @@ TURB_MOD,L ,1,1,21 * * *************************************************************************** * * -* ----- If wall distance required ----- * -* * -WALL_DIST,N ,0,0,0 -* -*************************************************************************** -* * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * +* ----- If Turb_extra_anis exists ----- * * * -K_AVAIL,N ,0,0,0 +AEX_AVAIL,I ,1,0,0 * *************************************************************************** * * @@ -2956,11 +3381,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -2969,28 +3391,19 @@ NAME_EX,S ,1,1,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.55317 -* -ALPHA2,R ,1,1,0 -0.4403547 +0.525 * BETA,R ,1,1,0 0.075 * -BETA2,R ,1,1,0 -0.0828 -* BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 -0.85 0.5 -* -SIGMA2,R ,1,2,0 -1.0 0.856 +0.66666 0.55 * -A1,R ,1,1,0 -0.31 +SIGMAD_CROSS,R ,1,1,0 +0.3 * WALL,R ,1,1,0 10.0 @@ -2998,12 +3411,21 @@ WALL,R ,1,1,0 PRT,R ,1,1,0 0.9 * +C1,R ,1,1,0 +1.8 +* +*************************************************************************** +* Diffusion correction of EARSM model +* +CD,R ,1,1,0 +0.0 +* *************************************************************************** * Coefficient to multiply the limit of the turbulent production * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) * PROLIM,R ,1,1,0 -1.0 +1.0E20 * *************************************************************************** * * @@ -3011,31 +3433,24 @@ PROLIM,R ,1,1,0 * * *************************************************************************** * * -* ----- Viscous terms ----- * -* * -FVISF,S ,1,1,0 -'GVISKBSL ' -* -*************************************************************************** -* * * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSKWSST ' +'HSSTCD ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXSST ' +'FXWJAR ' * *************************************************************************** * * -* --------------- MENTER SST k-omega + Transition --------------- * +* --------------- W&J EARSM + Menter BSL k-omega 2009 ---------- * * * -TURB_MOD,L ,1,1,41 -'Menter SST k-omega + Transition ' +TURB_MOD,L ,1,1,23 +'W&J EARSM + Menter BSL k-omega 2009 ' * *************************************************************************** * * @@ -3043,82 +3458,61 @@ TURB_MOD,L ,1,1,41 * * *************************************************************************** * * -* ----- Transition model options ----- * -* * -*************************************************************************** -* Governing correlation functions: -* 0 = *DEFAULT = Tomac-Pettersson -* 1 = Menter-Langtry -* -ICORRF,I ,1,1,0 -0 -* -*************************************************************************** -* * * ----- If wall distance required ----- * * * WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * +* ----- If Turb_extra_anis exists ----- * * * -MUT_AVAIL,N ,0,0,0 +AEX_AVAIL,I ,1,0,0 * *************************************************************************** * * -* ----- Turb_kin_energy exists ----- * +* ----- Number and names of turb eqs ----- * * * -K_AVAIL,N ,0,0,0 +NTEQ,I ,1,1,0 +2 * -*************************************************************************** -* * -* ----- Number and names of turb eqs ----- * -* * -NTEQ,I ,1,1,0 -4 -* -NAME_UNK,S ,1,4,0 -'turb_kin_energy ' 'turb_omega ' 'intermittency ' 're_tetha_t ' +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* NAME_EX,S ,1,2,0 -'turb_viscosity ' 'laminar_turbulen' +'turb_viscosity ' 'mut_simp_diff ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.55317 +0.556 * ALPHA2,R ,1,1,0 -0.4403547 +0.44035 * BETA,R ,1,1,0 0.075 * +BETA1,R ,1,1,0 +0.075 +* BETA2,R ,1,1,0 0.0828 * BETAS,R ,1,1,0 0.09 * -SIGMA,R ,1,4,0 -0.85 0.5 1.0 2.0 +SIGMA,R ,1,2,0 +0.5 0.5 * SIGMA2,R ,1,2,0 1.0 0.856 * -A1,R ,1,1,0 -0.31 -* WALL,R ,1,1,0 10.0 * @@ -3126,66 +3520,11 @@ PRT,R ,1,1,0 0.9 * *************************************************************************** -* * -* ----- Transition model constants ----- * -* * -CA1,R ,1,1,0 -2.0 -* -CA2,R ,1,1,0 -0.06 -* -CE1,R ,1,1,0 -1.0 -* -CE2,R ,1,1,0 -50.0 -* -CALPHA,R ,1,1,0 -0.5 -* -CTT,R ,1,1,0 -0.03 -* -S1,R ,1,1,0 -2.0 -* -FLTC1,R ,1,1,0 -0.3188 -* -FLTC2,R ,1,1,0 -100.0 +* Diffusion correction of EARSM model * -FLTC3,R ,1,1,0 +CD,R ,1,1,0 0.0 * -FLTC4,R ,1,1,0 -73000.0 -* -RETCC1,R ,1,1,0 -0.92345 -* -RETCC2,R ,1,1,0 -187.0 -* -RETCC3,R ,1,1,0 -0.615 -* -RETCC4,R ,1,1,0 -30000.0 -* -RETCC5,R ,1,1,0 -0.0080 -* -LTLIM,R ,1,2,0 --0.1 0.1 -* -TULIM,R ,1,1,0 -0.027 -* -RETTLIM,R ,1,1,0 -20.0 -* *************************************************************************** * Coefficient to multiply the limit of the turbulent production * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) @@ -3193,6 +3532,15 @@ RETTLIM,R ,1,1,0 PROLIM,R ,1,1,0 1.0 * +A1,R ,1,1,0 +1.245 +* +A3,R ,1,1,0 +1.8 +* +A4,R ,1,1,0 +2.25 +* *************************************************************************** * * * ----- Turbulence model subroutines ----- * @@ -3202,28 +3550,28 @@ PROLIM,R ,1,1,0 * ----- Viscous terms ----- * * * FVISF,S ,1,1,0 -'GVISKBSLT ' +'GVISKZBSL ' * *************************************************************************** * * * ----- Source terms ----- * * * -GSOUKZ,S ,1,2,0 -'HSKWSSTT ' 'HSINTRETT ' +GSOUKZ,S ,1,1,0 +'HSKWBSL ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * -EXTRVA,S ,1,2,0 -'FXSST ' 'FXINTRETT ' +EXTRVA,S ,1,1,0 +'FXWJAR ' * *************************************************************************** * * -* --------------- W&J EARSM + MENTER BSL k-omega 2009 ---------- * +* --------------- W&J EARSM + Hellsten k-omega --------------- * * * -TURB_MOD,L ,1,1,26 -'W&J EARSM + Menter BSL k-omega 2009 ' +TURB_MOD,L ,1,1,24 +'W&J EARSM + Hellsten k-omega ' * *************************************************************************** * * @@ -3237,18 +3585,6 @@ WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- If Turb_extra_anis exists ----- * * * AEX_AVAIL,I ,1,0,0 @@ -3265,29 +3601,26 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* -NAME_EX,S ,1,2,0 -'turb_viscosity ' 'mut_simp_diff ' +NAME_EX,S ,1,1,0 +'turb_viscosity ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.556 +0.518 * ALPHA2,R ,1,1,0 -0.44035 +0.44 * BETA,R ,1,1,0 -0.075 +0.0747 * BETA1,R ,1,1,0 -0.075 +0.0747 * BETA2,R ,1,1,0 0.0828 @@ -3296,22 +3629,31 @@ BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,2,0 -0.5 0.5 +1.1 0.53 * SIGMA2,R ,1,2,0 -1.0 0.856 +1.1 1.0 * -WALL,R ,1,1,0 -10.0 +SIGMAD1,R ,1,1,0 +1.0 * -PRT,R ,1,1,0 -0.9 +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 * *************************************************************************** * Diffusion correction of EARSM model * CD,R ,1,1,0 -0.0 +2.2 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 * *************************************************************************** * Coefficient to multiply the limit of the turbulent production @@ -3320,15 +3662,9 @@ CD,R ,1,1,0 PROLIM,R ,1,1,0 1.0 * -A1,R ,1,1,0 -1.245 -* -A3,R ,1,1,0 +C1,R ,1,1,0 1.8 * -A4,R ,1,1,0 -2.25 -* *************************************************************************** * * * ----- Turbulence model subroutines ----- * @@ -3338,14 +3674,14 @@ A4,R ,1,1,0 * ----- Viscous terms ----- * * * FVISF,S ,1,1,0 -'GVISKBSL ' +'GVISKZHELLST ' * *************************************************************************** * * * ----- Source terms ----- * * * GSOUKZ,S ,1,1,0 -'HSKWBSL ' +'HSSHELLST ' * *************************************************************************** * * @@ -3358,7 +3694,7 @@ EXTRVA,S ,1,1,0 * * * --------------- W&J CC-EARSM + std k-omega --------------- * * * -TURB_MOD,L ,1,1,20 +TURB_MOD,L ,1,1,17 'W&J CC-EARSM + std k-omega ' * *************************************************************************** @@ -3367,18 +3703,6 @@ TURB_MOD,L ,1,1,20 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- If Turb_extra_anis exists ----- * * * AEX_AVAIL,I ,1,0,0 @@ -3401,11 +3725,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -3472,7 +3793,7 @@ EXTRVA,S ,1,1,0 * * * --------------- W&J CC-EARSM + Menter BSL k-omega --------------- * * * -TURB_MOD,L ,1,1,26 +TURB_MOD,L ,1,1,23 'W&J CC-EARSM + Menter BSL k-omega ' * *************************************************************************** @@ -3487,18 +3808,6 @@ WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- If Turb_extra_anis exists ----- * * * AEX_AVAIL,I ,1,0,0 @@ -3521,11 +3830,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -3591,7 +3897,7 @@ A0,R ,1,1,0 * ----- Viscous terms ----- * * * FVISF,S ,1,1,0 -'GVISKBSL ' +'GVISKZBSL ' * *************************************************************************** * * @@ -3609,10 +3915,10 @@ EXTRVA,S ,1,1,0 * *************************************************************************** * * -* --------------- W&J EARSM + Hellsten k-omega --------------- * +* --------------- W&J CC-EARSM + Hellsten k-omega --------------- * * * -TURB_MOD,L ,1,1,27 -'W&J EARSM + Hellsten k-omega ' +TURB_MOD,L ,1,1,26 +'W&J CC-EARSM + Hellsten k-omega ' * *************************************************************************** * * @@ -3626,21 +3932,15 @@ WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * +* ----- If Turb_extra_anis exists ----- * * * -K_AVAIL,N ,0,0,0 +AEX_AVAIL,I ,1,0,0 * *************************************************************************** * * -* ----- If Turb_extra_anis exists ----- * +* ----- If curvature correction ----- * * * -AEX_AVAIL,I ,1,0,0 +CURV_CORR,I ,1,0,0 * *************************************************************************** * * @@ -3654,11 +3954,8 @@ NAME_UNK,S ,1,2,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -1 -* NAME_EX,S ,1,1,0 'turb_viscosity ' * @@ -3721,6 +4018,9 @@ PROLIM,R ,1,1,0 C1,R ,1,1,0 1.8 * +A0,R ,1,1,0 +-0.72 +* *************************************************************************** * * * ----- Turbulence model subroutines ----- * @@ -3748,10 +4048,10 @@ EXTRVA,S ,1,1,0 * *************************************************************************** * * -* --------------- W&J-CC EARSM + Hellsten k-omega --------------- * +* --------------- W&J DRSM + std k-omega --------------- * * * -TURB_MOD,L ,1,1,29 -'W&J CC-EARSM + Hellsten k-omega ' +TURB_MOD,L ,1,1,20 +'W&J DRSM + std k-omega ' * *************************************************************************** * * @@ -3759,96 +4059,42 @@ TURB_MOD,L ,1,1,29 * * *************************************************************************** * * -* ----- If wall distance required ----- * -* * -WALL_DIST,N ,0,0,0 -* -*************************************************************************** -* * -* ----- If MUT exists ----- * +* ----- If Reynolds_stress exists ----- * * * -MUT_AVAIL,N ,0,0,0 +RS_AVAIL,N ,0,0,0 * *************************************************************************** * * -* ----- Turb_kin_energy exists ----- * +* ----- Number and names of turb eqs ----- * * * -K_AVAIL,N ,0,0,0 +NTEQ,I ,1,2,0 +5 7 * -*************************************************************************** -* * -* ----- If Turb_extra_anis exists ----- * -* * -AEX_AVAIL,I ,1,0,0 +NAME_UNK,S ,1,12,0 +'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' * *************************************************************************** * * -* ----- If curvature correction ----- * +* ----- Names of additional turb fields ----- * * * -CURV_CORR,I ,1,0,0 +NAME_EX,S ,1,2,0 +'turb_kin_energy ' 'turb_viscosity ' * *************************************************************************** * * -* ----- Number and names of turb eqs ----- * +* ----- Turbulence model constants ----- * * * -NTEQ,I ,1,1,0 -2 +ALPHA,R ,1,1,0 +0.556 * -NAME_UNK,S ,1,2,0 -'turb_kin_energy ' 'turb_omega ' -* -*************************************************************************** -* * -* ----- Number and names of additional turb fields ----- * -* * -NTEX,I ,1,1,0 -1 -* -NAME_EX,S ,1,1,0 -'turb_viscosity ' -* -*************************************************************************** -* * -* ----- Turbulence model constants ----- * -* * -ALPHA,R ,1,1,0 -0.518 -* -ALPHA2,R ,1,1,0 -0.44 -* -BETA,R ,1,1,0 -0.0747 -* -BETA1,R ,1,1,0 -0.0747 -* -BETA2,R ,1,1,0 -0.0828 +BETA,R ,1,1,0 +0.075 * BETAS,R ,1,1,0 0.09 * -SIGMA,R ,1,2,0 -1.1 0.53 -* -SIGMA2,R ,1,2,0 -1.1 1.0 -* -SIGMAD1,R ,1,1,0 -1.0 -* -SIGMAD2,R ,1,1,0 -0.4 -* -CMIX,R ,1,1,0 -1.5 -* -*************************************************************************** -* Diffusion correction of EARSM model -* -CD,R ,1,1,0 -2.2 +SIGMA,R ,1,12,0 +0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 * WALL,R ,1,1,0 10.0 @@ -3861,45 +4107,57 @@ PRT,R ,1,1,0 * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) * PROLIM,R ,1,1,0 -1.0 -* -C1,R ,1,1,0 -1.8 -* -A0,R ,1,1,0 --0.72 +1.0E20 * *************************************************************************** * * -* ----- Turbulence model subroutines ----- * +* ----- Pressure-strain model constants ----- * * * +PSC10,R ,1,1,0 +4.6 +* +PSC11,R ,1,1,0 +1.24 +* +PSC2,R ,1,1,0 +0.47 +* +PSC2S,R ,1,1,0 +0.0 +* +PSC3,R ,1,1,0 +2.0 +* +PSC4,R ,1,1,0 +0.56 +* +PSC5,R ,1,1,0 +0.0 +* *************************************************************************** * * -* ----- Viscous terms ----- * +* ----- Turbulence model subroutines ----- * * * -FVISF,S ,1,1,0 -'GVISKZHELLST ' -* *************************************************************************** * * * ----- Source terms ----- * * * -GSOUKZ,S ,1,1,0 -'HSSHELLST ' +GSOUKZ,S ,1,2,0 +'HSSTKW ' 'HSSRST ' * *************************************************************************** * * * ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXWJAR ' +'FXXRST ' * *************************************************************************** * * -* --------------- W&J DRSM + std k-omega --------------- * +* --------------- W&J DRSM + Hellsten k-omega --------------- * * * -TURB_MOD,L ,1,1,23 -'W&J DRSM + std k-omega ' +TURB_MOD,L ,1,1,28 +'W&J DRSM + Hellsten k-omega ' * *************************************************************************** * * @@ -3907,15 +4165,9 @@ TURB_MOD,L ,1,1,23 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * +* ----- If wall distance required ----- * * * -K_AVAIL,N ,0,0,0 +WALL_DIST,N ,0,0,0 * *************************************************************************** * * @@ -3935,11 +4187,8 @@ NAME_UNK,S ,1,12,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* NAME_EX,S ,1,2,0 'turb_kin_energy ' 'turb_viscosity ' * @@ -3948,16 +4197,34 @@ NAME_EX,S ,1,2,0 * ----- Turbulence model constants ----- * * * ALPHA,R ,1,1,0 -0.556 +0.518 +* +ALPHA2,R ,1,1,0 +0.44 * BETA,R ,1,1,0 -0.075 +0.0747 +* +BETA2,R ,1,1,0 +0.0828 * BETAS,R ,1,1,0 0.09 * SIGMA,R ,1,12,0 -0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 +1.1 1.1 1.1 1.1 0.53 1.1 1.1 1.1 1.1 1.1 1.1 0.53 +* +SIGMA2,R ,1,12,0 +1.1 1.1 1.1 1.1 1.0 1.1 1.1 1.1 1.1 1.1 1.1 1.0 +* +SIGMAD1,R ,1,1,0 +1.0 +* +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 * WALL,R ,1,1,0 10.0 @@ -4003,10 +4270,17 @@ PSC5,R ,1,1,0 * * *************************************************************************** * * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZHELLST ' +* +*************************************************************************** +* * * ----- Source terms ----- * * * GSOUKZ,S ,1,2,0 -'HSSTKW ' 'HSSRST ' +'HSSHELLST ' 'HSSRST ' * *************************************************************************** * * @@ -4017,10 +4291,10 @@ EXTRVA,S ,1,1,0 * *************************************************************************** * * -* --------------- W&J DRSM + Hellsten k-omega --------------- * +* --------------- W&J DAMPED DRSM + Hellsten k-omega --------------- * * * TURB_MOD,L ,1,1,31 -'W&J DRSM + Hellsten k-omega ' +'W&J DAMPED DRSM + Hellsten k-omega ' * *************************************************************************** * * @@ -4034,18 +4308,6 @@ WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- Turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- If Reynolds_stress exists ----- * * * RS_AVAIL,N ,0,0,0 @@ -4062,11 +4324,8 @@ NAME_UNK,S ,1,12,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* NAME_EX,S ,1,2,0 'turb_kin_energy ' 'turb_viscosity ' * @@ -4142,6 +4401,15 @@ PSC4,R ,1,1,0 PSC5,R ,1,1,0 0.0 * +PSDC10,R ,1,1,0 +0.57 +* +PSDC11,R ,1,1,0 +0.9 +* +PSAPLUS,R ,1,1,0 +26.0 +* *************************************************************************** * * * ----- Turbulence model subroutines ----- * @@ -4158,7 +4426,7 @@ FVISF,S ,1,1,0 * ----- Source terms ----- * * * GSOUKZ,S ,1,2,0 -'HSSHELLST ' 'HSSRST ' +'HSSHELLST ' 'DAMPED_HSSRST ' * *************************************************************************** * * @@ -4171,7 +4439,7 @@ EXTRVA,S ,1,1,0 * * * --------------- SSG DRSM + std k-omega --------------- * * * -TURB_MOD,L ,1,1,23 +TURB_MOD,L ,1,1,20 'SSG DRSM + std k-omega ' * *************************************************************************** @@ -4180,18 +4448,6 @@ TURB_MOD,L ,1,1,23 * * *************************************************************************** * * -* ----- If MUT exists ----- * -* * -MUT_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * -* ----- If turb_kin_energy exists ----- * -* * -K_AVAIL,N ,0,0,0 -* -*************************************************************************** -* * * ----- If Reynolds_stress exists ----- * * * RS_AVAIL,N ,0,0,0 @@ -4208,11 +4464,8 @@ NAME_UNK,S ,1,12,0 * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* NAME_EX,S ,1,2,0 'turb_kin_energy ' 'turb_viscosity ' * @@ -4276,114 +4529,1290 @@ PSC5,R ,1,1,0 * *************************************************************************** * * -* ----- Turbulence model subroutines ----- * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSSTKW ' 'HSSRST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity and K) ----- * +* * +EXTRVA,S ,1,1,0 +'FXXRST ' +* +*************************************************************************** +* * +* --------------- SSG DRSM + Hellsten k-omega --------------- * +* * +TURB_MOD,L ,1,1,28 +'SSG DRSM + Hellsten k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- If Reynolds_stress exists ----- * +* * +RS_AVAIL,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs (2D and 3D) ----- * +* * +NTEQ,I ,1,2,0 +5 7 +* +NAME_UNK,S ,1,12,0 +'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,2,0 +'turb_kin_energy ' 'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +ALPHA,R ,1,1,0 +0.518 +* +ALPHA2,R ,1,1,0 +0.44 +* +BETA,R ,1,1,0 +0.0747 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,12,0 +1.1 1.1 1.1 1.1 0.53 1.1 1.1 1.1 1.1 1.1 1.1 0.53 +* +SIGMA2,R ,1,12,0 +1.1 1.1 1.1 1.1 1.0 1.1 1.1 1.1 1.1 1.1 1.1 1.0 +* +SIGMAD1,R ,1,1,0 +1.0 +* +SIGMAD2,R ,1,1,0 +0.4 +* +CMIX,R ,1,1,0 +1.5 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0E20 +* +*************************************************************************** +* * +* ----- Pressure-strain model constants ----- * +* * +PSC10,R ,1,1,0 +3.4 +* +PSC11,R ,1,1,0 +1.8 +* +PSC2,R ,1,1,0 +0.8 +* +PSC2S,R ,1,1,0 +1.3 +* +PSC3,R ,1,1,0 +1.25 +* +PSC4,R ,1,1,0 +0.4 +* +PSC5,R ,1,1,0 +4.2 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZHELLST ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOUKZ,S ,1,2,0 +'HSSHELLST ' 'HSSRST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity and K) ----- * +* * +EXTRVA,S ,1,1,0 +'FXXRST ' +* +*************************************************************************** +* * +* --------------- Peng hybrid HYB0 model ---------- * +* * +TURB_MOD,L ,1,1,9 +'Peng hybrid HYB0 model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +0 +* +NAME_UNK,S ,1,1,0 +'zero_equation ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,2,0 +'turb_viscosity ' 'rans_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CSGS,R ,1,1,0 +0.12 +* +CKSGS,R ,1,1,0 +0.0 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.4 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXHYB0P ' +* +*************************************************************************** +* * +* --------------- Spalart-Allmaras DES model ---------- * +* * +TURB_MOD,L ,1,1,17 +'Spalart-Allmaras DES model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDESSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- Spalart-Allmaras DDES ---------- * +* * +TURB_MOD,L ,1,1,17 +'Spalart-Allmaras DDES ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDDESSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- Spalart-Allmaras IDDES ---------- * +* * +TURB_MOD,L ,1,1,17 +'Spalart-Allmaras IDDES ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSIDDESSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- Menter SST-DES k-omega --------------- * +* * +TURB_MOD,L ,1,1,20 +'Menter SST-DES k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDESKW,R ,1,1,0 +0.78 +* +CDESKE,R ,1,1,0 +0.61 +* +ALPHA,R ,1,1,0 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 +* +BETA,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.85 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDESSST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSST ' +* +*************************************************************************** +* * +* --------------- Menter SST-DDES k-omega --------------- * +* * +TURB_MOD,L ,1,1,20 +'Menter SST-DDES k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDESKW,R ,1,1,0 +0.78 +* +CDESKE,R ,1,1,0 +0.61 +* +ALPHA,R ,1,1,0 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 +* +BETA,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.85 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDDESSST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSST ' +* +*************************************************************************** +* * +* --------------- Menter SST-IDDES k-omega --------------- * +* * +TURB_MOD,L ,1,1,20 +'Menter SST-IDDES k-omega ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +2 +* +NAME_UNK,S ,1,2,0 +'turb_kin_energy ' 'turb_omega ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDESKW,R ,1,1,0 +0.78 +* +CDESKE,R ,1,1,0 +0.61 +* +ALPHA,R ,1,1,0 +0.55317 +* +ALPHA2,R ,1,1,0 +0.4403547 +* +BETA,R ,1,1,0 +0.075 +* +BETA2,R ,1,1,0 +0.0828 +* +BETAS,R ,1,1,0 +0.09 +* +SIGMA,R ,1,2,0 +0.85 0.5 +* +SIGMA2,R ,1,2,0 +1.0 0.856 +* +A1,R ,1,1,0 +0.31 +* +WALL,R ,1,1,0 +10.0 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISKZBSL ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSIDDESSST ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSST ' +* +*************************************************************************** +* * +* --------------- Rung SALSA-DES ---------- * +* * +TURB_MOD,L ,1,1,17 +'Rung SALSA-DES ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDESSALSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- Rung SALSA-DDES ---------- * +* * +TURB_MOD,L ,1,1,17 +'Rung SALSA-DDES ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSDDESSALSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- Rung SALSA-IDDES ---------- * +* * +TURB_MOD,L ,1,1,17 +'Rung SALSA-IDDES ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 +* +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 +* +NAME_UNK,S ,1,1,0 +'turb_work_vt ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CDES,R ,1,1,0 +0.65 +* +SACB1,R ,1,1,0 +0.1355 +* +SACB2,R ,1,1,0 +0.622 +* +SACW1,R ,1,1,0 +3.24 +* +SACW2,R ,1,1,0 +0.3 +* +SACW3,R ,1,1,0 +2.0 +* +SACV1,R ,1,1,0 +7.1 +* +SIGMA,R ,1,1,0 +1.5 +* +PRT,R ,1,1,0 +0.9 +* +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 +* +*************************************************************************** +* * +* ----- Turbulence model subroutines ----- * +* * +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' +* +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSIDDESSALSA ' +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSAM ' +* +*************************************************************************** +* * +* --------------- Smagorinsky SGS model ---------- * +* * +TURB_MOD,L ,1,1,8 +'Smagorinsky SGS model ' +* +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +0 +* +NAME_UNK,S ,1,1,0 +'zero_equation ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CSMAG,R ,1,1,0 +0.2 +* +CKSMG,R ,1,1,0 +0.0 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.4 +* +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity and kin. energy) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSGSSMG ' +* +*************************************************************************** +* * +* --------------- Smagorinsky SGS with wall damping ---------- * * * +TURB_MOD,L ,1,1,9 +'Smagorinsky SGS with wall damping ' +* *************************************************************************** * * -* ----- Source terms ----- * +* ----- Turbulence model program logics ----- * * * -GSOUKZ,S ,1,2,0 -'HSSTKW ' 'HSSRST ' -* *************************************************************************** * * -* ----- Extra fields (turbulent viscosity and K) ----- * +* ----- If wall distance required ----- * * * -EXTRVA,S ,1,1,0 -'FXXRST ' +WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* --------------- SSG DRSM + Hellsten k-omega --------------- * +* ----- Number and names of turb eqs ----- * * * -TURB_MOD,L ,1,1,31 -'SSG DRSM + Hellsten k-omega ' +NTEQ,I ,1,1,0 +0 +* +NAME_UNK,S ,1,1,0 +'zero_equation ' * *************************************************************************** * * -* ----- Turbulence model program logics ----- * +* ----- Names of additional turb fields ----- * * * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* *************************************************************************** * * -* ----- If wall distance required ----- * +* ----- Turbulence model constants ----- * * * -WALL_DIST,N ,0,0,0 +CSMAG,R ,1,1,0 +0.2 +* +CKSMG,R ,1,1,0 +0.0 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 +0.4 * *************************************************************************** * * -* ----- If MUT exists ----- * +* ----- Extra fields (turbulent viscosity and kin. energy) ----- * * * -MUT_AVAIL,N ,0,0,0 +EXTRVA,S ,1,1,0 +'FXSGSSMG2 ' * *************************************************************************** * * -* ----- If turb_kin_energy exists ----- * +* --------------- Spalart-Allmaras SGS model ---------- * * * -K_AVAIL,N ,0,0,0 +TURB_MOD,L ,1,1,17 +'Spalart-Allmaras SGS model ' * *************************************************************************** * * -* ----- If Reynolds_stress exists ----- * +* ----- Turbulence model program logics ----- * * * -RS_AVAIL,N ,0,0,0 +*************************************************************************** +* * +* ----- If wall distance required ----- * +* * +WALL_DIST,N ,0,0,0 * *************************************************************************** * * -* ----- Number and names of turb eqs (2D and 3D) ----- * +* ----- Number and names of turb eqs ----- * * * -NTEQ,I ,1,2,0 -5 7 +NTEQ,I ,1,1,0 +1 * -NAME_UNK,S ,1,12,0 -'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'turb_omega ' 'RS_11 ' 'RS_22 ' 'RS_33 ' 'RS_12 ' 'RS_13 ' 'RS_23 ' 'turb_omega ' +NAME_UNK,S ,1,1,0 +'turb_work_vt ' * *************************************************************************** * * -* ----- Number and names of additional turb fields ----- * +* ----- Names of additional turb fields ----- * * * -NTEX,I ,1,1,0 -2 -* -NAME_EX,S ,1,2,0 -'turb_kin_energy ' 'turb_viscosity ' +NAME_EX,S ,1,1,0 +'turb_viscosity ' * *************************************************************************** * * * ----- Turbulence model constants ----- * * * -ALPHA,R ,1,1,0 -0.518 -* -ALPHA2,R ,1,1,0 -0.44 -* -BETA,R ,1,1,0 -0.0747 +CDES,R ,1,1,0 +0.65 * -BETA2,R ,1,1,0 -0.0828 +SACB1,R ,1,1,0 +0.1355 * -BETAS,R ,1,1,0 -0.09 +SACB2,R ,1,1,0 +0.622 * -SIGMA,R ,1,12,0 -1.1 1.1 1.1 1.1 0.53 1.1 1.1 1.1 1.1 1.1 1.1 0.53 +SACW1,R ,1,1,0 +3.24 * -SIGMA2,R ,1,12,0 -1.1 1.1 1.1 1.1 1.0 1.1 1.1 1.1 1.1 1.1 1.1 1.0 +SACW2,R ,1,1,0 +0.3 * -SIGMAD1,R ,1,1,0 -1.0 +SACW3,R ,1,1,0 +2.0 * -SIGMAD2,R ,1,1,0 -0.4 +SACV1,R ,1,1,0 +7.1 * -CMIX,R ,1,1,0 +SIGMA,R ,1,1,0 1.5 * -WALL,R ,1,1,0 -10.0 -* PRT,R ,1,1,0 0.9 * @@ -4392,32 +5821,83 @@ PRT,R ,1,1,0 * PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) * PROLIM,R ,1,1,0 -1.0E20 +1.0 * *************************************************************************** * * -* ----- Pressure-strain model constants ----- * +* ----- Turbulence model subroutines ----- * * * -PSC10,R ,1,1,0 -3.4 +*************************************************************************** +* * +* ----- Viscous terms ----- * +* * +FVISF,S ,1,1,0 +'GVISSA ' * -PSC11,R ,1,1,0 -1.8 +*************************************************************************** +* * +* ----- Source terms ----- * +* * +GSOULDES,S ,1,1,0 +'HSLESSA ' * -PSC2,R ,1,1,0 -0.8 +*************************************************************************** +* * +* ----- Extra fields (turbulent viscosity) ----- * +* * +EXTRVA,S ,1,1,0 +'FXSGSSA ' * -PSC2S,R ,1,1,0 -1.3 +*************************************************************************** +* * +* --------------- Yoshizawa SGS ---------- * +* * +TURB_MOD,L ,1,1,11 +'Yoshizawa k-eq SGS model ' * -PSC3,R ,1,1,0 -1.25 +*************************************************************************** +* * +* ----- Turbulence model program logics ----- * +* * +*************************************************************************** +* * +* ----- Number and names of turb eqs ----- * +* * +NTEQ,I ,1,1,0 +1 * -PSC4,R ,1,1,0 +NAME_UNK,S ,1,1,0 +'turb_kin_energy ' +* +*************************************************************************** +* * +* ----- Names of additional turb fields ----- * +* * +NAME_EX,S ,1,1,0 +'turb_viscosity ' +* +*************************************************************************** +* * +* ----- Turbulence model constants ----- * +* * +CKMU,R ,1,1,0 +0.07 +* +CEPS,R ,1,1,0 +1.05 +* +SIGMA,R ,1,1,0 +1.0 +* +PRT,R ,1,1,0 0.4 * -PSC5,R ,1,1,0 -4.2 +*************************************************************************** +* Coefficient to multiply the limit of the turbulent production +* PLIM = PROLIM*RHO*RK*SQRT(PROD/MUTC) +* +PROLIM,R ,1,1,0 +1.0 * *************************************************************************** * * @@ -4428,21 +5908,21 @@ PSC5,R ,1,1,0 * ----- Viscous terms ----- * * * FVISF,S ,1,1,0 -'GVISKZHELLST ' +'GVISLESYO ' * *************************************************************************** * * * ----- Source terms ----- * * * -GSOUKZ,S ,1,2,0 -'HSSHELLST ' 'HSSRST ' +GSOULDES,S ,1,1,0 +'HSLESYO ' * *************************************************************************** * * -* ----- Extra fields (turbulent viscosity and K) ----- * +* ----- Extra fields (turbulent viscosity) ----- * * * EXTRVA,S ,1,1,0 -'FXXRST ' +'FXSGSYO ' * *************************************************************************** * * @@ -4461,43 +5941,45 @@ NLEVEL,I ,1,1,0 5 * *************************************************************************** -* Removement of singletons (YES = 1, NO = 0) +* Coarsening ratio in the prismatic layer ( CRATIOB > 1.0) * -RMSING,I ,1,1,0 -1 +CRATIOB,R ,1,1,0 +4.0 * *************************************************************************** -* Number of prismatic layers +* Reduction of target number of agglomerated cells close to boundaries, +* >=1 if active * -NPLAYER,I ,1,1,0 -40 +NAGGLTBC,I ,1,1,0 +0 * *************************************************************************** -* Coarsening ratio in the prismatic layer ( CRATIOB > 1.0) +* Number of fine layers (nodes) where NAGGLTBC apply, >=1 if active * -CRATIOB,R ,1,1,0 -4.0 +NLAYERTBC,I ,1,1,0 +0 * *************************************************************************** * Number of partitions. NPART > 1 specifies a parallel calculation. * Used by both flow solver and preprocessor * NPART,I ,1,1,0 -__NPART__ +__NPART__ * *************************************************************************** -* Partitioning option -* 1 = Original option with algorithm based on agglomeration -* 2 = Partitioning based on METIS +* Node weight in implicit lines. Default 2000, can be reduced to 1000 +* if LINEIM=0. No effect for Euler meshes or if STR_LINES_OPT>1 * -PTYPE,I ,1,1,0 -2 +METIS_L_V_WEIGHT,I ,1,1,0 +2000 * *************************************************************************** -* Flag for printing the dual grid (YES = 1, NO = 0) +* 1 = Account for stretched lines in partitioning and agglomeration +* 2 = Account for stretched lines in agglomeration only +* 3 = Do not account for stretched lines at all * -PDUAL,I ,1,1,0 -0 +STR_LINES_OPT,I ,1,1,0 +1 * *************************************************************************** * Type of edge coloring : @@ -4540,8 +6022,8 @@ IWALLDIS,I ,1,1,0 * * *************************************************************************** * Adaption parameters taken from file: refinement_data.aref -* 0 = Data in this file used -* 1 = Data in refinement_data.aref used +* 0 = Data in this file used +* 1 = Data in refinement_data.aref used * EXTADAPT,I ,1,1,0 0 @@ -4724,134 +6206,45 @@ CFIBLAD,L ,1,1,0 * specified point in the volume or on a boundary * * * *************************************************************************** -* Number of active probes if >0 +* Probe data history on/off (IPROBEHIS=1/0) +* Probe input data file under CFIPRB * -PROBE_RECORD,I ,1,1,3 +IPROBEHIS,I ,1,1,0 0 * *************************************************************************** -* Coordinates of probes -* -PROBE_COORD,R ,8,3,0 -0.8939345 0.0105114 0.0759227 -0.8939345 -0.0299341 0.0678775 -0.8939345 -0.0528447 0.0335895 -0.8939345 -0.0447995 -0.006856 -0.8939345 -0.0105114 -0.0297666 -0.8939345 0.0299341 -0.0217215 -0.8939345 0.0528447 0.0125665 -0.8939345 0.0447995 0.0530121 -* +* * +* --------------- Sampling surface options ------------- * +* * *************************************************************************** -* Name and location of probes: -* interior = inside the volume -* boundary = on boundary surface +* Aerodynamic coeff history on/off (IACHIS=1/0) +* Aerodynamic coeff history input file name supplied to CFIACI * -PROBE_NAME,L ,8,2,0 -'PD1 ' 'interior ' -'PD2 ' 'interior ' -'PD3 ' 'interior ' -'PD4 ' 'interior ' -'PD5 ' 'interior ' -'PD6 ' 'interior ' -'PD7 ' 'interior ' -'PD8 ' 'interior ' +IACHIS,I ,1,1,0 +0 * *************************************************************************** -* Write probe info to a mesh file: 1=yes,0=no +* Sampling boundary data on/off (ISAMP=1/0) +* Sampling boundary data input file name supplied to CFIBSI * -PMESH,I ,1,1,1 -1 +ISAMP,I ,1,1,0 +0 * *************************************************************************** -* Name of mesh file +* Sampling on supplied mesh (ISAMMSH=1) +* Sampling mesh file name supplied to CFISAMMSH * -CFIPROBE,L ,1,1,0 -'Probe.bmsh ' +ISAMMSH,I ,1,1,0 +0 * *************************************************************************** * * * --------------- Inlet analysis options --------------- * * * *************************************************************************** -* 0 = No inlet analysis -* 1 = Calculate pressure recovery and distortion at specified AIP location -* (AIP=Aerodynamic Interface Plane must be circular) -* -* Note: Extra data is added to the bedg-file in the preprocessor step. -* If any setting is changed, make sure to run the preprocessor again. +* Inlet analysis option on/off (IAIPHIS=1/0) +* Inlet analysis input data file under CFIAIP * -AIP_RECORD,I ,1,1,7 +IAIPHIS,I ,1,1,0 0 * -*************************************************************************** -* Write Aip mesh to file: 1=yes,0=no -* -AIPMESH,I ,1,1,1 -1 -* -*************************************************************************** -* Name of mesh file -* -CFIAIP,L ,1,1,0 -'Aip.bmsh ' -* -*************************************************************************** -* Mid-point of AIP and probe rake -* -AIP_POINT,R ,1,3,0 -4.7217 0.0 2.1 -* -*************************************************************************** -* Radius of AIP and probe rake -* -AIP_RADIUS,R ,1,1,0 -0.33 -* -*************************************************************************** -* AIP and probe rake plane normal direction -* -AIP_NORM,R ,1,3,0 -1.0 0.0 0.0 -* -*************************************************************************** -* Start distortion analysis from this direction and rotate -* clockwise looking from the AIP_NORM vector. This will determine -* the angle of maximum distortion. -* -AIP_ROT,R ,1,3,0 -0.0 0.0 1.0 -* -*************************************************************************** -* Pos 1: Number of radial position of AIP rake -* Pos 2: Number of arms of AIP rake -* Pos 3: Full circle=1, half circle=0 (if using a symmetry plane at AIP) -* -AIP_GRID,I ,1,3,0 -5 5 0 -* -*************************************************************************** -* Evaluate freestream total pressure for AIP reference -* 1 = At specified point in volume (PT_POINT) -* 2 = At specified boundary name (PT_BC, mean values evaluated) -* 3 = Use Free stream values from this input file (PFREE,TFREE...) -* -PT_PROBE,I ,1,1,2 -1 -* -*************************************************************************** -* Coordinates of points for free stream references -* -PT_POINT,R ,1,3,0 -3.0717 0.15 2.4 -* -*************************************************************************** -* Boundary condition name for free stream reference -* -PT_BC,L ,1,1,0 -'BC1_on_INLET ' -* -*************************************************************************** -* * -* ---------------- The end of regular Edge parameters ---------------- * -* * From c7ccbb01b9238f2b3b8c2bbb6f4d8b1567bcbd43 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 10 Jan 2024 13:10:28 +0100 Subject: [PATCH 07/80] re modulation --- ceasiompy/EdgeRun/README.md | 40 ++ ceasiompy/EdgeRun/ToolInput/.keep | 1 + ceasiompy/EdgeRun/ToolOutput/.keep | 1 + ceasiompy/EdgeRun/__init__.py | 0 ceasiompy/EdgeRun/__specs__.py | 63 ++ ceasiompy/EdgeRun/func/edgeconfig.py | 88 ++- ceasiompy/EdgeRun/moduletemplate.py | 207 +++++++ .../tests/ToolInput/simpletest_cpacs.xml | 576 ++++++++++++++++++ ceasiompy/EdgeRun/tests/ToolOutput/.keep | 1 + .../{tests_edgeconfig => }/test_edgerun.py | 17 +- .../02_\342\232\231\357\270\217_Settings.py" | 11 - 11 files changed, 955 insertions(+), 50 deletions(-) create mode 100644 ceasiompy/EdgeRun/README.md create mode 100644 ceasiompy/EdgeRun/ToolInput/.keep create mode 100644 ceasiompy/EdgeRun/ToolOutput/.keep create mode 100644 ceasiompy/EdgeRun/__init__.py create mode 100644 ceasiompy/EdgeRun/__specs__.py create mode 100644 ceasiompy/EdgeRun/moduletemplate.py create mode 100644 ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml create mode 100644 ceasiompy/EdgeRun/tests/ToolOutput/.keep rename ceasiompy/EdgeRun/tests/{tests_edgeconfig => }/test_edgerun.py (81%) diff --git a/ceasiompy/EdgeRun/README.md b/ceasiompy/EdgeRun/README.md new file mode 100644 index 000000000..f20754ecf --- /dev/null +++ b/ceasiompy/EdgeRun/README.md @@ -0,0 +1,40 @@ + + + +# ModuleTemplate + +**Categories:** Template module, Example, Illustration + +**State**: :heavy_check_mark: + +This is a template module. Its purpose is to illustrate how other modules of CEASIOMpy should be structured, set up and documented. + +

+ +

+ +Example picture. Image in the public domain, from [Wikimedia Commons](https://commons.wikimedia.org/wiki/File:Spirit_of_St._Louis.jpg) + +## Inputs + +ModuleTemplate needs no inputs. + +## Analyses + +ModuleTemplate computes nothing. + +## Outputs + +ModuleTemplate outputs nothing. + +## Installation or requirements + +ModuleTemplate is a native CEASIOMpy module, hence it is available and installed by default. + +## Limitations + +ModuleTemplate is limited in every aspect. + +## More information + +* diff --git a/ceasiompy/EdgeRun/ToolInput/.keep b/ceasiompy/EdgeRun/ToolInput/.keep new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/ceasiompy/EdgeRun/ToolInput/.keep @@ -0,0 +1 @@ + diff --git a/ceasiompy/EdgeRun/ToolOutput/.keep b/ceasiompy/EdgeRun/ToolOutput/.keep new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/ceasiompy/EdgeRun/ToolOutput/.keep @@ -0,0 +1 @@ + diff --git a/ceasiompy/EdgeRun/__init__.py b/ceasiompy/EdgeRun/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py new file mode 100644 index 000000000..fe73a31de --- /dev/null +++ b/ceasiompy/EdgeRun/__specs__.py @@ -0,0 +1,63 @@ +from ceasiompy.utils.moduleinterfaces import CPACSInOut +from ceasiompy.utils.commonxpath import CEASIOMPY_XPATH, FUSELAGES_XPATH + +# ===== Module Status ===== +# True if the module is active +# False if the module is disabled (not working or not ready) +module_status = False # Because it is just an example not a real module + +# ===== CPACS inputs and outputs ===== + +cpacs_inout = CPACSInOut() + +include_gui = False + +# ----- Input ----- + +# * In the following example we add three (!) new entries to 'cpacs_inout' +# * Try to use (readable) loops instead of copy-pasting three almost same entries :) +for direction in ["x", "y", "z"]: + cpacs_inout.add_input( + var_name=direction, + var_type=float, + default_value=None, + unit="1", + descr=f"Fuselage scaling on {direction} axis", + xpath=FUSELAGES_XPATH + f"/fuselage/transformation/scaling/{direction}", + gui=include_gui, + gui_name=f"{direction.capitalize()} scaling", + gui_group="Fuselage scaling", + ) + +cpacs_inout.add_input( + var_name="test", + var_type=str, + default_value="This is a test", + unit=None, + descr="This is a test of description", + xpath=CEASIOMPY_XPATH + "/test/myTest", + gui=include_gui, + gui_name="My test", + gui_group="Group Test", +) + +cpacs_inout.add_input( + var_name="other_var", + var_type=list, + default_value=[2, 33, 444], + unit="[unit]", + xpath=CEASIOMPY_XPATH + "/test/myList", + gui=include_gui, + gui_name="Choice", + gui_group="My Selection", +) + +# ----- Output ----- + +cpacs_inout.add_output( + var_name="output", + default_value=None, + unit="1", + descr="Description of the output", + xpath=CEASIOMPY_XPATH + "/test/myOutput", +) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 28b0d5275..2e3421c63 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -26,33 +26,34 @@ from shutil import copyfile from ambiance import Atmosphere -#from ceasiompy.SU2Run.func.su2actuatordiskfile import ( + +# from ceasiompy.SU2Run.func.su2actuatordiskfile import ( # get_advanced_ratio, # get_radial_stations, # save_plots, # thrust_calculator, # write_actuator_disk_data, # write_header, -#) +# ) from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.commonnames import ( -AINP_CFD_NAME, + AINP_CFD_NAME, ) from ceasiompy.utils.commonxpath import ( GMSH_SYMMETRY_XPATH, PROP_XPATH, RANGE_XPATH, EdgeMESH_XPATH, - Edge_AEROMAP_UID_XPATH, + Edge_AEROMAP_UID_XPATH, Edge_CFL_NB_XPATH, Edge_MAX_ITER_XPATH, Edge_MG_LEVEL_XPATH, Edge_NB_CPU_XPATH, Edge_FIXED_CL_XPATH, - ) -#from ceasiompy.utils.configfiles import ConfigFile + +# from ceasiompy.utils.configfiles import ConfigFile from ceasiompy.utils.create_ainpfile import CreateAinp from cpacspy.cpacsfunctions import ( create_branch, @@ -61,7 +62,8 @@ get_value_or_default, ) from cpacspy.cpacspy import CPACS -#import cpacs + +# import cpacs log = get_logger() @@ -79,14 +81,14 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): - #output_path = Path(case_dir_path, AINP_CFD_NAME) + # output_path = Path(case_dir_path, AINP_CFD_NAME) """Function to create Edge input (*.ainp) file. Function 'generate_edge_cfd_ainp' reads data in the CPACS file and generate configuration files for one or multiple flight conditions (alt,mach,aoa,aos) Source: - * M-Edge ainp template: + * M-Edge ainp template: Args: cpacs_path (Path): Path to CPACS file @@ -100,7 +102,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): edge_mesh = Path(get_value(cpacs.tixi, EdgeMESH_XPATH)) if not edge_mesh.is_file(): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") - + # Get the fixedCL value from CPACS fixed_cl = get_value_or_default(cpacs.tixi, Edge_FIXED_CL_XPATH, "NO") if fixed_cl == "NO": @@ -109,7 +111,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): if aeromap_list: aeromap_default = aeromap_list[0] - log.info(f'The aeromap is {aeromap_default}') + log.info(f"The aeromap is {aeromap_default}") aeromap_uid = get_value_or_default(cpacs.tixi, Edge_AEROMAP_UID_XPATH, aeromap_default) @@ -134,7 +136,9 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): aoa_list = [0.0] aos_list = [0.0] - aeromap_uid = get_value_or_default(cpacs.tixi, Edge_AEROMAP_UID_XPATH, "DefaultAeromap") + aeromap_uid = get_value_or_default( + cpacs.tixi, Edge_AEROMAP_UID_XPATH, "DefaultAeromap" + ) log.info(f"{aeromap_uid} has been created") else: # if fixed_cl == 'YES': @@ -154,7 +158,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): aoa_list = [0.0] aos_list = [0.0] - #cfg = ConfigFile(get_su2_config_template()) + # cfg = ConfigFile(get_su2_config_template()) # Check if symmetry plane is defined (Default: False) sym_factor = 1.0 @@ -163,7 +167,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): sym_factor = 2.0 # General parameters -# cfg["RESTART_SOL"] = "NO" + # cfg["RESTART_SOL"] = "NO" CREF = cpacs.aircraft.ref_length SREF = cpacs.aircraft.ref_area / sym_factor BREF = SREF / CREF @@ -174,13 +178,12 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): ITMAX = int(get_value_or_default(cpacs.tixi, Edge_MAX_ITER_XPATH, 200)) CFL = get_value_or_default(cpacs.tixi, Edge_CFL_NB_XPATH, 1.5) NGRID = int(get_value_or_default(cpacs.tixi, Edge_MG_LEVEL_XPATH, 3)) - NPART = int(get_value_or_default(cpacs.tixi,Edge_NB_CPU_XPATH,32)) + NPART = int(get_value_or_default(cpacs.tixi, Edge_NB_CPU_XPATH, 32)) INSEUL = 0 - # Parameters which will vary for the different cases (alt,mach,aoa,aos) for case_nb in range(len(alt_list)): - #cfg["MESH_FILENAME"] = str(su2_mesh) + # cfg["MESH_FILENAME"] = str(su2_mesh) alt = alt_list[case_nb] mach = mach_list[case_nb] @@ -192,23 +195,23 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): PFREE = Atm.pressure[0] TFREE = Atm.temperature[0] speedofsound = Atm.speed_of_sound[0] - airspeed = mach*speedofsound - + airspeed = mach * speedofsound + aoa_rad = math.radians(aoa) aos_rad = math.radians(aos) - + UFREE = airspeed * math.cos(aos) * math.cos(aoa) WFREE = airspeed * math.cos(aos) * math.sin(aoa) VFREE = airspeed * math.sin(aos) * (-1) - + IDCDP1 = math.cos(aos) * math.cos(aoa) - IDCDP2 = math.sin(aos) + IDCDP2 = math.sin(aos) IDCDP3 = math.cos(aos) * math.sin(aoa) - + IDCLP1 = math.sin(aoa) * (-1) IDCLP2 = 0 IDCLP3 = math.cos(aoa) - + IDCCP1 = math.cos(aoa) * math.sin(aos) * (-1) IDCCP2 = math.cos(aos) * (-1) IDCCP3 = math.sin(aoa) * math.sin(aos) * (-1) @@ -221,7 +224,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): IDCRP1 = IDCDP1 IDCRP2 = IDCDP2 IDCRP3 = IDCDP3 - + IDCLP = f"{IDCLP1} {IDCLP2} {IDCLP3}" IDCDP = f"{IDCDP1} {IDCDP2} {IDCDP3}" IDCMP = f"{IDCMP1} {IDCMP2} {IDCMP3}" @@ -238,20 +241,41 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): if not case_dir_path.exists(): case_dir_path.mkdir() output_path = Path(case_dir_path, AINP_CFD_NAME) - #template_path = get_edge_ainp_template() + # template_path = get_edge_ainp_template() create_ainp_instance = CreateAinp() - #create_ainp_instance = CreateAinp(get_edge_ainp_template()) - - create_ainp_instance.create_ainp(UFREE, VFREE, WFREE, TFREE, PFREE, SREF, CREF, BREF, IXMP, IDCLP, IDCDP, IDCCP, IDCMP, IDCNP, IDCRP, NPART, ITMAX, INSEUL, NGRID, CFL, output_path) + # create_ainp_instance = CreateAinp(get_edge_ainp_template()) + + create_ainp_instance.create_ainp( + UFREE, + VFREE, + WFREE, + TFREE, + PFREE, + SREF, + CREF, + BREF, + IXMP, + IDCLP, + IDCDP, + IDCCP, + IDCMP, + IDCNP, + IDCRP, + NPART, + ITMAX, + INSEUL, + NGRID, + CFL, + output_path, + ) - #cfg.write_file(config_output_path, overwrite=True) + # cfg.write_file(config_output_path, overwrite=True) cpacs.save_cpacs(cpacs_out_path, overwrite=True) - # ================================================================================================= # MAIN # ================================================================================================= if __name__ == "__main__": - log.info("Nothing to execute!") \ No newline at end of file + log.info("Nothing to execute!") diff --git a/ceasiompy/EdgeRun/moduletemplate.py b/ceasiompy/EdgeRun/moduletemplate.py new file mode 100644 index 000000000..fe0a536d9 --- /dev/null +++ b/ceasiompy/EdgeRun/moduletemplate.py @@ -0,0 +1,207 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland + +Small description of the script + +Python version: >=3.8 + +| Author: Name +| Creation: YEAR-MONTH-DAY + +TODO: + + * Things to improve ... + * Things to add ... + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +from pathlib import Path + + +from ambiance import Atmosphere +from ceasiompy.ModuleTemplate.func.subfunc import my_subfunc +from ceasiompy.utils.ceasiomlogger import get_logger +from ceasiompy.utils.moduleinterfaces import ( + check_cpacs_input_requirements, + get_toolinput_file_path, + get_tooloutput_file_path, +) +from ceasiompy.utils.commonxpath import FUSELAGES_XPATH +from cpacspy.cpacsfunctions import ( + add_float_vector, + add_string_vector, + add_uid, + copy_branch, + create_branch, + get_float_vector, + get_string_vector, + get_tigl_configuration, + get_uid, + get_value, + get_value_or_default, + get_xpath_parent, + open_tigl, + open_tixi, +) + +log = get_logger() + +MODULE_DIR = Path(__file__).parent +MODULE_NAME = MODULE_DIR.name + + +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +class MyClass: + """ + Description of the class + + Attributes: + var_a (float): Argument a [unit] + var_b (float): Argument b [unit] + + .. seealso:: + + See some other source + + """ + + def __init__(self, a=1.1, b=2.2): + self.var_a = a + self.var_b = b + self.var_c = 0.0 + + def add_my_var(self): + """This methode will sum up var_a and var_b in var_c""" + + self.var_c = self.var_a + self.var_b + + +# ================================================================================================= +# FUNCTIONS +# ================================================================================================= + + +def sum_funcion(arg1, arg2): + """Function to calculate ... + + Function 'sum_funcion' return the total of arg1 and arg2, after it convert + arg1 into an float. + + Source: + * Reference paper or book, with author and date + + Args: + arg1 (interger): Argument 1 [unit] + arg2 (float): Argument 2 [unit] + + Returns: + total (float): Output1 [unit] + + .. warning:: + + Example of warning + """ + + if not isinstance(arg1, int): + raise ValueError("arg1 is not an integer") + + # Use of a subfunction here + print(my_subfunc("test1", "test2")) + + total = float(arg1) + arg2 + + return total + + +def get_fuselage_scaling(cpacs_path, cpacs_out_path): + """Function to get fuselage scaling along x,y,z axis. + + Function 'get_fuselage_scaling' return the value of the scaling for the + fuselage. (This is an example function just to show usage of CPACS and tixi) + + Source: + * Reference paper or book, with author and date + + Args: + cpacs_path (Path): Path to CPACS file + cpacs_out_path (Path):Path to CPACS output file + + Returns: + Tuple with fuselage scaling + + * x (float): Scaling on x [-] + * y (float): Scaling on y [-] + * z (float): Scaling on z [-] + """ + + # Open TIXI handle + tixi = open_tixi(cpacs_path) + + # Create xpaths + SCALING_XPATH = "/fuselage/transformation/scaling" + + x_fus_scaling_xpath = FUSELAGES_XPATH + SCALING_XPATH + "/x" + y_fus_scaling_xpath = FUSELAGES_XPATH + SCALING_XPATH + "/y" + z_fus_scaling_xpath = FUSELAGES_XPATH + SCALING_XPATH + "/z" + + # Get values + x = get_value(tixi, x_fus_scaling_xpath) + y = get_value(tixi, y_fus_scaling_xpath) + z = get_value(tixi, z_fus_scaling_xpath) + + # Log + log.info("Fuselage x scaling is : " + str(x)) + log.info("Fuselage y scaling is : " + str(y)) + log.info("Fuselage z scaling is : " + str(z)) + + # Close TIXI handle and save the CPACS file + tixi.save(str(cpacs_out_path)) + + return (x, y, z) + + +# ================================================================================================= +# MAIN +# ================================================================================================= + + +def main(cpacs_path, cpacs_out_path): + + log.info("----- Start of " + MODULE_NAME + " -----") + + check_cpacs_input_requirements(cpacs_path) + + # Define other inputs value + my_value1 = 6 + my_value2 = 5.5 + + # Call 'sum_function' + my_total = sum_funcion(my_value1, my_value2) + log.info("My total is equal to: " + str(my_total)) + + # Call a function which use CPACS inputs + x, y, z = get_fuselage_scaling(cpacs_path, cpacs_out_path) + log.info("Value x,y,z as been calculated") + log.info("x = " + str(x)) + log.info("y = " + str(y)) + log.info("z = " + str(z)) + + log.info("----- End of " + MODULE_NAME + " -----") + + +if __name__ == "__main__": + + cpacs_path = get_toolinput_file_path(MODULE_NAME) + cpacs_out_path = get_tooloutput_file_path(MODULE_NAME) + + main(cpacs_path, cpacs_out_path) diff --git a/ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml b/ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml new file mode 100644 index 000000000..b407294db --- /dev/null +++ b/ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml @@ -0,0 +1,576 @@ + + +
+ Cpacs2Test + Simple Wing for unit testing + Martin Siggel + 2012-10-09T15:12:47 + 0.2 + 3.0 + + + Converted to cpacs 3.0 using cpacs2to3 - does not include structure update + cpacs2to3 + 2018-01-15T09:22:57 + 0.2 + 3.0 + + + Add this update + Aidan + 2018-10-03T09:00:01 + 0.3 + 3.0 + + +
+ + + + Cpacs2Test + + 1 + 1 + + 0 + 0 + 0 + + + + + name + description + + + 1.0 + 0.5 + 0.5 + + + 0.0 + 0.0 + 0.0 + + + 0.0 + 0.0 + 0.0 + + + +
+ D150_Fuselage_1Section1 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0 + 0 + 0 + + + + + D150_Fuselage_1Section1 + fuselageCircleProfileuID + + + 1.0 + 1.0 + 1.0 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ D150_Fuselage_1Section2 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0.5 + 0 + 0 + + + + + D150_Fuselage_1Section2 + fuselageCircleProfileuID + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ D150_Fuselage_1Section3 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0 + 0 + 0 + + + + + D150_Fuselage_1Section3 + fuselageCircleProfileuID + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ D150_Fuselage_1Section4 + + + 1.0 + 1.0 + 1.0 + + + 0.0 + 0.0 + 0.0 + + + 0 + 0 + 0 + + + + + D150_Fuselage_1Section4 + fuselageCircleProfileuID + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ + + D150_Fuselage_1Positioning1 + -0.5 + 90 + 0 + D150_Fuselage_1Section1ID + + + D150_Fuselage_1Positioning3 + 2 + 90 + 0 + D150_Fuselage_1Section1ID + D150_Fuselage_1Section2ID + + + D150_Fuselage_1Positioning3 + 2 + 90 + 0 + D150_Fuselage_1Section2ID + D150_Fuselage_1Section3ID + + + D150_Fuselage_1Positioning4 + 2 + 90 + 0 + D150_Fuselage_1Section3ID + D150_Fuselage_1Section4ID + + + + + D150_Fuselage_1Segment1 + D150_Fuselage_1Section1IDElement1 + D150_Fuselage_1Section2IDElement1 + + + D150_Fuselage_1Segment2 + D150_Fuselage_1Section2IDElement1 + D150_Fuselage_1Section3IDElement1 + + + D150_Fuselage_1Segment3 + D150_Fuselage_1Section3IDElement1 + D150_Fuselage_1Section4IDElement1 + + +
+
+ + + Wing + SimpleFuselage + This wing has been generated to test CATIA2CPACS. + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + +
+ Cpacs2Test - Wing Section 1 + Cpacs2Test - Wing Section 1 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + Cpacs2Test - Wing Section 1 Main Element + Cpacs2Test - Wing Section 1 Main Element + NACA0012 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Cpacs2Test - Wing Section 2 + Cpacs2Test - Wing Section 2 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + Cpacs2Test - Wing Section 2 Main Element + Cpacs2Test - Wing Section 2 Main Element + NACA0012 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Cpacs2Test - Wing Section 3 + Cpacs2Test - Wing Section 3 + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + Cpacs2Test - Wing Section 3 Main Element + Cpacs2Test - Wing Section 3 Main Element + NACA0012 + + + 0.5 + 0.5 + 0.5 + + + 0 + 0 + 0 + + + 0.5 + 0 + 0 + + + + +
+
+ + + Cpacs2Test - Wing Section 1 Positioning + Cpacs2Test - Wing Section 1 Positioning + 0 + 0 + 0 + Cpacs2Test_Wing_Sec1 + + + Cpacs2Test - Wing Section 2 Positioning + Cpacs2Test - Wing Section 2 Positioning + 1 + 0 + 0 + Cpacs2Test_Wing_Sec1 + Cpacs2Test_Wing_Sec2 + + + Cpacs2Test - Wing Section 3 Positioning + Cpacs2Test - Wing Section 3 Positioning + 1 + 0 + 0 + Cpacs2Test_Wing_Sec2 + Cpacs2Test_Wing_Sec3 + + + + + Fuselage Segment from Cpacs2Test - Wing Section 1 Main Element to Cpacs2Test - Wing Section 2 Main Element + Fuselage Segment from Cpacs2Test - Wing Section 1 Main Element to Cpacs2Test - Wing Section 2 Main Element + Cpacs2Test_Wing_Sec1_El1 + Cpacs2Test_Wing_Sec2_El1 + + + Fuselage Segment from Cpacs2Test - Wing Section 2 Main Element to Cpacs2Test - Wing Section 3 Main Element + Fuselage Segment from Cpacs2Test - Wing Section 2 Main Element to Cpacs2Test - Wing Section 3 Main Element + Cpacs2Test_Wing_Sec2_El1 + Cpacs2Test_Wing_Sec3_El1 + + + + + Wing_CS1 + Cpacs2Test_Wing_Sec1_El1 + Cpacs2Test_Wing_Sec3_El1 + + + + + MySkinMat + 0.0 + + + + + + + MyCellMat + 0.0 + + + + 0.8 + 0.8 + + + 1.0 + 1.0 + + + 0.0 + 0.0 + + + 0.5 + 0.5 + + + + + + + + MySkinMat + + + + + + +
+
+
+
+ + + + NACA0.00.00.12 + NACA 4 Series Profile + + 1.0;0.9875;0.975;0.9625;0.95;0.9375;0.925;0.9125;0.9;0.8875;0.875;0.8625;0.85;0.8375;0.825;0.8125;0.8;0.7875;0.775;0.7625;0.75;0.7375;0.725;0.7125;0.7;0.6875;0.675;0.6625;0.65;0.6375;0.625;0.6125;0.6;0.5875;0.575;0.5625;0.55;0.5375;0.525;0.5125;0.5;0.4875;0.475;0.4625;0.45;0.4375;0.425;0.4125;0.4;0.3875;0.375;0.3625;0.35;0.3375;0.325;0.3125;0.3;0.2875;0.275;0.2625;0.25;0.2375;0.225;0.2125;0.2;0.1875;0.175;0.1625;0.15;0.1375;0.125;0.1125;0.1;0.0875;0.075;0.0625;0.05;0.0375;0.025;0.0125;0.0;0.0125;0.025;0.0375;0.05;0.0625;0.075;0.0875;0.1;0.1125;0.125;0.1375;0.15;0.1625;0.175;0.1875;0.2;0.2125;0.225;0.2375;0.25;0.2625;0.275;0.2875;0.3;0.3125;0.325;0.3375;0.35;0.3625;0.375;0.3875;0.4;0.4125;0.425;0.4375;0.45;0.4625;0.475;0.4875;0.5;0.5125;0.525;0.5375;0.55;0.5625;0.575;0.5875;0.6;0.6125;0.625;0.6375;0.65;0.6625;0.675;0.6875;0.7;0.7125;0.725;0.7375;0.75;0.7625;0.775;0.7875;0.8;0.8125;0.825;0.8375;0.85;0.8625;0.875;0.8875;0.9;0.9125;0.925;0.9375;0.95;0.9625;0.975;0.9875;1.0 + 0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0 + -0.00126;-0.0030004180415;-0.00471438572941;-0.00640256842113;-0.00806559133343;-0.00970403933653;-0.0113184567357;-0.0129093470398;-0.0144771727147;-0.0160223549226;-0.0175452732434;-0.0190462653789;-0.0205256268372;-0.0219836105968;-0.0234204267471;-0.024836242105;-0.0262311798047;-0.0276053188583;-0.0289586936852;-0.0302912936071;-0.0316030623052;-0.0328938972373;-0.0341636490097;-0.0354121207001;-0.0366390671268;-0.0378441940595;-0.0390271573644;-0.0401875620783;-0.0413249614032;-0.042438855614;-0.043528690869;-0.0445938579126;-0.0456336906587;-0.04664746464;-0.0476343953088;-0.0485936361694;-0.0495242767241;-0.0504253402064;-0.0512957810767;-0.0521344822472;-0.0529402520006;-0.0537118205596;-0.0544478362583;-0.0551468612564;-0.0558073667285;-0.0564277274483;-0.0570062156697;-0.0575409941929;-0.0580301084765;-0.0584714776309;-0.0588628840933;-0.059201961739;-0.0594861821311;-0.0597128385384;-0.059879027262;-0.0599816256958;-0.060017266394;-0.059982306219;-0.05987278938;-0.0596844028137;-0.059412421875;-0.059051643633;-0.0585963041308;-0.0580399746271;-0.0573754299024;-0.0565944788455;-0.0556877432118;-0.054644363746;-0.0534516022043;-0.0520942903127;-0.0505540468987;-0.0488081315259;-0.0468277042382;-0.0445750655553;-0.0419990347204;-0.0390266537476;-0.0355468568262;-0.0313738751622;-0.0261471986426;-0.0189390266528;0.0;0.0189390266528;0.0261471986426;0.0313738751622;0.0355468568262;0.0390266537476;0.0419990347204;0.0445750655553;0.0468277042382;0.0488081315259;0.0505540468987;0.0520942903127;0.0534516022043;0.054644363746;0.0556877432118;0.0565944788455;0.0573754299024;0.0580399746271;0.0585963041308;0.059051643633;0.059412421875;0.0596844028137;0.05987278938;0.059982306219;0.060017266394;0.0599816256958;0.059879027262;0.0597128385384;0.0594861821311;0.059201961739;0.0588628840933;0.0584714776309;0.0580301084765;0.0575409941929;0.0570062156697;0.0564277274483;0.0558073667285;0.0551468612564;0.0544478362583;0.0537118205596;0.0529402520006;0.0521344822472;0.0512957810767;0.0504253402064;0.0495242767241;0.0485936361694;0.0476343953088;0.04664746464;0.0456336906587;0.0445938579126;0.043528690869;0.042438855614;0.0413249614032;0.0401875620783;0.0390271573644;0.0378441940595;0.0366390671268;0.0354121207001;0.0341636490097;0.0328938972373;0.0316030623052;0.0302912936071;0.0289586936852;0.0276053188583;0.0262311798047;0.024836242105;0.0234204267471;0.0219836105968;0.0205256268372;0.0190462653789;0.0175452732434;0.0160223549226;0.0144771727147;0.0129093470398;0.0113184567357;0.00970403933653;0.00806559133343;0.00640256842113;0.00471438572941;0.0030004180415;0.00126 + + + + + + Circle + Profile build up from set of Points on Circle where may Dimensions are 1..-1 + + 0.0;0.0;0.0;0.0;0.0 + 0.0;1.0;0.0;-1.0;0.0 + 1.0;0.0;-1.0;0.0;1.0 + + + + +
+ +
diff --git a/ceasiompy/EdgeRun/tests/ToolOutput/.keep b/ceasiompy/EdgeRun/tests/ToolOutput/.keep new file mode 100644 index 000000000..8d1c8b69c --- /dev/null +++ b/ceasiompy/EdgeRun/tests/ToolOutput/.keep @@ -0,0 +1 @@ + diff --git a/ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py b/ceasiompy/EdgeRun/tests/test_edgerun.py similarity index 81% rename from ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py rename to ceasiompy/EdgeRun/tests/test_edgerun.py index 44ce5c506..7901f68d5 100644 --- a/ceasiompy/EdgeRun/tests/tests_edgeconfig/test_edgerun.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun.py @@ -23,14 +23,15 @@ from pathlib import Path # Add the ceasiompy module to the PYTHONPATH -ceasiompy_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy') +ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") sys.path.append(str(ceasiompy_path)) # Now you can import and use the ceasiompy module -#import ceasiompy +# import ceasiompy from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp import os -#from ceasiompy.utils.create_ainpfile import CreateAinp + +# from ceasiompy.utils.create_ainpfile import CreateAinp MODULE_DIR = Path(__file__).parent @@ -38,14 +39,17 @@ # CLASSES # ================================================================================================= + class TestEdgeConfig(unittest.TestCase): """Test class for 'ceasiompy/EdgeRun/func/edgerun.py'""" def test_generate_edge_cfd_ainp(self): """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - cpacs_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') - cpacs_out_path = MODULE_DIR / 'ToolOutput' - wkdir = MODULE_DIR / 'ToolOutput' + cpacs_path = Path( + "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" + ) + cpacs_out_path = MODULE_DIR / "ToolOutput" + wkdir = MODULE_DIR / "ToolOutput" if not os.path.exists(wkdir): os.makedirs(wkdir) @@ -58,7 +62,6 @@ def test_generate_edge_cfd_ainp(self): # ================================================================================================= if __name__ == "__main__": - print("Test configfile.py") print("To run test use the following command:") print(">> pytest -v") diff --git "a/src/streamlit/pages/02_\342\232\231\357\270\217_Settings.py" "b/src/streamlit/pages/02_\342\232\231\357\270\217_Settings.py" index e9f74ed04..225482556 100644 --- "a/src/streamlit/pages/02_\342\232\231\357\270\217_Settings.py" +++ "b/src/streamlit/pages/02_\342\232\231\357\270\217_Settings.py" @@ -217,7 +217,6 @@ def section_edit_aeromap(): def mesh_file_upload(): st.markdown("#### Upload mesh file") - # Verifica se è stato caricato un file mesh uploaded_mesh = st.file_uploader( "Select a mesh file", key="00_mesh_upload", @@ -225,37 +224,28 @@ def mesh_file_upload(): ) if uploaded_mesh: - # Crea la cartella "mesh" se non esiste mesh_dir = os.path.join(st.session_state.workflow.working_dir, "mesh") os.makedirs(mesh_dir, exist_ok=True) - # Crea un nuovo percorso per il file .su2 nella cartella "mesh" mesh_new_path = os.path.join(mesh_dir, uploaded_mesh.name) print(f"mesh path: {mesh_new_path}") try: - # Scrivi il file nel percorso specificato with open(mesh_new_path, "wb") as f: f.write(uploaded_mesh.getbuffer()) - # Apri il file CPACS cpacs_path = st.session_state.workflow.cpacs_in print(f"cpacs_path: {cpacs_path}") tixi = open_tixi(cpacs_path) - # Definisci la variabile mesh_xpath in base alla tua struttura CPACS mesh_xpath = "/cpacs/toolspecific/CEASIOMpy/filesPath/su2Mesh" - # Verifica se il percorso esiste if not tixi.checkElement(mesh_xpath): - # Se il percorso non esiste, crealo create_branch(tixi, mesh_xpath) if st.button("Add this mesh"): - # Aggiorna il percorso del file SU2 mesh nel documento CPACS tixi.updateTextElement(mesh_xpath, str(mesh_new_path)) - # Salva il file CPACS save_cpacs_file() return mesh_new_path @@ -361,7 +351,6 @@ def add_module_tab(): ) elif name == "pathtype": - # Chiama la funzione mesh_file_upload() e ottieni il percorso del file mesh mesh_path = mesh_file_upload() with st.columns([1, 2])[0]: From 1e386b4c24ad4aa17dceabffc174b5962a89a11b Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 10 Jan 2024 21:14:16 +0100 Subject: [PATCH 08/80] modified: test_edgerun.py new file: test_edgerun_mpi.py --- ceasiompy/EdgeRun/ToolOutput/.keep | 1 - ceasiompy/EdgeRun/tests/ToolOutput/.keep | 1 - ceasiompy/EdgeRun/tests/test_edgerun.py | 7 ++- ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 70 +++++++++++++++++++++ 4 files changed, 74 insertions(+), 5 deletions(-) delete mode 100644 ceasiompy/EdgeRun/ToolOutput/.keep delete mode 100644 ceasiompy/EdgeRun/tests/ToolOutput/.keep create mode 100644 ceasiompy/EdgeRun/tests/test_edgerun_mpi.py diff --git a/ceasiompy/EdgeRun/ToolOutput/.keep b/ceasiompy/EdgeRun/ToolOutput/.keep deleted file mode 100644 index 8d1c8b69c..000000000 --- a/ceasiompy/EdgeRun/ToolOutput/.keep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ceasiompy/EdgeRun/tests/ToolOutput/.keep b/ceasiompy/EdgeRun/tests/ToolOutput/.keep deleted file mode 100644 index 8d1c8b69c..000000000 --- a/ceasiompy/EdgeRun/tests/ToolOutput/.keep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/ceasiompy/EdgeRun/tests/test_edgerun.py b/ceasiompy/EdgeRun/tests/test_edgerun.py index 7901f68d5..63d341229 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun.py @@ -48,8 +48,8 @@ def test_generate_edge_cfd_ainp(self): cpacs_path = Path( "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" ) - cpacs_out_path = MODULE_DIR / "ToolOutput" - wkdir = MODULE_DIR / "ToolOutput" + cpacs_out_path = MODULE_DIR / "ToolOutput.xml" + wkdir = MODULE_DIR / "Results/Edge" if not os.path.exists(wkdir): os.makedirs(wkdir) @@ -60,8 +60,9 @@ def test_generate_edge_cfd_ainp(self): # ================================================================================================= # MAIN # ================================================================================================= - +""" if __name__ == "__main__": print("Test configfile.py") print("To run test use the following command:") print(">> pytest -v") +""" \ No newline at end of file diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py new file mode 100644 index 000000000..a8d11e79e --- /dev/null +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -0,0 +1,70 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by Airinnova AB, Stockholm, Sweden + +Test functions of 'ceasiompy/EdgeRun/func/edgeconfig.py' + +Python version: >=3.8 + + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import unittest + +import sys +from pathlib import Path + +# Add the ceasiompy module to the PYTHONPATH +ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") +sys.path.append(str(ceasiompy_path)) + +# Now you can import and use the ceasiompy module +# import ceasiompy +from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp +import os +from ceasiompy.EdgeRun.edgerun import run_Edge_multi +from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH + +# from ceasiompy.utils.create_ainpfile import CreateAinp + +MODULE_DIR = Path(__file__).parent +nb_proc = 32 +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +class TestEdgeConfig(unittest.TestCase): + """Test class for 'ceasiompy/EdgeRun/func/edgerun.py'""" + + def test_generate_edge_cfd_ainp(self): + """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" + cpacs_path = Path( + "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" + ) + cpacs_out_path = MODULE_DIR / "ToolOutput.xml" + wkdir = MODULE_DIR / "Results/Edge" + + if not os.path.exists(wkdir): + os.makedirs(wkdir) + + run_Edge_multi(wkdir) + + +# ================================================================================================= +# MAIN +# ================================================================================================= +""" +if __name__ == "__main__": + print("Test configfile.py") + print("To run test use the following command:") + print(">> pytest -v") +""" \ No newline at end of file From 58610c377642e22a7c63e5754acbb5cb37a376e0 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 10 Jan 2024 21:15:11 +0100 Subject: [PATCH 09/80] new file: edgerun.py --- ceasiompy/EdgeRun/edgerun.py | 130 +++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) create mode 100644 ceasiompy/EdgeRun/edgerun.py diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py new file mode 100644 index 000000000..b32995216 --- /dev/null +++ b/ceasiompy/EdgeRun/edgerun.py @@ -0,0 +1,130 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland + +Module to run SU2 Calculation in CEASIOMpy + +Python version: >=3.8 + +| Author : Aidan Jungo +| Creation: 2018-11-06 + +TODO: + + * Create test functions + * complete input/output in __specs__ + * Check platform with-> sys.platform + * Move run_SU2_fsi to /SU2Run/func/su2fsi.py + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +from pathlib import Path + +from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp +from ceasiompy.utils.ceasiomlogger import get_logger +from ceasiompy.utils.ceasiompyutils import ( + get_reasonable_nb_cpu, + get_results_directory, + run_software, +) +#from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME +from ceasiompy.utils.commonnames import AINP_CFD_NAME +from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH +from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path +from cpacspy.cpacsfunctions import get_value_or_default, open_tixi + +log = get_logger() + +MODULE_DIR = Path(__file__).parent +MODULE_NAME = MODULE_DIR.name + +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +# ================================================================================================= +# FUNCTIONS +# ================================================================================================= + + +def run_Edge_multi(wkdir, nb_proc=2): + """Function to run a multiple Edge calculation. + + Function 'run_Edge_multi' will run in the given working directory Edge calculations. The working + directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module. + + Args: + wkdir (Path): Path to the working directory + nb_proc (int): Number of processor that should be used to run the calculation in parallel + """ + + if not wkdir.exists(): + raise OSError(f"The working directory : {wkdir} does not exit!") + + case_dir_list = [dir for dir in wkdir.iterdir() if "Case" in dir.name] + if not case_dir_list: + raise OSError(f"No Case directory has been found in the working directory: {wkdir}") + + for config_dir in sorted(case_dir_list): + + config_cfd = [c for c in config_dir.iterdir() if c.name == AINP_CFD_NAME] + + if not config_cfd: + raise ValueError(f"No '{AINP_CFD_NAME}' file has been found in this directory!") + + if len(config_cfd) > 1: + raise ValueError(f"More than one '{AINP_CFD_NAME}' file in this directory!") + + run_software( + software_name="edge_mpi_run", + arguments=[config_cfd[0], str(nb_proc)], + wkdir=config_dir, + with_mpi=False, +# nb_proc + ) + + + #forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME) + #if not forces_breakdown_file.exists(): + # raise ValueError( + # "The SU2_CFD calculation has not ended correctly," + # f"{SU2_FORCES_BREAKDOWN_NAME} is missing!" + # ) + + +# ================================================================================================= +# MAIN +# ================================================================================================= + + +def main(cpacs_path, cpacs_out_path): + + log.info("----- Start of " + MODULE_NAME + " -----") + + tixi = open_tixi(cpacs_path) + nb_proc = get_value_or_default(tixi, Edge_NB_CPU_XPATH, get_reasonable_nb_cpu()) + + results_dir = get_results_directory("EdgeRun") + + # Temporary CPACS to be stored after "generate_edge_cfd_ainp" + cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") + + generate_edge_cfd_ainp(cpacs_path, cpacs_tmp_cfg, results_dir) + run_Edge_multi(results_dir, nb_proc) + #get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) + + log.info("----- End of " + MODULE_NAME + " -----") + + +if __name__ == "__main__": + + cpacs_path = get_toolinput_file_path(MODULE_NAME) + cpacs_out_path = get_tooloutput_file_path(MODULE_NAME) + + main(cpacs_path, cpacs_out_path) From 593f98928c74fcc4f40ae2bacf420ba42188f430 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Thu, 11 Jan 2024 09:20:07 +0100 Subject: [PATCH 10/80] new file: edgeutils.py --- ceasiompy/EdgeRun/func/edgeutils.py | 107 ++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 ceasiompy/EdgeRun/func/edgeutils.py diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py new file mode 100644 index 000000000..5a0c950f8 --- /dev/null +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -0,0 +1,107 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed for Airinnova AB, Stockholm, Sweden + +Functions to manipulate Edge input file and results (TO-DO) + +Python version: >=3.8 + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 + +TODO: + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import re +from pathlib import Path + +import requests +from ceasiompy.utils.ceasiomlogger import get_logger +from ceasiompy.utils.ceasiompyutils import get_install_path +from ceasiompy.utils.commonnames import ( + ACTUATOR_DISK_INLET_SUFFIX, + ACTUATOR_DISK_OUTLET_SUFFIX, + ENGINE_EXHAUST_SUFFIX, + ENGINE_INTAKE_SUFFIX, +) +from ceasiompy.utils.moduleinterfaces import get_module_path + +log = get_logger() + + +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +# ================================================================================================= +# FUNCTIONS +# ================================================================================================= + +def get_edge_ainp_template(): + """Return path of the M-Edge ainp template corresponding to the M-Edge version.""" + +# su2_version = get_su2_version() + edge_dir = get_module_path("EdgeRun") + edge_ainp_template_path = Path(edge_dir, "files", f"default.ainp.tmp") + if not edge_ainp_template_path.is_file(): + raise FileNotFoundError( + f"The M-Edge ainp template '{edge_ainp_template_path}' has not been found!" + ) + return edge_ainp_template_path + +"""""" +def get_su2_aerocoefs(force_file): + """Get aerodynamic coefficients and velocity from SU2 forces file (forces_breakdown.dat) + + Args: + force_file (Path): Path to the SU2 forces file + + Returns: + cl, cd, cs, cmd, cms, cml, velocity: Aerodynamic coefficients and velocity + """ + + if not force_file.is_file(): + raise FileNotFoundError(f"The SU2 forces file '{force_file}' has not been found!") + + cl, cd, cs, cmd, cms, cml, velocity = None, None, None, None, None, None, None + + with open(force_file) as f: + for line in f.readlines(): + if "Total CL:" in line: + cl = float(line.split(":")[1].split("|")[0]) + if "Total CD:" in line: + cd = float(line.split(":")[1].split("|")[0]) + if "Total CSF:" in line: + cs = float(line.split(":")[1].split("|")[0]) + # TODO: Check which axis name correspond to that: cml, cmd, cms + if "Total CMx:" in line: + cmd = float(line.split(":")[1].split("|")[0]) + if "Total CMy:" in line: + cms = float(line.split(":")[1].split("|")[0]) + if "Total CMz:" in line: + cml = float(line.split(":")[1].split("|")[0]) + if "Free-stream velocity" in line and "m/s" in line: + velocity = float(line.split(" ")[7]) + + return cl, cd, cs, cmd, cms, cml, velocity +"""""" + + + + + + +# ================================================================================================= +# MAIN +# ================================================================================================= + +if __name__ == "__main__": + + print("Nothing to execute!") From cfef30152acb3622ddca84930fd9b50f7709cac4 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 11 Jan 2024 09:24:07 +0100 Subject: [PATCH 11/80] formatting --- ceasiompy/EdgeRun/edgerun.py | 23 ++++++++++------------- ceasiompy/EdgeRun/func/edgeconfig.py | 5 +++-- ceasiompy/EdgeRun/tests/test_edgerun.py | 6 +++--- 3 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index b32995216..33252efdc 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -32,7 +32,8 @@ get_results_directory, run_software, ) -#from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME + +# from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME from ceasiompy.utils.commonnames import AINP_CFD_NAME from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path @@ -56,8 +57,8 @@ def run_Edge_multi(wkdir, nb_proc=2): """Function to run a multiple Edge calculation. - Function 'run_Edge_multi' will run in the given working directory Edge calculations. The working - directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module. + Function 'run_Edge_multi' will run in the given working directory Edge calculations. + The working directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module. Args: wkdir (Path): Path to the working directory @@ -72,7 +73,6 @@ def run_Edge_multi(wkdir, nb_proc=2): raise OSError(f"No Case directory has been found in the working directory: {wkdir}") for config_dir in sorted(case_dir_list): - config_cfd = [c for c in config_dir.iterdir() if c.name == AINP_CFD_NAME] if not config_cfd: @@ -86,15 +86,14 @@ def run_Edge_multi(wkdir, nb_proc=2): arguments=[config_cfd[0], str(nb_proc)], wkdir=config_dir, with_mpi=False, -# nb_proc + # nb_proc ) - - #forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME) - #if not forces_breakdown_file.exists(): + # forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME) + # if not forces_breakdown_file.exists(): # raise ValueError( - # "The SU2_CFD calculation has not ended correctly," - # f"{SU2_FORCES_BREAKDOWN_NAME} is missing!" + # "The SU2_CFD calculation has not ended correctly," + # f"{SU2_FORCES_BREAKDOWN_NAME} is missing!" # ) @@ -104,7 +103,6 @@ def run_Edge_multi(wkdir, nb_proc=2): def main(cpacs_path, cpacs_out_path): - log.info("----- Start of " + MODULE_NAME + " -----") tixi = open_tixi(cpacs_path) @@ -117,13 +115,12 @@ def main(cpacs_path, cpacs_out_path): generate_edge_cfd_ainp(cpacs_path, cpacs_tmp_cfg, results_dir) run_Edge_multi(results_dir, nb_proc) - #get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) + # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) log.info("----- End of " + MODULE_NAME + " -----") if __name__ == "__main__": - cpacs_path = get_toolinput_file_path(MODULE_NAME) cpacs_out_path = get_tooloutput_file_path(MODULE_NAME) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 2e3421c63..ec387f437 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -35,6 +35,7 @@ # write_actuator_disk_data, # write_header, # ) + from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.commonnames import ( @@ -197,8 +198,8 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): speedofsound = Atm.speed_of_sound[0] airspeed = mach * speedofsound - aoa_rad = math.radians(aoa) - aos_rad = math.radians(aos) + # aoa_rad = math.radians(aoa) + # aos_rad = math.radians(aos) UFREE = airspeed * math.cos(aos) * math.cos(aoa) WFREE = airspeed * math.cos(aos) * math.sin(aoa) diff --git a/ceasiompy/EdgeRun/tests/test_edgerun.py b/ceasiompy/EdgeRun/tests/test_edgerun.py index 63d341229..88ae0d217 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun.py @@ -23,8 +23,8 @@ from pathlib import Path # Add the ceasiompy module to the PYTHONPATH -ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") -sys.path.append(str(ceasiompy_path)) +# ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") +# sys.path.append(str(ceasiompy_path)) # Now you can import and use the ceasiompy module # import ceasiompy @@ -65,4 +65,4 @@ def test_generate_edge_cfd_ainp(self): print("Test configfile.py") print("To run test use the following command:") print(">> pytest -v") -""" \ No newline at end of file +""" From d1ff01ba4b78d0f69d5f0f56ba3d0a3bfae89e2f Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 11 Jan 2024 10:10:27 +0100 Subject: [PATCH 12/80] PATH modification --- ceasiompy/EdgeRun/func/edgeconfig.py | 14 +- ceasiompy/EdgeRun/func/edgeutils.py | 11 +- .../tests/ToolInput/simpletest_cpacs.xml | 576 ------------------ ceasiompy/EdgeRun/tests/test_edgerun.py | 6 +- ceasiompy/utils/commonxpath.py | 18 +- 5 files changed, 21 insertions(+), 604 deletions(-) delete mode 100644 ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index ec387f437..17673ca2e 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -45,13 +45,13 @@ GMSH_SYMMETRY_XPATH, PROP_XPATH, RANGE_XPATH, - EdgeMESH_XPATH, - Edge_AEROMAP_UID_XPATH, - Edge_CFL_NB_XPATH, - Edge_MAX_ITER_XPATH, - Edge_MG_LEVEL_XPATH, - Edge_NB_CPU_XPATH, - Edge_FIXED_CL_XPATH, + EDGE_MESH_XPATH, + EDGE_AEROMAP_UID_XPATH, + EDGE_CFL_NB_XPATH, + EDGE_MAX_ITER_XPATH, + EDGE_MG_LEVEL_XPATH, + EDGE_NB_CPU_XPATH, + EDGE_FIXED_CL_XPATH, ) # from ceasiompy.utils.configfiles import ConfigFile diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py index 5a0c950f8..fc9d46896 100644 --- a/ceasiompy/EdgeRun/func/edgeutils.py +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -44,10 +44,11 @@ # FUNCTIONS # ================================================================================================= + def get_edge_ainp_template(): """Return path of the M-Edge ainp template corresponding to the M-Edge version.""" -# su2_version = get_su2_version() + # su2_version = get_su2_version() edge_dir = get_module_path("EdgeRun") edge_ainp_template_path = Path(edge_dir, "files", f"default.ainp.tmp") if not edge_ainp_template_path.is_file(): @@ -56,7 +57,7 @@ def get_edge_ainp_template(): ) return edge_ainp_template_path -"""""" + def get_su2_aerocoefs(force_file): """Get aerodynamic coefficients and velocity from SU2 forces file (forces_breakdown.dat) @@ -91,11 +92,6 @@ def get_su2_aerocoefs(force_file): velocity = float(line.split(" ")[7]) return cl, cd, cs, cmd, cms, cml, velocity -"""""" - - - - # ================================================================================================= @@ -103,5 +99,4 @@ def get_su2_aerocoefs(force_file): # ================================================================================================= if __name__ == "__main__": - print("Nothing to execute!") diff --git a/ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml b/ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml deleted file mode 100644 index b407294db..000000000 --- a/ceasiompy/EdgeRun/tests/ToolInput/simpletest_cpacs.xml +++ /dev/null @@ -1,576 +0,0 @@ - - -
- Cpacs2Test - Simple Wing for unit testing - Martin Siggel - 2012-10-09T15:12:47 - 0.2 - 3.0 - - - Converted to cpacs 3.0 using cpacs2to3 - does not include structure update - cpacs2to3 - 2018-01-15T09:22:57 - 0.2 - 3.0 - - - Add this update - Aidan - 2018-10-03T09:00:01 - 0.3 - 3.0 - - -
- - - - Cpacs2Test - - 1 - 1 - - 0 - 0 - 0 - - - - - name - description - - - 1.0 - 0.5 - 0.5 - - - 0.0 - 0.0 - 0.0 - - - 0.0 - 0.0 - 0.0 - - - -
- D150_Fuselage_1Section1 - - - 1.0 - 1.0 - 1.0 - - - 0.0 - 0.0 - 0.0 - - - 0 - 0 - 0 - - - - - D150_Fuselage_1Section1 - fuselageCircleProfileuID - - - 1.0 - 1.0 - 1.0 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - -
-
- D150_Fuselage_1Section2 - - - 1.0 - 1.0 - 1.0 - - - 0.0 - 0.0 - 0.0 - - - 0.5 - 0 - 0 - - - - - D150_Fuselage_1Section2 - fuselageCircleProfileuID - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - -
-
- D150_Fuselage_1Section3 - - - 1.0 - 1.0 - 1.0 - - - 0.0 - 0.0 - 0.0 - - - 0 - 0 - 0 - - - - - D150_Fuselage_1Section3 - fuselageCircleProfileuID - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - -
-
- D150_Fuselage_1Section4 - - - 1.0 - 1.0 - 1.0 - - - 0.0 - 0.0 - 0.0 - - - 0 - 0 - 0 - - - - - D150_Fuselage_1Section4 - fuselageCircleProfileuID - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - -
-
- - - D150_Fuselage_1Positioning1 - -0.5 - 90 - 0 - D150_Fuselage_1Section1ID - - - D150_Fuselage_1Positioning3 - 2 - 90 - 0 - D150_Fuselage_1Section1ID - D150_Fuselage_1Section2ID - - - D150_Fuselage_1Positioning3 - 2 - 90 - 0 - D150_Fuselage_1Section2ID - D150_Fuselage_1Section3ID - - - D150_Fuselage_1Positioning4 - 2 - 90 - 0 - D150_Fuselage_1Section3ID - D150_Fuselage_1Section4ID - - - - - D150_Fuselage_1Segment1 - D150_Fuselage_1Section1IDElement1 - D150_Fuselage_1Section2IDElement1 - - - D150_Fuselage_1Segment2 - D150_Fuselage_1Section2IDElement1 - D150_Fuselage_1Section3IDElement1 - - - D150_Fuselage_1Segment3 - D150_Fuselage_1Section3IDElement1 - D150_Fuselage_1Section4IDElement1 - - -
-
- - - Wing - SimpleFuselage - This wing has been generated to test CATIA2CPACS. - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - -
- Cpacs2Test - Wing Section 1 - Cpacs2Test - Wing Section 1 - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - Cpacs2Test - Wing Section 1 Main Element - Cpacs2Test - Wing Section 1 Main Element - NACA0012 - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - -
-
- Cpacs2Test - Wing Section 2 - Cpacs2Test - Wing Section 2 - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - Cpacs2Test - Wing Section 2 Main Element - Cpacs2Test - Wing Section 2 Main Element - NACA0012 - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - -
-
- Cpacs2Test - Wing Section 3 - Cpacs2Test - Wing Section 3 - - - 1 - 1 - 1 - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - Cpacs2Test - Wing Section 3 Main Element - Cpacs2Test - Wing Section 3 Main Element - NACA0012 - - - 0.5 - 0.5 - 0.5 - - - 0 - 0 - 0 - - - 0.5 - 0 - 0 - - - - -
-
- - - Cpacs2Test - Wing Section 1 Positioning - Cpacs2Test - Wing Section 1 Positioning - 0 - 0 - 0 - Cpacs2Test_Wing_Sec1 - - - Cpacs2Test - Wing Section 2 Positioning - Cpacs2Test - Wing Section 2 Positioning - 1 - 0 - 0 - Cpacs2Test_Wing_Sec1 - Cpacs2Test_Wing_Sec2 - - - Cpacs2Test - Wing Section 3 Positioning - Cpacs2Test - Wing Section 3 Positioning - 1 - 0 - 0 - Cpacs2Test_Wing_Sec2 - Cpacs2Test_Wing_Sec3 - - - - - Fuselage Segment from Cpacs2Test - Wing Section 1 Main Element to Cpacs2Test - Wing Section 2 Main Element - Fuselage Segment from Cpacs2Test - Wing Section 1 Main Element to Cpacs2Test - Wing Section 2 Main Element - Cpacs2Test_Wing_Sec1_El1 - Cpacs2Test_Wing_Sec2_El1 - - - Fuselage Segment from Cpacs2Test - Wing Section 2 Main Element to Cpacs2Test - Wing Section 3 Main Element - Fuselage Segment from Cpacs2Test - Wing Section 2 Main Element to Cpacs2Test - Wing Section 3 Main Element - Cpacs2Test_Wing_Sec2_El1 - Cpacs2Test_Wing_Sec3_El1 - - - - - Wing_CS1 - Cpacs2Test_Wing_Sec1_El1 - Cpacs2Test_Wing_Sec3_El1 - - - - - MySkinMat - 0.0 - - - - - - - MyCellMat - 0.0 - - - - 0.8 - 0.8 - - - 1.0 - 1.0 - - - 0.0 - 0.0 - - - 0.5 - 0.5 - - - - - - - - MySkinMat - - - - - - -
-
-
-
- - - - NACA0.00.00.12 - NACA 4 Series Profile - - 1.0;0.9875;0.975;0.9625;0.95;0.9375;0.925;0.9125;0.9;0.8875;0.875;0.8625;0.85;0.8375;0.825;0.8125;0.8;0.7875;0.775;0.7625;0.75;0.7375;0.725;0.7125;0.7;0.6875;0.675;0.6625;0.65;0.6375;0.625;0.6125;0.6;0.5875;0.575;0.5625;0.55;0.5375;0.525;0.5125;0.5;0.4875;0.475;0.4625;0.45;0.4375;0.425;0.4125;0.4;0.3875;0.375;0.3625;0.35;0.3375;0.325;0.3125;0.3;0.2875;0.275;0.2625;0.25;0.2375;0.225;0.2125;0.2;0.1875;0.175;0.1625;0.15;0.1375;0.125;0.1125;0.1;0.0875;0.075;0.0625;0.05;0.0375;0.025;0.0125;0.0;0.0125;0.025;0.0375;0.05;0.0625;0.075;0.0875;0.1;0.1125;0.125;0.1375;0.15;0.1625;0.175;0.1875;0.2;0.2125;0.225;0.2375;0.25;0.2625;0.275;0.2875;0.3;0.3125;0.325;0.3375;0.35;0.3625;0.375;0.3875;0.4;0.4125;0.425;0.4375;0.45;0.4625;0.475;0.4875;0.5;0.5125;0.525;0.5375;0.55;0.5625;0.575;0.5875;0.6;0.6125;0.625;0.6375;0.65;0.6625;0.675;0.6875;0.7;0.7125;0.725;0.7375;0.75;0.7625;0.775;0.7875;0.8;0.8125;0.825;0.8375;0.85;0.8625;0.875;0.8875;0.9;0.9125;0.925;0.9375;0.95;0.9625;0.975;0.9875;1.0 - 0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0;0.0 - -0.00126;-0.0030004180415;-0.00471438572941;-0.00640256842113;-0.00806559133343;-0.00970403933653;-0.0113184567357;-0.0129093470398;-0.0144771727147;-0.0160223549226;-0.0175452732434;-0.0190462653789;-0.0205256268372;-0.0219836105968;-0.0234204267471;-0.024836242105;-0.0262311798047;-0.0276053188583;-0.0289586936852;-0.0302912936071;-0.0316030623052;-0.0328938972373;-0.0341636490097;-0.0354121207001;-0.0366390671268;-0.0378441940595;-0.0390271573644;-0.0401875620783;-0.0413249614032;-0.042438855614;-0.043528690869;-0.0445938579126;-0.0456336906587;-0.04664746464;-0.0476343953088;-0.0485936361694;-0.0495242767241;-0.0504253402064;-0.0512957810767;-0.0521344822472;-0.0529402520006;-0.0537118205596;-0.0544478362583;-0.0551468612564;-0.0558073667285;-0.0564277274483;-0.0570062156697;-0.0575409941929;-0.0580301084765;-0.0584714776309;-0.0588628840933;-0.059201961739;-0.0594861821311;-0.0597128385384;-0.059879027262;-0.0599816256958;-0.060017266394;-0.059982306219;-0.05987278938;-0.0596844028137;-0.059412421875;-0.059051643633;-0.0585963041308;-0.0580399746271;-0.0573754299024;-0.0565944788455;-0.0556877432118;-0.054644363746;-0.0534516022043;-0.0520942903127;-0.0505540468987;-0.0488081315259;-0.0468277042382;-0.0445750655553;-0.0419990347204;-0.0390266537476;-0.0355468568262;-0.0313738751622;-0.0261471986426;-0.0189390266528;0.0;0.0189390266528;0.0261471986426;0.0313738751622;0.0355468568262;0.0390266537476;0.0419990347204;0.0445750655553;0.0468277042382;0.0488081315259;0.0505540468987;0.0520942903127;0.0534516022043;0.054644363746;0.0556877432118;0.0565944788455;0.0573754299024;0.0580399746271;0.0585963041308;0.059051643633;0.059412421875;0.0596844028137;0.05987278938;0.059982306219;0.060017266394;0.0599816256958;0.059879027262;0.0597128385384;0.0594861821311;0.059201961739;0.0588628840933;0.0584714776309;0.0580301084765;0.0575409941929;0.0570062156697;0.0564277274483;0.0558073667285;0.0551468612564;0.0544478362583;0.0537118205596;0.0529402520006;0.0521344822472;0.0512957810767;0.0504253402064;0.0495242767241;0.0485936361694;0.0476343953088;0.04664746464;0.0456336906587;0.0445938579126;0.043528690869;0.042438855614;0.0413249614032;0.0401875620783;0.0390271573644;0.0378441940595;0.0366390671268;0.0354121207001;0.0341636490097;0.0328938972373;0.0316030623052;0.0302912936071;0.0289586936852;0.0276053188583;0.0262311798047;0.024836242105;0.0234204267471;0.0219836105968;0.0205256268372;0.0190462653789;0.0175452732434;0.0160223549226;0.0144771727147;0.0129093470398;0.0113184567357;0.00970403933653;0.00806559133343;0.00640256842113;0.00471438572941;0.0030004180415;0.00126 - - - - - - Circle - Profile build up from set of Points on Circle where may Dimensions are 1..-1 - - 0.0;0.0;0.0;0.0;0.0 - 0.0;1.0;0.0;-1.0;0.0 - 1.0;0.0;-1.0;0.0;1.0 - - - - -
- -
diff --git a/ceasiompy/EdgeRun/tests/test_edgerun.py b/ceasiompy/EdgeRun/tests/test_edgerun.py index 88ae0d217..52c23f457 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun.py @@ -45,16 +45,14 @@ class TestEdgeConfig(unittest.TestCase): def test_generate_edge_cfd_ainp(self): """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - cpacs_path = Path( - "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" - ) + cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" if not os.path.exists(wkdir): os.makedirs(wkdir) - generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir) + generate_edge_cfd_ainp(cpacs_in_path, cpacs_out_path, wkdir) # ================================================================================================= diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 7b29eadbc..1e0fe9cbd 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -78,7 +78,7 @@ OPTWKDIR_XPATH = CEASIOMPY_XPATH + "/filesPath/optimPath" SMFILE_XPATH = CEASIOMPY_XPATH + "/filesPath/SMpath" SU2MESH_XPATH = CEASIOMPY_XPATH + "/filesPath/su2Mesh" -EdgeMESH_XPATH = CEASIOMPY_XPATH + "/filesPath/edgeMesh" +EDGE_MESH_XPATH = CEASIOMPY_XPATH + "/filesPath/edgeMesh" SUMOFILE_XPATH = CEASIOMPY_XPATH + "/filesPath/sumoFilePath" WKDIR_XPATH = CEASIOMPY_XPATH + "/filesPath/wkdirPath" @@ -143,14 +143,14 @@ SU2_ACTUATOR_DISK_XPATH = SU2_XPATH + "/options/includeActuatorDisk" -# m-Edge -Edge_XPATH = CEASIOMPY_XPATH + "/aerodynamics/m-edge" -Edge_AEROMAP_UID_XPATH = Edge_XPATH + "/aeroMapUID" -Edge_NB_CPU_XPATH = Edge_XPATH + "/settings/nbCPU" -Edge_MAX_ITER_XPATH = Edge_XPATH + "/settings/maxIter" -Edge_CFL_NB_XPATH = Edge_XPATH + "/settings/cflNumber/value" -Edge_MG_LEVEL_XPATH = Edge_XPATH + "/settings/multigridLevel" -Edge_FIXED_CL_XPATH = Edge_XPATH + "/fixedCL" +# EDGE +EDGE_XPATH = CEASIOMPY_XPATH + "/aerodynamics/m-edge" +EDGE_AEROMAP_UID_XPATH = EDGE_XPATH + "/aeroMapUID" +EDGE_NB_CPU_XPATH = EDGE_XPATH + "/settings/nbCPU" +EDGE_MAX_ITER_XPATH = EDGE_XPATH + "/settings/maxIter" +EDGE_CFL_NB_XPATH = EDGE_XPATH + "/settings/cflNumber/value" +EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" +EDGE_FIXED_CL_XPATH = EDGE_XPATH + "/fixedCL" # RANGE RANGE_LD_RATIO_XPATH = CEASIOMPY_XPATH + "/ranges/lDRatio" From 73c9bed98e4439ae54d8d7d9c4d9e63284256cbe Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 11 Jan 2024 10:27:10 +0100 Subject: [PATCH 13/80] formatting --- ceasiompy/EdgeRun/func/edgeconfig.py | 18 +++--- ceasiompy/EdgeRun/func/edgeutils.py | 2 +- ceasiompy/utils/create_ainpfile.py | 88 +++++++++++++++++----------- 3 files changed, 65 insertions(+), 43 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 17673ca2e..3e78a7819 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -12,7 +12,7 @@ TODO: - * + * """ @@ -100,12 +100,12 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): cpacs = CPACS(cpacs_path) - edge_mesh = Path(get_value(cpacs.tixi, EdgeMESH_XPATH)) + edge_mesh = Path(get_value(cpacs.tixi, EDGE_MESH_XPATH)) if not edge_mesh.is_file(): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") # Get the fixedCL value from CPACS - fixed_cl = get_value_or_default(cpacs.tixi, Edge_FIXED_CL_XPATH, "NO") + fixed_cl = get_value_or_default(cpacs.tixi, EDGE_FIXED_CL_XPATH, "NO") if fixed_cl == "NO": # Get the first aeroMap as default one or create automatically one aeromap_list = cpacs.get_aeromap_uid_list() @@ -114,7 +114,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): aeromap_default = aeromap_list[0] log.info(f"The aeromap is {aeromap_default}") - aeromap_uid = get_value_or_default(cpacs.tixi, Edge_AEROMAP_UID_XPATH, aeromap_default) + aeromap_uid = get_value_or_default(cpacs.tixi, EDGE_AEROMAP_UID_XPATH, aeromap_default) activate_aeromap = cpacs.get_aeromap_by_uid(aeromap_uid) alt_list = activate_aeromap.get("altitude").tolist() @@ -138,7 +138,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): aos_list = [0.0] aeromap_uid = get_value_or_default( - cpacs.tixi, Edge_AEROMAP_UID_XPATH, "DefaultAeromap" + cpacs.tixi, EDGE_AEROMAP_UID_XPATH, "DefaultAeromap" ) log.info(f"{aeromap_uid} has been created") @@ -176,10 +176,10 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): # Settings - ITMAX = int(get_value_or_default(cpacs.tixi, Edge_MAX_ITER_XPATH, 200)) - CFL = get_value_or_default(cpacs.tixi, Edge_CFL_NB_XPATH, 1.5) - NGRID = int(get_value_or_default(cpacs.tixi, Edge_MG_LEVEL_XPATH, 3)) - NPART = int(get_value_or_default(cpacs.tixi, Edge_NB_CPU_XPATH, 32)) + ITMAX = int(get_value_or_default(cpacs.tixi, EDGE_MAX_ITER_XPATH, 200)) + CFL = get_value_or_default(cpacs.tixi, EDGE_CFL_NB_XPATH, 1.5) + NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) + NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 32)) INSEUL = 0 # Parameters which will vary for the different cases (alt,mach,aoa,aos) diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py index fc9d46896..cf65a51c3 100644 --- a/ceasiompy/EdgeRun/func/edgeutils.py +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -50,7 +50,7 @@ def get_edge_ainp_template(): # su2_version = get_su2_version() edge_dir = get_module_path("EdgeRun") - edge_ainp_template_path = Path(edge_dir, "files", f"default.ainp.tmp") + edge_ainp_template_path = Path(edge_dir, "files", "default.ainp.tmp") if not edge_ainp_template_path.is_file(): raise FileNotFoundError( f"The M-Edge ainp template '{edge_ainp_template_path}' has not been found!" diff --git a/ceasiompy/utils/create_ainpfile.py b/ceasiompy/utils/create_ainpfile.py index 1d26a8df6..5f6900295 100644 --- a/ceasiompy/utils/create_ainpfile.py +++ b/ceasiompy/utils/create_ainpfile.py @@ -32,45 +32,67 @@ class CreateAinp: def __init__(self): self.template_file = get_edge_ainp_template() - - def _write_file(self,content,output_file_path): - #output_file_path = os.path.join(output_folder, 'Edge.ainp') - with open(output_file_path,'w') as f: - f.write(content) + def _write_file(self, content, output_file_path): + # output_file_path = os.path.join(output_folder, 'Edge.ainp') + with open(output_file_path, "w") as f: + f.write(content) - def create_ainp(self,UFREE, VFREE, WFREE, TFREE, PFREE, SREF, CREF, BREF, IXMP, IDCLP, IDCDP, IDCCP, IDCMP, IDCNP, IDCRP, NPART, ITMAX, INSEUL, NGRID, CFL,output_folder): - #template_file_path = get_edge_ainp_template() - with open(self.template_file,'r') as f: + def create_ainp( + self, + UFREE, + VFREE, + WFREE, + TFREE, + PFREE, + SREF, + CREF, + BREF, + IXMP, + IDCLP, + IDCDP, + IDCCP, + IDCMP, + IDCNP, + IDCRP, + NPART, + ITMAX, + INSEUL, + NGRID, + CFL, + output_folder, + ): + # template_file_path = get_edge_ainp_template() + with open(self.template_file, "r") as f: template_content = f.read() - - # Define a dictionary for keyword-value pairs + + # Define a dictionary for keyword-value pairs replacements = { - '__UFREE__': str(UFREE), - '__VFREE__': str(VFREE), - '__WFREE__': str(WFREE), - '__TFREE__': str(TFREE), - '__PFREE__': str(PFREE), - '__SREF__': str(SREF), - '__CREF__': str(CREF), - '__BREF__': str(BREF), - '__IXMP__': f"{IXMP[0]} {IXMP[1]} {IXMP[2]}", - '__IDCLP__': IDCLP, - '__IDCDP__': IDCDP, - '__IDCCP__': IDCCP, - '__IDCMP__': IDCMP, - '__IDCNP__': IDCNP, - '__IDCRP__': IDCRP, - '__NPART__': str(NPART), - '__ITMAX__': str(ITMAX), - '__INSEUL__': str(INSEUL), - '__NGRID__': str(NGRID), - '__CFL__': str(CFL) + "__UFREE__": str(UFREE), + "__VFREE__": str(VFREE), + "__WFREE__": str(WFREE), + "__TFREE__": str(TFREE), + "__PFREE__": str(PFREE), + "__SREF__": str(SREF), + "__CREF__": str(CREF), + "__BREF__": str(BREF), + "__IXMP__": f"{IXMP[0]} {IXMP[1]} {IXMP[2]}", + "__IDCLP__": IDCLP, + "__IDCDP__": IDCDP, + "__IDCCP__": IDCCP, + "__IDCMP__": IDCMP, + "__IDCNP__": IDCNP, + "__IDCRP__": IDCRP, + "__NPART__": str(NPART), + "__ITMAX__": str(ITMAX), + "__INSEUL__": str(INSEUL), + "__NGRID__": str(NGRID), + "__CFL__": str(CFL), } - - # Use regular expression to replace keywords with their corresponding values + + # Use regular expression to replace keywords with their corresponding values edge_content = template_content for keyword, value in replacements.items(): edge_content = re.sub(re.escape(keyword), value, edge_content) - + self._write_file(edge_content, output_folder) From 7bfd49aec017ba94911c989b2c8bc274ee0c5f65 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 11 Jan 2024 10:30:28 +0100 Subject: [PATCH 14/80] formatting --- ceasiompy/EdgeRun/edgerun.py | 2 +- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 10 ++++------ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 33252efdc..316a15e85 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -28,7 +28,7 @@ from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.ceasiompyutils import ( - get_reasonable_nb_cpu, + get_reasonable_nb_cpu,xed_cl_aeromap = cpacs.create_aeromap("aeroMap_fixedCL_SU2") get_results_directory, run_software, ) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 3e78a7819..2708a7f10 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -146,7 +146,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): log.info("Configuration file for fixed CL calculation will be created.") fixed_cl_aeromap = cpacs.create_aeromap("aeroMap_fixedCL_SU2") - fixed_cl_aeromap.description = f"AeroMap created for SU2 fixed CL value of {target_cl}" + # fixed_cl_aeromap.description = f"AeroMap created for SU2 fixed CL value of {target_cl}" mach = get_value_or_default(cpacs.tixi, RANGE_XPATH + "/cruiseMach", 0.78) alt = get_value_or_default(cpacs.tixi, RANGE_XPATH + "/cruiseAltitude", 12000) diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py index a8d11e79e..457cde5ed 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -23,8 +23,8 @@ from pathlib import Path # Add the ceasiompy module to the PYTHONPATH -ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") -sys.path.append(str(ceasiompy_path)) +# ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") +# sys.path.append(str(ceasiompy_path)) # Now you can import and use the ceasiompy module # import ceasiompy @@ -47,9 +47,7 @@ class TestEdgeConfig(unittest.TestCase): def test_generate_edge_cfd_ainp(self): """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - cpacs_path = Path( - "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" - ) + cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" @@ -67,4 +65,4 @@ def test_generate_edge_cfd_ainp(self): print("Test configfile.py") print("To run test use the following command:") print(">> pytest -v") -""" \ No newline at end of file +""" From 11ccb81e114b69bf4ab99efd08c252c4ab3ecd0f Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 11 Jan 2024 15:33:28 +0100 Subject: [PATCH 15/80] modification --- ceasiompy/EdgeRun/edgerun.py | 12 ++++++------ ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 316a15e85..0ceefcb4c 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -28,14 +28,14 @@ from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.ceasiompyutils import ( - get_reasonable_nb_cpu,xed_cl_aeromap = cpacs.create_aeromap("aeroMap_fixedCL_SU2") + get_reasonable_nb_cpu, get_results_directory, run_software, ) # from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME from ceasiompy.utils.commonnames import AINP_CFD_NAME -from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH +from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path from cpacspy.cpacsfunctions import get_value_or_default, open_tixi @@ -54,10 +54,10 @@ # ================================================================================================= -def run_Edge_multi(wkdir, nb_proc=2): +def run_edge_multi(wkdir, nb_proc=2): """Function to run a multiple Edge calculation. - Function 'run_Edge_multi' will run in the given working directory Edge calculations. + Function 'run_edge_multi' will run in the given working directory Edge calculations. The working directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module. Args: @@ -106,7 +106,7 @@ def main(cpacs_path, cpacs_out_path): log.info("----- Start of " + MODULE_NAME + " -----") tixi = open_tixi(cpacs_path) - nb_proc = get_value_or_default(tixi, Edge_NB_CPU_XPATH, get_reasonable_nb_cpu()) + nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) results_dir = get_results_directory("EdgeRun") @@ -114,7 +114,7 @@ def main(cpacs_path, cpacs_out_path): cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") generate_edge_cfd_ainp(cpacs_path, cpacs_tmp_cfg, results_dir) - run_Edge_multi(results_dir, nb_proc) + run_edge_multi(results_dir, nb_proc) # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) log.info("----- End of " + MODULE_NAME + " -----") diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py index 457cde5ed..62cc9d814 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -30,8 +30,8 @@ # import ceasiompy from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp import os -from ceasiompy.EdgeRun.edgerun import run_Edge_multi -from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH +from ceasiompy.EdgeRun.edgerun import run_edge_multi +from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH # from ceasiompy.utils.create_ainpfile import CreateAinp @@ -47,14 +47,14 @@ class TestEdgeConfig(unittest.TestCase): def test_generate_edge_cfd_ainp(self): """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") - cpacs_out_path = MODULE_DIR / "ToolOutput.xml" + # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") + # cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" if not os.path.exists(wkdir): os.makedirs(wkdir) - run_Edge_multi(wkdir) + run_edge_multi(wkdir) # ================================================================================================= From f34030663910295d0f33a11702fff2aa16cbd308 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Thu, 11 Jan 2024 18:40:12 +0100 Subject: [PATCH 16/80] modified: edgeutils.py added to get edge queuing script --- ceasiompy/EdgeRun/edgerun.py | 31 ++++++++++++++--------------- ceasiompy/EdgeRun/func/edgeutils.py | 11 ++++++++++ 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index b32995216..77b6f43ab 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -1,22 +1,14 @@ """ CEASIOMpy: Conceptual Aircraft Design Software -Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland +Developed for Airinnova AB, Stockholm, Sweden -Module to run SU2 Calculation in CEASIOMpy +Functions to manipulate Edge input file and results (TO-DO) Python version: >=3.8 -| Author : Aidan Jungo -| Creation: 2018-11-06 - -TODO: - - * Create test functions - * complete input/output in __specs__ - * Check platform with-> sys.platform - * Move run_SU2_fsi to /SU2Run/func/su2fsi.py - +| Author : Mengmeng Zhang +| Creation: 2024-01-05 """ # ================================================================================================= @@ -37,12 +29,16 @@ from ceasiompy.utils.commonxpath import Edge_NB_CPU_XPATH from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path from cpacspy.cpacsfunctions import get_value_or_default, open_tixi +from ceasiompy.EdgeRun.func.edge_queScript_gen import EdgeScripts +from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template log = get_logger() MODULE_DIR = Path(__file__).parent MODULE_NAME = MODULE_DIR.name + + # ================================================================================================= # CLASSES # ================================================================================================= @@ -51,7 +47,7 @@ # ================================================================================================= # FUNCTIONS # ================================================================================================= - +input_que_script_path = get_edge_queScript_template() def run_Edge_multi(wkdir, nb_proc=2): """Function to run a multiple Edge calculation. @@ -80,15 +76,18 @@ def run_Edge_multi(wkdir, nb_proc=2): if len(config_cfd) > 1: raise ValueError(f"More than one '{AINP_CFD_NAME}' file in this directory!") - + edge_scripts_instance = EdgeScripts(config_cfd[0], input_que_script_path, AINP_CFD_NAME) + edge_scripts_instance.submit_preprocessor_script() + #edge_scripts_instance.submit_solver_script(nb_proc) +""" run_software( software_name="edge_mpi_run", arguments=[config_cfd[0], str(nb_proc)], wkdir=config_dir, - with_mpi=False, + with_mpi=True, # nb_proc ) - +""" #forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME) #if not forces_breakdown_file.exists(): diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py index 5a0c950f8..3ee8f0c65 100644 --- a/ceasiompy/EdgeRun/func/edgeutils.py +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -56,6 +56,17 @@ def get_edge_ainp_template(): ) return edge_ainp_template_path +def get_edge_queScript_template(): + """Return path of the M-Edge ainp template corresponding to the M-Edge version.""" + + edge_dir = get_module_path("EdgeRun") + edge_queScript_template_path = Path(edge_dir, "files", f"queue_template.script") + if not edge_queScript_template_path.is_file(): + raise FileNotFoundError( + f"The M-Edge queueScript template '{edge_queScript_template_path}' has not been found!" + ) + return edge_queScript_template_path + """""" def get_su2_aerocoefs(force_file): """Get aerodynamic coefficients and velocity from SU2 forces file (forces_breakdown.dat) From 7ef00afa89acaf026c1f32b7f144d7945386cb5a Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Thu, 11 Jan 2024 19:14:49 +0100 Subject: [PATCH 17/80] modified: ../edgerun.py new file: queue_template.script modified: ../tests/test_edgerun.py modified: ../tests/test_edgerun_mpi.py --- ceasiompy/EdgeRun/edgerun.py | 34 +++---------------- ceasiompy/EdgeRun/files/queue_template.script | 15 ++++++++ ceasiompy/EdgeRun/tests/test_edgerun.py | 3 +- ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 15 ++++---- 4 files changed, 31 insertions(+), 36 deletions(-) create mode 100755 ceasiompy/EdgeRun/files/queue_template.script diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 046fbed38..5f1a8f681 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -22,7 +22,7 @@ from ceasiompy.utils.ceasiompyutils import ( get_reasonable_nb_cpu, get_results_directory, - run_software, +# run_software, ) # from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME @@ -50,7 +50,7 @@ # ================================================================================================= input_que_script_path = get_edge_queScript_template() -def run_edge_multi(wkdir, nb_proc=2): +def run_edge_multi(wkdir, input_que_script_path , nb_proc=2): """Function to run a multiple Edge calculation. Function 'run_edge_multi' will run in the given working directory Edge calculations. @@ -76,35 +76,11 @@ def run_edge_multi(wkdir, nb_proc=2): if len(config_cfd) > 1: raise ValueError(f"More than one '{AINP_CFD_NAME}' file in this directory!") - edge_scripts_instance = EdgeScripts(config_cfd[0], input_que_script_path, AINP_CFD_NAME) + + # run / submit edge commands + edge_scripts_instance = EdgeScripts(config_dir, input_que_script_path, AINP_CFD_NAME) edge_scripts_instance.submit_preprocessor_script() #edge_scripts_instance.submit_solver_script(nb_proc) -""" - run_software( - software_name="edge_mpi_run", - arguments=[config_cfd[0], str(nb_proc)], - wkdir=config_dir, -<<<<<<< HEAD - with_mpi=True, -# nb_proc - ) -""" - - #forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME) - #if not forces_breakdown_file.exists(): -======= - with_mpi=False, - # nb_proc - ) - - # forces_breakdown_file = Path(config_dir, SU2_FORCES_BREAKDOWN_NAME) - # if not forces_breakdown_file.exists(): ->>>>>>> 11ccb81e114b69bf4ab99efd08c252c4ab3ecd0f - # raise ValueError( - # "The SU2_CFD calculation has not ended correctly," - # f"{SU2_FORCES_BREAKDOWN_NAME} is missing!" - # ) - # ================================================================================================= # MAIN diff --git a/ceasiompy/EdgeRun/files/queue_template.script b/ceasiompy/EdgeRun/files/queue_template.script new file mode 100755 index 000000000..c61c2935b --- /dev/null +++ b/ceasiompy/EdgeRun/files/queue_template.script @@ -0,0 +1,15 @@ +#!/bin/sh +#SBATCH -t 1:0:0 +#SBATCH -n 1 +#SBATCH -p main +#SBATCH -A naiss2023-22-818 +#SBATCH -c 1 +#SBATCH -J jobname +# +# slurm file submitted to cluster +# -t - time limit for jobs +# -N - number of nodes (not cores, use -n for cores) +# -A - project name/number +# -C - specific node required +# -J - name of job for identification in queue +# diff --git a/ceasiompy/EdgeRun/tests/test_edgerun.py b/ceasiompy/EdgeRun/tests/test_edgerun.py index 52c23f457..4ff714be3 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun.py @@ -45,7 +45,8 @@ class TestEdgeConfig(unittest.TestCase): def test_generate_edge_cfd_ainp(self): """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") + # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") + cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py index 62cc9d814..27f02d719 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -32,10 +32,11 @@ import os from ceasiompy.EdgeRun.edgerun import run_edge_multi from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH - +from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template # from ceasiompy.utils.create_ainpfile import CreateAinp MODULE_DIR = Path(__file__).parent +input_que_script_path = get_edge_queScript_template() nb_proc = 32 # ================================================================================================= # CLASSES @@ -45,16 +46,18 @@ class TestEdgeConfig(unittest.TestCase): """Test class for 'ceasiompy/EdgeRun/func/edgerun.py'""" - def test_generate_edge_cfd_ainp(self): - """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") - # cpacs_out_path = MODULE_DIR / "ToolOutput.xml" + def test_run_edge_cfd(self): + # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") + cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') + cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" + if not os.path.exists(wkdir): os.makedirs(wkdir) - run_edge_multi(wkdir) + generate_edge_cfd_ainp(cpacs_in_path, cpacs_out_path, wkdir) + run_edge_multi(wkdir,input_que_script_path ) # ================================================================================================= From 2a9941bec7b61c9b7852c392cf73372302c03a19 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Fri, 12 Jan 2024 13:24:28 +0100 Subject: [PATCH 18/80] new file: edge_queScript_gen.py modified: edgeconfig.py modified: ../tests/test_edgerun_mpi.py new file: ../tests/test_edgerun_submit.py --- ceasiompy/EdgeRun/edgerun.py | 19 +++++- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 63 +++++++++++++++++++ ceasiompy/EdgeRun/func/edgeconfig.py | 12 +++- ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 2 +- .../EdgeRun/tests/test_edgerun_submit.py | 50 +++++++++++++++ 5 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 ceasiompy/EdgeRun/func/edge_queScript_gen.py create mode 100644 ceasiompy/EdgeRun/tests/test_edgerun_submit.py diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 5f1a8f681..1557748ba 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -62,13 +62,26 @@ def run_edge_multi(wkdir, input_que_script_path , nb_proc=2): """ if not wkdir.exists(): - raise OSError(f"The working directory : {wkdir} does not exit!") + raise OSError(f"The working directory : {wkdir} does not exist!") + + case_dir_name = ( + f"Case{str(case_nb).zfill(2)}_alt{alt}_mach{round(mach, 2)}" + f"_aoa{round(aoa, 1)}_aos{round(aos, 1)}" + ) + + case_dir_path = Path(wkdir, case_dir_name) + if not case_dir_path.exists(): + case_dir_path.mkdir() + output_path = Path(case_dir_path, AINP_CFD_NAME) case_dir_list = [dir for dir in wkdir.iterdir() if "Case" in dir.name] if not case_dir_list: raise OSError(f"No Case directory has been found in the working directory: {wkdir}") + for config_dir in sorted(case_dir_list): + current_dir = Path(case_dir_path, config_dir) + config_cfd = [c for c in config_dir.iterdir() if c.name == AINP_CFD_NAME] if not config_cfd: @@ -78,9 +91,9 @@ def run_edge_multi(wkdir, input_que_script_path , nb_proc=2): raise ValueError(f"More than one '{AINP_CFD_NAME}' file in this directory!") # run / submit edge commands - edge_scripts_instance = EdgeScripts(config_dir, input_que_script_path, AINP_CFD_NAME) + edge_scripts_instance = EdgeScripts(current_dir, input_que_script_path, AINP_CFD_NAME) edge_scripts_instance.submit_preprocessor_script() - #edge_scripts_instance.submit_solver_script(nb_proc) + edge_scripts_instance.submit_solver_script(nb_proc) # ================================================================================================= # MAIN diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py new file mode 100644 index 000000000..f9c7a36ba --- /dev/null +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -0,0 +1,63 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed for Airinnova AB, Stockholm, Sweden + +Functions to generate queuing script for Edge: queue_preprocessor.script and queue_edgesolver.script + +Python version: >=3.8 + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import os +from pathlib import Path + +from pathlib import Path + + + +class EdgeScripts: + def __init__(self, dir_path, jobname, input_que_script_path, edge_input_file): + self.jobname = jobname + self.dir_path = dir_path + self.input_que_script_path = input_que_script_path + self.Edge_dir = '/pdc/software/22.06/other/m-edge/3.2/gnu/bin/' + self.EdgeInputFile = edge_input_file + #self.GridDir = 'grid' + #os.chdir(os.path.join(caseDir, self.GridDir)) + + def submit_preprocessor_script(self,dir_path): + preprocessor = os.path.join(self.Edge_dir, 'preprocessor') + QueScript = f'queue_preprocessor.script' + Submitcommand = 'sbatch' + os.chdir(dir_path) + with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: + for line in template_file: + if '-J jobname' in line: + line = line.replace('-J jobname', f'-J {self.jobname}prepro') + que_script.write(line) + que_script.write(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + os.system(f'{Submitcommand} {que_script}') + + def submit_solver_script(self, dir_path, nb_proc): + run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') + QueScript = f'queue_edgesolver.script' + Submitcommand = 'sbatch' + os.chdir(dir_path) + with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: + for line in template_file: + if '-J jobname' in line: + line = line.replace('-J jobname', f'-J {self.jobname}solver') + que_script.write(line) + que_script.write(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') + os.system(f'{Submitcommand} {que_script}') + + + diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 2708a7f10..ca978b8fc 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -63,14 +63,15 @@ get_value_or_default, ) from cpacspy.cpacspy import CPACS - +from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template +from ceasiompy.EdgeRun.func.edge_queScript_gen import EdgeScripts # import cpacs log = get_logger() MODULE_DIR = Path(__file__).parent - +input_que_script_path = get_edge_queScript_template() # ================================================================================================= # CLASSES # ================================================================================================= @@ -271,7 +272,12 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): ) # cfg.write_file(config_output_path, overwrite=True) - + # create and submit the edge-run scripts + # run / submit edge commands + jobname = case_dir_name + edge_scripts_instance = EdgeScripts(jobname,case_dir_path, input_que_script_path, AINP_CFD_NAME) + edge_scripts_instance.submit_preprocessor_script(case_dir_path) + edge_scripts_instance.submit_solver_script(case_dir_path,NPART) cpacs.save_cpacs(cpacs_out_path, overwrite=True) # ================================================================================================= diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py index 27f02d719..5593e6a0e 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -57,7 +57,7 @@ def test_run_edge_cfd(self): os.makedirs(wkdir) generate_edge_cfd_ainp(cpacs_in_path, cpacs_out_path, wkdir) - run_edge_multi(wkdir,input_que_script_path ) + #run_edge_multi(wkdir,input_que_script_path ) # ================================================================================================= diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py new file mode 100644 index 000000000..a0f94b1dc --- /dev/null +++ b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py @@ -0,0 +1,50 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed by Airinnova AB, Stockholm, Sweden + +Test functions of 'ceasiompy/EdgeRun/func/edgeconfig.py' + +Python version: >=3.8 + + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 + +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import unittest + +import sys +from pathlib import Path + +# Add the ceasiompy module to the PYTHONPATH +# ceasiompy_path = Path("/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/ceasiompy") +# sys.path.append(str(ceasiompy_path)) + +# Now you can import and use the ceasiompy module +# import ceasiompy +from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp +import os +from ceasiompy.EdgeRun.edgerun import run_edge_multi +from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH +from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template +# from ceasiompy.utils.create_ainpfile import CreateAinp + +MODULE_DIR = Path(__file__).parent +input_que_script_path = get_edge_queScript_template() + + # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") +cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') +cpacs_out_path = MODULE_DIR / "ToolOutput.xml" +wkdir = MODULE_DIR / "Results/Edge" + + +if not os.path.exists(wkdir): + os.makedirs(wkdir) + +generate_edge_cfd_ainp(cpacs_in_path, cpacs_out_path, wkdir) From ccb6de83f4643d1516d5610d62ce4fa6e351ae39 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Fri, 12 Jan 2024 13:40:16 +0100 Subject: [PATCH 19/80] new file: labARstraight_toolInput.xml for testing --- WKDIR/labARstraight_toolInput.xml | 1003 +++++++++++++++++++++++++++++ 1 file changed, 1003 insertions(+) create mode 100644 WKDIR/labARstraight_toolInput.xml diff --git a/WKDIR/labARstraight_toolInput.xml b/WKDIR/labARstraight_toolInput.xml new file mode 100644 index 000000000..db4c94e60 --- /dev/null +++ b/WKDIR/labARstraight_toolInput.xml @@ -0,0 +1,1003 @@ + + +
+ labARstraight + Simple Wing for unit testing + Martin Siggel + 2012-10-09T15:12:47 + 0.2 + 3.0 + + + Converted to cpacs 3.0 using cpacs2to3 - does not include structure update + cpacs2to3 + 2018-01-15T09:22:57 + 0.2 + 3.0 + + + Add this update + Aidan + 2018-10-03T09:00:01 + 0.3 + 3.0 + + +
+ + + + labAv0 + + 0.027329 + 0.069737 + + 0.14126 + 0 + 0 + + + + + Body1 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + +
+ Body1Frame1 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.004572 + 0 + 0 + + + + + ... + fuseprof_1_1 + + + 1 + 0.0022547 + 0.0022547 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame2 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.054356 + 0 + 0 + + + + + ... + fuseprof_1_2 + + + 1 + 0.013229 + 0.013229 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame3 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.10414 + 0 + 0 + + + + + ... + fuseprof_1_3 + + + 1 + 0.019512 + 0.019512 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame4 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.15392 + 0 + 0 + + + + + ... + fuseprof_1_4 + + + 1 + 0.023339 + 0.023339 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame5 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.20371 + 0 + 0 + + + + + ... + fuseprof_1_5 + + + 1 + 0.025174 + 0.025174 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame6 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.25349 + 0 + 0 + + + + + ... + fuseprof_1_6 + + + 1 + 0.025174 + 0.025174 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame7 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.30328 + 0 + 0 + + + + + ... + fuseprof_1_7 + + + 1 + 0.023339 + 0.023339 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame8 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.35306 + 0 + 0 + + + + + ... + fuseprof_1_8 + + + 1 + 0.019512 + 0.019512 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame9 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.40284 + 0 + 0 + + + + + ... + fuseprof_1_9 + + + 1 + 0.013229 + 0.013229 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ Body1Frame10 + description + + + 1 + 1 + 1 + + + 0 + 0 + 0 + + + 0.45263 + 0 + 0 + + + + + ... + fuseprof_1_10 + + + 1 + 0.0022547 + 0.0022547 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ + + ... + description + 0 + 0 + Body1Frame1 + 0 + + + ... + description + 0 + 0 + Body1Frame2 + 0 + + + ... + description + 0 + 0 + Body1Frame3 + 0 + + + ... + description + 0 + 0 + Body1Frame4 + 0 + + + ... + description + 0 + 0 + Body1Frame5 + 0 + + + ... + description + 0 + 0 + Body1Frame6 + 0 + + + ... + description + 0 + 0 + Body1Frame7 + 0 + + + ... + description + 0 + 0 + Body1Frame8 + 0 + + + ... + description + 0 + 0 + Body1Frame9 + 0 + + + ... + description + 0 + 0 + Body1Frame10 + 0 + + + + + ... + Body1Frame1elem1 + Body1Frame2elem1 + + + ... + Body1Frame2elem1 + Body1Frame3elem1 + + + ... + Body1Frame3elem1 + Body1Frame4elem1 + + + ... + Body1Frame4elem1 + Body1Frame5elem1 + + + ... + Body1Frame5elem1 + Body1Frame6elem1 + + + ... + Body1Frame6elem1 + Body1Frame7elem1 + + + ... + Body1Frame7elem1 + Body1Frame8elem1 + + + ... + Body1Frame8elem1 + Body1Frame9elem1 + + + ... + Body1Frame9elem1 + Body1Frame10elem1 + + +
+
+ + + wingmod1A + Body1 + description + + + 1 + 1 + 1 + + + -0 + 0 + -0 + + + 0.1016 + 0 + 0 + + + +
+ wingmod1Aroot + description + + + 1 + 1 + 1 + + + -0 + 0 + -0 + + + 0 + 0 + 0 + + + + + ... + foil_1_2 + + + 0.089662 + 0.089662 + 0.089662 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ wingmod1Atip + description + + + 1 + 1 + 1 + + + -0 + 0 + -0 + + + 0.05 + 0.2032 + 0 + + + + + ... + foil_1_1 + + + 0.044831 + 0.044831 + 0.044831 + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + +
+
+ + + ... + description + 0 + 0 + wingmod1Atip + 0 + + + ... + description + 0 + 0 + wingmod1Aroot + 0 + + + + + ... + wingmod1Atipelem1 + wingmod1Arootelem1 + + +
+
+ + + + aeromap_empty + Common default aeroMap + + ISA + + + 0.0 + 0.3 + 0.0 + 0.0 + + + + + 1000;1000;1000;1000 + 0.3;0.3;0.3;0.3 + 0;0;0;0 + 0;1;2;3 + + aeromap_new + Created with CEASIOMpy Graphical user interface + + ISA + + + + +
+
+ + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + ... + ... + + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + 0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 + -1.000000 ;-0.951057 ;-0.809017 ;-0.587785 ;-0.309017 ;0.000000 ;0.309017 ;0.587785 ;0.809017 ;0.951057 ;1.000000 ;0.951057 ;0.809017 ;0.587785 ;0.309017 ;0.000000 ;-0.309017 ;-0.587785 ;-0.809017 ;-0.951057 ;-1.000000 + + + + + + ... + ... + + 1.000000 ;0.951194 ;0.902266 ;0.853214 ;0.804038 ;0.754739 ;0.705314 ;0.655764 ;0.606088 ;0.556287 ;0.506358 ;0.456303 ;0.406120 ;0.355808 ;0.305368 ;0.254799 ;0.204101 ;0.153272 ;0.102313 ;0.076784 ;0.051222 ;0.025628 ;0.012818 ;0.007692 ;0.005128 ;0.000000 ;0.005128 ;0.007692 ;0.012818 ;0.025628 ;0.051222 ;0.076784 ;0.102313 ;0.153272 ;0.204101 ;0.254799 ;0.305368 ;0.355808 ;0.406120 ;0.456303 ;0.506358 ;0.556287 ;0.606088 ;0.655764 ;0.705314 ;0.754739 ;0.804038 ;0.853214 ;0.902266 ;0.951194 ;1.000000 + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + -0.000224 ;-0.005576 ;-0.010942 ;-0.016321 ;-0.021714 ;-0.027121 ;-0.032470 ;-0.037536 ;-0.042148 ;-0.046177 ;-0.049506 ;-0.051949 ;-0.053253 ;-0.053150 ;-0.051842 ;-0.049452 ;-0.045919 ;-0.041032 ;-0.034397 ;-0.030137 ;-0.024954 ;-0.018011 ;-0.013038 ;-0.010317 ;-0.008572 ;0.000000 ;0.008572 ;0.010317 ;0.013038 ;0.018011 ;0.024954 ;0.030137 ;0.034397 ;0.041032 ;0.045919 ;0.049452 ;0.051842 ;0.053150 ;0.053253 ;0.051949 ;0.049506 ;0.046177 ;0.042148 ;0.037536 ;0.032470 ;0.027121 ;0.021714 ;0.016321 ;0.010942 ;0.005576 ;0.000224 + + + + ... + ... + + 1.000000 ;0.951194 ;0.902266 ;0.853214 ;0.804038 ;0.754739 ;0.705314 ;0.655764 ;0.606088 ;0.556287 ;0.506358 ;0.456303 ;0.406120 ;0.355808 ;0.305368 ;0.254799 ;0.204101 ;0.153272 ;0.102313 ;0.076784 ;0.051222 ;0.025628 ;0.012818 ;0.007692 ;0.005128 ;0.000000 ;0.005128 ;0.007692 ;0.012818 ;0.025628 ;0.051222 ;0.076784 ;0.102313 ;0.153272 ;0.204101 ;0.254799 ;0.305368 ;0.355808 ;0.406120 ;0.456303 ;0.506358 ;0.556287 ;0.606088 ;0.655764 ;0.705314 ;0.754739 ;0.804038 ;0.853214 ;0.902266 ;0.951194 ;1.000000 + 0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 ;0.000000 + -0.000224 ;-0.005576 ;-0.010942 ;-0.016321 ;-0.021714 ;-0.027121 ;-0.032470 ;-0.037536 ;-0.042148 ;-0.046177 ;-0.049506 ;-0.051949 ;-0.053253 ;-0.053150 ;-0.051842 ;-0.049452 ;-0.045919 ;-0.041032 ;-0.034397 ;-0.030137 ;-0.024954 ;-0.018011 ;-0.013038 ;-0.010317 ;-0.008572 ;0.000000 ;0.008572 ;0.010317 ;0.013038 ;0.018011 ;0.024954 ;0.030137 ;0.034397 ;0.041032 ;0.045919 ;0.049452 ;0.051842 ;0.053150 ;0.053253 ;0.051949 ;0.049506 ;0.046177 ;0.042148 ;0.037536 ;0.032470 ;0.027121 ;0.021714 ;0.016321 ;0.010942 ;0.005576 ;0.000224 + + + + +
+ + + + False + False + + + - + - + /home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/Edge.bmsh + /home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/Workflow_test + + + + 1.4 + + + + su2 + + + + aeromap_new + + False + 1.0 + False + False + + + 2 + 20 + + + False + 0.5 + 1.5 + 0.5 + 100.0 + + + 3 + + + False + False + + + + aeromap_new + + False + 1.0 + False + False + + + 32 + 20 + + False + + 3 + + + False + False + + + + + + 3000.0 + + False + + + + + aeromap_new + + + +
From 1d28b272fd6b52334c8e4dd04c07dfb00b9a8315 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Fri, 12 Jan 2024 14:45:03 +0100 Subject: [PATCH 20/80] modified: commonxpath.py --- WKDIR/labARstraight_toolInput.xml | 6 +++--- ceasiompy/utils/commonxpath.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/WKDIR/labARstraight_toolInput.xml b/WKDIR/labARstraight_toolInput.xml index db4c94e60..da0101900 100644 --- a/WKDIR/labARstraight_toolInput.xml +++ b/WKDIR/labARstraight_toolInput.xml @@ -965,7 +965,7 @@ False - + aeromap_new False @@ -979,13 +979,13 @@ False - 3 + 1 False False - + diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 1e0fe9cbd..ff2334924 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -144,7 +144,7 @@ SU2_ACTUATOR_DISK_XPATH = SU2_XPATH + "/options/includeActuatorDisk" # EDGE -EDGE_XPATH = CEASIOMPY_XPATH + "/aerodynamics/m-edge" +EDGE_XPATH = CEASIOMPY_XPATH + "/aerodynamics/medge" EDGE_AEROMAP_UID_XPATH = EDGE_XPATH + "/aeroMapUID" EDGE_NB_CPU_XPATH = EDGE_XPATH + "/settings/nbCPU" EDGE_MAX_ITER_XPATH = EDGE_XPATH + "/settings/maxIter" From 354e1cc410fd8a381959d81a46924f7fd9bcb9b2 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Fri, 12 Jan 2024 15:56:55 +0100 Subject: [PATCH 21/80] Added to copy mesh and aboc files from CPACS filesPath to /grid folder modified: ../EdgeRun/func/edge_queScript_gen.py modified: ../EdgeRun/func/edgeconfig.py modified: create_ainpfile.py --- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 2 ++ ceasiompy/EdgeRun/func/edgeconfig.py | 19 ++++++++++++++++--- ceasiompy/utils/create_ainpfile.py | 4 ++-- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py index f9c7a36ba..95d117dff 100644 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -34,6 +34,7 @@ def __init__(self, dir_path, jobname, input_que_script_path, edge_input_file): def submit_preprocessor_script(self,dir_path): preprocessor = os.path.join(self.Edge_dir, 'preprocessor') + #dir_path = self.dir_path QueScript = f'queue_preprocessor.script' Submitcommand = 'sbatch' os.chdir(dir_path) @@ -49,6 +50,7 @@ def submit_preprocessor_script(self,dir_path): def submit_solver_script(self, dir_path, nb_proc): run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') QueScript = f'queue_edgesolver.script' + #dir_path = self.dir_path Submitcommand = 'sbatch' os.chdir(dir_path) with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index ca978b8fc..d9ffb45bc 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -20,7 +20,7 @@ # IMPORTS # ================================================================================================= -import math +import math,os from pathlib import Path from shutil import copyfile @@ -102,8 +102,21 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): cpacs = CPACS(cpacs_path) edge_mesh = Path(get_value(cpacs.tixi, EDGE_MESH_XPATH)) + edge_aboc = edge_mesh.with_suffix(".aboc") + if not edge_mesh.is_file(): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") + # copy edge_mesh and edge_aboc file to the Working directory + + grid_folder = Path(wkdir, "grid") + to_grid = grid_folder / edge_mesh.name + to_aboc = grid_folder / edge_aboc.name + + if not os.path.exists(grid_folder): + os.makedirs(grid_folder) + copyfile(edge_mesh, to_grid) + copyfile(edge_aboc, to_aboc) + # Get the fixedCL value from CPACS fixed_cl = get_value_or_default(cpacs.tixi, EDGE_FIXED_CL_XPATH, "NO") @@ -242,7 +255,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): case_dir_path = Path(wkdir, case_dir_name) if not case_dir_path.exists(): case_dir_path.mkdir() - output_path = Path(case_dir_path, AINP_CFD_NAME) + output_file_withpath = Path(case_dir_path, AINP_CFD_NAME) # template_path = get_edge_ainp_template() create_ainp_instance = CreateAinp() # create_ainp_instance = CreateAinp(get_edge_ainp_template()) @@ -268,7 +281,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): INSEUL, NGRID, CFL, - output_path, + output_file_withpath, ) # cfg.write_file(config_output_path, overwrite=True) diff --git a/ceasiompy/utils/create_ainpfile.py b/ceasiompy/utils/create_ainpfile.py index 5f6900295..292c7ae64 100644 --- a/ceasiompy/utils/create_ainpfile.py +++ b/ceasiompy/utils/create_ainpfile.py @@ -33,9 +33,9 @@ class CreateAinp: def __init__(self): self.template_file = get_edge_ainp_template() - def _write_file(self, content, output_file_path): + def _write_file(self, content, output_file_withpath): # output_file_path = os.path.join(output_folder, 'Edge.ainp') - with open(output_file_path, "w") as f: + with open(output_file_withpath, "w") as f: f.write(content) def create_ainp( From df4ddcca678330c298b80f89ca4779e62a0947d4 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 13 Jan 2024 17:38:33 +0100 Subject: [PATCH 22/80] modified: edge_queScript_gen.py: added runlocal_preprocessor_script to run preprocessor on local modified: edgeconfig.py: added a check for Edge.bedg_p* file, if the files already exist, preprocessor won't run --- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 18 ++++++++++++++++++ ceasiompy/EdgeRun/func/edgeconfig.py | 15 ++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py index 95d117dff..1c87c532a 100644 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -47,6 +47,24 @@ def submit_preprocessor_script(self,dir_path): print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') os.system(f'{Submitcommand} {que_script}') + def runlocal_preprocessor_script(self,dir_path): + #preprocessor = os.path.join(self.Edge_dir, 'preprocessor') + #dir_path = self.dir_path + #QueScript = f'queue_preprocessor.script' + #Submitcommand = 'sbatch' + os.chdir(dir_path) + """ + with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: + for line in template_file: + if '-J jobname' in line: + line = line.replace('-J jobname', f'-J {self.jobname}prepro') + que_script.write(line) + + que_script.write(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + """ + os.system(f'preprocessor {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + def submit_solver_script(self, dir_path, nb_proc): run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') QueScript = f'queue_edgesolver.script' diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index d9ffb45bc..2721792e6 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -289,7 +289,20 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): # run / submit edge commands jobname = case_dir_name edge_scripts_instance = EdgeScripts(jobname,case_dir_path, input_que_script_path, AINP_CFD_NAME) - edge_scripts_instance.submit_preprocessor_script(case_dir_path) + + bedg_files_exist = True + for i in range(1, NPART+1): + bedg_file_path = Path(case_dir_path, grid_folder, f'Edge.bedg_p{i}') + if not bedg_file_path.exists(): + bedg_files_exist = False + break + + if not bedg_files_exist: + #edge_scripts_instance.submit_preprocessor_script(case_dir_path) + edge_scripts_instance.runlocal_preprocessor_script(case_dir_path) + print('bedg files are generated') + #else: + # print('bedg files exist, not generated') edge_scripts_instance.submit_solver_script(case_dir_path,NPART) cpacs.save_cpacs(cpacs_out_path, overwrite=True) From 474bd0a42ad8f4ccf8b6d8eee397818eb6f9c004 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 13 Jan 2024 17:40:26 +0100 Subject: [PATCH 23/80] modified: edge_queScript_gen.py modified: edgeconfig.py --- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 2 +- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py index 1c87c532a..1c7439828 100644 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -47,7 +47,7 @@ def submit_preprocessor_script(self,dir_path): print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') os.system(f'{Submitcommand} {que_script}') - def runlocal_preprocessor_script(self,dir_path): + def runlocal_preprocessor(self,dir_path): #preprocessor = os.path.join(self.Edge_dir, 'preprocessor') #dir_path = self.dir_path #QueScript = f'queue_preprocessor.script' diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 2721792e6..1c8ddf941 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -299,7 +299,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): if not bedg_files_exist: #edge_scripts_instance.submit_preprocessor_script(case_dir_path) - edge_scripts_instance.runlocal_preprocessor_script(case_dir_path) + edge_scripts_instance.runlocal_preprocessor(case_dir_path) print('bedg files are generated') #else: # print('bedg files exist, not generated') From a78f04b26fc10bef6c05d070feb8179b422329e0 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 13 Jan 2024 17:41:27 +0100 Subject: [PATCH 24/80] modified: edgeconfig.py: enable remote preprocessor instead of local preprocessor --- ceasiompy/EdgeRun/func/edgeconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 1c8ddf941..e86b8a1a3 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -298,8 +298,8 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): break if not bedg_files_exist: - #edge_scripts_instance.submit_preprocessor_script(case_dir_path) - edge_scripts_instance.runlocal_preprocessor(case_dir_path) + edge_scripts_instance.submit_preprocessor_script(case_dir_path) + #edge_scripts_instance.runlocal_preprocessor(case_dir_path) print('bedg files are generated') #else: # print('bedg files exist, not generated') From bcc8d7d1483bd4e6a9de9c1a97403106fd34d5fc Mon Sep 17 00:00:00 2001 From: GBenedett Date: Tue, 16 Jan 2024 08:54:18 +0100 Subject: [PATCH 25/80] medge spec file --- ceasiompy/EdgeRun/__specs__.py | 438 ++++++++++++++++++++++++++++++--- 1 file changed, 406 insertions(+), 32 deletions(-) diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index fe73a31de..4b701e752 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -1,63 +1,437 @@ +from pathlib import Path + +from ceasiompy.utils.ceasiompyutils import get_reasonable_nb_cpu +from ceasiompy.utils.commonxpath import ( + AEROPERFORMANCE_XPATH, + GEOM_XPATH, + PROP_XPATH, + RANGE_XPATH, + REF_XPATH, + EDGE_ACTUATOR_DISK_XPATH, + EDGE_AEROMAP_UID_XPATH, + EDGE_BC_FARFIELD_XPATH, + EDGE_BC_WALL_XPATH, + EDGE_CFL_NB_XPATH, + EDGE_CFL_ADAPT_XPATH, + EDGE_CFL_ADAPT_PARAM_DOWN_XPATH, + EDGE_CFL_ADAPT_PARAM_UP_XPATH, + EDGE_CFL_MIN_XPATH, + EDGE_CFL_MAX_XPATH, + EDGE_CONTROL_SURF_XPATH, + EDGE_DAMPING_DER_XPATH, + EDGE_EXTRACT_LOAD_XPATH, + EDGE_FIXED_CL_XPATH, + EDGE_MAX_ITER_XPATH, + EDGE_MG_LEVEL_XPATH, + EDGE_NB_CPU_XPATH, + EDGE_ROTATION_RATE_XPATH, + EDGE_TARGET_CL_XPATH, + EDGE_UPDATE_WETTED_AREA_XPATH, + EDGE_MESH_XPATH, +) from ceasiompy.utils.moduleinterfaces import CPACSInOut -from ceasiompy.utils.commonxpath import CEASIOMPY_XPATH, FUSELAGES_XPATH # ===== Module Status ===== # True if the module is active # False if the module is disabled (not working or not ready) -module_status = False # Because it is just an example not a real module +module_status = True + +# ===== Results directory path ===== + +RESULTS_DIR = Path("Results", "MEDGE") # ===== CPACS inputs and outputs ===== cpacs_inout = CPACSInOut() -include_gui = False - # ----- Input ----- -# * In the following example we add three (!) new entries to 'cpacs_inout' -# * Try to use (readable) loops instead of copy-pasting three almost same entries :) +cpacs_inout.add_input( + var_name="aeromap_uid", + var_type=list, + default_value=None, + unit=None, + descr="Name of the aero map to calculate", + xpath=EDGE_AEROMAP_UID_XPATH, + gui=True, + gui_name="__AEROMAP_SELECTION", + gui_group="Aeromap settings", +) + +# cpacs_inout.add_input( +# var_name="mesh_upload", +# var_type=str, +# default_value="your path", +# unit=None, +# descr="Name of the mesh to upload", +# xpath=SU2MESH_XPATH, +# gui=True, +# gui_name="Path of the mesh", +# gui_group="Mesh upload", +# ) + +cpacs_inout.add_input( + var_name="ref_len", + var_type=float, + default_value=None, + unit="m", + descr="Reference length of the aircraft", + xpath=REF_XPATH + "/length", + gui=False, + gui_name=None, + gui_group=None, +) + +cpacs_inout.add_input( + var_name="ref_area", + var_type=float, + default_value=None, + unit="m^2", + descr="Reference area of the aircraft", + xpath=REF_XPATH + "/area", + gui=False, + gui_name=None, + gui_group=None, +) + for direction in ["x", "y", "z"]: cpacs_inout.add_input( - var_name=direction, + var_name=f"ref_ori_moment_{direction}", var_type=float, - default_value=None, - unit="1", + default_value=0.0, + unit="m", descr=f"Fuselage scaling on {direction} axis", - xpath=FUSELAGES_XPATH + f"/fuselage/transformation/scaling/{direction}", - gui=include_gui, - gui_name=f"{direction.capitalize()} scaling", - gui_group="Fuselage scaling", + xpath=REF_XPATH + f"/point/{direction}", + gui=False, + gui_name=None, + gui_group=None, ) cpacs_inout.add_input( - var_name="test", + var_name="cruise_mach", + var_type=float, + default_value=0.78, + unit="1", + descr="Aircraft cruise Mach number", + xpath=RANGE_XPATH + "/cruiseMach", + gui=False, + gui_name="Cruise Mach", + gui_group="If fixed CL", +) + +cpacs_inout.add_input( + var_name="cruise_alt", + var_type=float, + default_value=120000.0, + unit="m", + descr="Aircraft cruise altitude", + xpath=RANGE_XPATH + "/cruiseAltitude", + gui=False, + gui_name="Cruise Altitude", + gui_group="If fixed CL", +) + +cpacs_inout.add_input( + var_name="target_cl", + var_type=float, + default_value=1.0, + unit="1", + descr="Value of CL to achieve to have a level flight with the given conditions", + xpath=EDGE_TARGET_CL_XPATH, + gui=False, + gui_name=None, + gui_group=None, +) + +cpacs_inout.add_input( + var_name="fixed_cl", var_type=str, - default_value="This is a test", - unit=None, - descr="This is a test of description", - xpath=CEASIOMPY_XPATH + "/test/myTest", - gui=include_gui, - gui_name="My test", - gui_group="Group Test", + default_value="NO", + unit="-", + descr="FIXED_CL_MODE parameter for SU2", + xpath=EDGE_FIXED_CL_XPATH, + gui=False, + gui_name=None, + gui_group=None, ) cpacs_inout.add_input( - var_name="other_var", - var_type=list, - default_value=[2, 33, 444], - unit="[unit]", - xpath=CEASIOMPY_XPATH + "/test/myList", - gui=include_gui, - gui_name="Choice", - gui_group="My Selection", + var_name="damping_der", + var_type=bool, + default_value=False, + unit="1", + descr="To check if damping derivatives should be calculated or not", + xpath=EDGE_DAMPING_DER_XPATH, + gui=True, + gui_name="Damping Derivatives", + gui_group="Aeromap Options", +) + +cpacs_inout.add_input( + var_name="rotation_rate", + var_type=float, + default_value=1.0, + unit="rad/s", + descr="Rotation rate use to calculate damping derivatives", + xpath=EDGE_ROTATION_RATE_XPATH, + gui=True, + gui_name="Rotation Rate", + gui_group="Aeromap Options", +) + +cpacs_inout.add_input( + var_name="control_surf", + var_type=bool, + default_value=False, + unit="1", + descr="To check if control surfaces deflections should be calculated or not", + xpath=EDGE_CONTROL_SURF_XPATH, + gui=True, + gui_name="Control Surfaces", + gui_group="Aeromap Options", +) + +cpacs_inout.add_input( + var_name="nb_proc", + var_type=int, + default_value=get_reasonable_nb_cpu(), + unit="1", + descr="Number of proc to use to run EDGE", + xpath=EDGE_NB_CPU_XPATH, + gui=True, + gui_name="Nb of processor", + gui_group="CPU", +) + +cpacs_inout.add_input( + var_name="max_iter", + var_type=int, + default_value=200, + unit="1", + descr="Maximum number of iterations performed by EDGE", + xpath=EDGE_MAX_ITER_XPATH, + gui=True, + gui_name="Maximum iterations", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="cfl_nb", + var_type=float, + default_value=1.0, + unit="1", + descr="CFL Number, Courant–Friedrichs–Lewy condition", + xpath=EDGE_CFL_NB_XPATH, + gui=False, + gui_name="CFL Number", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="cfl_adapt", + var_type=bool, + default_value=False, + unit="1", + descr="CFL Adaptation", + xpath=EDGE_CFL_ADAPT_XPATH, + gui=True, + gui_name="CFL Adaptation", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="cfl_adapt_param_factor_down", + var_type=float, + default_value=0.5, + unit="1", + descr="CFL Adaptation Factor Down", + xpath=EDGE_CFL_ADAPT_PARAM_DOWN_XPATH, + gui=True, + gui_name="CFL Adaptation Factor Down", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="cfl_adapt_param_factor_up", + var_type=float, + default_value=1.5, + unit="1", + descr="CFL Adaptation Factor Up", + xpath=EDGE_CFL_ADAPT_PARAM_UP_XPATH, + gui=True, + gui_name="CFL Adaptation Factor Up", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="cfl_adapt_param_min", + var_type=float, + default_value=0.5, + unit="1", + descr="CFL Minimum Value", + xpath=EDGE_CFL_MIN_XPATH, + gui=True, + gui_name="CFL Min Value", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="cfl_adapt_param_max", + var_type=float, + default_value=100, + unit="1", + descr="CFL Maximum Value", + xpath=EDGE_CFL_MAX_XPATH, + gui=True, + gui_name="CFL Max Value", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="mg_level", + var_type=int, + default_value=3, + unit="3", + descr="Multi-grid level (0 = no multigrid)", + xpath=EDGE_MG_LEVEL_XPATH, + gui=True, + gui_name="Multigrid Level", + gui_group="EDGE Parameters", +) + +cpacs_inout.add_input( + var_name="EDGE_mesh_path", + var_type="pathtype", + default_value="-", + unit="1", + descr="Absolute path of the EDGE mesh", + xpath=EDGE_MESH_XPATH, + gui=True, + gui_name="EDGE Mesh", + gui_group="Inputs", ) +cpacs_inout.add_input( + var_name="update_wetted_area", + var_type=bool, + default_value=False, + unit="1", + descr="Option to update the wetted area from the latest EDGE result.", + xpath=EDGE_UPDATE_WETTED_AREA_XPATH, + gui=True, + gui_name="Update Wetted Area", + gui_group="Results", +) + +cpacs_inout.add_input( + var_name="check_extract_loads", + var_type=bool, + default_value=False, + unit="1", + descr="Option to extract loads (forces in each point) from results", + xpath=EDGE_EXTRACT_LOAD_XPATH, + gui=True, + gui_name="Extract loads", + gui_group="Results", +) + +# Actuator disk + +cpacs_inout.add_input( + var_name="include_actuator_disk", + var_type=bool, + default_value=False, + unit="1", + descr="To check if actuator disk(s) should be included in the EDGE calculation", + xpath=EDGE_ACTUATOR_DISK_XPATH, + gui=True, + gui_name="Include actuator disk(s)", + gui_group="Actuator disk", +) + +cpacs_inout.add_input( + var_name="thrust", + var_type=float, + default_value=3000, + unit="N", + descr="Aircraft thrust", + xpath=PROP_XPATH + "/propeller/thrust", + gui=True, + gui_name="Thrust", + gui_group="Actuator disk", +) + +# cpacs_inout.add_input( +# var_name="n", +# var_type=float, +# default_value=33, +# unit="1/s", +# descr="Propeller rotational velocity", +# xpath=PROP_XPATH + "/propeller/rotational_velocity", +# gui=True, +# gui_name="Rotational velocity setting", +# gui_group="Actuator disk", +# ) + +cpacs_inout.add_input( + var_name="prandtl", + var_type=bool, + default_value=False, + unit=None, + descr="Enable or disable the tip loss correction of Prandtl", + xpath=PROP_XPATH + "/propeller/blade/loss", + gui=True, + gui_name="Tip loss correction", + gui_group="Actuator disk", +) + +# cpacs_inout.add_input( +# var_name="blades_number", +# var_type=int, +# default_value=3, +# unit=None, +# descr="Number of propeller blades", +# xpath=PROP_XPATH + "/propeller/bladeNumber", +# gui=True, +# gui_name="Propeller blades numbers", +# gui_group="Actuator disk", +# ) + + # ----- Output ----- cpacs_inout.add_output( - var_name="output", + var_name="wetted_area", + var_type=float, + default_value=None, + unit="m^2", + descr="Aircraft wetted area calculated by EDGE", + xpath=GEOM_XPATH + "/analyses/wettedArea", +) + +cpacs_inout.add_output( + var_name="bc_wall_list", + var_type=list, + default_value=None, + unit="1", + descr="Wall boundary conditions found in the EDGE mesh", + xpath=EDGE_BC_WALL_XPATH, +) + +cpacs_inout.add_output( + var_name="bc_farfield_list", + var_type=list, default_value=None, unit="1", - descr="Description of the output", - xpath=CEASIOMPY_XPATH + "/test/myOutput", + descr="Farfield boundary conditions found in the EDGE mesh (for off engines)", + xpath=EDGE_BC_FARFIELD_XPATH, +) + +cpacs_inout.add_output( + var_name="aeromap_EDGE", # name to change... + # var_type=CPACS_aeroMap, # no type pour output, would it be useful? + default_value=None, + unit="-", + descr="aeroMap with aero coefficients calculated by EDGE", + xpath=AEROPERFORMANCE_XPATH + "/aeroMap/aeroPerformanceMap", ) From 1e01bae927498e73845efef363d996bf2553dde6 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Tue, 16 Jan 2024 13:00:05 +0100 Subject: [PATCH 26/80] if euler removed --- ceasiompy/CPACS2GMSH/__specs__.py | 13 --------- ceasiompy/CPACS2GMSH/cpacs2gmsh.py | 3 -- ceasiompy/CPACS2GMSH/func/generategmesh.py | 32 ++++++++-------------- ceasiompy/EdgeRun/__specs__.py | 2 +- ceasiompy/utils/commonxpath.py | 1 - 5 files changed, 12 insertions(+), 39 deletions(-) diff --git a/ceasiompy/CPACS2GMSH/__specs__.py b/ceasiompy/CPACS2GMSH/__specs__.py index 9edbd0349..cdefcd57c 100644 --- a/ceasiompy/CPACS2GMSH/__specs__.py +++ b/ceasiompy/CPACS2GMSH/__specs__.py @@ -16,7 +16,6 @@ GMSH_OPEN_GUI_XPATH, GMSH_REFINE_TRUNCATED_XPATH, GMSH_REFINE_FACTOR_XPATH, - GMSH_EULER_XPATH, GMSH_SYMMETRY_XPATH, SU2MESH_XPATH, GMSH_MESH_SIZE_FACTOR_FUSELAGE_XPATH, @@ -64,18 +63,6 @@ gui_group="General options", ) -cpacs_inout.add_input( - var_name="euler", - var_type=bool, - default_value=True, - unit="1", - descr="Create a farfield", - xpath=GMSH_EULER_XPATH, - gui=True, - gui_name="Domain for euler calculation", - gui_group="Domain", -) - cpacs_inout.add_input( var_name="symmetry", var_type=bool, diff --git a/ceasiompy/CPACS2GMSH/cpacs2gmsh.py b/ceasiompy/CPACS2GMSH/cpacs2gmsh.py index 7a2a80e01..648a849da 100644 --- a/ceasiompy/CPACS2GMSH/cpacs2gmsh.py +++ b/ceasiompy/CPACS2GMSH/cpacs2gmsh.py @@ -44,7 +44,6 @@ GMSH_OPEN_GUI_XPATH, GMSH_REFINE_FACTOR_XPATH, GMSH_REFINE_TRUNCATED_XPATH, - GMSH_EULER_XPATH, GMSH_SYMMETRY_XPATH, SU2MESH_XPATH, ) @@ -79,7 +78,6 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path): # Retrieve value from the GUI Setting open_gmsh = get_value_or_default(cpacs.tixi, GMSH_OPEN_GUI_XPATH, False) farfield_factor = get_value_or_default(cpacs.tixi, GMSH_FARFIELD_FACTOR_XPATH, 6) - euler = get_value_or_default(cpacs.tixi, GMSH_EULER_XPATH, True) symmetry = get_value_or_default(cpacs.tixi, GMSH_SYMMETRY_XPATH, False) farfield_size_factor = get_value_or_default(cpacs.tixi, GMSH_MESH_SIZE_FARFIELD_XPATH, 17) n_power_factor = get_value_or_default(cpacs.tixi, GMSH_N_POWER_FACTOR_XPATH, 2) @@ -107,7 +105,6 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path): results_dir, open_gmsh=open_gmsh, farfield_factor=farfield_factor, - euler=euler, symmetry=symmetry, farfield_size_factor=farfield_size_factor, n_power_factor=n_power_factor, diff --git a/ceasiompy/CPACS2GMSH/func/generategmesh.py b/ceasiompy/CPACS2GMSH/func/generategmesh.py index 1a809c0ab..49b0ecdae 100644 --- a/ceasiompy/CPACS2GMSH/func/generategmesh.py +++ b/ceasiompy/CPACS2GMSH/func/generategmesh.py @@ -567,7 +567,6 @@ def generate_gmsh( results_dir, open_gmsh=False, farfield_factor=6, - euler=False, symmetry=False, farfield_size_factor=10, n_power_factor=2, @@ -693,12 +692,9 @@ def generate_gmsh( ] domain_length = farfield_factor * max(model_dimensions) - - if euler: - farfield = gmsh.model.occ.addSphere(*model_center, domain_length) - gmsh.model.occ.synchronize() - - ext_domain = [(3, farfield)] + farfield = gmsh.model.occ.addSphere(*model_center, domain_length) + gmsh.model.occ.synchronize() + ext_domain = [(3, farfield)] if symmetry: log.info("Preparing: symmetry operation") @@ -715,14 +711,9 @@ def generate_gmsh( log.info("Start fragment operation between the aircraft and the farfield") - if euler: - _, children_dimtag = gmsh.model.occ.fragment(ext_domain, parts_parent_dimtag) - gmsh.model.occ.synchronize() - - log.info("Fragment operation finished") - - else: - _, child_dimtag = parts_parent_dimtag + _, children_dimtag = gmsh.model.occ.fragment(ext_domain, parts_parent_dimtag) + gmsh.model.occ.synchronize() + log.info("Fragment operation finished") # fragment produce fragments_dimtag and children_dimtag @@ -919,13 +910,12 @@ def generate_gmsh( symmetry_group = gmsh.model.addPhysicalGroup(2, symmetry_surfaces_tags) gmsh.model.setPhysicalName(2, symmetry_group, "symmetry") - if euler: - farfield = gmsh.model.addPhysicalGroup(2, farfield_surfaces_tags) - gmsh.model.setPhysicalName(2, farfield, "Farfield") + farfield = gmsh.model.addPhysicalGroup(2, farfield_surfaces_tags) + gmsh.model.setPhysicalName(2, farfield, "Farfield") - # Fluid domain - ps = gmsh.model.addPhysicalGroup(3, final_domain.volume_tag) - gmsh.model.setPhysicalName(3, ps, final_domain.uid) + # Fluid domain + ps = gmsh.model.addPhysicalGroup(3, final_domain.volume_tag) + gmsh.model.setPhysicalName(3, ps, final_domain.uid) gmsh.model.occ.synchronize() log.info("Markers for SU2 generated") diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index 4b701e752..9e62bdc26 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -38,7 +38,7 @@ # ===== Results directory path ===== -RESULTS_DIR = Path("Results", "MEDGE") +RESULTS_DIR = Path("Results", "EdgeRun") # ===== CPACS inputs and outputs ===== diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index ff2334924..5a68497e2 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -94,7 +94,6 @@ # GMSH GMSH_XPATH = MESH_XPATH + "/gmshOptions" GMSH_OPEN_GUI_XPATH = GMSH_XPATH + "/open_gui" -GMSH_EULER_XPATH = GMSH_XPATH + "/euler" GMSH_SYMMETRY_XPATH = GMSH_XPATH + "/symmetry" GMSH_EXPORT_PROP_XPATH = GMSH_XPATH + "/exportPropellers" GMSH_FARFIELD_FACTOR_XPATH = GMSH_XPATH + "/farfield_factor" From 509a1b0970ddabcfbf26634082d09237287f1d84 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 17 Jan 2024 19:51:29 +0100 Subject: [PATCH 27/80] modified: ../../../WKDIR/labARstraight_toolInput.xml added solver type (Euler/RANS) modified: edge_queScript_gen.py added run_commands option so that one can run on interactive node (same as run in local) modified: edgeconfig.py modified to change to run_edge commands instead of submitting commands, to run on interactive node (same as run in local) --- WKDIR/labARstraight_toolInput.xml | 1 + ceasiompy/EdgeRun/func/edge_queScript_gen.py | 43 +++++++++++++++++++- ceasiompy/EdgeRun/func/edgeconfig.py | 10 +++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/WKDIR/labARstraight_toolInput.xml b/WKDIR/labARstraight_toolInput.xml index da0101900..c5c0670c4 100644 --- a/WKDIR/labARstraight_toolInput.xml +++ b/WKDIR/labARstraight_toolInput.xml @@ -974,6 +974,7 @@ False + euler 32 20 diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py index 1c7439828..219297555 100644 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -47,7 +47,7 @@ def submit_preprocessor_script(self,dir_path): print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') os.system(f'{Submitcommand} {que_script}') - def runlocal_preprocessor(self,dir_path): + def run_preprocessor(self,dir_path): #preprocessor = os.path.join(self.Edge_dir, 'preprocessor') #dir_path = self.dir_path #QueScript = f'queue_preprocessor.script' @@ -80,4 +80,45 @@ def submit_solver_script(self, dir_path, nb_proc): os.system(f'{Submitcommand} {que_script}') + def run_edgesolver(self, dir_path, nb_proc): + run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') + #QueScript = f'queue_edgesolver.script' + #dir_path = self.dir_path + #Submitcommand = 'sbatch' + os.chdir(dir_path) + """ + with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: + for line in template_file: + if '-J jobname' in line: + line = line.replace('-J jobname', f'-J {self.jobname}solver') + que_script.write(line) + que_script.write(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') + """ + os.system(f'run_solver {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') + + def postprocess_script(self, dir_path): + ffaucut = os.path.join(self.Edge_dir, 'ffaucut') + ffauinterpol = os.path.join(self.Edge_dir, 'ffauinterpol') + ffa2tab = os.path.join(self.Edge_dir, 'ffa2tab') + ffa2engold = os.path.join(self.Edge_dir, 'ffa2engold') + + # output file names + walldata2 = "Edge_wall.cf" + forcemoments = "Edge_force_moment.dat" + ensgoldprefix = "zzz" + solution1 = "Edge.bout" + solution2 = "Post.bout" + #QueScript = f'queue_edgesolver.script' + #dir_path = self.dir_path + #Submitcommand = 'sbatch' + os.chdir(dir_path) + with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: + for line in template_file: + if '-J jobname' in line: + line = line.replace('-J jobname', f'-J {self.jobname}solver') + que_script.write(line) + que_script.write(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') + os.system(f'{Submitcommand} {que_script}') + + diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index e86b8a1a3..fd98029da 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -298,12 +298,16 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): break if not bedg_files_exist: - edge_scripts_instance.submit_preprocessor_script(case_dir_path) - #edge_scripts_instance.runlocal_preprocessor(case_dir_path) + #edge_scripts_instance.submit_preprocessor_script(case_dir_path) + edge_scripts_instance.run_preprocessor(case_dir_path) print('bedg files are generated') #else: # print('bedg files exist, not generated') - edge_scripts_instance.submit_solver_script(case_dir_path,NPART) + #edge_scripts_instance.submit_solver_script(case_dir_path,NPART) + edge_scripts_instance.run_edgesolver(case_dir_path,NPART) + + # postprocess for results + # wait until the results are generated cpacs.save_cpacs(cpacs_out_path, overwrite=True) # ================================================================================================= From f211e173bd9cd191e67e217ced103c5a2f964275 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 17 Jan 2024 20:45:59 +0100 Subject: [PATCH 28/80] modified: commonxpath.py added Edge_solver type PATH --- WKDIR/labARstraight_toolInput.xml | 2 +- ceasiompy/EdgeRun/func/edgeconfig.py | 5 +++-- ceasiompy/utils/commonxpath.py | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/WKDIR/labARstraight_toolInput.xml b/WKDIR/labARstraight_toolInput.xml index c5c0670c4..71ba5bb63 100644 --- a/WKDIR/labARstraight_toolInput.xml +++ b/WKDIR/labARstraight_toolInput.xml @@ -974,7 +974,7 @@ False - euler + 0 32 20 diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index fd98029da..cca563b94 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -47,6 +47,7 @@ RANGE_XPATH, EDGE_MESH_XPATH, EDGE_AEROMAP_UID_XPATH, + EDGE_SOLVER_XPATH, EDGE_CFL_NB_XPATH, EDGE_MAX_ITER_XPATH, EDGE_MG_LEVEL_XPATH, @@ -193,8 +194,8 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): ITMAX = int(get_value_or_default(cpacs.tixi, EDGE_MAX_ITER_XPATH, 200)) CFL = get_value_or_default(cpacs.tixi, EDGE_CFL_NB_XPATH, 1.5) NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) - NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 32)) - INSEUL = 0 + NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) + INSEUL = int(get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH, 0)) # Parameters which will vary for the different cases (alt,mach,aoa,aos) for case_nb in range(len(alt_list)): diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 5a68497e2..e0788d134 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -146,6 +146,7 @@ EDGE_XPATH = CEASIOMPY_XPATH + "/aerodynamics/medge" EDGE_AEROMAP_UID_XPATH = EDGE_XPATH + "/aeroMapUID" EDGE_NB_CPU_XPATH = EDGE_XPATH + "/settings/nbCPU" +EDGE_SOLVER_XPATH = EDGE_XPATH + "/settings/solver" EDGE_MAX_ITER_XPATH = EDGE_XPATH + "/settings/maxIter" EDGE_CFL_NB_XPATH = EDGE_XPATH + "/settings/cflNumber/value" EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" From 7da1fa99edccae809eaaff481d42e45c7778993e Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 17 Jan 2024 21:44:08 +0100 Subject: [PATCH 29/80] modified: edge_queScript_gen.py modified: edgeconfig.py postprocess added --- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 62 ++++++++++++-------- ceasiompy/EdgeRun/func/edgeconfig.py | 1 + 2 files changed, 38 insertions(+), 25 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py index 219297555..902e2a467 100644 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -16,8 +16,7 @@ # ================================================================================================= import os -from pathlib import Path - +import subprocess from pathlib import Path @@ -82,43 +81,56 @@ def submit_solver_script(self, dir_path, nb_proc): def run_edgesolver(self, dir_path, nb_proc): run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') - #QueScript = f'queue_edgesolver.script' - #dir_path = self.dir_path - #Submitcommand = 'sbatch' os.chdir(dir_path) - """ - with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: - for line in template_file: - if '-J jobname' in line: - line = line.replace('-J jobname', f'-J {self.jobname}solver') - que_script.write(line) - que_script.write(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') - """ - os.system(f'run_solver {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') + os.system(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') - def postprocess_script(self, dir_path): + def postprocess_script(self, dir_path,edge_grid): ffaucut = os.path.join(self.Edge_dir, 'ffaucut') ffauinterpol = os.path.join(self.Edge_dir, 'ffauinterpol') ffa2tab = os.path.join(self.Edge_dir, 'ffa2tab') ffa2engold = os.path.join(self.Edge_dir, 'ffa2engold') + grid = edge_grid # output file names + walldata1 = "Edge_wall.dat" walldata2 = "Edge_wall.cf" forcemoments = "Edge_force_moment.dat" ensgoldprefix = "zzz" solution1 = "Edge.bout" solution2 = "Post.bout" - #QueScript = f'queue_edgesolver.script' - #dir_path = self.dir_path - #Submitcommand = 'sbatch' + + # Enter the folder os.chdir(dir_path) - with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: - for line in template_file: - if '-J jobname' in line: - line = line.replace('-J jobname', f'-J {self.jobname}solver') - que_script.write(line) - que_script.write(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') - os.system(f'{Submitcommand} {que_script}') + + # Extract the boundary + input_data = """1 + 0 + """ + with subprocess.Popen([ffaucut, grid, 'tmp1'], stdin=subprocess.PIPE, text=True) as process: + process.communicate(input=input_data) + + + # Inteerpolate the soulutions + subprocess.run([ffauinterpol, solution1, 'tmp1', 'tmp11']) + subprocess.run([ffauinterpol, solution2, 'tmp1', 'tmp12']) + + # Extract tabulated data + subprocess.run([ffa2tab, 'tmp11', walldata1]) + subprocess.run([ffa2tab, 'tmp12', walldata2]) + + # Cleanup + for temp_file in ['tmp1', 'tmp11', 'tmp12']: + os.remove(temp_file) + + # Create ensight gold files + subprocess.run([ffa2engold, grid, solution1, ensgoldprefix]) + + + + + + + #os.system(f'{Submitcommand} {que_script}') diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index cca563b94..083ab0507 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -308,6 +308,7 @@ def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): edge_scripts_instance.run_edgesolver(case_dir_path,NPART) # postprocess for results + edge_scripts_instance.postprocess_script(case_dir_path,edge_mesh) # wait until the results are generated cpacs.save_cpacs(cpacs_out_path, overwrite=True) From 4ea72030c4c915fbe5fc46bf37bb7bba638e2374 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 18 Jan 2024 15:24:18 +0100 Subject: [PATCH 30/80] edge mesh path added --- ceasiompy/CPACS2GMSH/cpacs2gmsh.py | 12 +++++++++--- ceasiompy/CPACS2GMSH/func/generategmesh.py | 6 +++++- ceasiompy/CPACS2GMSH/tests/test_generatemesh.py | 2 +- .../CPACS2GMSH/tests/test_wingclassification.py | 2 +- ceasiompy/EdgeRun/__specs__.py | 2 +- ceasiompy/SUMOAutoMesh/sumoautomesh.py | 14 +++++++++++--- 6 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ceasiompy/CPACS2GMSH/cpacs2gmsh.py b/ceasiompy/CPACS2GMSH/cpacs2gmsh.py index 648a849da..a9e7db028 100644 --- a/ceasiompy/CPACS2GMSH/cpacs2gmsh.py +++ b/ceasiompy/CPACS2GMSH/cpacs2gmsh.py @@ -46,6 +46,7 @@ GMSH_REFINE_TRUNCATED_XPATH, GMSH_SYMMETRY_XPATH, SU2MESH_XPATH, + EDGE_MESH_XPATH, ) from cpacspy.cpacsfunctions import create_branch, get_value_or_default from cpacspy.cpacspy import CPACS @@ -98,7 +99,7 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path): # Run mesh generation export_brep(cpacs, brep_dir, (intake_percent, exhaust_percent)) - mesh_path, _ = generate_gmsh( + su2mesh_path, _, cgnsmesh_path = generate_gmsh( cpacs, cpacs_path, brep_dir, @@ -119,11 +120,16 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path): testing_gmsh=False, ) - if mesh_path.exists(): + if su2mesh_path.exists(): create_branch(cpacs.tixi, SU2MESH_XPATH) - cpacs.tixi.updateTextElement(SU2MESH_XPATH, str(mesh_path)) + cpacs.tixi.updateTextElement(SU2MESH_XPATH, str(su2mesh_path)) log.info("SU2 Mesh has been correctly generated.") + if cgnsmesh_path.exists(): + create_branch(cpacs.tixi, EDGE_MESH_XPATH) + cpacs.tixi.updateTextElement(EDGE_MESH_XPATH, str(cgnsmesh_path)) + log.info("EDGE Mesh has been correctly generated.") + # Save CPACS cpacs.save_cpacs(cpacs_out_path, overwrite=True) diff --git a/ceasiompy/CPACS2GMSH/func/generategmesh.py b/ceasiompy/CPACS2GMSH/func/generategmesh.py index 49b0ecdae..63588e10f 100644 --- a/ceasiompy/CPACS2GMSH/func/generategmesh.py +++ b/ceasiompy/CPACS2GMSH/func/generategmesh.py @@ -1109,7 +1109,11 @@ def generate_gmsh( if not testing_gmsh: gmsh.clear() gmsh.finalize() - return su2mesh_path, aircraft_parts + return ( + su2mesh_path, + aircraft_parts, + cgnsmesh_path, + ) # ================================================================================================= diff --git a/ceasiompy/CPACS2GMSH/tests/test_generatemesh.py b/ceasiompy/CPACS2GMSH/tests/test_generatemesh.py index 215619704..58000483a 100644 --- a/ceasiompy/CPACS2GMSH/tests/test_generatemesh.py +++ b/ceasiompy/CPACS2GMSH/tests/test_generatemesh.py @@ -213,7 +213,7 @@ def test_assignation(): export_brep(cpacs, TEST_OUT_PATH) - _, aircraft_parts = generate_gmsh( + _, aircraft_parts, _ = generate_gmsh( cpacs=cpacs, cpacs_path=CPACS_IN_PATH, brep_dir=TEST_OUT_PATH, diff --git a/ceasiompy/CPACS2GMSH/tests/test_wingclassification.py b/ceasiompy/CPACS2GMSH/tests/test_wingclassification.py index 4b9f13778..17300c7f3 100644 --- a/ceasiompy/CPACS2GMSH/tests/test_wingclassification.py +++ b/ceasiompy/CPACS2GMSH/tests/test_wingclassification.py @@ -231,7 +231,7 @@ def test_classify_wing(): export_brep(cpacs, TEST_OUT_PATH) - _, aircraft_parts = generate_gmsh( + _, aircraft_parts, _ = generate_gmsh( cpacs=cpacs, cpacs_path=CPACS_IN_PATH, brep_dir=TEST_OUT_PATH, diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index 9e62bdc26..907255fd1 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -34,7 +34,7 @@ # ===== Module Status ===== # True if the module is active # False if the module is disabled (not working or not ready) -module_status = True +module_status = False # ===== Results directory path ===== diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index b083728f8..f73904fdf 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -34,6 +34,7 @@ SUMO_REFINE_LEVEL_XPATH, SUMOFILE_XPATH, SUMO_OUTPUT_MESH_FORMAT_XPATH, + EDGE_MESH_XPATH, ) from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path from cpacspy.cpacsfunctions import create_branch, get_value_or_default, open_tixi @@ -308,9 +309,16 @@ def create_mesh(cpacs_path, cpacs_out_path): raise ValueError("No mesh file has been generated!") log.info(f"A {output} mesh has been correctly generated.") - create_branch(tixi, SU2MESH_XPATH) - tixi.updateTextElement(SU2MESH_XPATH, str(mesh_out_path)) - mesh_path.unlink() + + if output == "su2": + create_branch(tixi, SU2MESH_XPATH) + tixi.updateTextElement(SU2MESH_XPATH, str(mesh_out_path)) + mesh_path.unlink() + + else: + create_branch(tixi, EDGE_MESH_XPATH) + tixi.updateTextElement(EDGE_MESH_XPATH, str(mesh_out_path)) + mesh_path.unlink() tixi.save(str(cpacs_out_path)) From b56b7ebc0e1983dd49c8a41c174f9f21dd1a3bc6 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 18 Jan 2024 15:46:55 +0100 Subject: [PATCH 31/80] spec file for edge --- ceasiompy/EdgeRun/__specs__.py | 255 ++-------------------------- ceasiompy/EdgeRun/moduletemplate.py | 207 ---------------------- ceasiompy/utils/commonxpath.py | 1 + 3 files changed, 15 insertions(+), 448 deletions(-) delete mode 100644 ceasiompy/EdgeRun/moduletemplate.py diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index 907255fd1..d86028ab2 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -4,37 +4,23 @@ from ceasiompy.utils.commonxpath import ( AEROPERFORMANCE_XPATH, GEOM_XPATH, - PROP_XPATH, RANGE_XPATH, REF_XPATH, - EDGE_ACTUATOR_DISK_XPATH, EDGE_AEROMAP_UID_XPATH, - EDGE_BC_FARFIELD_XPATH, - EDGE_BC_WALL_XPATH, EDGE_CFL_NB_XPATH, - EDGE_CFL_ADAPT_XPATH, - EDGE_CFL_ADAPT_PARAM_DOWN_XPATH, - EDGE_CFL_ADAPT_PARAM_UP_XPATH, - EDGE_CFL_MIN_XPATH, - EDGE_CFL_MAX_XPATH, - EDGE_CONTROL_SURF_XPATH, - EDGE_DAMPING_DER_XPATH, - EDGE_EXTRACT_LOAD_XPATH, EDGE_FIXED_CL_XPATH, EDGE_MAX_ITER_XPATH, EDGE_MG_LEVEL_XPATH, EDGE_NB_CPU_XPATH, - EDGE_ROTATION_RATE_XPATH, - EDGE_TARGET_CL_XPATH, - EDGE_UPDATE_WETTED_AREA_XPATH, EDGE_MESH_XPATH, + EDGE_SOLVER, ) from ceasiompy.utils.moduleinterfaces import CPACSInOut # ===== Module Status ===== # True if the module is active # False if the module is disabled (not working or not ready) -module_status = False +module_status = True # ===== Results directory path ===== @@ -58,18 +44,6 @@ gui_group="Aeromap settings", ) -# cpacs_inout.add_input( -# var_name="mesh_upload", -# var_type=str, -# default_value="your path", -# unit=None, -# descr="Name of the mesh to upload", -# xpath=SU2MESH_XPATH, -# gui=True, -# gui_name="Path of the mesh", -# gui_group="Mesh upload", -# ) - cpacs_inout.add_input( var_name="ref_len", var_type=float, @@ -131,18 +105,6 @@ gui_group="If fixed CL", ) -cpacs_inout.add_input( - var_name="target_cl", - var_type=float, - default_value=1.0, - unit="1", - descr="Value of CL to achieve to have a level flight with the given conditions", - xpath=EDGE_TARGET_CL_XPATH, - gui=False, - gui_name=None, - gui_group=None, -) - cpacs_inout.add_input( var_name="fixed_cl", var_type=str, @@ -155,42 +117,6 @@ gui_group=None, ) -cpacs_inout.add_input( - var_name="damping_der", - var_type=bool, - default_value=False, - unit="1", - descr="To check if damping derivatives should be calculated or not", - xpath=EDGE_DAMPING_DER_XPATH, - gui=True, - gui_name="Damping Derivatives", - gui_group="Aeromap Options", -) - -cpacs_inout.add_input( - var_name="rotation_rate", - var_type=float, - default_value=1.0, - unit="rad/s", - descr="Rotation rate use to calculate damping derivatives", - xpath=EDGE_ROTATION_RATE_XPATH, - gui=True, - gui_name="Rotation Rate", - gui_group="Aeromap Options", -) - -cpacs_inout.add_input( - var_name="control_surf", - var_type=bool, - default_value=False, - unit="1", - descr="To check if control surfaces deflections should be calculated or not", - xpath=EDGE_CONTROL_SURF_XPATH, - gui=True, - gui_name="Control Surfaces", - gui_group="Aeromap Options", -) - cpacs_inout.add_input( var_name="nb_proc", var_type=int, @@ -227,66 +153,6 @@ gui_group="EDGE Parameters", ) -cpacs_inout.add_input( - var_name="cfl_adapt", - var_type=bool, - default_value=False, - unit="1", - descr="CFL Adaptation", - xpath=EDGE_CFL_ADAPT_XPATH, - gui=True, - gui_name="CFL Adaptation", - gui_group="EDGE Parameters", -) - -cpacs_inout.add_input( - var_name="cfl_adapt_param_factor_down", - var_type=float, - default_value=0.5, - unit="1", - descr="CFL Adaptation Factor Down", - xpath=EDGE_CFL_ADAPT_PARAM_DOWN_XPATH, - gui=True, - gui_name="CFL Adaptation Factor Down", - gui_group="EDGE Parameters", -) - -cpacs_inout.add_input( - var_name="cfl_adapt_param_factor_up", - var_type=float, - default_value=1.5, - unit="1", - descr="CFL Adaptation Factor Up", - xpath=EDGE_CFL_ADAPT_PARAM_UP_XPATH, - gui=True, - gui_name="CFL Adaptation Factor Up", - gui_group="EDGE Parameters", -) - -cpacs_inout.add_input( - var_name="cfl_adapt_param_min", - var_type=float, - default_value=0.5, - unit="1", - descr="CFL Minimum Value", - xpath=EDGE_CFL_MIN_XPATH, - gui=True, - gui_name="CFL Min Value", - gui_group="EDGE Parameters", -) - -cpacs_inout.add_input( - var_name="cfl_adapt_param_max", - var_type=float, - default_value=100, - unit="1", - descr="CFL Maximum Value", - xpath=EDGE_CFL_MAX_XPATH, - gui=True, - gui_name="CFL Max Value", - gui_group="EDGE Parameters", -) - cpacs_inout.add_input( var_name="mg_level", var_type=int, @@ -299,6 +165,18 @@ gui_group="EDGE Parameters", ) +cpacs_inout.add_input( + var_name="calculation_type", + var_type=list, + default_value=["RANS", "Euler"], + unit="1", + descr="Chose if perform a RANS or an Euler calculation", + xpath=EDGE_SOLVER, + gui=True, + gui_name="Solver for calculation", + gui_group="EDGE parameters", +) + cpacs_inout.add_input( var_name="EDGE_mesh_path", var_type="pathtype", @@ -311,93 +189,6 @@ gui_group="Inputs", ) -cpacs_inout.add_input( - var_name="update_wetted_area", - var_type=bool, - default_value=False, - unit="1", - descr="Option to update the wetted area from the latest EDGE result.", - xpath=EDGE_UPDATE_WETTED_AREA_XPATH, - gui=True, - gui_name="Update Wetted Area", - gui_group="Results", -) - -cpacs_inout.add_input( - var_name="check_extract_loads", - var_type=bool, - default_value=False, - unit="1", - descr="Option to extract loads (forces in each point) from results", - xpath=EDGE_EXTRACT_LOAD_XPATH, - gui=True, - gui_name="Extract loads", - gui_group="Results", -) - -# Actuator disk - -cpacs_inout.add_input( - var_name="include_actuator_disk", - var_type=bool, - default_value=False, - unit="1", - descr="To check if actuator disk(s) should be included in the EDGE calculation", - xpath=EDGE_ACTUATOR_DISK_XPATH, - gui=True, - gui_name="Include actuator disk(s)", - gui_group="Actuator disk", -) - -cpacs_inout.add_input( - var_name="thrust", - var_type=float, - default_value=3000, - unit="N", - descr="Aircraft thrust", - xpath=PROP_XPATH + "/propeller/thrust", - gui=True, - gui_name="Thrust", - gui_group="Actuator disk", -) - -# cpacs_inout.add_input( -# var_name="n", -# var_type=float, -# default_value=33, -# unit="1/s", -# descr="Propeller rotational velocity", -# xpath=PROP_XPATH + "/propeller/rotational_velocity", -# gui=True, -# gui_name="Rotational velocity setting", -# gui_group="Actuator disk", -# ) - -cpacs_inout.add_input( - var_name="prandtl", - var_type=bool, - default_value=False, - unit=None, - descr="Enable or disable the tip loss correction of Prandtl", - xpath=PROP_XPATH + "/propeller/blade/loss", - gui=True, - gui_name="Tip loss correction", - gui_group="Actuator disk", -) - -# cpacs_inout.add_input( -# var_name="blades_number", -# var_type=int, -# default_value=3, -# unit=None, -# descr="Number of propeller blades", -# xpath=PROP_XPATH + "/propeller/bladeNumber", -# gui=True, -# gui_name="Propeller blades numbers", -# gui_group="Actuator disk", -# ) - - # ----- Output ----- cpacs_inout.add_output( @@ -409,24 +200,6 @@ xpath=GEOM_XPATH + "/analyses/wettedArea", ) -cpacs_inout.add_output( - var_name="bc_wall_list", - var_type=list, - default_value=None, - unit="1", - descr="Wall boundary conditions found in the EDGE mesh", - xpath=EDGE_BC_WALL_XPATH, -) - -cpacs_inout.add_output( - var_name="bc_farfield_list", - var_type=list, - default_value=None, - unit="1", - descr="Farfield boundary conditions found in the EDGE mesh (for off engines)", - xpath=EDGE_BC_FARFIELD_XPATH, -) - cpacs_inout.add_output( var_name="aeromap_EDGE", # name to change... # var_type=CPACS_aeroMap, # no type pour output, would it be useful? diff --git a/ceasiompy/EdgeRun/moduletemplate.py b/ceasiompy/EdgeRun/moduletemplate.py deleted file mode 100644 index fe0a536d9..000000000 --- a/ceasiompy/EdgeRun/moduletemplate.py +++ /dev/null @@ -1,207 +0,0 @@ -""" -CEASIOMpy: Conceptual Aircraft Design Software - -Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland - -Small description of the script - -Python version: >=3.8 - -| Author: Name -| Creation: YEAR-MONTH-DAY - -TODO: - - * Things to improve ... - * Things to add ... - -""" - -# ================================================================================================= -# IMPORTS -# ================================================================================================= - -from pathlib import Path - - -from ambiance import Atmosphere -from ceasiompy.ModuleTemplate.func.subfunc import my_subfunc -from ceasiompy.utils.ceasiomlogger import get_logger -from ceasiompy.utils.moduleinterfaces import ( - check_cpacs_input_requirements, - get_toolinput_file_path, - get_tooloutput_file_path, -) -from ceasiompy.utils.commonxpath import FUSELAGES_XPATH -from cpacspy.cpacsfunctions import ( - add_float_vector, - add_string_vector, - add_uid, - copy_branch, - create_branch, - get_float_vector, - get_string_vector, - get_tigl_configuration, - get_uid, - get_value, - get_value_or_default, - get_xpath_parent, - open_tigl, - open_tixi, -) - -log = get_logger() - -MODULE_DIR = Path(__file__).parent -MODULE_NAME = MODULE_DIR.name - - -# ================================================================================================= -# CLASSES -# ================================================================================================= - - -class MyClass: - """ - Description of the class - - Attributes: - var_a (float): Argument a [unit] - var_b (float): Argument b [unit] - - .. seealso:: - - See some other source - - """ - - def __init__(self, a=1.1, b=2.2): - self.var_a = a - self.var_b = b - self.var_c = 0.0 - - def add_my_var(self): - """This methode will sum up var_a and var_b in var_c""" - - self.var_c = self.var_a + self.var_b - - -# ================================================================================================= -# FUNCTIONS -# ================================================================================================= - - -def sum_funcion(arg1, arg2): - """Function to calculate ... - - Function 'sum_funcion' return the total of arg1 and arg2, after it convert - arg1 into an float. - - Source: - * Reference paper or book, with author and date - - Args: - arg1 (interger): Argument 1 [unit] - arg2 (float): Argument 2 [unit] - - Returns: - total (float): Output1 [unit] - - .. warning:: - - Example of warning - """ - - if not isinstance(arg1, int): - raise ValueError("arg1 is not an integer") - - # Use of a subfunction here - print(my_subfunc("test1", "test2")) - - total = float(arg1) + arg2 - - return total - - -def get_fuselage_scaling(cpacs_path, cpacs_out_path): - """Function to get fuselage scaling along x,y,z axis. - - Function 'get_fuselage_scaling' return the value of the scaling for the - fuselage. (This is an example function just to show usage of CPACS and tixi) - - Source: - * Reference paper or book, with author and date - - Args: - cpacs_path (Path): Path to CPACS file - cpacs_out_path (Path):Path to CPACS output file - - Returns: - Tuple with fuselage scaling - - * x (float): Scaling on x [-] - * y (float): Scaling on y [-] - * z (float): Scaling on z [-] - """ - - # Open TIXI handle - tixi = open_tixi(cpacs_path) - - # Create xpaths - SCALING_XPATH = "/fuselage/transformation/scaling" - - x_fus_scaling_xpath = FUSELAGES_XPATH + SCALING_XPATH + "/x" - y_fus_scaling_xpath = FUSELAGES_XPATH + SCALING_XPATH + "/y" - z_fus_scaling_xpath = FUSELAGES_XPATH + SCALING_XPATH + "/z" - - # Get values - x = get_value(tixi, x_fus_scaling_xpath) - y = get_value(tixi, y_fus_scaling_xpath) - z = get_value(tixi, z_fus_scaling_xpath) - - # Log - log.info("Fuselage x scaling is : " + str(x)) - log.info("Fuselage y scaling is : " + str(y)) - log.info("Fuselage z scaling is : " + str(z)) - - # Close TIXI handle and save the CPACS file - tixi.save(str(cpacs_out_path)) - - return (x, y, z) - - -# ================================================================================================= -# MAIN -# ================================================================================================= - - -def main(cpacs_path, cpacs_out_path): - - log.info("----- Start of " + MODULE_NAME + " -----") - - check_cpacs_input_requirements(cpacs_path) - - # Define other inputs value - my_value1 = 6 - my_value2 = 5.5 - - # Call 'sum_function' - my_total = sum_funcion(my_value1, my_value2) - log.info("My total is equal to: " + str(my_total)) - - # Call a function which use CPACS inputs - x, y, z = get_fuselage_scaling(cpacs_path, cpacs_out_path) - log.info("Value x,y,z as been calculated") - log.info("x = " + str(x)) - log.info("y = " + str(y)) - log.info("z = " + str(z)) - - log.info("----- End of " + MODULE_NAME + " -----") - - -if __name__ == "__main__": - - cpacs_path = get_toolinput_file_path(MODULE_NAME) - cpacs_out_path = get_tooloutput_file_path(MODULE_NAME) - - main(cpacs_path, cpacs_out_path) diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index e0788d134..18ed4aa47 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -151,6 +151,7 @@ EDGE_CFL_NB_XPATH = EDGE_XPATH + "/settings/cflNumber/value" EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" EDGE_FIXED_CL_XPATH = EDGE_XPATH + "/fixedCL" +EDGE_SOLVER = EDGE_XPATH + "/solver" # RANGE RANGE_LD_RATIO_XPATH = CEASIOMPY_XPATH + "/ranges/lDRatio" From 5ad406f185445a7c79d19893b78db7ff0998af46 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Thu, 18 Jan 2024 16:07:20 +0100 Subject: [PATCH 32/80] modified: ../func/edgeconfig.py modified: test_edgerun_submit.py changed function name in edgeconfig.py from generate_edge_cfd_ainp() edge_cfd() --- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- ceasiompy/EdgeRun/tests/test_edgerun_submit.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 083ab0507..f13e62a0f 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -83,7 +83,7 @@ # ================================================================================================= -def generate_edge_cfd_ainp(cpacs_path, cpacs_out_path, wkdir): +def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # output_path = Path(case_dir_path, AINP_CFD_NAME) """Function to create Edge input (*.ainp) file. diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py index a0f94b1dc..d4e9801fe 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py @@ -28,7 +28,7 @@ # Now you can import and use the ceasiompy module # import ceasiompy -from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp +from ceasiompy.EdgeRun.func.edgeconfig import edge_cfd import os from ceasiompy.EdgeRun.edgerun import run_edge_multi from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH @@ -47,4 +47,4 @@ if not os.path.exists(wkdir): os.makedirs(wkdir) -generate_edge_cfd_ainp(cpacs_in_path, cpacs_out_path, wkdir) +edge_cfd(cpacs_in_path, cpacs_out_path, wkdir) From 816800692a43b092a3f8ea226fac26579a716fb1 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Fri, 19 Jan 2024 11:58:57 +0100 Subject: [PATCH 33/80] edgerun workflow --- ceasiompy/EdgeRun/edgerun.py | 20 +++++------ ceasiompy/EdgeRun/func/edgeconfig.py | 33 ++++++++++--------- .../pages/01_ \342\236\241_Workflow.py" | 4 +-- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 1557748ba..6b09b90d9 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -22,7 +22,7 @@ from ceasiompy.utils.ceasiompyutils import ( get_reasonable_nb_cpu, get_results_directory, -# run_software, + # run_software, ) # from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME @@ -39,7 +39,6 @@ MODULE_NAME = MODULE_DIR.name - # ================================================================================================= # CLASSES # ================================================================================================= @@ -50,7 +49,8 @@ # ================================================================================================= input_que_script_path = get_edge_queScript_template() -def run_edge_multi(wkdir, input_que_script_path , nb_proc=2): + +def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): """Function to run a multiple Edge calculation. Function 'run_edge_multi' will run in the given working directory Edge calculations. @@ -63,21 +63,20 @@ def run_edge_multi(wkdir, input_que_script_path , nb_proc=2): if not wkdir.exists(): raise OSError(f"The working directory : {wkdir} does not exist!") - + case_dir_name = ( - f"Case{str(case_nb).zfill(2)}_alt{alt}_mach{round(mach, 2)}" - f"_aoa{round(aoa, 1)}_aos{round(aos, 1)}" - ) + f"Case{str(case_nb).zfill(2)}_alt{alt}_mach{round(mach, 2)}" + f"_aoa{round(aoa, 1)}_aos{round(aos, 1)}" + ) case_dir_path = Path(wkdir, case_dir_name) if not case_dir_path.exists(): - case_dir_path.mkdir() + case_dir_path.mkdir() output_path = Path(case_dir_path, AINP_CFD_NAME) case_dir_list = [dir for dir in wkdir.iterdir() if "Case" in dir.name] if not case_dir_list: raise OSError(f"No Case directory has been found in the working directory: {wkdir}") - for config_dir in sorted(case_dir_list): current_dir = Path(case_dir_path, config_dir) @@ -89,12 +88,13 @@ def run_edge_multi(wkdir, input_que_script_path , nb_proc=2): if len(config_cfd) > 1: raise ValueError(f"More than one '{AINP_CFD_NAME}' file in this directory!") - + # run / submit edge commands edge_scripts_instance = EdgeScripts(current_dir, input_que_script_path, AINP_CFD_NAME) edge_scripts_instance.submit_preprocessor_script() edge_scripts_instance.submit_solver_script(nb_proc) + # ================================================================================================= # MAIN # ================================================================================================= diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index f13e62a0f..a4364d7df 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -20,7 +20,7 @@ # IMPORTS # ================================================================================================= -import math,os +import math, os from pathlib import Path from shutil import copyfile @@ -43,7 +43,6 @@ ) from ceasiompy.utils.commonxpath import ( GMSH_SYMMETRY_XPATH, - PROP_XPATH, RANGE_XPATH, EDGE_MESH_XPATH, EDGE_AEROMAP_UID_XPATH, @@ -66,6 +65,7 @@ from cpacspy.cpacspy import CPACS from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template from ceasiompy.EdgeRun.func.edge_queScript_gen import EdgeScripts + # import cpacs log = get_logger() @@ -73,6 +73,8 @@ MODULE_DIR = Path(__file__).parent input_que_script_path = get_edge_queScript_template() + + # ================================================================================================= # CLASSES # ================================================================================================= @@ -108,7 +110,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): if not edge_mesh.is_file(): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") # copy edge_mesh and edge_aboc file to the Working directory - + grid_folder = Path(wkdir, "grid") to_grid = grid_folder / edge_mesh.name to_aboc = grid_folder / edge_aboc.name @@ -118,7 +120,6 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): copyfile(edge_mesh, to_grid) copyfile(edge_aboc, to_aboc) - # Get the fixedCL value from CPACS fixed_cl = get_value_or_default(cpacs.tixi, EDGE_FIXED_CL_XPATH, "NO") if fixed_cl == "NO": @@ -195,7 +196,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): CFL = get_value_or_default(cpacs.tixi, EDGE_CFL_NB_XPATH, 1.5) NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) - INSEUL = int(get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH, 0)) + INSEUL = int(get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH, 0)) # Parameters which will vary for the different cases (alt,mach,aoa,aos) for case_nb in range(len(alt_list)): @@ -289,26 +290,28 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # create and submit the edge-run scripts # run / submit edge commands jobname = case_dir_name - edge_scripts_instance = EdgeScripts(jobname,case_dir_path, input_que_script_path, AINP_CFD_NAME) - + edge_scripts_instance = EdgeScripts( + jobname, case_dir_path, input_que_script_path, AINP_CFD_NAME + ) + bedg_files_exist = True - for i in range(1, NPART+1): - bedg_file_path = Path(case_dir_path, grid_folder, f'Edge.bedg_p{i}') + for i in range(1, NPART + 1): + bedg_file_path = Path(case_dir_path, grid_folder, f"Edge.bedg_p{i}") if not bedg_file_path.exists(): bedg_files_exist = False break if not bedg_files_exist: - #edge_scripts_instance.submit_preprocessor_script(case_dir_path) + # edge_scripts_instance.submit_preprocessor_script(case_dir_path) edge_scripts_instance.run_preprocessor(case_dir_path) - print('bedg files are generated') - #else: + print("bedg files are generated") + # else: # print('bedg files exist, not generated') - #edge_scripts_instance.submit_solver_script(case_dir_path,NPART) - edge_scripts_instance.run_edgesolver(case_dir_path,NPART) + # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) + edge_scripts_instance.run_edgesolver(case_dir_path, NPART) # postprocess for results - edge_scripts_instance.postprocess_script(case_dir_path,edge_mesh) + edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) # wait until the results are generated cpacs.save_cpacs(cpacs_out_path, overwrite=True) diff --git "a/src/streamlit/pages/01_ \342\236\241_Workflow.py" "b/src/streamlit/pages/01_ \342\236\241_Workflow.py" index 27ac8306e..c35fe1d4f 100644 --- "a/src/streamlit/pages/01_ \342\236\241_Workflow.py" +++ "b/src/streamlit/pages/01_ \342\236\241_Workflow.py" @@ -60,13 +60,13 @@ def section_predefined_workflow(): - st.markdown("#### Predefined Workflows") predefine_workflows = [ ["PyTornado", "WeightConventional"], ["CPACS2GMSH", "SU2Run", "SkinFriction"], ["CPACS2SUMO", "SUMOAutoMesh", "SU2Run", "ExportCSV"], + ["CPACS2SUMO", "SUMOAutoMesh", "EdgeRun"], ] for workflow in predefine_workflows: @@ -75,7 +75,6 @@ def section_predefined_workflow(): def section_add_module(): - st.markdown("#### Your workflow") if "workflow_modules" not in st.session_state: @@ -83,7 +82,6 @@ def section_add_module(): if len(st.session_state.workflow_modules): for i, module in enumerate(st.session_state.workflow_modules): - col1, col2, col3, _ = st.columns([6, 1, 1, 5]) with col1: From 031aaf3df0d59cf67e365949868cb7facde9976e Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 20 Jan 2024 12:16:51 +0100 Subject: [PATCH 34/80] modified: edgeconfig.py removed/commented line 39, unused function --- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index a4364d7df..c62f6ee23 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -36,7 +36,7 @@ # write_header, # ) -from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template +#from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.commonnames import ( AINP_CFD_NAME, From 27661f34ff7d3740ba079fee13fa3573a04e69f3 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 20 Jan 2024 12:57:50 +0100 Subject: [PATCH 35/80] modified: edgerun.py call the correct name edge_cfd in edgeconfig.py --- ceasiompy/EdgeRun/edgerun.py | 33 +++++++++++++++---- ceasiompy/EdgeRun/func/edgeconfig.py | 4 +++ .../EdgeRun/tests/test_edgerun_submit.py | 2 +- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 6b09b90d9..91d9273b9 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -16,8 +16,8 @@ # ================================================================================================= from pathlib import Path - -from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp +from cpacspy.cpacspy import CPACS +from ceasiompy.EdgeRun.func.edgeconfig import edge_cfd from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.ceasiompyutils import ( get_reasonable_nb_cpu, @@ -27,7 +27,7 @@ # from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME from ceasiompy.utils.commonnames import AINP_CFD_NAME -from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH +from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH, EDGE_MESH_XPATH from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path from cpacspy.cpacsfunctions import get_value_or_default, open_tixi from ceasiompy.EdgeRun.func.edge_queScript_gen import EdgeScripts @@ -60,6 +60,9 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): wkdir (Path): Path to the working directory nb_proc (int): Number of processor that should be used to run the calculation in parallel """ + cpacs = CPACS(cpacs_path) + + edge_mesh = Path(get_value(cpacs.tixi, EDGE_MESH_XPATH)) if not wkdir.exists(): raise OSError(f"The working directory : {wkdir} does not exist!") @@ -91,8 +94,23 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): # run / submit edge commands edge_scripts_instance = EdgeScripts(current_dir, input_que_script_path, AINP_CFD_NAME) - edge_scripts_instance.submit_preprocessor_script() - edge_scripts_instance.submit_solver_script(nb_proc) + # check if preprocessor is already run + bedg_files_exist = True + for i in range(1, nb_proc + 1): + bedg_file_path = Path(case_dir_path, grid_folder, f"Edge.bedg_p{i}") + if not bedg_file_path.exists(): + bedg_files_exist = False + break + if not bedg_files_exist: + # edge_scripts_instance.submit_preprocessor_script(case_dir_path) + edge_scripts_instance.run_preprocessor(case_dir_path) + print("bedg files are generated") + + #edge_scripts_instance.submit_solver_script(nb_proc) + edge_scripts_instance.run_solver(nb_proc) + + # postprocess for results + edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) # ================================================================================================= @@ -105,14 +123,15 @@ def main(cpacs_path, cpacs_out_path): tixi = open_tixi(cpacs_path) nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) + results_dir = get_results_directory("EdgeRun") # Temporary CPACS to be stored after "generate_edge_cfd_ainp" cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") - generate_edge_cfd_ainp(cpacs_path, cpacs_tmp_cfg, results_dir) - run_edge_multi(results_dir, nb_proc) + edge_cfd(cpacs_path, cpacs_tmp_cfg, results_dir) + #run_edge_multi(results_dir, nb_proc) # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) log.info("----- End of " + MODULE_NAME + " -----") diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index c62f6ee23..a4b4476d2 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -289,6 +289,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # cfg.write_file(config_output_path, overwrite=True) # create and submit the edge-run scripts # run / submit edge commands + jobname = case_dir_name edge_scripts_instance = EdgeScripts( jobname, case_dir_path, input_que_script_path, AINP_CFD_NAME @@ -305,14 +306,17 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # edge_scripts_instance.submit_preprocessor_script(case_dir_path) edge_scripts_instance.run_preprocessor(case_dir_path) print("bedg files are generated") + # else: # print('bedg files exist, not generated') # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) + edge_scripts_instance.run_edgesolver(case_dir_path, NPART) # postprocess for results edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) # wait until the results are generated + cpacs.save_cpacs(cpacs_out_path, overwrite=True) # ================================================================================================= diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py index d4e9801fe..382a0a776 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py @@ -39,7 +39,7 @@ input_que_script_path = get_edge_queScript_template() # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") -cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') +cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/CPACS_selected_from_GUI.xml') cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" From 957efe7983c2f669d8a158bb062d6c4e9b3639ea Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 20 Jan 2024 13:56:18 +0100 Subject: [PATCH 36/80] modified: edgeconfig.py commented postprocess for now --- WKDIR/labARstraight_toolInput.xml | 2 +- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WKDIR/labARstraight_toolInput.xml b/WKDIR/labARstraight_toolInput.xml index 71ba5bb63..83fae1cfe 100644 --- a/WKDIR/labARstraight_toolInput.xml +++ b/WKDIR/labARstraight_toolInput.xml @@ -935,7 +935,7 @@ - su2 + edge diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index a4b4476d2..71d72ceca 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -314,7 +314,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): edge_scripts_instance.run_edgesolver(case_dir_path, NPART) # postprocess for results - edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) + #edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) # wait until the results are generated cpacs.save_cpacs(cpacs_out_path, overwrite=True) From 22ca4e5bbaab05078ad8e66265a8788d03200426 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 20 Jan 2024 14:19:04 +0100 Subject: [PATCH 37/80] modified: ../files/default.ainp.tmp modified: edgeconfig.py modified: ../../utils/create_ainpfile.py changed to copy the edge_mesh and aboc names to /grid --- ceasiompy/EdgeRun/files/default.ainp.tmp | 4 ++-- ceasiompy/EdgeRun/func/edgeconfig.py | 6 +++++- ceasiompy/utils/create_ainpfile.py | 4 ++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ceasiompy/EdgeRun/files/default.ainp.tmp b/ceasiompy/EdgeRun/files/default.ainp.tmp index 30abac877..75df3204c 100644 --- a/ceasiompy/EdgeRun/files/default.ainp.tmp +++ b/ceasiompy/EdgeRun/files/default.ainp.tmp @@ -1826,7 +1826,7 @@ VGKCONSTSCALE,R ,1,1,0 * The mesh file ( .bmsh ) * CFIMSH,L ,1,1,0 -'../grid/Edge.bmsh ' +'../grid/__BMSH__ ' * *************************************************************************** * Edge file name from the preprocessor ( .bedg ) @@ -1838,7 +1838,7 @@ CFIEDG,L ,1,1,0 * The boundary condition file ( .aboc ) * CFIBOC,L ,1,1,0 -'../grid/Edge.aboc ' +'../grid/__ABOC__ ' * *************************************************************************** * The residual file ( .bres ) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 71d72ceca..9f264d03a 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -184,7 +184,9 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): sym_factor = 2.0 # General parameters - # cfg["RESTART_SOL"] = "NO" + # + BMSH = edge_mesh.name + ABOC = edge_aboc.name CREF = cpacs.aircraft.ref_length SREF = cpacs.aircraft.ref_area / sym_factor BREF = SREF / CREF @@ -263,6 +265,8 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # create_ainp_instance = CreateAinp(get_edge_ainp_template()) create_ainp_instance.create_ainp( + BMSH, + ABOC, UFREE, VFREE, WFREE, diff --git a/ceasiompy/utils/create_ainpfile.py b/ceasiompy/utils/create_ainpfile.py index 292c7ae64..c4af0aba6 100644 --- a/ceasiompy/utils/create_ainpfile.py +++ b/ceasiompy/utils/create_ainpfile.py @@ -40,6 +40,8 @@ def _write_file(self, content, output_file_withpath): def create_ainp( self, + BMSH, + ABOC, UFREE, VFREE, WFREE, @@ -68,6 +70,8 @@ def create_ainp( # Define a dictionary for keyword-value pairs replacements = { + "__BMSH__": f"../grid/{BMSH}", + "__ABOC__": f"../grid/{ABOC}", "__UFREE__": str(UFREE), "__VFREE__": str(VFREE), "__WFREE__": str(WFREE), From 3ab5f15c339c974a4e8d2490fa7e7aaaf746b8d9 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 22 Jan 2024 15:21:03 +0100 Subject: [PATCH 38/80] modified: ../edgerun.py changed result folder from EdgeRun to MEdge modified: edgeconfig.py added some log output for preprocessor and running_solver --- ceasiompy/EdgeRun/edgerun.py | 2 +- ceasiompy/EdgeRun/func/edgeconfig.py | 3 ++- ceasiompy/EdgeRun/tests/test_edgerun_submit.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 91d9273b9..66075c987 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -125,7 +125,7 @@ def main(cpacs_path, cpacs_out_path): nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) - results_dir = get_results_directory("EdgeRun") + results_dir = get_results_directory("MEdge") # Temporary CPACS to be stored after "generate_edge_cfd_ainp" cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 9f264d03a..3d292d9a1 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -308,13 +308,14 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): if not bedg_files_exist: # edge_scripts_instance.submit_preprocessor_script(case_dir_path) + log.info("Running Edge preprocessor for Case..." + case_dir_name ) edge_scripts_instance.run_preprocessor(case_dir_path) print("bedg files are generated") # else: # print('bedg files exist, not generated') # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) - + log.info("Running Edge solver for Case..." + case_dir_name ) edge_scripts_instance.run_edgesolver(case_dir_path, NPART) # postprocess for results diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py index 382a0a776..0b871e1d2 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py @@ -41,7 +41,7 @@ # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/CPACS_selected_from_GUI.xml') cpacs_out_path = MODULE_DIR / "ToolOutput.xml" -wkdir = MODULE_DIR / "Results/Edge" +wkdir = MODULE_DIR / "Results" if not os.path.exists(wkdir): From 5579cba950582d7dc9d5837cdbf4f900dd00781d Mon Sep 17 00:00:00 2001 From: GBenedett Date: Mon, 22 Jan 2024 16:00:30 +0100 Subject: [PATCH 39/80] spec Edge --- ceasiompy/EdgeRun/__specs__.py | 9 ++++----- ceasiompy/EdgeRun/edgerun.py | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index d86028ab2..fc8c8ae98 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -1,6 +1,5 @@ from pathlib import Path -from ceasiompy.utils.ceasiompyutils import get_reasonable_nb_cpu from ceasiompy.utils.commonxpath import ( AEROPERFORMANCE_XPATH, GEOM_XPATH, @@ -120,7 +119,7 @@ cpacs_inout.add_input( var_name="nb_proc", var_type=int, - default_value=get_reasonable_nb_cpu(), + default_value=64, unit="1", descr="Number of proc to use to run EDGE", xpath=EDGE_NB_CPU_XPATH, @@ -156,8 +155,8 @@ cpacs_inout.add_input( var_name="mg_level", var_type=int, - default_value=3, - unit="3", + default_value=1, + unit="1", descr="Multi-grid level (0 = no multigrid)", xpath=EDGE_MG_LEVEL_XPATH, gui=True, @@ -168,7 +167,7 @@ cpacs_inout.add_input( var_name="calculation_type", var_type=list, - default_value=["RANS", "Euler"], + default_value=["Euler", "RANS"], unit="1", descr="Chose if perform a RANS or an Euler calculation", xpath=EDGE_SOLVER, diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 91d9273b9..12c6ebe39 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -106,7 +106,7 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): edge_scripts_instance.run_preprocessor(case_dir_path) print("bedg files are generated") - #edge_scripts_instance.submit_solver_script(nb_proc) + # edge_scripts_instance.submit_solver_script(nb_proc) edge_scripts_instance.run_solver(nb_proc) # postprocess for results @@ -123,7 +123,6 @@ def main(cpacs_path, cpacs_out_path): tixi = open_tixi(cpacs_path) nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) - results_dir = get_results_directory("EdgeRun") @@ -131,7 +130,7 @@ def main(cpacs_path, cpacs_out_path): cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") edge_cfd(cpacs_path, cpacs_tmp_cfg, results_dir) - #run_edge_multi(results_dir, nb_proc) + # run_edge_multi(results_dir, nb_proc) # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) log.info("----- End of " + MODULE_NAME + " -----") From 5e0900df46d74d51b1cf347185da6422918d3675 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 22 Jan 2024 20:57:11 +0100 Subject: [PATCH 40/80] modified: ../edgerun.py changed results_dir = get_results_directory("EdgeRun") back from ("MEdge"), but this must be fixed later --- ceasiompy/EdgeRun/edgerun.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 66075c987..91d9273b9 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -125,7 +125,7 @@ def main(cpacs_path, cpacs_out_path): nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) - results_dir = get_results_directory("MEdge") + results_dir = get_results_directory("EdgeRun") # Temporary CPACS to be stored after "generate_edge_cfd_ainp" cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") From 729ac4598251ed3bd18606e4051c249d1ca4ad09 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Tue, 23 Jan 2024 22:38:32 +0100 Subject: [PATCH 41/80] modified: ceasiompy/EdgeRun/edgerun.py modified: ceasiompy/EdgeRun/func/edge_queScript_gen.py modified: ceasiompy/EdgeRun/func/edgeconfig.py added postprocessing for extracting forces in edgerun, and cleared out the postprocessing in edge_queScript_gen added some info.logging in edgeconfig --- ceasiompy/EdgeRun/edgerun.py | 60 +++++++++++++++++++- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 20 ++++--- ceasiompy/EdgeRun/func/edgeconfig.py | 10 ++-- 3 files changed, 75 insertions(+), 15 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 12c6ebe39..cd076e43a 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -14,7 +14,7 @@ # ================================================================================================= # IMPORTS # ================================================================================================= - +import os, re from pathlib import Path from cpacspy.cpacspy import CPACS from ceasiompy.EdgeRun.func.edgeconfig import edge_cfd @@ -26,6 +26,12 @@ ) # from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME +from cpacspy.cpacsfunctions import ( + create_branch, + get_string_vector, + get_value, + get_value_or_default, +) from ceasiompy.utils.commonnames import AINP_CFD_NAME from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH, EDGE_MESH_XPATH from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path @@ -77,6 +83,7 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): case_dir_path.mkdir() output_path = Path(case_dir_path, AINP_CFD_NAME) + case_dir_list = [dir for dir in wkdir.iterdir() if "Case" in dir.name] if not case_dir_list: raise OSError(f"No Case directory has been found in the working directory: {wkdir}") @@ -112,6 +119,55 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): # postprocess for results edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) +def extract_edge_forces(results_dir): + # Use list comprehension to get a list of directory names starting with "Case" + dir_names = [dir_name for dir_name in os.listdir(results_dir) if os.path.isdir(os.path.join(results_dir, dir_name)) and dir_name.startswith("Case")] + + # Define the header for the forcemoments file + header = " alt mach alfa beta CL CD CDP CDV CM " + + + # Loop through the list and perform actions in each directory + for dir_name in dir_names: + dir_path = os.path.join(results_dir, dir_name) + #print(f"Processing directory: {dir_path}") + log.info(f"Extracting forces from Directory : {dir_name}") + + # Extract mach and alfa from directory name + match = re.match(r'.*alt(\d+\.\d+)_mach(\d+\.\d+)_aoa(\d+\.\d+)_aos(\d+\.\d+)*', dir_name) + if match: + alt = float(match.group(1)) + mach = float(match.group(2)) + aoa = float(match.group(3)) + aos = float(match.group(4)) + #print(f" - alt: {alt}, mach: {mach}, aoa: {aoa}, aos: {aos}") + + # Extract information from Edge.log file + filelog = os.path.join(dir_path, 'Edge.log') + with open(filelog, 'r') as log_file: + lines = log_file.readlines() + + total_line_number = next((i for i, line in enumerate(lines) if ' Total:' in line), None) + if total_line_number is not None: + line = total_line_number + 4 + CL = lines[line].split()[0] + CD = lines[line].split()[1] + CM = lines[line].split()[3] + + line += 2 + CDP = lines[line].split()[1] + + line += 2 + CDV = lines[line].split()[1] + + # Append values to forcemoments file + forcemoments = os.path.join(results_dir, 'Edge_force_moment.dat') + with open(forcemoments, 'a') as output_file: + # Check if the file is empty and add the header + if os.stat(forcemoments).st_size == 0: + output_file.write(header + "\n") + output_file.write(f"{alt:.8f} {mach:.8f} {aoa:.8f} {aos:.8f} {CL} {CD} {CDP} {CDV} {CM}\n") + log.info(f"Saving forces to file: {forcemoments}") # ================================================================================================= # MAIN @@ -130,6 +186,8 @@ def main(cpacs_path, cpacs_out_path): cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") edge_cfd(cpacs_path, cpacs_tmp_cfg, results_dir) + extract_edge_forces(results_dir) + log.info("Edge Postprocess finished") # run_edge_multi(results_dir, nb_proc) # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py index 902e2a467..9138bb9af 100644 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ b/ceasiompy/EdgeRun/func/edge_queScript_gen.py @@ -85,15 +85,15 @@ def run_edgesolver(self, dir_path, nb_proc): os.system(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') def postprocess_script(self, dir_path,edge_grid): - ffaucut = os.path.join(self.Edge_dir, 'ffaucut') - ffauinterpol = os.path.join(self.Edge_dir, 'ffauinterpol') - ffa2tab = os.path.join(self.Edge_dir, 'ffa2tab') + #ffaucut = os.path.join(self.Edge_dir, 'ffaucut') + #ffauinterpol = os.path.join(self.Edge_dir, 'ffauinterpol') + #ffa2tab = os.path.join(self.Edge_dir, 'ffa2tab') ffa2engold = os.path.join(self.Edge_dir, 'ffa2engold') grid = edge_grid # output file names - walldata1 = "Edge_wall.dat" - walldata2 = "Edge_wall.cf" + #walldata1 = "Edge_wall.dat" + #walldata2 = "Edge_wall.cf" forcemoments = "Edge_force_moment.dat" ensgoldprefix = "zzz" solution1 = "Edge.bout" @@ -102,9 +102,11 @@ def postprocess_script(self, dir_path,edge_grid): # Enter the folder os.chdir(dir_path) - # Extract the boundary - input_data = """1 - 0 + """ + # Extract the boundary + input_data = """ + #1 + #0 """ with subprocess.Popen([ffaucut, grid, 'tmp1'], stdin=subprocess.PIPE, text=True) as process: process.communicate(input=input_data) @@ -121,7 +123,7 @@ def postprocess_script(self, dir_path,edge_grid): # Cleanup for temp_file in ['tmp1', 'tmp11', 'tmp12']: os.remove(temp_file) - + """ # Create ensight gold files subprocess.run([ffa2engold, grid, solution1, ensgoldprefix]) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 3d292d9a1..3ef1938eb 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -308,15 +308,15 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): if not bedg_files_exist: # edge_scripts_instance.submit_preprocessor_script(case_dir_path) - log.info("Running Edge preprocessor for Case..." + case_dir_name ) + log.info("Running Edge preprocessor ...") edge_scripts_instance.run_preprocessor(case_dir_path) - print("bedg files are generated") + log.info("Preprocessor is done. *.bedg files are generated") - # else: - # print('bedg files exist, not generated') + # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) - log.info("Running Edge solver for Case..." + case_dir_name ) + log.info("Running Edge solver for " + case_dir_name ) edge_scripts_instance.run_edgesolver(case_dir_path, NPART) + log.info("Edge solver is done for" + case_dir_name ) # postprocess for results #edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) From f8fd12a37731df44d4c0ce41ad2f68a4e899c186 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 24 Jan 2024 13:20:49 +0100 Subject: [PATCH 42/80] aboc path --- ceasiompy/SUMOAutoMesh/sumoautomesh.py | 8 ++++++++ ceasiompy/utils/commonxpath.py | 1 + 2 files changed, 9 insertions(+) diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index f73904fdf..9d4b581d4 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -35,6 +35,7 @@ SUMOFILE_XPATH, SUMO_OUTPUT_MESH_FORMAT_XPATH, EDGE_MESH_XPATH, + EDGE_ABOC_XPATH, ) from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path from cpacspy.cpacsfunctions import create_branch, get_value_or_default, open_tixi @@ -318,6 +319,13 @@ def create_mesh(cpacs_path, cpacs_out_path): else: create_branch(tixi, EDGE_MESH_XPATH) tixi.updateTextElement(EDGE_MESH_XPATH, str(mesh_out_path)) + + edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") + shutil.copyfile(mesh_path, edge_aboc_path) + + create_branch(tixi, EDGE_ABOC_XPATH) + tixi.updateTextElement(EDGE_ABOC_XPATH, str(edge_aboc_path)) + mesh_path.unlink() tixi.save(str(cpacs_out_path)) diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 18ed4aa47..4e11d1a7a 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -152,6 +152,7 @@ EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" EDGE_FIXED_CL_XPATH = EDGE_XPATH + "/fixedCL" EDGE_SOLVER = EDGE_XPATH + "/solver" +EDGE_ABOC_XPATH = EDGE_XPATH + "/boundary_condition" # RANGE RANGE_LD_RATIO_XPATH = CEASIOMPY_XPATH + "/ranges/lDRatio" From 0257ecce5c35ca04f57f46f4fd6e55d240a663ef Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 24 Jan 2024 13:44:16 +0100 Subject: [PATCH 43/80] edgerun --- ceasiompy/EdgeRun/edgerun.py | 42 ++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index cd076e43a..729acd9e5 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -83,7 +83,6 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): case_dir_path.mkdir() output_path = Path(case_dir_path, AINP_CFD_NAME) - case_dir_list = [dir for dir in wkdir.iterdir() if "Case" in dir.name] if not case_dir_list: raise OSError(f"No Case directory has been found in the working directory: {wkdir}") @@ -119,35 +118,41 @@ def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): # postprocess for results edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) + def extract_edge_forces(results_dir): # Use list comprehension to get a list of directory names starting with "Case" - dir_names = [dir_name for dir_name in os.listdir(results_dir) if os.path.isdir(os.path.join(results_dir, dir_name)) and dir_name.startswith("Case")] + dir_names = [ + dir_name + for dir_name in os.listdir(results_dir) + if os.path.isdir(os.path.join(results_dir, dir_name)) and dir_name.startswith("Case") + ] # Define the header for the forcemoments file header = " alt mach alfa beta CL CD CDP CDV CM " - # Loop through the list and perform actions in each directory for dir_name in dir_names: dir_path = os.path.join(results_dir, dir_name) - #print(f"Processing directory: {dir_path}") + # print(f"Processing directory: {dir_path}") log.info(f"Extracting forces from Directory : {dir_name}") - + # Extract mach and alfa from directory name - match = re.match(r'.*alt(\d+\.\d+)_mach(\d+\.\d+)_aoa(\d+\.\d+)_aos(\d+\.\d+)*', dir_name) + match = re.match(r".*alt(\d+\.\d+)_mach(\d+\.\d+)_aoa(\d+\.\d+)_aos(\d+\.\d+)*", dir_name) if match: alt = float(match.group(1)) mach = float(match.group(2)) aoa = float(match.group(3)) aos = float(match.group(4)) - #print(f" - alt: {alt}, mach: {mach}, aoa: {aoa}, aos: {aos}") + # print(f" - alt: {alt}, mach: {mach}, aoa: {aoa}, aos: {aos}") # Extract information from Edge.log file - filelog = os.path.join(dir_path, 'Edge.log') - with open(filelog, 'r') as log_file: + filelog = os.path.join(dir_path, "Edge.log") + with open(filelog, "r") as log_file: lines = log_file.readlines() - total_line_number = next((i for i, line in enumerate(lines) if ' Total:' in line), None) + total_line_number = next( + (i for i, line in enumerate(lines) if " Total:" in line), None + ) if total_line_number is not None: line = total_line_number + 4 CL = lines[line].split()[0] @@ -161,14 +166,17 @@ def extract_edge_forces(results_dir): CDV = lines[line].split()[1] # Append values to forcemoments file - forcemoments = os.path.join(results_dir, 'Edge_force_moment.dat') - with open(forcemoments, 'a') as output_file: + forcemoments = os.path.join(results_dir, "Edge_force_moment.dat") + with open(forcemoments, "a") as output_file: # Check if the file is empty and add the header if os.stat(forcemoments).st_size == 0: output_file.write(header + "\n") - output_file.write(f"{alt:.8f} {mach:.8f} {aoa:.8f} {aos:.8f} {CL} {CD} {CDP} {CDV} {CM}\n") + output_file.write( + f"{alt:.8f} {mach:.8f} {aoa:.8f} {aos:.8f} {CL} {CD} {CDP} {CDV} {CM}\n" + ) log.info(f"Saving forces to file: {forcemoments}") + # ================================================================================================= # MAIN # ================================================================================================= @@ -177,8 +185,8 @@ def extract_edge_forces(results_dir): def main(cpacs_path, cpacs_out_path): log.info("----- Start of " + MODULE_NAME + " -----") - tixi = open_tixi(cpacs_path) - nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) + # tixi = open_tixi(cpacs_path) + # nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) results_dir = get_results_directory("EdgeRun") @@ -186,8 +194,10 @@ def main(cpacs_path, cpacs_out_path): cpacs_tmp_cfg = Path(cpacs_out_path.parent, "ConfigTMP.xml") edge_cfd(cpacs_path, cpacs_tmp_cfg, results_dir) + + log.info("Edge postprocessing started") extract_edge_forces(results_dir) - log.info("Edge Postprocess finished") + log.info("Edge postprocessing finished") # run_edge_multi(results_dir, nb_proc) # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) From caf251d295400f94a1453816d91146d0e3539b63 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 11:45:01 +0100 Subject: [PATCH 44/80] modified: sumoautomesh.py changed aboc file name in SUMO folder in Results folder as the same name as bmsh file --- ceasiompy/SUMOAutoMesh/sumoautomesh.py | 6 ++++-- ceasiompy/utils/commonxpath.py | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index 9d4b581d4..879f66f23 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -316,11 +316,13 @@ def create_mesh(cpacs_path, cpacs_out_path): tixi.updateTextElement(SU2MESH_XPATH, str(mesh_out_path)) mesh_path.unlink() - else: + elif output == "edge": create_branch(tixi, EDGE_MESH_XPATH) tixi.updateTextElement(EDGE_MESH_XPATH, str(mesh_out_path)) - edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") + #edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") # commented by Mengmeng + edge_aboc_name = aircraft_name(tixi) + f"_baseline.aboc" + edge_aboc_path = Path(sumo_results_dir, edge_aboc_name) shutil.copyfile(mesh_path, edge_aboc_path) create_branch(tixi, EDGE_ABOC_XPATH) diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 4e11d1a7a..7f9117a4a 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -79,6 +79,7 @@ SMFILE_XPATH = CEASIOMPY_XPATH + "/filesPath/SMpath" SU2MESH_XPATH = CEASIOMPY_XPATH + "/filesPath/su2Mesh" EDGE_MESH_XPATH = CEASIOMPY_XPATH + "/filesPath/edgeMesh" + SUMOFILE_XPATH = CEASIOMPY_XPATH + "/filesPath/sumoFilePath" WKDIR_XPATH = CEASIOMPY_XPATH + "/filesPath/wkdirPath" @@ -151,7 +152,7 @@ EDGE_CFL_NB_XPATH = EDGE_XPATH + "/settings/cflNumber/value" EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" EDGE_FIXED_CL_XPATH = EDGE_XPATH + "/fixedCL" -EDGE_SOLVER = EDGE_XPATH + "/solver" +EDGE_SOLVER = EDGE_XPATH + "/solver" # duplicate of EDGE_SOLVER_XPATH EDGE_ABOC_XPATH = EDGE_XPATH + "/boundary_condition" # RANGE From fb5dd24bb54fa18d0469d0c644fe0a0327d29213 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 11:56:04 +0100 Subject: [PATCH 45/80] line 114-117 --- ceasiompy/EdgeRun/func/edgeconfig.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 3ef1938eb..e9afb8a18 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -111,7 +111,8 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") # copy edge_mesh and edge_aboc file to the Working directory - grid_folder = Path(wkdir, "grid") + #grid_folder = Path(wkdir, "grid") # Commented by Mengmeng Zhang + grid_folder = Path(wkdir) # Added by Mengmeng Zhang to_grid = grid_folder / edge_mesh.name to_aboc = grid_folder / edge_aboc.name From 5f5041f07d2de40474d58d1348480fb054c0b77a Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 12:01:56 +0100 Subject: [PATCH 46/80] changed back to copy bmsh and aboc to /grid folder --- ceasiompy/EdgeRun/func/edgeconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index e9afb8a18..1d01693bb 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -111,8 +111,8 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") # copy edge_mesh and edge_aboc file to the Working directory - #grid_folder = Path(wkdir, "grid") # Commented by Mengmeng Zhang - grid_folder = Path(wkdir) # Added by Mengmeng Zhang + grid_folder = Path(wkdir, "grid") + #grid_folder = Path(wkdir) # Added by Mengmeng Zhang to_grid = grid_folder / edge_mesh.name to_aboc = grid_folder / edge_aboc.name From d217437a35cb2b6794c68e2b3d3a50ab993d8a91 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 15:02:42 +0100 Subject: [PATCH 47/80] modified: ../../SUMOAutoMesh/sumoautomesh.py changed line 323-329 --- ceasiompy/SUMOAutoMesh/sumoautomesh.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index 879f66f23..e9564481a 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -320,13 +320,13 @@ def create_mesh(cpacs_path, cpacs_out_path): create_branch(tixi, EDGE_MESH_XPATH) tixi.updateTextElement(EDGE_MESH_XPATH, str(mesh_out_path)) - #edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") # commented by Mengmeng + edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") # commented by Mengmeng edge_aboc_name = aircraft_name(tixi) + f"_baseline.aboc" - edge_aboc_path = Path(sumo_results_dir, edge_aboc_name) - shutil.copyfile(mesh_path, edge_aboc_path) + aboc_out_path = Path(sumo_results_dir, edge_aboc_name) + shutil.copyfile(edge_aboc_path, aboc_out_path) create_branch(tixi, EDGE_ABOC_XPATH) - tixi.updateTextElement(EDGE_ABOC_XPATH, str(edge_aboc_path)) + tixi.updateTextElement(EDGE_ABOC_XPATH, str(aboc_out_path)) mesh_path.unlink() From c65c60cebc2d6a7efd6e54d697ebfa682e7545a8 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 15:23:19 +0100 Subject: [PATCH 48/80] changed log.info --- ceasiompy/EdgeRun/func/edgeconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 1d01693bb..bde2236fd 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -315,9 +315,9 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) - log.info("Running Edge solver for " + case_dir_name ) + log.info("Running Edge solver... for " + case_dir_name ) edge_scripts_instance.run_edgesolver(case_dir_path, NPART) - log.info("Edge solver is done for" + case_dir_name ) + log.info("Edge solver is done." ) # postprocess for results #edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) From 8c37a4bec108bfb7f63e8c379f665d1b635893d5 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 15:38:00 +0100 Subject: [PATCH 49/80] modified: edgerun.py added line 203-204, save cpacs_out_path, ToolOutput.xml --- ceasiompy/EdgeRun/edgerun.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 729acd9e5..83d18b156 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -200,7 +200,9 @@ def main(cpacs_path, cpacs_out_path): log.info("Edge postprocessing finished") # run_edge_multi(results_dir, nb_proc) # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) - + cpacs = CPACS(cpacs_path) + cpacs.save_cpacs(cpacs_out_path, overwrite=True) + log.info("----- End of " + MODULE_NAME + " -----") From e4a1314de6d0acc2e5d0ce1e14bcabf50565321b Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 15:47:47 +0100 Subject: [PATCH 50/80] modified: edgerun.py clean edgerun --- ceasiompy/EdgeRun/edgerun.py | 71 +----------------------------------- 1 file changed, 2 insertions(+), 69 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index 83d18b156..f53f0d39b 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -55,70 +55,6 @@ # ================================================================================================= input_que_script_path = get_edge_queScript_template() - -def run_edge_multi(wkdir, input_que_script_path, nb_proc=2): - """Function to run a multiple Edge calculation. - - Function 'run_edge_multi' will run in the given working directory Edge calculations. - The working directory must have a folder structure created by 'SU2Config'/ 'EdgeConfig' module. - - Args: - wkdir (Path): Path to the working directory - nb_proc (int): Number of processor that should be used to run the calculation in parallel - """ - cpacs = CPACS(cpacs_path) - - edge_mesh = Path(get_value(cpacs.tixi, EDGE_MESH_XPATH)) - - if not wkdir.exists(): - raise OSError(f"The working directory : {wkdir} does not exist!") - - case_dir_name = ( - f"Case{str(case_nb).zfill(2)}_alt{alt}_mach{round(mach, 2)}" - f"_aoa{round(aoa, 1)}_aos{round(aos, 1)}" - ) - - case_dir_path = Path(wkdir, case_dir_name) - if not case_dir_path.exists(): - case_dir_path.mkdir() - output_path = Path(case_dir_path, AINP_CFD_NAME) - - case_dir_list = [dir for dir in wkdir.iterdir() if "Case" in dir.name] - if not case_dir_list: - raise OSError(f"No Case directory has been found in the working directory: {wkdir}") - - for config_dir in sorted(case_dir_list): - current_dir = Path(case_dir_path, config_dir) - - config_cfd = [c for c in config_dir.iterdir() if c.name == AINP_CFD_NAME] - - if not config_cfd: - raise ValueError(f"No '{AINP_CFD_NAME}' file has been found in this directory!") - - if len(config_cfd) > 1: - raise ValueError(f"More than one '{AINP_CFD_NAME}' file in this directory!") - - # run / submit edge commands - edge_scripts_instance = EdgeScripts(current_dir, input_que_script_path, AINP_CFD_NAME) - # check if preprocessor is already run - bedg_files_exist = True - for i in range(1, nb_proc + 1): - bedg_file_path = Path(case_dir_path, grid_folder, f"Edge.bedg_p{i}") - if not bedg_file_path.exists(): - bedg_files_exist = False - break - if not bedg_files_exist: - # edge_scripts_instance.submit_preprocessor_script(case_dir_path) - edge_scripts_instance.run_preprocessor(case_dir_path) - print("bedg files are generated") - - # edge_scripts_instance.submit_solver_script(nb_proc) - edge_scripts_instance.run_solver(nb_proc) - - # postprocess for results - edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) - - def extract_edge_forces(results_dir): # Use list comprehension to get a list of directory names starting with "Case" dir_names = [ @@ -185,8 +121,7 @@ def extract_edge_forces(results_dir): def main(cpacs_path, cpacs_out_path): log.info("----- Start of " + MODULE_NAME + " -----") - # tixi = open_tixi(cpacs_path) - # nb_proc = get_value_or_default(tixi, EDGE_NB_CPU_XPATH, get_reasonable_nb_cpu()) + cpacs = CPACS(cpacs_path) results_dir = get_results_directory("EdgeRun") @@ -198,9 +133,7 @@ def main(cpacs_path, cpacs_out_path): log.info("Edge postprocessing started") extract_edge_forces(results_dir) log.info("Edge postprocessing finished") - # run_edge_multi(results_dir, nb_proc) - # get_su2_results(cpacs_tmp_cfg, cpacs_out_path, results_dir) - cpacs = CPACS(cpacs_path) + cpacs.save_cpacs(cpacs_out_path, overwrite=True) log.info("----- End of " + MODULE_NAME + " -----") From a9c837c8a613716d8ee2c11ed562448562aab1be Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 27 Jan 2024 15:49:10 +0100 Subject: [PATCH 51/80] modified: func/edgeconfig.py added postprocessor --- ceasiompy/EdgeRun/func/edgeconfig.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index bde2236fd..f4b17d665 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -320,7 +320,9 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): log.info("Edge solver is done." ) # postprocess for results - #edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) + log.info("Running Edge postprocessor...for " + case_dir_name ) + edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) + log.info("Edge postprocessor is done." ) # wait until the results are generated cpacs.save_cpacs(cpacs_out_path, overwrite=True) From 673bcef8d585ee86cbb2611568badea62feb30f3 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Mon, 29 Jan 2024 08:15:08 +0100 Subject: [PATCH 52/80] edge solver path --- ceasiompy/EdgeRun/__specs__.py | 4 ++-- ceasiompy/utils/commonxpath.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index fc8c8ae98..969617481 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -12,7 +12,7 @@ EDGE_MG_LEVEL_XPATH, EDGE_NB_CPU_XPATH, EDGE_MESH_XPATH, - EDGE_SOLVER, + EDGE_SOLVER_XPATH, ) from ceasiompy.utils.moduleinterfaces import CPACSInOut @@ -170,7 +170,7 @@ default_value=["Euler", "RANS"], unit="1", descr="Chose if perform a RANS or an Euler calculation", - xpath=EDGE_SOLVER, + xpath=EDGE_SOLVER_XPATH, gui=True, gui_name="Solver for calculation", gui_group="EDGE parameters", diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 4e11d1a7a..af804ffc7 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -151,7 +151,6 @@ EDGE_CFL_NB_XPATH = EDGE_XPATH + "/settings/cflNumber/value" EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" EDGE_FIXED_CL_XPATH = EDGE_XPATH + "/fixedCL" -EDGE_SOLVER = EDGE_XPATH + "/solver" EDGE_ABOC_XPATH = EDGE_XPATH + "/boundary_condition" # RANGE From e42af2db38cbc8d3d45d7b30bd3f2d22decf0002 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Mon, 29 Jan 2024 08:45:04 +0100 Subject: [PATCH 53/80] edge path --- ceasiompy/EdgeRun/func/edgeconfig.py | 21 ++++++++++----------- ceasiompy/utils/commonxpath.py | 1 - 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index f4b17d665..f9d3e43a3 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -36,7 +36,7 @@ # write_header, # ) -#from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template +# from ceasiompy.EdgeRun.func.edgeutils import get_edge_ainp_template from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.commonnames import ( AINP_CFD_NAME, @@ -111,8 +111,8 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") # copy edge_mesh and edge_aboc file to the Working directory - grid_folder = Path(wkdir, "grid") - #grid_folder = Path(wkdir) # Added by Mengmeng Zhang + grid_folder = Path(wkdir, "grid") + # grid_folder = Path(wkdir) # Added by Mengmeng Zhang to_grid = grid_folder / edge_mesh.name to_aboc = grid_folder / edge_aboc.name @@ -185,7 +185,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): sym_factor = 2.0 # General parameters - # + # BMSH = edge_mesh.name ABOC = edge_aboc.name CREF = cpacs.aircraft.ref_length @@ -294,7 +294,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # cfg.write_file(config_output_path, overwrite=True) # create and submit the edge-run scripts # run / submit edge commands - + jobname = case_dir_name edge_scripts_instance = EdgeScripts( jobname, case_dir_path, input_que_script_path, AINP_CFD_NAME @@ -312,19 +312,18 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): log.info("Running Edge preprocessor ...") edge_scripts_instance.run_preprocessor(case_dir_path) log.info("Preprocessor is done. *.bedg files are generated") - # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) - log.info("Running Edge solver... for " + case_dir_name ) + log.info("Running Edge solver... for " + case_dir_name) edge_scripts_instance.run_edgesolver(case_dir_path, NPART) - log.info("Edge solver is done." ) + log.info("Edge solver is done.") # postprocess for results - log.info("Running Edge postprocessor...for " + case_dir_name ) + log.info("Running Edge postprocessor...for " + case_dir_name) edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) - log.info("Edge postprocessor is done." ) + log.info("Edge postprocessor is done.") # wait until the results are generated - + cpacs.save_cpacs(cpacs_out_path, overwrite=True) # ================================================================================================= diff --git a/ceasiompy/utils/commonxpath.py b/ceasiompy/utils/commonxpath.py index 310ed8186..28398fd46 100644 --- a/ceasiompy/utils/commonxpath.py +++ b/ceasiompy/utils/commonxpath.py @@ -152,7 +152,6 @@ EDGE_CFL_NB_XPATH = EDGE_XPATH + "/settings/cflNumber/value" EDGE_MG_LEVEL_XPATH = EDGE_XPATH + "/settings/multigridLevel" EDGE_FIXED_CL_XPATH = EDGE_XPATH + "/fixedCL" -EDGE_SOLVER = EDGE_XPATH + "/solver" EDGE_ABOC_XPATH = EDGE_XPATH + "/boundary_condition" # RANGE From 7a6bb835d13d2689bb01e6ccc96cf5afdce68c11 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 10:53:34 +0100 Subject: [PATCH 54/80] modified: ceasiomlogger.py commented line 60 and line 67 in order to avoid writting log file in dardel installation folder --- ceasiompy/utils/ceasiomlogger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 971f0c35b..21f258795 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -57,14 +57,14 @@ def get_logger(): file_handler = logging.FileHandler(filename=LOGFILE, mode="w") file_handler.setLevel(logging.DEBUG) # Level for the logfile file_handler.setFormatter(file_formatter) - logger.addHandler(file_handler) +# logger.addHandler(file_handler) # Write log messages on the console console_formatter = logging.Formatter("%(levelname)-8s - %(message)s") console_handler = logging.StreamHandler() console_handler.setLevel(logging.DEBUG) # Level for the console log console_handler.setFormatter(console_formatter) - logger.addHandler(console_handler) + # logger.addHandler(console_handler) return logger From c298a75832ee8895c477e2324cf8f3f328a153e0 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 10:59:12 +0100 Subject: [PATCH 55/80] commented function get_logger() --- ceasiompy/utils/ceasiomlogger.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 21f258795..f82314484 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -42,6 +42,7 @@ def get_logger(): logger (logger): Logger """ +""" logger = logging.getLogger("CEASIOMpy") # NOTE: Multiple calls to getLogger() with the same name will return a @@ -57,17 +58,17 @@ def get_logger(): file_handler = logging.FileHandler(filename=LOGFILE, mode="w") file_handler.setLevel(logging.DEBUG) # Level for the logfile file_handler.setFormatter(file_formatter) -# logger.addHandler(file_handler) + logger.addHandler(file_handler) # Write log messages on the console console_formatter = logging.Formatter("%(levelname)-8s - %(message)s") console_handler = logging.StreamHandler() console_handler.setLevel(logging.DEBUG) # Level for the console log console_handler.setFormatter(console_formatter) - # logger.addHandler(console_handler) + logger.addHandler(console_handler) return logger - +""" def add_to_runworkflow_history(working_dir: Path, comment: str = "") -> None: """Add a line to the runworkflow history""" From 26820711050a4b7f410c1e2991ca369d872e4200 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 11:02:05 +0100 Subject: [PATCH 56/80] write an empty logger --- ceasiompy/utils/ceasiomlogger.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index f82314484..81e7669c9 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -42,7 +42,7 @@ def get_logger(): logger (logger): Logger """ -""" + logger = logging.getLogger("CEASIOMpy") # NOTE: Multiple calls to getLogger() with the same name will return a @@ -54,6 +54,7 @@ def get_logger(): logger.setLevel(logging.DEBUG) # Write logfile + """ file_formatter = logging.Formatter("%(asctime)s - %(levelname)8s - %(module)18s - %(message)s") file_handler = logging.FileHandler(filename=LOGFILE, mode="w") file_handler.setLevel(logging.DEBUG) # Level for the logfile @@ -66,9 +67,9 @@ def get_logger(): console_handler.setLevel(logging.DEBUG) # Level for the console log console_handler.setFormatter(console_formatter) logger.addHandler(console_handler) - + """ return logger -""" + def add_to_runworkflow_history(working_dir: Path, comment: str = "") -> None: """Add a line to the runworkflow history""" From 4a1766929eb24f46512ef31110b96e5d46ff1e0f Mon Sep 17 00:00:00 2001 From: GBenedett Date: Mon, 29 Jan 2024 11:19:44 +0100 Subject: [PATCH 57/80] INSEUL changed --- ceasiompy/EdgeRun/func/edgeconfig.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index f9d3e43a3..08cf5488b 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -199,7 +199,14 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): CFL = get_value_or_default(cpacs.tixi, EDGE_CFL_NB_XPATH, 1.5) NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) - INSEUL = int(get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH, 0)) + + edge_solver = get_value(cpacs.tixi, EDGE_SOLVER_XPATH) + if edge_solver == "Euler" + INSEUL = 0 + if edge_solver == "RANS" + INSEUL = 1 + else: + raise Exception("Error, edge solver not assigned") # Parameters which will vary for the different cases (alt,mach,aoa,aos) for case_nb in range(len(alt_list)): From 7d622332b64bccb19bf07e502b237dfc1d19f80f Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 11:27:53 +0100 Subject: [PATCH 58/80] INSEUL, corrected the code format --- ceasiompy/EdgeRun/func/edgeconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 08cf5488b..6b8eb8661 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -201,9 +201,9 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) edge_solver = get_value(cpacs.tixi, EDGE_SOLVER_XPATH) - if edge_solver == "Euler" + if edge_solver == "Euler": INSEUL = 0 - if edge_solver == "RANS" + if edge_solver == "RANS": INSEUL = 1 else: raise Exception("Error, edge solver not assigned") From 5633dedefaae9d445ed00c9cfe5044df53251740 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 11:36:16 +0100 Subject: [PATCH 59/80] get_value_or_default for edge_solver --- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 6b8eb8661..45d5fe14b 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -200,7 +200,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) - edge_solver = get_value(cpacs.tixi, EDGE_SOLVER_XPATH) + edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") if edge_solver == "Euler": INSEUL = 0 if edge_solver == "RANS": From 78034550409962430623440e88786d9218ffb8db Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 12:08:33 +0100 Subject: [PATCH 60/80] modified: edgeconfig.py --- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 45d5fe14b..6b8eb8661 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -200,7 +200,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) - edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") + edge_solver = get_value(cpacs.tixi, EDGE_SOLVER_XPATH) if edge_solver == "Euler": INSEUL = 0 if edge_solver == "RANS": From afb14c95c93ed399346ae1d2680c513001464ee8 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 15:47:33 +0100 Subject: [PATCH 61/80] modified: edgeconfig.py edge_solver --- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 6b8eb8661..45d5fe14b 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -200,7 +200,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) - edge_solver = get_value(cpacs.tixi, EDGE_SOLVER_XPATH) + edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") if edge_solver == "Euler": INSEUL = 0 if edge_solver == "RANS": From 0d2d4446d893c608003000a332ec1bccf7d18edf Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 21:43:24 +0100 Subject: [PATCH 62/80] added print to debug --- ceasiompy/EdgeRun/func/edgeconfig.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 45d5fe14b..9eeff060f 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -195,12 +195,13 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): # Settings - ITMAX = int(get_value_or_default(cpacs.tixi, EDGE_MAX_ITER_XPATH, 200)) + ITMAX = int(get_value_or_default(cpacs.tixi, EDGE_MAX_ITER_XPATH, 1000)) CFL = get_value_or_default(cpacs.tixi, EDGE_CFL_NB_XPATH, 1.5) - NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 3)) - NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 64)) + NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 1)) + NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 128)) edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") + print(f'edge_solver: {edge_solver}') if edge_solver == "Euler": INSEUL = 0 if edge_solver == "RANS": From 279be83950dd65689fcd1dee27bcd4b9ada1b8e1 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 21:46:37 +0100 Subject: [PATCH 63/80] modified: edgeconfig.py changed to if-elif structure --- ceasiompy/EdgeRun/func/edgeconfig.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 9eeff060f..54a8393a8 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -204,7 +204,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): print(f'edge_solver: {edge_solver}') if edge_solver == "Euler": INSEUL = 0 - if edge_solver == "RANS": + elif edge_solver == "RANS": INSEUL = 1 else: raise Exception("Error, edge solver not assigned") From 6d2d53201114c6137de4b40800f8613af2816085 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Mon, 29 Jan 2024 21:51:05 +0100 Subject: [PATCH 64/80] changed/updated edge_solver --- ceasiompy/EdgeRun/func/edgeconfig.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 54a8393a8..cd09a6e5a 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -200,8 +200,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 1)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 128)) - edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") - print(f'edge_solver: {edge_solver}') + edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") if edge_solver == "Euler": INSEUL = 0 elif edge_solver == "RANS": From f1f761c7579ed5346ca5c568d379c626a38b8b6d Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 1 Feb 2024 11:47:12 +0100 Subject: [PATCH 65/80] log and gmsh problem solved --- ceasiompy/CPACS2GMSH/func/mesh_sizing.py | 6 ++++-- ceasiompy/utils/ceasiomlogger.py | 4 ---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ceasiompy/CPACS2GMSH/func/mesh_sizing.py b/ceasiompy/CPACS2GMSH/func/mesh_sizing.py index 122d034d3..c364eb135 100644 --- a/ceasiompy/CPACS2GMSH/func/mesh_sizing.py +++ b/ceasiompy/CPACS2GMSH/func/mesh_sizing.py @@ -178,6 +178,8 @@ def fuselage_size(cpacs_path): # Get overall minimum radius (semi-minor axis for ellipse) min_radius = min(min_radius, height, width) + if min_radius == 0: + min_radius = 0.0001 mean_circ = sum(circ_list) / len(circ_list) @@ -186,7 +188,7 @@ def fuselage_size(cpacs_path): fuselage_minlen = min(0.1 * fuselage_maxlen, min_radius / 2) log.info(f"Fuselage maxlen={fuselage_maxlen:.3f} m") - log.info(f"Fuselage minlen={fuselage_minlen:.3f} m") + log.info(f"Fuselage minlen={fuselage_minlen:.4f} m") return fuselage_maxlen, fuselage_minlen @@ -283,6 +285,6 @@ def wings_size(cpacs_path): wing_minlen = 0.08 * wing_maxlen log.info(f"Wing maxlen={wing_maxlen:.3f} m") - log.info(f"Wing minlen={wing_minlen:.3f} m") + log.info(f"Wing minlen={wing_minlen:.4f} m") return wing_maxlen, wing_minlen diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 81e7669c9..05e9bf7b0 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -42,7 +42,6 @@ def get_logger(): logger (logger): Logger """ - logger = logging.getLogger("CEASIOMpy") # NOTE: Multiple calls to getLogger() with the same name will return a @@ -54,7 +53,6 @@ def get_logger(): logger.setLevel(logging.DEBUG) # Write logfile - """ file_formatter = logging.Formatter("%(asctime)s - %(levelname)8s - %(module)18s - %(message)s") file_handler = logging.FileHandler(filename=LOGFILE, mode="w") file_handler.setLevel(logging.DEBUG) # Level for the logfile @@ -67,7 +65,6 @@ def get_logger(): console_handler.setLevel(logging.DEBUG) # Level for the console log console_handler.setFormatter(console_formatter) logger.addHandler(console_handler) - """ return logger @@ -104,5 +101,4 @@ def get_last_runworkflow() -> Path: # ================================================================================================= if __name__ == "__main__": - print("Nothing to execute!") From ba78f32567579641995d3b58557fbc6f210ebd15 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Thu, 1 Feb 2024 15:12:55 +0100 Subject: [PATCH 66/80] nmae changed --- ceasiompy/CPACS2GMSH/func/mesh_sizing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ceasiompy/CPACS2GMSH/func/mesh_sizing.py b/ceasiompy/CPACS2GMSH/func/mesh_sizing.py index c364eb135..eb2098a6b 100644 --- a/ceasiompy/CPACS2GMSH/func/mesh_sizing.py +++ b/ceasiompy/CPACS2GMSH/func/mesh_sizing.py @@ -3,7 +3,7 @@ Developed by CFS ENGINEERING, 1015 Lausanne, Switzerland -This script contains different functions to classify and manipulate wing elements +This script contains different functions to classify and manipulate wing and fuselage elements Python version: >=3.8 @@ -35,6 +35,8 @@ def fuselage_size(cpacs_path): + """Function to get the measure of the fuselage and to obtain a good mesh size""" + tixi = open_tixi(cpacs_path) if tixi.checkElement(FUSELAGES_XPATH): fus_cnt = tixi.getNamedChildrenCount(FUSELAGES_XPATH, "fuselage") @@ -194,6 +196,8 @@ def fuselage_size(cpacs_path): def wings_size(cpacs_path): + """Function to get the measure of the wing and to obtain a good mesh size""" + tixi = open_tixi(cpacs_path) if tixi.checkElement(WINGS_XPATH): wing_cnt = tixi.getNamedChildrenCount(WINGS_XPATH, "wing") From 912b4df712639c2e66fd5055de1dd28bf983657a Mon Sep 17 00:00:00 2001 From: GBenedett Date: Mon, 5 Feb 2024 14:20:10 +0100 Subject: [PATCH 67/80] aboc path --- ceasiompy/EdgeRun/__specs__.py | 13 +++++++++++++ ceasiompy/EdgeRun/func/edgeconfig.py | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/__specs__.py b/ceasiompy/EdgeRun/__specs__.py index 969617481..9e70acd4b 100644 --- a/ceasiompy/EdgeRun/__specs__.py +++ b/ceasiompy/EdgeRun/__specs__.py @@ -13,6 +13,7 @@ EDGE_NB_CPU_XPATH, EDGE_MESH_XPATH, EDGE_SOLVER_XPATH, + EDGE_ABOC_XPATH, ) from ceasiompy.utils.moduleinterfaces import CPACSInOut @@ -188,6 +189,18 @@ gui_group="Inputs", ) +cpacs_inout.add_input( + var_name="EDGE_ABOC_path", + var_type="pathtype", + default_value="-", + unit="1", + descr="Absolute path of the EDGE Boundary Condition file", + xpath=EDGE_ABOC_XPATH, + gui=True, + gui_name="EDGE ABOC", + gui_group="Inputs", +) + # ----- Output ----- cpacs_inout.add_output( diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index cd09a6e5a..a75d89f0a 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -52,6 +52,7 @@ EDGE_MG_LEVEL_XPATH, EDGE_NB_CPU_XPATH, EDGE_FIXED_CL_XPATH, + EDGE_ABOC_XPATH, ) # from ceasiompy.utils.configfiles import ConfigFile @@ -105,7 +106,10 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): cpacs = CPACS(cpacs_path) edge_mesh = Path(get_value(cpacs.tixi, EDGE_MESH_XPATH)) - edge_aboc = edge_mesh.with_suffix(".aboc") + # edge_aboc = edge_mesh.with_suffix(".aboc") + edge_aboc = Path( + get_value_or_default(cpacs.tixi, EDGE_ABOC_XPATH, edge_mesh.with_suffix(".aboc")) + ) if not edge_mesh.is_file(): raise FileNotFoundError(f"M-Edge mesh file {edge_mesh} not found") @@ -200,7 +204,7 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): NGRID = int(get_value_or_default(cpacs.tixi, EDGE_MG_LEVEL_XPATH, 1)) NPART = int(get_value_or_default(cpacs.tixi, EDGE_NB_CPU_XPATH, 128)) - edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH,"Euler") + edge_solver = get_value_or_default(cpacs.tixi, EDGE_SOLVER_XPATH, "Euler") if edge_solver == "Euler": INSEUL = 0 elif edge_solver == "RANS": From 3abf78034eaf03b74938dd7211c21b574caa52d1 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 7 Feb 2024 15:54:15 +0100 Subject: [PATCH 68/80] formatting --- ceasiompy/EdgeRun/edgerun.py | 24 +-- ceasiompy/EdgeRun/func/edge_queScript_gen.py | 138 ----------------- ceasiompy/EdgeRun/func/edge_que_script_gen.py | 141 ++++++++++++++++++ ceasiompy/EdgeRun/func/edgeconfig.py | 7 +- ceasiompy/EdgeRun/func/edgeutils.py | 8 +- ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 19 ++- .../EdgeRun/tests/test_edgerun_submit.py | 16 +- 7 files changed, 166 insertions(+), 187 deletions(-) delete mode 100644 ceasiompy/EdgeRun/func/edge_queScript_gen.py create mode 100644 ceasiompy/EdgeRun/func/edge_que_script_gen.py diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index f53f0d39b..cd05323b1 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -14,29 +14,14 @@ # ================================================================================================= # IMPORTS # ================================================================================================= -import os, re +import os +import re from pathlib import Path from cpacspy.cpacspy import CPACS from ceasiompy.EdgeRun.func.edgeconfig import edge_cfd from ceasiompy.utils.ceasiomlogger import get_logger -from ceasiompy.utils.ceasiompyutils import ( - get_reasonable_nb_cpu, - get_results_directory, - # run_software, -) - -# from ceasiompy.utils.commonnames import AINP_CFD_NAME, SU2_FORCES_BREAKDOWN_NAME -from cpacspy.cpacsfunctions import ( - create_branch, - get_string_vector, - get_value, - get_value_or_default, -) -from ceasiompy.utils.commonnames import AINP_CFD_NAME -from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH, EDGE_MESH_XPATH +from ceasiompy.utils.ceasiompyutils import get_results_directory from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path -from cpacspy.cpacsfunctions import get_value_or_default, open_tixi -from ceasiompy.EdgeRun.func.edge_queScript_gen import EdgeScripts from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template log = get_logger() @@ -55,6 +40,7 @@ # ================================================================================================= input_que_script_path = get_edge_queScript_template() + def extract_edge_forces(results_dir): # Use list comprehension to get a list of directory names starting with "Case" dir_names = [ @@ -135,7 +121,7 @@ def main(cpacs_path, cpacs_out_path): log.info("Edge postprocessing finished") cpacs.save_cpacs(cpacs_out_path, overwrite=True) - + log.info("----- End of " + MODULE_NAME + " -----") diff --git a/ceasiompy/EdgeRun/func/edge_queScript_gen.py b/ceasiompy/EdgeRun/func/edge_queScript_gen.py deleted file mode 100644 index 9138bb9af..000000000 --- a/ceasiompy/EdgeRun/func/edge_queScript_gen.py +++ /dev/null @@ -1,138 +0,0 @@ -""" -CEASIOMpy: Conceptual Aircraft Design Software - -Developed for Airinnova AB, Stockholm, Sweden - -Functions to generate queuing script for Edge: queue_preprocessor.script and queue_edgesolver.script - -Python version: >=3.8 - -| Author : Mengmeng Zhang -| Creation: 2024-01-05 -""" - -# ================================================================================================= -# IMPORTS -# ================================================================================================= - -import os -import subprocess -from pathlib import Path - - - -class EdgeScripts: - def __init__(self, dir_path, jobname, input_que_script_path, edge_input_file): - self.jobname = jobname - self.dir_path = dir_path - self.input_que_script_path = input_que_script_path - self.Edge_dir = '/pdc/software/22.06/other/m-edge/3.2/gnu/bin/' - self.EdgeInputFile = edge_input_file - #self.GridDir = 'grid' - #os.chdir(os.path.join(caseDir, self.GridDir)) - - def submit_preprocessor_script(self,dir_path): - preprocessor = os.path.join(self.Edge_dir, 'preprocessor') - #dir_path = self.dir_path - QueScript = f'queue_preprocessor.script' - Submitcommand = 'sbatch' - os.chdir(dir_path) - with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: - for line in template_file: - if '-J jobname' in line: - line = line.replace('-J jobname', f'-J {self.jobname}prepro') - que_script.write(line) - que_script.write(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') - print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') - os.system(f'{Submitcommand} {que_script}') - - def run_preprocessor(self,dir_path): - #preprocessor = os.path.join(self.Edge_dir, 'preprocessor') - #dir_path = self.dir_path - #QueScript = f'queue_preprocessor.script' - #Submitcommand = 'sbatch' - os.chdir(dir_path) - """ - with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: - for line in template_file: - if '-J jobname' in line: - line = line.replace('-J jobname', f'-J {self.jobname}prepro') - que_script.write(line) - - que_script.write(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') - print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') - """ - os.system(f'preprocessor {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') - - def submit_solver_script(self, dir_path, nb_proc): - run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') - QueScript = f'queue_edgesolver.script' - #dir_path = self.dir_path - Submitcommand = 'sbatch' - os.chdir(dir_path) - with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: - for line in template_file: - if '-J jobname' in line: - line = line.replace('-J jobname', f'-J {self.jobname}solver') - que_script.write(line) - que_script.write(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') - os.system(f'{Submitcommand} {que_script}') - - - def run_edgesolver(self, dir_path, nb_proc): - run_solver = os.path.join(self.Edge_dir, 'edge_mpi_run') - os.chdir(dir_path) - os.system(f'{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n') - - def postprocess_script(self, dir_path,edge_grid): - #ffaucut = os.path.join(self.Edge_dir, 'ffaucut') - #ffauinterpol = os.path.join(self.Edge_dir, 'ffauinterpol') - #ffa2tab = os.path.join(self.Edge_dir, 'ffa2tab') - ffa2engold = os.path.join(self.Edge_dir, 'ffa2engold') - grid = edge_grid - - # output file names - #walldata1 = "Edge_wall.dat" - #walldata2 = "Edge_wall.cf" - forcemoments = "Edge_force_moment.dat" - ensgoldprefix = "zzz" - solution1 = "Edge.bout" - solution2 = "Post.bout" - - # Enter the folder - os.chdir(dir_path) - - """ - # Extract the boundary - input_data = """ - #1 - #0 - """ - with subprocess.Popen([ffaucut, grid, 'tmp1'], stdin=subprocess.PIPE, text=True) as process: - process.communicate(input=input_data) - - - # Inteerpolate the soulutions - subprocess.run([ffauinterpol, solution1, 'tmp1', 'tmp11']) - subprocess.run([ffauinterpol, solution2, 'tmp1', 'tmp12']) - - # Extract tabulated data - subprocess.run([ffa2tab, 'tmp11', walldata1]) - subprocess.run([ffa2tab, 'tmp12', walldata2]) - - # Cleanup - for temp_file in ['tmp1', 'tmp11', 'tmp12']: - os.remove(temp_file) - """ - # Create ensight gold files - subprocess.run([ffa2engold, grid, solution1, ensgoldprefix]) - - - - - - - #os.system(f'{Submitcommand} {que_script}') - - - diff --git a/ceasiompy/EdgeRun/func/edge_que_script_gen.py b/ceasiompy/EdgeRun/func/edge_que_script_gen.py new file mode 100644 index 000000000..bd8b86c5f --- /dev/null +++ b/ceasiompy/EdgeRun/func/edge_que_script_gen.py @@ -0,0 +1,141 @@ +""" +CEASIOMpy: Conceptual Aircraft Design Software + +Developed for Airinnova AB, Stockholm, Sweden + +Functions to generate queuing script for Edge: queue_preprocessor.script and queue_edgesolver.script + +Python version: >=3.8 + +| Author : Mengmeng Zhang +| Creation: 2024-01-05 +""" + +# ================================================================================================= +# IMPORTS +# ================================================================================================= + +import os +import subprocess +from pathlib import Path + +# ================================================================================================= +# CLASSES +# ================================================================================================= + + +class EdgeScripts: + def __init__(self, dir_path, jobname, input_que_script_path, edge_input_file): + self.jobname = jobname + self.dir_path = dir_path + self.input_que_script_path = input_que_script_path + self.Edge_dir = "/pdc/software/22.06/other/m-edge/3.2/gnu/bin/" + self.EdgeInputFile = edge_input_file + # self.GridDir = 'grid' + # os.chdir(os.path.join(caseDir, self.GridDir)) + + def submit_preprocessor_script(self, dir_path): + preprocessor = os.path.join(self.Edge_dir, "preprocessor") + # dir_path = self.dir_path + QueScript = "queue_preprocessor.script" + Submitcommand = "sbatch" + os.chdir(dir_path) + with open(self.input_que_script_path, "r") as template_file, open( + QueScript, "w" + ) as que_script: + for line in template_file: + if "-J jobname" in line: + line = line.replace("-J jobname", f"-J {self.jobname}prepro") + que_script.write(line) + que_script.write(f"{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n") + print(f"{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n") + os.system(f"{Submitcommand} {que_script}") + + def run_preprocessor(self, dir_path): + # preprocessor = os.path.join(self.Edge_dir, 'preprocessor') + # dir_path = self.dir_path + # QueScript = f'queue_preprocessor.script' + # Submitcommand = 'sbatch' + os.chdir(dir_path) + """ + with open(self.input_que_script_path, 'r') as template_file, + open(QueScript, 'w') as que_script: + for line in template_file: + if '-J jobname' in line: + line = line.replace('-J jobname', f'-J {self.jobname}prepro') + que_script.write(line) + + que_script.write(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') + """ + os.system(f"preprocessor {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n") + + def submit_solver_script(self, dir_path, nb_proc): + run_solver = os.path.join(self.Edge_dir, "edge_mpi_run") + QueScript = "queue_edgesolver.script" + # dir_path = self.dir_path + Submitcommand = "sbatch" + os.chdir(dir_path) + with open(self.input_que_script_path, "r") as template_file, open( + QueScript, "w" + ) as que_script: + for line in template_file: + if "-J jobname" in line: + line = line.replace("-J jobname", f"-J {self.jobname}solver") + que_script.write(line) + que_script.write(f"{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n") + os.system(f"{Submitcommand} {que_script}") + + def run_edgesolver(self, dir_path, nb_proc): + run_solver = os.path.join(self.Edge_dir, "edge_mpi_run") + os.chdir(dir_path) + os.system(f"{run_solver} {self.EdgeInputFile} {nb_proc} > edge_run.log 2>&1\n") + + def postprocess_script(self, dir_path, edge_grid): + # ffaucut = os.path.join(self.Edge_dir, 'ffaucut') + # ffauinterpol = os.path.join(self.Edge_dir, 'ffauinterpol') + # ffa2tab = os.path.join(self.Edge_dir, 'ffa2tab') + ffa2engold = os.path.join(self.Edge_dir, "ffa2engold") + grid = edge_grid + + # output file names + # walldata1 = "Edge_wall.dat" + # walldata2 = "Edge_wall.cf" + # forcemoments = "Edge_force_moment.dat" + ensgoldprefix = "zzz" + solution1 = "Edge.bout" + # solution2 = "Post.bout" + + # Enter the folder + os.chdir(dir_path) + + """ + # Extract the boundary + input_data = + 1 + 0 + with subprocess.Popen([ffaucut, grid, 'tmp1'], stdin=subprocess.PIPE, text=True) as process: + process.communicate(input=input_data) + + + # Inteerpolate the soulutions + subprocess.run([ffauinterpol, solution1, 'tmp1', 'tmp11']) + subprocess.run([ffauinterpol, solution2, 'tmp1', 'tmp12']) + + # Extract tabulated data + subprocess.run([ffa2tab, 'tmp11', walldata1]) + subprocess.run([ffa2tab, 'tmp12', walldata2]) + + # Cleanup + for temp_file in ['tmp1', 'tmp11', 'tmp12']: + os.remove(temp_file) + """ + # Create ensight gold files + subprocess.run([ffa2engold, grid, solution1, ensgoldprefix]) + + # os.system(f'{Submitcommand} {que_script}') + + +# ================================================================================================= +# FUNCTIONS +# ================================================================================================= diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index a75d89f0a..df2e1e871 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -20,7 +20,8 @@ # IMPORTS # ================================================================================================= -import math, os +import math +import os from pathlib import Path from shutil import copyfile @@ -58,14 +59,12 @@ # from ceasiompy.utils.configfiles import ConfigFile from ceasiompy.utils.create_ainpfile import CreateAinp from cpacspy.cpacsfunctions import ( - create_branch, - get_string_vector, get_value, get_value_or_default, ) from cpacspy.cpacspy import CPACS from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template -from ceasiompy.EdgeRun.func.edge_queScript_gen import EdgeScripts +from ceasiompy.EdgeRun.func.edge_que_script_gen import EdgeScripts # import cpacs diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py index 3b4d67d7e..93c0fe6a9 100644 --- a/ceasiompy/EdgeRun/func/edgeutils.py +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -23,12 +23,6 @@ import requests from ceasiompy.utils.ceasiomlogger import get_logger -from ceasiompy.utils.ceasiompyutils import get_install_path -from ceasiompy.utils.commonnames import ( - ACTUATOR_DISK_INLET_SUFFIX, - ACTUATOR_DISK_OUTLET_SUFFIX, - ENGINE_EXHAUST_SUFFIX, - ENGINE_INTAKE_SUFFIX, ) from ceasiompy.utils.moduleinterfaces import get_module_path @@ -57,7 +51,7 @@ def get_edge_ainp_template(): ) return edge_ainp_template_path -def get_edge_queScript_template(): +def get_edge_que_script_template(): """Return path of the M-Edge ainp template corresponding to the M-Edge version.""" edge_dir = get_module_path("EdgeRun") diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py index 5593e6a0e..7f57660f9 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -19,7 +19,6 @@ import unittest -import sys from pathlib import Path # Add the ceasiompy module to the PYTHONPATH @@ -30,14 +29,13 @@ # import ceasiompy from ceasiompy.EdgeRun.func.edgeconfig import generate_edge_cfd_ainp import os -from ceasiompy.EdgeRun.edgerun import run_edge_multi -from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH -from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template + # from ceasiompy.utils.create_ainpfile import CreateAinp MODULE_DIR = Path(__file__).parent -input_que_script_path = get_edge_queScript_template() -nb_proc = 32 + +# input_que_script_path = get_edge_queScript_template() + # ================================================================================================= # CLASSES # ================================================================================================= @@ -47,17 +45,18 @@ class TestEdgeConfig(unittest.TestCase): """Test class for 'ceasiompy/EdgeRun/func/edgerun.py'""" def test_run_edge_cfd(self): - # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") - cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') + # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") + cpacs_in_path = Path( + "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" + ) cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" - if not os.path.exists(wkdir): os.makedirs(wkdir) generate_edge_cfd_ainp(cpacs_in_path, cpacs_out_path, wkdir) - #run_edge_multi(wkdir,input_que_script_path ) + # run_edge_multi(wkdir,input_que_script_path ) # ================================================================================================= diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py index 0b871e1d2..75a9d9208 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_submit.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_submit.py @@ -17,9 +17,6 @@ # IMPORTS # ================================================================================================= -import unittest - -import sys from pathlib import Path # Add the ceasiompy module to the PYTHONPATH @@ -30,16 +27,17 @@ # import ceasiompy from ceasiompy.EdgeRun.func.edgeconfig import edge_cfd import os -from ceasiompy.EdgeRun.edgerun import run_edge_multi -from ceasiompy.utils.commonxpath import EDGE_NB_CPU_XPATH -from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template + +# from ceasiompy.EdgeRun.func.edgeutils import get_edge_que_script_template # from ceasiompy.utils.create_ainpfile import CreateAinp MODULE_DIR = Path(__file__).parent -input_que_script_path = get_edge_queScript_template() +# input_que_script_path = get_edge_que_script_template() - # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") -cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/CPACS_selected_from_GUI.xml') +# cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") +cpacs_in_path = Path( + "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/CPACS_selected_from_GUI.xml" +) cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results" From 61c06d15c17639de7e75eccf2f1c12347a283019 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 7 Feb 2024 15:57:25 +0100 Subject: [PATCH 69/80] formatting --- ceasiompy/EdgeRun/func/edge_que_script_gen.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edge_que_script_gen.py b/ceasiompy/EdgeRun/func/edge_que_script_gen.py index bd8b86c5f..d794ba713 100644 --- a/ceasiompy/EdgeRun/func/edge_que_script_gen.py +++ b/ceasiompy/EdgeRun/func/edge_que_script_gen.py @@ -64,7 +64,6 @@ def run_preprocessor(self, dir_path): if '-J jobname' in line: line = line.replace('-J jobname', f'-J {self.jobname}prepro') que_script.write(line) - que_script.write(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') print(f'{preprocessor} {self.EdgeInputFile} > edge_preprocessor.log 2>&1\n') """ @@ -114,7 +113,8 @@ def postprocess_script(self, dir_path, edge_grid): input_data = 1 0 - with subprocess.Popen([ffaucut, grid, 'tmp1'], stdin=subprocess.PIPE, text=True) as process: + with subprocess.Popen([ffaucut, grid, 'tmp1'], stdin=subprocess.PIPE, text=True) + as process: process.communicate(input=input_data) From 97cc049474f9f06c8fd1317b8ac26750b0431169 Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 7 Feb 2024 16:01:46 +0100 Subject: [PATCH 70/80] formatting --- ceasiompy/EdgeRun/func/edge_que_script_gen.py | 4 +++- ceasiompy/EdgeRun/func/edgeutils.py | 6 +++++- ceasiompy/EdgeRun/tests/test_edgerun.py | 6 ++++-- ceasiompy/EdgeRun/tests/test_edgerun_mpi.py | 1 + ceasiompy/SUMOAutoMesh/sumoautomesh.py | 4 ++-- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edge_que_script_gen.py b/ceasiompy/EdgeRun/func/edge_que_script_gen.py index d794ba713..be75402eb 100644 --- a/ceasiompy/EdgeRun/func/edge_que_script_gen.py +++ b/ceasiompy/EdgeRun/func/edge_que_script_gen.py @@ -3,7 +3,8 @@ Developed for Airinnova AB, Stockholm, Sweden -Functions to generate queuing script for Edge: queue_preprocessor.script and queue_edgesolver.script +Functions to generate queuing script for Edge: +queue_preprocessor.script and queue_edgesolver.script Python version: >=3.8 @@ -57,6 +58,7 @@ def run_preprocessor(self, dir_path): # QueScript = f'queue_preprocessor.script' # Submitcommand = 'sbatch' os.chdir(dir_path) + """ with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py index 93c0fe6a9..2910166df 100644 --- a/ceasiompy/EdgeRun/func/edgeutils.py +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -23,7 +23,7 @@ import requests from ceasiompy.utils.ceasiomlogger import get_logger -) + from ceasiompy.utils.moduleinterfaces import get_module_path log = get_logger() @@ -51,6 +51,7 @@ def get_edge_ainp_template(): ) return edge_ainp_template_path + def get_edge_que_script_template(): """Return path of the M-Edge ainp template corresponding to the M-Edge version.""" @@ -62,7 +63,10 @@ def get_edge_que_script_template(): ) return edge_queScript_template_path + """""" + + def get_su2_aerocoefs(force_file): """Get aerodynamic coefficients and velocity from SU2 forces file (forces_breakdown.dat) diff --git a/ceasiompy/EdgeRun/tests/test_edgerun.py b/ceasiompy/EdgeRun/tests/test_edgerun.py index 4ff714be3..7a818f671 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun.py @@ -45,8 +45,10 @@ class TestEdgeConfig(unittest.TestCase): def test_generate_edge_cfd_ainp(self): """Test function for 'ceasiompy.EdgeRun.func.edgeconfig.py'.""" - # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") - cpacs_in_path = Path('/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml') + # cpacs_in_path = Path(MODULE_DIR / "ToolInput" / "ToolInput.xml") + cpacs_in_path = Path( + "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" + ) cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" diff --git a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py index 7f57660f9..fba4ad3e9 100644 --- a/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py +++ b/ceasiompy/EdgeRun/tests/test_edgerun_mpi.py @@ -49,6 +49,7 @@ def test_run_edge_cfd(self): cpacs_in_path = Path( "/home/mengmeng/Documents/CEASIOMpy23/CEASIOMpy/WKDIR/labARstraight_toolInput.xml" ) + cpacs_out_path = MODULE_DIR / "ToolOutput.xml" wkdir = MODULE_DIR / "Results/Edge" diff --git a/ceasiompy/SUMOAutoMesh/sumoautomesh.py b/ceasiompy/SUMOAutoMesh/sumoautomesh.py index e9564481a..a356ce7ee 100644 --- a/ceasiompy/SUMOAutoMesh/sumoautomesh.py +++ b/ceasiompy/SUMOAutoMesh/sumoautomesh.py @@ -320,8 +320,8 @@ def create_mesh(cpacs_path, cpacs_out_path): create_branch(tixi, EDGE_MESH_XPATH) tixi.updateTextElement(EDGE_MESH_XPATH, str(mesh_out_path)) - edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") # commented by Mengmeng - edge_aboc_name = aircraft_name(tixi) + f"_baseline.aboc" + edge_aboc_path = Path(sumo_results_dir, "ToolOutput.aboc") # commented by Mengmeng + edge_aboc_name = aircraft_name(tixi) + "_baseline.aboc" aboc_out_path = Path(sumo_results_dir, edge_aboc_name) shutil.copyfile(edge_aboc_path, aboc_out_path) From ad379afce44a15135ba354da541dadaa2915e2ee Mon Sep 17 00:00:00 2001 From: GBenedett Date: Wed, 7 Feb 2024 16:03:09 +0100 Subject: [PATCH 71/80] formatting --- ceasiompy/EdgeRun/func/edge_que_script_gen.py | 6 +++--- ceasiompy/EdgeRun/func/edgeutils.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edge_que_script_gen.py b/ceasiompy/EdgeRun/func/edge_que_script_gen.py index be75402eb..08b01a8b6 100644 --- a/ceasiompy/EdgeRun/func/edge_que_script_gen.py +++ b/ceasiompy/EdgeRun/func/edge_que_script_gen.py @@ -3,7 +3,7 @@ Developed for Airinnova AB, Stockholm, Sweden -Functions to generate queuing script for Edge: +Functions to generate queuing script for Edge: queue_preprocessor.script and queue_edgesolver.script Python version: >=3.8 @@ -60,7 +60,7 @@ def run_preprocessor(self, dir_path): os.chdir(dir_path) """ - with open(self.input_que_script_path, 'r') as template_file, + with open(self.input_que_script_path, 'r') as template_file, open(QueScript, 'w') as que_script: for line in template_file: if '-J jobname' in line: @@ -111,7 +111,7 @@ def postprocess_script(self, dir_path, edge_grid): os.chdir(dir_path) """ - # Extract the boundary + # Extract the boundary input_data = 1 0 diff --git a/ceasiompy/EdgeRun/func/edgeutils.py b/ceasiompy/EdgeRun/func/edgeutils.py index 2910166df..75f75efd4 100644 --- a/ceasiompy/EdgeRun/func/edgeutils.py +++ b/ceasiompy/EdgeRun/func/edgeutils.py @@ -56,7 +56,7 @@ def get_edge_que_script_template(): """Return path of the M-Edge ainp template corresponding to the M-Edge version.""" edge_dir = get_module_path("EdgeRun") - edge_queScript_template_path = Path(edge_dir, "files", f"queue_template.script") + edge_queScript_template_path = Path(edge_dir, "files", "queue_template.script") if not edge_queScript_template_path.is_file(): raise FileNotFoundError( f"The M-Edge queueScript template '{edge_queScript_template_path}' has not been found!" From c33e59f3462c3bca3558e4ca15a92487ad4e8657 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 28 Feb 2024 20:25:48 +0100 Subject: [PATCH 72/80] modified: ceasiompy/utils/ceasiomlogger.py commented logger writing --- ceasiompy/utils/ceasiomlogger.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 05e9bf7b0..6da3afee3 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -42,6 +42,7 @@ def get_logger(): logger (logger): Logger """ +""" logger = logging.getLogger("CEASIOMpy") # NOTE: Multiple calls to getLogger() with the same name will return a @@ -67,7 +68,7 @@ def get_logger(): logger.addHandler(console_handler) return logger - +""" def add_to_runworkflow_history(working_dir: Path, comment: str = "") -> None: """Add a line to the runworkflow history""" From a22a59882ead1eb48bef8c26f5c6f1c359f90363 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 28 Feb 2024 20:38:07 +0100 Subject: [PATCH 73/80] modified: ceasiompy/utils/ceasiomlogger.py --- ceasiompy/utils/ceasiomlogger.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 6da3afee3..37f71a036 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -42,7 +42,7 @@ def get_logger(): logger (logger): Logger """ -""" + logger = logging.getLogger("CEASIOMpy") # NOTE: Multiple calls to getLogger() with the same name will return a @@ -68,7 +68,7 @@ def get_logger(): logger.addHandler(console_handler) return logger -""" + def add_to_runworkflow_history(working_dir: Path, comment: str = "") -> None: """Add a line to the runworkflow history""" From e751d18d064136e56745a6ed227b7c60045874e9 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 28 Feb 2024 21:00:59 +0100 Subject: [PATCH 74/80] modified: ceasiompy/EdgeRun/func/edgeconfig.py --- ceasiompy/EdgeRun/func/edgeconfig.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index df2e1e871..07433fffb 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -63,7 +63,7 @@ get_value_or_default, ) from cpacspy.cpacspy import CPACS -from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template +from ceasiompy.EdgeRun.func.edgeutils import get_edge_que_script_template from ceasiompy.EdgeRun.func.edge_que_script_gen import EdgeScripts # import cpacs @@ -72,7 +72,7 @@ MODULE_DIR = Path(__file__).parent -input_que_script_path = get_edge_queScript_template() +input_que_script_path = get_edge_que_script_template() # ================================================================================================= From 3d78c971afeef63a8d78cb2b35fc86de3a768ecf Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Wed, 28 Feb 2024 21:13:06 +0100 Subject: [PATCH 75/80] modified: ceasiompy/utils/ceasiomlogger.py --- ceasiompy/utils/ceasiomlogger.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 37f71a036..b0d356d2a 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -54,11 +54,11 @@ def get_logger(): logger.setLevel(logging.DEBUG) # Write logfile - file_formatter = logging.Formatter("%(asctime)s - %(levelname)8s - %(module)18s - %(message)s") - file_handler = logging.FileHandler(filename=LOGFILE, mode="w") - file_handler.setLevel(logging.DEBUG) # Level for the logfile - file_handler.setFormatter(file_formatter) - logger.addHandler(file_handler) + #file_formatter = logging.Formatter("%(asctime)s - %(levelname)8s - %(module)18s - %(message)s") + #file_handler = logging.FileHandler(filename=LOGFILE, mode="w") + #file_handler.setLevel(logging.DEBUG) # Level for the logfile + #file_handler.setFormatter(file_formatter) + #logger.addHandler(file_handler) # Write log messages on the console console_formatter = logging.Formatter("%(levelname)-8s - %(message)s") From fedad8d725d085e4e48a7acb8ae8e8ba10a516f2 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Thu, 29 Feb 2024 09:41:52 +0100 Subject: [PATCH 76/80] modified: ceasiompy/utils/ceasiomlogger.py --- ceasiompy/utils/ceasiomlogger.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index b0d356d2a..78cf97258 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -61,11 +61,11 @@ def get_logger(): #logger.addHandler(file_handler) # Write log messages on the console - console_formatter = logging.Formatter("%(levelname)-8s - %(message)s") - console_handler = logging.StreamHandler() - console_handler.setLevel(logging.DEBUG) # Level for the console log - console_handler.setFormatter(console_formatter) - logger.addHandler(console_handler) + #console_formatter = logging.Formatter("%(levelname)-8s - %(message)s") + #console_handler = logging.StreamHandler() + #console_handler.setLevel(logging.DEBUG) # Level for the console log + #console_handler.setFormatter(console_formatter) + #logger.addHandler(console_handler) return logger From 250e70a9ec34087493f5a83fe37ad29753ff000b Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Thu, 29 Feb 2024 16:34:23 +0100 Subject: [PATCH 77/80] modified: ceasiompy/utils/ceasiomlogger.py --- ceasiompy/utils/ceasiomlogger.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ceasiompy/utils/ceasiomlogger.py b/ceasiompy/utils/ceasiomlogger.py index 78cf97258..10329aa99 100644 --- a/ceasiompy/utils/ceasiomlogger.py +++ b/ceasiompy/utils/ceasiomlogger.py @@ -72,14 +72,14 @@ def get_logger(): def add_to_runworkflow_history(working_dir: Path, comment: str = "") -> None: """Add a line to the runworkflow history""" - RUNWORKFLOW_HISTORY_PATH.parent.mkdir(exist_ok=True) - RUNWORKFLOW_HISTORY_PATH.touch(exist_ok=True) + #RUNWORKFLOW_HISTORY_PATH.parent.mkdir(exist_ok=True) + #RUNWORKFLOW_HISTORY_PATH.touch(exist_ok=True) if comment: comment = " - " + comment - with open(RUNWORKFLOW_HISTORY_PATH, "a") as f: - f.write(f"{datetime.now():%Y-%m-%d %H:%M:%S} - {working_dir}{comment}\n") + #with open(RUNWORKFLOW_HISTORY_PATH, "a") as f: + # f.write(f"{datetime.now():%Y-%m-%d %H:%M:%S} - {working_dir}{comment}\n") def get_last_runworkflow() -> Path: From 1d47f78b26445b153bc49ff9db62a68b72749983 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Fri, 1 Mar 2024 17:02:33 +0100 Subject: [PATCH 78/80] modified: ceasiompy/EdgeRun/func/edgeconfig.py corrected aoa/aos to radius --- ceasiompy/EdgeRun/func/edgeconfig.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 07433fffb..8ec3a8b7c 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -227,24 +227,24 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): speedofsound = Atm.speed_of_sound[0] airspeed = mach * speedofsound - # aoa_rad = math.radians(aoa) - # aos_rad = math.radians(aos) + aoa_rad = math.radians(aoa) + aos_rad = math.radians(aos) - UFREE = airspeed * math.cos(aos) * math.cos(aoa) - WFREE = airspeed * math.cos(aos) * math.sin(aoa) - VFREE = airspeed * math.sin(aos) * (-1) + UFREE = airspeed * math.cos(aos_rad) * math.cos(aoa_rad) + WFREE = airspeed * math.cos(aos_rad) * math.sin(aoa_rad) + VFREE = airspeed * math.sin(aos_rad) * (-1) - IDCDP1 = math.cos(aos) * math.cos(aoa) - IDCDP2 = math.sin(aos) - IDCDP3 = math.cos(aos) * math.sin(aoa) + IDCDP1 = math.cos(aos_rad) * math.cos(aoa_rad) + IDCDP2 = math.sin(aos_rad) + IDCDP3 = math.cos(aos_rad) * math.sin(aoa_rad) - IDCLP1 = math.sin(aoa) * (-1) + IDCLP1 = math.sin(aoa_rad) * (-1) IDCLP2 = 0 - IDCLP3 = math.cos(aoa) + IDCLP3 = math.cos(aoa_rad) - IDCCP1 = math.cos(aoa) * math.sin(aos) * (-1) - IDCCP2 = math.cos(aos) * (-1) - IDCCP3 = math.sin(aoa) * math.sin(aos) * (-1) + IDCCP1 = math.cos(aoa_rad) * math.sin(aos_rad) * (-1) + IDCCP2 = math.cos(aos_rad) * (-1) + IDCCP3 = math.sin(aoa_rad) * math.sin(aos_rad) * (-1) IDCMP1 = IDCCP1 IDCMP2 = IDCCP2 IDCMP3 = IDCCP3 From 7ba945ed35d5b2016120f5ca0a458c9172d4552c Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Fri, 1 Mar 2024 17:27:41 +0100 Subject: [PATCH 79/80] modified: ceasiompy/EdgeRun/func/edgeconfig.py added print (instead of log.info) --- ceasiompy/EdgeRun/func/edgeconfig.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ceasiompy/EdgeRun/func/edgeconfig.py b/ceasiompy/EdgeRun/func/edgeconfig.py index 8ec3a8b7c..661f108b4 100644 --- a/ceasiompy/EdgeRun/func/edgeconfig.py +++ b/ceasiompy/EdgeRun/func/edgeconfig.py @@ -320,18 +320,24 @@ def edge_cfd(cpacs_path, cpacs_out_path, wkdir): if not bedg_files_exist: # edge_scripts_instance.submit_preprocessor_script(case_dir_path) log.info("Running Edge preprocessor ...") + print("Running Edge preprocessor ...") edge_scripts_instance.run_preprocessor(case_dir_path) log.info("Preprocessor is done. *.bedg files are generated") + print("Preprocessor is done. *.bedg files are generated") # edge_scripts_instance.submit_solver_script(case_dir_path,NPART) log.info("Running Edge solver... for " + case_dir_name) + print("Running Edge solver... for " + case_dir_name) edge_scripts_instance.run_edgesolver(case_dir_path, NPART) log.info("Edge solver is done.") + print("Edge solver is done.") # postprocess for results log.info("Running Edge postprocessor...for " + case_dir_name) + print("Running Edge postprocessor...for " + case_dir_name) edge_scripts_instance.postprocess_script(case_dir_path, edge_mesh) log.info("Edge postprocessor is done.") + print("Edge postprocessor is done.") # wait until the results are generated cpacs.save_cpacs(cpacs_out_path, overwrite=True) From a110919f30fb3b6d03d5e9f8e0d939b050031d72 Mon Sep 17 00:00:00 2001 From: Mengmeng Zhang Date: Sat, 2 Mar 2024 08:41:46 +0100 Subject: [PATCH 80/80] modified: ceasiompy/EdgeRun/edgerun.py --- ceasiompy/EdgeRun/edgerun.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ceasiompy/EdgeRun/edgerun.py b/ceasiompy/EdgeRun/edgerun.py index cd05323b1..203e1620b 100644 --- a/ceasiompy/EdgeRun/edgerun.py +++ b/ceasiompy/EdgeRun/edgerun.py @@ -22,7 +22,7 @@ from ceasiompy.utils.ceasiomlogger import get_logger from ceasiompy.utils.ceasiompyutils import get_results_directory from ceasiompy.utils.moduleinterfaces import get_toolinput_file_path, get_tooloutput_file_path -from ceasiompy.EdgeRun.func.edgeutils import get_edge_queScript_template +from ceasiompy.EdgeRun.func.edgeutils import get_edge_que_script_template log = get_logger() @@ -38,7 +38,7 @@ # ================================================================================================= # FUNCTIONS # ================================================================================================= -input_que_script_path = get_edge_queScript_template() +input_que_script_path = get_edge_que_script_template() def extract_edge_forces(results_dir): @@ -57,6 +57,7 @@ def extract_edge_forces(results_dir): dir_path = os.path.join(results_dir, dir_name) # print(f"Processing directory: {dir_path}") log.info(f"Extracting forces from Directory : {dir_name}") + print(f"Extracting forces from Directory : {dir_name}") # Extract mach and alfa from directory name match = re.match(r".*alt(\d+\.\d+)_mach(\d+\.\d+)_aoa(\d+\.\d+)_aos(\d+\.\d+)*", dir_name) @@ -97,6 +98,7 @@ def extract_edge_forces(results_dir): f"{alt:.8f} {mach:.8f} {aoa:.8f} {aos:.8f} {CL} {CD} {CDP} {CDV} {CM}\n" ) log.info(f"Saving forces to file: {forcemoments}") + print(f"Saving forces to file: {forcemoments}") # =================================================================================================