diff --git a/docs/conf.py b/docs/conf.py index 1d476aeda2ee0ec22e5334a14f02de7b3da65e8a..6831462e120f600d2a003bf48a7c4e991d7bdb5d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -33,7 +33,7 @@ import ntrfc # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] -# Add any paths that contain templates here, relative to this directory. +# Add any paths that contain TEMPLATES here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. diff --git a/examples/gwk_compressor_casegeneration/Snakefile b/examples/gwk_compressor_casegeneration/Snakefile new file mode 100644 index 0000000000000000000000000000000000000000..da9480dfa827c9c0181e0bea1b795a90abb51469 --- /dev/null +++ b/examples/gwk_compressor_casegeneration/Snakefile @@ -0,0 +1,31 @@ +from snakemake.utils import validate + + +#todo move this snakepipe to according dir in sourcecode + +configfile : "casesettings.yaml" +validate(config,"config.schema.yaml") + +rule all: + input: + "done.txt" + +rule copy_template: + output: + #todo: is there a readable dataformat alternative (csv) instead of pickle? + dynamic("01_case/{case_type}/{case_files}") + params: + case_type = config["case_params"]["case_type"], + + run: + from case_creation import create_case_fromtemplate + + create_case_fromtemplate(params["case_type"]) + +rule check_template: + input: + dynamic("01_case/{case_type}/{case_files}"), + output: + "done.txt" + run: + print("tbd") diff --git a/examples/gwk_compressor_casegeneration/case_creation.py b/examples/gwk_compressor_casegeneration/case_creation.py new file mode 100644 index 0000000000000000000000000000000000000000..b34e98ffdc8ab7a13e79d6096836f0a78f1e584e --- /dev/null +++ b/examples/gwk_compressor_casegeneration/case_creation.py @@ -0,0 +1,94 @@ +import os +from functools import reduce +import shutil +from pathlib import Path +import copy +import re + +from ntrfc.utils.dictionaries.dictutils import nested_dict_pairs_iterator, setInDict + +TEMPLATEDIR = r"D:\CodingProjects\NTRfC\ntrfc\database\case_templates" +path_to_sim=r"D:\CodingProjects\NTRfC\examples\gwk_compressor_casegeneration\01_case" +TEMPLATES = [i for i in os.listdir(TEMPLATEDIR) if os.path.isdir(os.path.join(TEMPLATEDIR, i))] + +def get_directory_structure(rootdir): + """ + Creates a nested dictionary that represents the folder structure of rootdir + """ + dir = {} + rootdir = rootdir.rstrip(os.sep) + start = rootdir.rfind(os.sep) + 1 + for path, dirs, files in os.walk(rootdir): + folders = path[start:].split(os.sep) + subdir = dict.fromkeys(files) + parent = reduce(dict.get, folders[:-1], dir) + parent[folders[-1]] = subdir + return dir + + + +def find_vars_opts(case_structure, sign, all_pairs, path_to_sim): + # allowing names like JOB_NUMBERS, only capital letters and underlines - no digits, no whitespaces + datadict = copy.deepcopy(case_structure) + varsignature = r"<PLACEHOLDER [A-Z]{3,}(_{1,1}[A-Z]{3,}){,} PLACEHOLDER>".replace(r'PLACEHOLDER', sign) + siglim = (len(sign)+2, -(len(sign)+2)) + + for pair in all_pairs: + #if os.path.isfile(os.path.join(path_to_sim,*pair)): + setInDict(datadict, pair[:-1], {}) + filepath = os.path.join(*pair[:-1]) + with open(os.path.join(path_to_sim, filepath), "r") as fhandle: + for line in fhandle.readlines(): + datadict = search_paras(datadict, line, pair, siglim, varsignature, sign) + return datadict + +def create_simdirstructure(case_structure, path): + directories = list(nested_dict_pairs_iterator(case_structure)) + for d in directories: + dirstructure = d[:-2] + Path(os.path.join(path,*dirstructure)).mkdir(parents=True, exist_ok=True) + return 0 + + +def search_paras(case_structure, line, pair, siglim, varsignature, varsign): + lookforvar = True + while (lookforvar): + lookup_var = re.search(varsignature, line) + if not lookup_var: + lookforvar = False + else: + span = lookup_var.span() + parameter = line[span[0] + siglim[0]:span[1] + siglim[1]] + setInDict(case_structure, list(pair[:-1]) + [parameter], varsign) + match = line[span[0]:span[1]] + line = line.replace(match, "") + return case_structure + + +def create_case_fromtemplate(template, path_to_sim): + found = template in TEMPLATES + assert found, "template unknown. check ntrfc.database.casetemplates directory" + + case_structure = get_directory_structure(os.path.join(TEMPLATEDIR, template)) + case_files = [i[:-1] for i in list(nested_dict_pairs_iterator(case_structure)) if os.path.isfile(os.path.join(TEMPLATEDIR,*list(i[:-1])))] + + for fpath in case_files: + filename = fpath[-1] + dirstructure = fpath[:-1] + if dirstructure == (): + dirstructure = "" + + template_fpath = os.path.join(TEMPLATEDIR, + *dirstructure, + filename) + create_simdirstructure(case_structure,path_to_sim) + sim_fpath = os.path.join(path_to_sim, *dirstructure) + + shutil.copyfile(template_fpath, os.path.join(sim_fpath,filename)) + variables = find_vars_opts(case_structure, "var", list(nested_dict_pairs_iterator(case_structure)),"01_case") + nov = len(list(nested_dict_pairs_iterator(variables))) + print("found ", str(nov), "parameters of type var in copied template") + return case_files + + +case_structure = create_case_fromtemplate('trace-compressor-cascade-ras', path_to_sim) diff --git a/examples/gwk_compressor_casegeneration/casesettings.yaml b/examples/gwk_compressor_casegeneration/casesettings.yaml new file mode 100644 index 0000000000000000000000000000000000000000..5f348db2fd21e827724ac6dd53a9a7cafac77e0f --- /dev/null +++ b/examples/gwk_compressor_casegeneration/casesettings.yaml @@ -0,0 +1,2 @@ +case_params: + case_type: trace-compressor-cascade-ras diff --git a/examples/gwk_compressor_casegeneration/config.schema.yaml b/examples/gwk_compressor_casegeneration/config.schema.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3e555147109df0ed2c04911b87d3952147f6b371 --- /dev/null +++ b/examples/gwk_compressor_casegeneration/config.schema.yaml @@ -0,0 +1,13 @@ +$schema : "http://json-schema.org/draft-06/schema#" +description : Config file for the parPE snakemake optimization workflow + + +properties : + case_params : + type : object + description : definition of the case and its parameterspace + + case_type : + type : string + description : name of the case-template + pattern : trace-compressor-cascade-ras diff --git a/examples/gwk_compressor/00_resources/tfd_gwk_compressor.txt b/examples/gwk_compressor_meshgeneration/00_resources/tfd_gwk_compressor.txt similarity index 100% rename from examples/gwk_compressor/00_resources/tfd_gwk_compressor.txt rename to examples/gwk_compressor_meshgeneration/00_resources/tfd_gwk_compressor.txt diff --git a/examples/gwk_compressor/Snakefile b/examples/gwk_compressor_meshgeneration/Snakefile similarity index 100% rename from examples/gwk_compressor/Snakefile rename to examples/gwk_compressor_meshgeneration/Snakefile diff --git a/examples/gwk_compressor/casesettings.yaml b/examples/gwk_compressor_meshgeneration/casesettings.yaml similarity index 100% rename from examples/gwk_compressor/casesettings.yaml rename to examples/gwk_compressor_meshgeneration/casesettings.yaml diff --git a/examples/gwk_compressor/config.schema.yaml b/examples/gwk_compressor_meshgeneration/config.schema.yaml similarity index 100% rename from examples/gwk_compressor/config.schema.yaml rename to examples/gwk_compressor_meshgeneration/config.schema.yaml diff --git a/examples/gwk_compressor/development_run.py b/examples/gwk_compressor_meshgeneration/development_run.py similarity index 100% rename from examples/gwk_compressor/development_run.py rename to examples/gwk_compressor_meshgeneration/development_run.py diff --git a/ntrfc/database/airfoil_generators/__init__.py b/ntrfc/database/airfoil_generators/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ntrfc/database/naca_airfoil_creator.py b/ntrfc/database/airfoil_generators/naca_airfoil_creator.py similarity index 100% rename from ntrfc/database/naca_airfoil_creator.py rename to ntrfc/database/airfoil_generators/naca_airfoil_creator.py diff --git a/ntrfc/database/parsec_airfoil_creator.py b/ntrfc/database/airfoil_generators/parsec_airfoil_creator.py similarity index 100% rename from ntrfc/database/parsec_airfoil_creator.py rename to ntrfc/database/airfoil_generators/parsec_airfoil_creator.py diff --git a/ntrfc/database/case_templates/__init__.py b/ntrfc/database/case_templates/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ntrfc/database/case_templates/trace-compressor-cascade-ras/input/TRACE_control.input b/ntrfc/database/case_templates/trace-compressor-cascade-ras/input/TRACE_control.input new file mode 100644 index 0000000000000000000000000000000000000000..0b52979f2a6802b337369ec64e94c68795a630fc --- /dev/null +++ b/ntrfc/database/case_templates/trace-compressor-cascade-ras/input/TRACE_control.input @@ -0,0 +1 @@ +<var TRACE_CONTROLINPUT var> \ No newline at end of file diff --git a/ntrfc/database/case_templates/trace-compressor-cascade-ras/input/verdichter.jou b/ntrfc/database/case_templates/trace-compressor-cascade-ras/input/verdichter.jou new file mode 100644 index 0000000000000000000000000000000000000000..b2cd0c8434c13efded177057676f8379adbe9d3d --- /dev/null +++ b/ntrfc/database/case_templates/trace-compressor-cascade-ras/input/verdichter.jou @@ -0,0 +1,150 @@ +# journal recorded by gmc_v9.1.8 at 2021/06/11 14:58:57 + +gmc -> open '<var MESHNAME var>' + +gmc -> repair + +gmc -> create_zone : name 'row01' type STATOR + +gmc -> move_block 'Block_7' to zone named 'row01' +gmc -> move_block 'Block_8' to zone named 'row01' +gmc -> move_block 'Block_9' to zone named 'row01' +gmc -> move_block 'Block_1' to zone named 'row01' +gmc -> move_block 'Block_10' to zone named 'row01' +gmc -> move_block 'Block_11' to zone named 'row01' +gmc -> move_block 'Block_12' to zone named 'row01' +gmc -> move_block 'Block_2' to zone named 'row01' +gmc -> move_block 'Block_3' to zone named 'row01' +gmc -> move_block 'Block_4' to zone named 'row01' +gmc -> move_block 'Block_5' to zone named 'row01' +gmc -> move_block 'Block_6' to zone named 'row01' + +gmc -> delete_empty_zones + +gmc -> set_global_tolerance <var GLOBAL_TOLERANCE var> + +gmc -> set_pmode linear_periodic + +gmc -> set_y_translation_count of zone named 'row01' to <var LENGTH_YPER var> +gmc -> set_z_translation_count of zone named 'row01' to 0.0 + +gmc -> find_connectivity_light +gmc -> find_connectivity + +gmc -> create_panel_group : name 'INLET' type INLET_BC +gmc -> create_panel_group : name 'OUTLET' type OUTLET_BC +gmc -> create_panel_group : name 'BLADE' type VISCOUS_BC +gmc -> create_panel_group : name 'FREESLIP' type INVISCID_BC + +gmc -> move_panel 'Block_2/1' to group named 'INLET' +gmc -> move_panel 'Block_3/1' to group named 'INLET' +gmc -> move_panel 'Block_1/1' to group named 'INLET' + +gmc -> move_panel 'Block_7/2' to group named 'OUTLET' +gmc -> move_panel 'Block_6/2' to group named 'OUTLET' +gmc -> move_panel 'Block_5/2' to group named 'OUTLET' + +gmc -> move_panel 'Block_11/4' to group named 'BLADE' +gmc -> move_panel 'Block_12/3' to group named 'BLADE' +gmc -> move_panel 'Block_10/4' to group named 'BLADE' +gmc -> move_panel 'Block_9/2' to group named 'BLADE' + +gmc -> move_panel 'Block_1/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_1/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_2/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_2/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_3/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_3/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_4/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_4/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_5/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_5/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_6/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_6/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_7/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_7/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_8/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_8/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_9/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_9/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_10/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_10/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_11/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_11/6' to group named 'FREESLIP' +gmc -> move_panel 'Block_12/5' to group named 'FREESLIP' +gmc -> move_panel 'Block_12/6' to group named 'FREESLIP' + +gmc -> compute_wall_distances + +gmc -> generate_machine_from_scratch +gmc -> modify_component named 'default_component' : name 'CascadeCase_rans_trace' type LPC + +gmc -> set_trans_velocity of component type 'LPC' to 0.000000 0.000000 0.000000 +gmc -> set_default_stages of component type 'LPC' +gmc -> apply_default_settings for component type 'LPC' +gmc -> apply_default_settings for machine +gmc -> delete_attributes of panel_group named 'BLADE' : delete transition_properties +gmc -> set_attributes of zone named 'row01' : set UpstreamRPM to 0.000000 +gmc -> set_attributes of zone named 'row01' : set UpstreamNoOfBlades to 0.000000 + +gmc -> set_reference Length to 0.13 +gmc -> set_reference Temperature to 298 +gmc -> set_reference Pressure to 1e6 + +gmc -> set_equation_properties for machine : StagnationPointAnomallyFix to <var STAGPOINT_ANNOMALLYFIX var> +gmc -> set_equation_properties for machine : QuasiUnsteadyModel to <var QUASIUNSTEADYMODEL var> +gmc -> set_equation_properties for machine : WavinessModel to <var WAVINESSMODEL var> +gmc -> set_equation_properties for machine : Version2009 to <var VERSION_TWONULLNULLNINE var> +gmc -> set_equation_properties for machine : HeatFluxModel to <var HEATFLUXMODEL var> +gmc -> set_equation_properties for machine : PrandtlTurbulent to <var PRANDTLTURBULENT var> +gmc -> set_equation_properties for machine : RotationalEffects to <var ROTATIONAL_EFF var> +gmc -> set_equation_properties for machine : TransitionModel to <var TRANSITIONMODEL var> +gmc -> set_equation_properties for machine : VGJModel to <var VGJMODEL var> + +gmc -> set_equation_properties for row01 : StagnationPointAnomallyFix to <var STAGPOINT_ANNOMALLYFIX var> +gmc -> set_equation_properties for row01 : QuasiUnsteadyModel to <var QUASIUNSTEADYMODEL var> +gmc -> set_equation_properties for row01 : WavinessModel to <var WAVINESSMODEL var> +gmc -> set_equation_properties for row01 : Version2009 to <var VERSION_TWONULLNULLNINE var> +gmc -> set_equation_properties for row01 : HeatFluxModel to <var HEATFLUXMODEL var> +gmc -> set_equation_properties for row01 : PrandtlTurbulent to <var PRANDTLTURBULENT var> +gmc -> set_equation_properties for row01 : RotationalEffects to <var ROTATIONAL_EFF var> +gmc -> set_equation_properties for row01 : TransitionModel to <var TRANSITIONMODEL var> +gmc -> set_equation_properties for row01 : VGJModel to <var VGJMODEL var> + +gmc -> set_solver_properties for 'machine' : SpatialAccuracy to <var ACCURACY_ORDER var> +gmc -> set_solver_properties for 'row01' : SpatialAccuracy to <var ACCURACY_ORDER var> + +gmc -> set_attributes of panel_group named 'BLADE' : set wall_treatment to low_Reynolds +gmc -> set_attributes of panel_group named 'BLADE' : set translational_velocity to 0.0 0.0 0.0 + +gmc -> set_attributes of panel_group named 'OUTLET' : set massflow to <var OUTLET_MFLOW var> +gmc -> set_attributes of panel_group named 'OUTLET' : set radial_equilibrium to Midspan to <var OUTLET_RADIAL_EQUI var> +gmc -> set_attributes of panel_group named 'OUTLET' : set create_radial_bands to On + +gmc -> set_attributes of panel_group named 'INLET' : set PressureStagnationAbs to <var INLET_TOTAL_PRESSURE var> +gmc -> set_attributes of panel_group named 'INLET' : set VelocityAngleYAbs to <var VEL_YANGLE var> +gmc -> set_attributes of panel_group named 'INLET' : set VelocityAngleZ to 0.000000 +gmc -> set_attributes of panel_group named 'INLET' : set TemperatureStagnationAbs to <var ABS_STAGN_TEMP var> +gmc -> set_attributes of panel_group named 'INLET' : set TurbulenceIntensityAbs to <var TURBULENTINTENSITY var> +gmc -> set_attributes of panel_group named 'INLET' : set TurbulentLengthScale to <var TURBULENTLENGTHSCALE var> +gmc -> set_attributes of panel_group named 'INLET' : set Species all to null +gmc -> set_attributes of panel_group named 'INLET' : set create_radial_bands to On + +gmc -> set_init_properties for machine : DataFile to '' +gmc -> set_init_properties for row01 : InflowTemperature to <var INLET_TEMP var> +gmc -> set_init_properties for row01 : InflowPressure to <var INLET_TOTAL_PRESSURE var> +gmc -> set_init_properties for row01 : InflowVelocityX to <var INLET_VELX var> +gmc -> set_init_properties for row01 : InflowVelocityYAbs to <var INLET_VELY var> +gmc -> set_init_properties for row01 : InflowVelocityZ to <var INLET_VELZ var> + +gmc -> set_init_properties for row01 : OutflowTemperature to <var OUTFLOW_TEMP var> +gmc -> set_init_properties for row01 : OutflowPressure to <var OUTFLOW_PRESSURE var> +gmc -> set_init_properties for row01 : OutflowVelocityX to <var OUTFLOW_VELX var> +gmc -> set_init_properties for row01 : OutflowVelocityYAbs to <var OUTFLOW_VELY var> +gmc -> set_init_properties for row01 : OutflowVelocityZ to <var OUTFLOW_VELZ var> +gmc -> set_init_properties for row01 : XStart to -0.100000 +gmc -> set_init_properties for row01 : XEnd to 0.270000 + + +gmc -> set_trace6_conventions on +gmc -> save 'TRACE.cgns' diff --git a/ntrfc/utils/dictionaries/__init__.py b/ntrfc/utils/dictionaries/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/ntrfc/utils/dictionaries/dictutils.py b/ntrfc/utils/dictionaries/dictutils.py new file mode 100644 index 0000000000000000000000000000000000000000..5224d62381b5a0cd7b8bdab9c9d954de6dc51487 --- /dev/null +++ b/ntrfc/utils/dictionaries/dictutils.py @@ -0,0 +1,30 @@ +from functools import reduce +import operator + + + +def nested_dict_pairs_iterator(dict_obj): + ''' This function accepts a nested dictionary as argument + and iterate over all values of nested dictionaries + ''' + # Iterate over all key-value pairs of dict argument + for key, value in dict_obj.items(): + # Check if value is of dict type + if isinstance(value, dict): + # If value is dict then iterate over all its values + for pair in nested_dict_pairs_iterator(value): + yield (key, *pair) + else: + # If value is not dict type then yield the value + yield (key, value) + +def setInDict(dataDict, mapList, value): + """ + sets value to nested dict + """ + #todo: test-method + getFromDict(dataDict, mapList[:-1])[mapList[-1]] = value + +def getFromDict(dataDict, mapList): + #todo: test-method + return reduce(operator.getitem, mapList, dataDict) diff --git a/tests/test_ntrfc.py b/tests/test_ntrfc.py index b79e2b65bb5c5ac88e524b015cf9502f9c0fedc9..26710e3023ca80cf9873d9108075e447cddbad38 100644 --- a/tests/test_ntrfc.py +++ b/tests/test_ntrfc.py @@ -6,6 +6,8 @@ import pytest import pyvista as pv import numpy as np +from utils.dictionaries.dictutils import nested_dict_pairs_iterator + @pytest.fixture def response(): @@ -129,4 +131,7 @@ def test_refine_spline(): assert fline.number_of_points == fineres - +def test_nested_dict_pairs_iterator(): + testdict = {"0":{"0":0,"1":1},"1":1} + check = [('0', '0', 0), ('0', '1', 1), ('1', 1)] + assert check == list(nested_dict_pairs_iterator(testdict)), "error" diff --git a/tests/test_ntrfc_geometry.py b/tests/test_ntrfc_geometry.py index 3df6dfab428d9e87c6263d4f4ffab4d8623ba383..75715949ff025607e16c75aabd154f61531b752b 100644 --- a/tests/test_ntrfc_geometry.py +++ b/tests/test_ntrfc_geometry.py @@ -40,7 +40,7 @@ def test_calcConcaveHull(): def test_parsec(): - from ntrfc.database.parsec_airfoil_creator import parsec_airfoil_gen + from database.airfoil_generators.parsec_airfoil_creator import parsec_airfoil_gen R_LE = 0.01 x_PRE = 0.450 @@ -58,7 +58,7 @@ def test_parsec(): def test_naca(): - from ntrfc.database.naca_airfoil_creator import naca + from database.airfoil_generators.naca_airfoil_creator import naca def rand_naca_code(): digits = np.random.choice([4,5]) if digits ==4: @@ -79,7 +79,7 @@ def test_extract_vk_hk(verbose=False): :return: """ from ntrfc.utils.geometry.pointcloud_methods import extract_vk_hk - from ntrfc.database.naca_airfoil_creator import naca + from database.airfoil_generators.naca_airfoil_creator import naca res = 400 # d1,d2,d3,d4 = np.random.randint(0,9),np.random.randint(0,9),np.random.randint(0,9),np.random.randint(0,9) @@ -115,7 +115,7 @@ def test_extract_vk_hk(verbose=False): def test_midline_from_sides(): from ntrfc.utils.geometry.pointcloud_methods import midline_from_sides from ntrfc.utils.math.vectorcalc import vecAbs - from ntrfc.database.naca_airfoil_creator import naca + from database.airfoil_generators.naca_airfoil_creator import naca from ntrfc.utils.geometry.pointcloud_methods import extractSidePolys res = 240 @@ -160,7 +160,7 @@ def test_midLength(): def test_extractSidePolys(): from ntrfc.utils.geometry.pointcloud_methods import extractSidePolys - from ntrfc.database.naca_airfoil_creator import naca + from database.airfoil_generators.naca_airfoil_creator import naca d1, d2, d3, d4 = np.random.randint(0, 9), np.random.randint(0, 9), np.random.randint(0, 9), np.random.randint(0, 9) digitstring = str(d1) + str(d2) + str(d3) + str(d4) @@ -179,7 +179,7 @@ def test_extractSidePolys(): def test_extract_geo_paras(): from ntrfc.utils.geometry.pointcloud_methods import extract_geo_paras - from ntrfc.database.naca_airfoil_creator import naca + from database.airfoil_generators.naca_airfoil_creator import naca naca_code = "0009" angle = 20 # deg diff --git a/workflows/01_profile_generation/Snakefile b/workflows/01_profile_generation/Snakefile deleted file mode 100644 index f9b8a54f94a024e1f06cc60a8c515087acbda7b1..0000000000000000000000000000000000000000 --- a/workflows/01_profile_generation/Snakefile +++ /dev/null @@ -1,24 +0,0 @@ -#todo make part of validation -basedir = workflow.current_basedir - -rule profile_from_pointcloud: - input : - "00_resources/{profile_name}.txt" - output: - "01_profile/{profile_name}_sortedPoints.txt", - "01_profile/{profile_name}_psPoly.vtk", - "01_profile/{profile_name}_ssPoly.vtk", - "01_profile/{profile_name}_midsPoly.vtk", - "01_profile/{profile_name}_geometry_paras.yml", - "01_profile/{profile_name}_profile.pdf" - - params: - algorithm=config["blade"]["algorithm"], - pointcloud = config["blade"]["ptcloud_profile"], - unit = config["blade"]["ptcloud_profile_unit"], - alpha = config["blade"]["alpha"] - - run: -# from ntrfc.preprocessing.geometry_creation.profile_pointcloud import generate_profile_pointcloud_geometry - print(wildcards.profile_name) -# generate_profile_pointcloud_geometry(basedir,**params) diff --git a/workflows/animationcase_creation/Snakefile b/workflows/animationcase_creation/Snakefile deleted file mode 100644 index 96e0750db7f85a69c547cfc4beac7d883c519038..0000000000000000000000000000000000000000 --- a/workflows/animationcase_creation/Snakefile +++ /dev/null @@ -1,31 +0,0 @@ -rule openfoam_les: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - script: - "python helloworld.py" - -rule openfoam_ras: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" - -rule openfoam_potential: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" - -rule trace_ras: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" diff --git a/workflows/case_creation/Snakefile b/workflows/case_creation/Snakefile deleted file mode 100644 index 96e0750db7f85a69c547cfc4beac7d883c519038..0000000000000000000000000000000000000000 --- a/workflows/case_creation/Snakefile +++ /dev/null @@ -1,31 +0,0 @@ -rule openfoam_les: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - script: - "python helloworld.py" - -rule openfoam_ras: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" - -rule openfoam_potential: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" - -rule trace_ras: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" diff --git a/workflows/mesh_creation/Snakefile b/workflows/mesh_creation/Snakefile deleted file mode 100644 index b92688a0c1027ea353af56f0a2a7e08e7d8a8620..0000000000000000000000000000000000000000 --- a/workflows/mesh_creation/Snakefile +++ /dev/null @@ -1,8 +0,0 @@ -rule igg_cascade: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - script: - "python helloworld.py" - diff --git a/workflows/postprocessing/Snakefile b/workflows/postprocessing/Snakefile deleted file mode 100644 index 545255db5944cbff2fc25acb1240600cf77a5a78..0000000000000000000000000000000000000000 --- a/workflows/postprocessing/Snakefile +++ /dev/null @@ -1,24 +0,0 @@ -rule blade_loading: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - script: - "python helloworld.py" - -rule operating_point: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" - -rule operating_point: -# input: -# "input/helloworld.txt" -# output: -# "output/heythere.txt" - shell: - "python helloworld.py" -