From 3fa92cd8098855fbd7f5b366f31f56b883ff0dcb Mon Sep 17 00:00:00 2001 From: Juri Date: Fri, 24 Feb 2023 07:35:22 +0100 Subject: [PATCH 1/3] ENH: Improve twin schema --- tests/test_deployment.py | 3 +-- tests/xfoil/cases/naca0012/input_values.json | 4 ++-- tests/xfoil/cases/naca0018/input_values.json | 4 ++-- twine.json | 19 ++++++++++++++----- xfoil_module/routines.py | 4 ++-- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/tests/test_deployment.py b/tests/test_deployment.py index 23132b8..3b67d49 100644 --- a/tests/test_deployment.py +++ b/tests/test_deployment.py @@ -17,9 +17,8 @@ def test_deployment(self): ) input_values = { - "airfoil_geometry": {"airfoil_geometry_filename": "naca_0012.dat"}, + "airfoil_geometry": {"airfoil_geometry_filename": "naca_0012.dat", "repanel": False}, "alpha_range": [0, 6, 3], - "repanel": False, "inflow_speed": 100, "kinematic_viscosity": 15e-6, "characteristic_length": 1, diff --git a/tests/xfoil/cases/naca0012/input_values.json b/tests/xfoil/cases/naca0012/input_values.json index 7b39bb9..9cf454d 100644 --- a/tests/xfoil/cases/naca0012/input_values.json +++ b/tests/xfoil/cases/naca0012/input_values.json @@ -1,8 +1,8 @@ { "airfoil_geometry":{ - "airfoil_geometry_filename": "naca_0012.dat" + "airfoil_geometry_filename": "naca_0012.dat", + "repanel": false }, - "repanel": false, "alpha_range": [0, 6, 3], "inflow_speed": 100, "kinematic_viscosity": 15e-5, diff --git a/tests/xfoil/cases/naca0018/input_values.json b/tests/xfoil/cases/naca0018/input_values.json index 4f55b3a..f575564 100644 --- a/tests/xfoil/cases/naca0018/input_values.json +++ b/tests/xfoil/cases/naca0018/input_values.json @@ -21,9 +21,9 @@ -0.0848389 , -0.07941038, -0.07257604, -0.06472053, -0.05621423, -0.04740459, -0.03861703, -0.03016091, -0.02233527, -0.01542949, -0.00971646, -0.00543833, -0.0027879 , -0.00189 ] - } + }, + "repanel": false }, - "repanel": false, "alpha_range": [0, 6, 3], "inflow_speed": 100, "kinematic_viscosity": 15e-5, diff --git a/twine.json b/twine.json index 815c071..abf9db9 100644 --- a/twine.json +++ b/twine.json @@ -88,14 +88,23 @@ "title": "Airfoil geometry filename", "description": "Filename from the Dataset containing geometry files ex. naca_0012.dat", "type": "string" + }, + "repanel": { + "title": "Repanel Airfoil", + "type": "boolean", + "default": false + }, + "repanel_configuration": { + "type": "object", + "properties": { + "nodes": { + "description": "Number of nodes used to re-panel the airfoil", + "type": "integer" + } + } } } }, - "repanel": { - "title": "Repanel Airfoil", - "type": "boolean", - "default": false - }, "alpha_range": { "description": "The range of alpha values at which the solver will be run.", "type": "array", diff --git a/xfoil_module/routines.py b/xfoil_module/routines.py index 721f8a3..ed617aa 100644 --- a/xfoil_module/routines.py +++ b/xfoil_module/routines.py @@ -15,8 +15,8 @@ def call(analysis): # TODO [?] Should airfoil section and repanel settings be in config rather then input? # It is possible to re-panel - if analysis.input_values['repanel']: - xf.repanel(n_nodes=analysis.input_values['repanel_configuration']['nodes']) + if analysis.input_values["airfoil_geometry"]['repanel']: + xf.repanel(n_nodes=analysis.input_values["airfoil_geometry"]['repanel_configuration']['nodes']) # Reynolds number, xf.Re = set_input(analysis.input_values)[0] From 9b7074a591d457e588436d7ec7d1a4384cc6f944 Mon Sep 17 00:00:00 2001 From: Juri Date: Fri, 24 Feb 2023 07:38:18 +0100 Subject: [PATCH 2/3] OPS: Update Version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 46e1d05..32b9226 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "panel-codes-service" -version = "0.1.1" +version = "0.2.0" description = "" authors = ["time-trader"] license = "MIT" From 5a7db2d1ded826bf3f49e2962cb667c575f50f2f Mon Sep 17 00:00:00 2001 From: Juri Date: Fri, 24 Feb 2023 07:45:40 +0100 Subject: [PATCH 3/3] FEA: Change input schema --- twine.json | 1 + 1 file changed, 1 insertion(+) diff --git a/twine.json b/twine.json index abf9db9..4902e84 100644 --- a/twine.json +++ b/twine.json @@ -91,6 +91,7 @@ }, "repanel": { "title": "Repanel Airfoil", + "description":"Use XFOIL routines to re-panel the geometry?", "type": "boolean", "default": false },