Skip to content

Commit 58697ec

Browse files
committed
Some progress
1 parent 725121f commit 58697ec

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

data/vsm_settings.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Model:
2+
VSM: Vortex Step Method
3+
LLT: Lifting Line Theory
14
wings:
25
- name: main_wing
36
n_panels: 40
@@ -8,5 +11,5 @@ wings:
811
- name: tail
912
n_panels: 20
1013
solver_settings:
11-
aerodynamic_model_type: "VSM"
14+
aerodynamic_model_type: VSM
1215
max_iterations: 1000

src/settings.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
filename = "vsm_settings.yaml"
2+
data = YAML.load_file(joinpath("data", filename))
23

34
@with_kw mutable struct WingSettings
45
name::String = "main_wing"
@@ -10,7 +11,7 @@ filename = "vsm_settings.yaml"
1011
end
1112

1213
@with_kw mutable struct SolverSettings
13-
aerodynamic_model_type::String = "VSM"
14+
aerodynamic_model_type::Model = VSM
1415
max_iterations::Int64 = 1000
1516
end
1617

@@ -21,9 +22,11 @@ end
2122

2223
const VSM_SETTINGS = VSMSettings()
2324

24-
function vs()
25+
function vs(filename=filename)
2526
res = VSM_SETTINGS
27+
data = YAML.load_file(joinpath("data", filename))
2628
res.solver_settings.max_iterations = data["solver_settings"]["max_iterations"]
29+
res.solver_settings.aerodynamic_model_type = eval(Symbol(data["solver_settings"]["aerodynamic_model_type"]))
2730
res
2831
end
2932

0 commit comments

Comments
 (0)