Skip to content

Commit b08dd6e

Browse files
committed
added yaml_geometry: enabling one to run VSM defined from a yaml file.
1 parent 1ba7681 commit b08dd6e

File tree

10 files changed

+418
-142
lines changed

10 files changed

+418
-142
lines changed
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ wing_airfoils:
4141
# csv_file_path: Path to polar CSV file (columns: alpha [rad], cl, cd, cm)
4242
# - masure_regression:
4343
# t, eta, kappa, delta, lamba, phi: Regression parameters
44+
# - inviscid:
45+
# no further data is required
4446
# ---------------------------------------------------------------
4547
alpha_range: [-10, 31, 0.5] # [deg], in this range the polars are calculated
4648
reynolds: !!float 1e6 # Reynolds number
4749
headers: [airfoil_id, type, info_dict]
4850
data:
49-
- [1, breukels_regression, {t: 0.3225132246121334, kappa: 0.0405837}]
50-
- [2, breukels_regression, {t: 0.1837401335882308, kappa: 0.043495}]
51+
- [1, polars, {csv_file_path: "polars/1.csv"}]
52+
- [2, polars, {csv_file_path: "polars/2.csv"}]

data/pyramid_model/polars/1.csv

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,71 @@
1-
alpha,cl,cd,cm
2-
-10.0,0.1,0.01,0.0
3-
-5.0,0.5,0.012,0.02
4-
0.0,0.8,0.015,0.04
5-
5.0,1.1,0.018,0.06
1+
alpha,Cd,Cs,Cl,Cm
2+
-10.0,0.0249065318608897,-3.434761974054366e-21,-1.0732064541182402,0.0054067639622245
3+
-9.5,0.0236873271741019,-3.285535810591269e-21,-1.0370727681402363,0.0058564293781756
4+
-9.0,0.0225262393305432,-3.1355323293482928e-21,-0.9992907398617008,0.0062213900212979
5+
-8.5,0.0214269325718191,-2.984782761608788e-21,-0.9599576821061372,0.0065104482864488
6+
-8.0,0.0203930711395351,-2.833318338656105e-21,-0.9191709076970505,0.006732406568486
7+
-7.5,0.0194283192752969,-2.6811702917735944e-21,-0.8770277294579452,0.0068960672622671
8+
-7.0,0.01853634122071,-2.528369852244608e-21,-0.8336254602123256,0.0070102327626497
9+
-6.5,0.0177208012173799,-2.3749482513524935e-21,-0.7890614127836962,0.0070837054644914
10+
-6.0,0.0169853635069124,-2.2209367203806045e-21,-0.7434328999955613,0.0071252877626499
11+
-5.5,0.0163336923309129,-2.06636649061229e-21,-0.6968372346714253,0.0071437820519827
12+
-5.0,0.0157694519309871,-1.9112687933309017e-21,-0.6493717296347931,0.0071479907273476
13+
-4.5,0.0152645128216272,-1.753587209885578e-21,-0.5997295153722275,0.0070196560505497
14+
-4.0,0.01479533503566,-1.5927577702719893e-21,-0.5471734663994646,0.0066920925435352
15+
-3.5,0.0143724670921928,-1.4310503787432801e-21,-0.4926555115837663,0.0062514609913727
16+
-3.0,0.0140064575103327,-1.2707349395525959e-21,-0.4371275797923952,0.0057839221791311
17+
-2.5,0.0137078548091868,-1.1140813569530825e-21,-0.3815415998926136,0.005375636891879
18+
-2.0,0.0134872075078624,-9.63359535197884e-22,-0.326849500751684,0.0051127659146851
19+
-1.5,0.0133110016081565,-8.173276016701202e-22,-0.2729636358104737,0.0049791802562241
20+
-1.0,0.013154948085695,-6.747509165125449e-22,-0.219054658831915,0.0048810850331918
21+
-0.5,0.0130434329203279,-5.379102331177564e-22,-0.1649619491663683,0.004788142192688
22+
0.0,0.0130008420919056,-4.090863048783536e-22,-0.1105248861641936,0.0046700136818125
23+
0.5,0.0130084720389809,-2.8680744793175213e-22,-0.0553123307395135,0.0044698279268781
24+
1.0,0.0130294722244102,-1.6963327644127745e-22,0.0004648326011776,0.0042125035054924
25+
1.5,0.013061008164498,-5.989149083839288e-23,0.0560041891189628,0.0039903875916971
26+
2.0,0.0131002453755492,4.009020844543824e-23,0.1105033240749248,0.0038958273595339
27+
2.5,0.0131856144242583,1.3202243421906704e-22,0.1645080620709747,0.0039708828537188
28+
3.0,0.0133528446868354,2.1941233713727904e-22,0.2188020358375745,0.0041687564292972
29+
3.5,0.0135950498938577,3.026270235375132e-22,0.2729395428286329,0.0044485087258047
30+
4.0,0.0139053437759025,3.820335997572082e-22,0.3264748804980587,0.0047692003827766
31+
4.5,0.0142768400635472,4.579991721338029e-22,0.3789623462997606,0.0050898920397485
32+
5.0,0.014702652487369,5.308908470047359e-22,0.4299562376876474,0.005369644336256
33+
5.5,0.0151758947779452,6.010757307074465e-22,0.4790108521156277,0.0055675179118344
34+
6.0,0.0156896806658533,6.6892092957937285e-22,0.5256804870376105,0.0056425734060194
35+
6.5,0.0163419408046433,7.3156512099210305e-22,0.5727462893873533,0.0056195012255208
36+
7.0,0.0172347131714976,7.87652640520907e-22,0.621930082521374,0.0055494832763917
37+
7.5,0.0183672724824413,8.3980908180874655e-22,0.6711971785277222,0.0054313174471822
38+
8.0,0.0197388934534996,8.906600384985838e-22,0.7185128894944469,0.0052638016264423
39+
8.5,0.0213488508006975,9.428311042333809e-22,0.7618425275095976,0.005045733702722
40+
9.0,0.0231964192400604,9.989478726560997e-22,0.7991514046612234,0.0047759115645714
41+
9.5,0.0252808734876132,1.0616359374097021e-21,0.8284048330373738,0.0044531331005404
42+
10.0,0.0276014882593813,1.133520892137151e-21,0.8475681247260978,0.0040761961991793
43+
10.5,0.0309750509211813,1.2264041564916665e-21,0.8593005363065593,0.0027629989121379
44+
11.0,0.0358184780617999,1.338964707337134e-21,0.8683373609449135,6.549186061715782e-05
45+
11.5,0.0415312382317165,1.4541444741325102e-21,0.8757579656096959,-0.0033664482125074
46+
12.0,0.0475127999814107,1.5548853863367533e-21,0.8826417172694425,-0.00688294456436
47+
12.5,0.0535718016380152,1.6355125000226549e-21,0.8901844683279677,-0.0103977924929974
48+
13.0,0.0601841135567709,1.707161865298813e-21,0.8977108722659604,-0.0143417322759933
49+
13.5,0.0677500523303184,1.7779919026778908e-21,0.9034934976672676,-0.0188403046397463
50+
14.0,0.0766699345512988,1.856161032672556e-21,0.9058049131157374,-0.0240190503106557
51+
14.5,0.0886600983806959,1.954578481220623e-21,0.8829547896813587,-0.0308720072112254
52+
15.0,0.1037898454535693,2.066176426506049e-21,0.8310805080016944,-0.0393733326507776
53+
15.5,0.1199889375736733,2.1691477174107125e-21,0.7751962010119524,-0.0481187464359375
54+
16.0,0.135187136544762,2.2416852028164918e-21,0.7403160016473408,-0.0557039683733306
55+
16.5,0.1490568222149959,2.2904946311980992e-21,0.7250755717384425,-0.0620365090305877
56+
17.0,0.1626441988491108,2.333059752262545e-21,0.7123987575512702,-0.0679085904012768
57+
17.5,0.1759397648757243,2.3637404167401576e-21,0.7037319686741754,-0.0732429994309288
58+
18.0,0.1889340187234538,2.376896475361265e-21,0.7005216146955101,-0.0779625230650747
59+
18.5,0.2016174588209165,2.366887778856196e-21,0.7042141052036259,-0.0819899482492452
60+
19.0,0.21398058359673,2.3280741779552778e-21,0.7162558497868752,-0.0852480619289713
61+
19.5,0.2260138914795117,2.2548155233888405e-21,0.738093258033609,-0.087659651049784
62+
20.0,0.237707880897879,2.1414716658872106e-21,0.7711727395321798,-0.0891475025572141
63+
20.5,0.2490530502804493,1.982402456180717e-21,0.816940703870939,-0.0896344033967926
64+
21.0,0.2600398980558399,1.7719677449996867e-21,0.8768435606382389,-0.0890431405140503
65+
21.5,0.2706589226526683,1.504527383074451e-21,0.9523277194224308,-0.0872965008545183
66+
22.0,0.280900622499552,1.174441221135335e-21,1.0448395898118663,-0.0843172713637273
67+
22.5,0.2907554960251083,7.760691099126683e-22,1.1558255813948983,-0.0800282389872084
68+
23.0,0.3002140416579548,3.0377090013677857e-22,1.2867321037598782,-0.0743521906704924
69+
23.5,0.3092667578267086,-2.480935574620052e-22,1.439005566495157,-0.0672119133591102
70+
24.0,0.3179041429599872,-8.851644121533548e-22,1.6140923791890878,-0.0585301939985927
71+
24.5,0.3261166954864083,-1.6130818132069429e-21,1.813438951430021,-0.048229819534471

data/pyramid_model/polars/2.csv

Lines changed: 71 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,71 @@
1-
alpha,cl,cd,cm
2-
-10.0,0.1,0.01,0.0
3-
-5.0,0.5,0.012,0.02
4-
0.0,0.8,0.015,0.04
5-
5.0,1.1,0.018,0.06
1+
alpha,Cd,Cs,Cl,Cm
2+
-10.0,0.1028496958630713,-4.970266483175547e-24,-0.4060358502753723,0.0550990480582689
3+
-9.5,0.0971839746448208,-9.302148562803722e-24,-0.4438529313194241,0.0537303438488007
4+
-9.0,0.0916177006701586,-2.1982895735540862e-23,-0.4741345054395691,0.0511424232336705
5+
-8.5,0.0861488323939917,-4.2540159402165874e-23,-0.4977178511829077,0.047464579144667
6+
-8.0,0.0807753282712272,-7.050159096345767e-23,-0.5154402470965408,0.0428261045135789
7+
-7.5,0.0754951467567722,-1.0539484182019521e-22,-0.5281389717275694,0.0373562922721951
8+
-7.0,0.070306246305534,-1.4674756337315738e-22,-0.536651303623094,0.0311844353523042
9+
-6.5,0.0652065853724195,-1.9408740702312298e-22,-0.5418145213302155,0.0244398266856952
10+
-6.0,0.0601941224123359,-2.4694202417087115e-22,-0.5444659033960346,0.0172517592041566
11+
-5.5,0.0552668158801903,-3.048390662171807e-22,-0.5454427283676522,0.0097495258394774
12+
-5.0,0.0504226242308899,-3.6730618456283053e-22,-0.5455822747921689,0.0020624195234464
13+
-4.5,0.0454586930290803,-4.8527727098003185e-22,-0.5164772120836574,-0.0086109691796144
14+
-4.0,0.0403444322748116,-6.841919162753791e-22,-0.4407589545148366,-0.0234630209344745
15+
-3.5,0.0353361970760969,-9.25336320401227e-22,-0.3358228979207768,-0.0399508996529828
16+
-3.0,0.0306903425409498,-1.1699966833099293e-21,-0.2190644381365483,-0.0555317692469881
17+
-2.5,0.0266632237773835,-1.379459204953841e-21,-0.1078789709972217,-0.0676627936283392
18+
-2.0,0.0235111958934114,-1.5150100852853154e-21,-0.0196618923378672,-0.0738011367088848
19+
-1.5,0.0209681290308454,-1.593094370401261e-21,0.0469798152131813,-0.0758613643823688
20+
-1.0,0.0187153462483676,-1.6568047141524793e-21,0.1073778817595349,-0.0774463151945054
21+
-0.5,0.0169303820292961,-1.707398728122166e-21,0.1650449805640406,-0.0785455620350991
22+
0.0,0.0157907708569491,-1.7461340238935162e-21,0.2234937848895452,-0.079148677793954
23+
0.5,0.0150698972023441,-1.7793957856478226e-21,0.2837610810937657,-0.0794729390812699
24+
1.0,0.0144690585964555,-1.8093789788140737e-21,0.3439466460348425,-0.079729267044402
25+
1.5,0.0140576591125365,-1.831055886847014e-21,0.4031576387262576,-0.0798977013788872
26+
2.0,0.0139051028238406,-1.8393987932013843e-21,0.4605012181814928,-0.079958281780263
27+
2.5,0.0139674904323853,-1.831535360602796e-21,0.516687351824163,-0.0796996874903342
28+
3.0,0.0141466259946626,-1.8099484238780976e-21,0.57273004334973,-0.0790013079673623
29+
3.5,0.0144304686156374,-1.777643024633895e-21,0.6281925061794459,-0.0779792482315685
30+
4.0,0.0148069774002744,-1.7376242044767923e-21,0.6826379537345634,-0.0767496133031744
31+
4.5,0.0152641114535385,-1.6928970050133933e-21,0.7356295994363342,-0.0754285082024013
32+
5.0,0.0157898298803945,-1.646466467850302e-21,0.7867306567060111,-0.0741320379494707
33+
5.5,0.0163720917858072,-1.601337634594123e-21,0.8355043389648463,-0.0729763075646039
34+
6.0,0.0169988562747415,-1.5605155468514597e-21,0.8815138596340918,-0.0720774220680224
35+
6.5,0.0177994356563183,-1.5175949498829897e-21,0.9288116136606078,-0.0713170815492992
36+
7.0,0.0189149173688029,-1.4669336832133196e-21,0.979706268880088,-0.0705266061060592
37+
7.5,0.020350923210876,-1.412681429844948e-21,1.031145448047036,-0.0697465307706008
38+
8.0,0.0221130749812183,-1.358987872780374e-21,1.0800767739159551,-0.0690173905752227
39+
8.5,0.0242069944785106,-1.3100026950220965e-21,1.1234478692413494,-0.0683797205522237
40+
9.0,0.0266383035014336,-1.2698755795726137e-21,1.158206356777722,-0.0678740557339022
41+
9.5,0.029412623848668,-1.2427562094344249e-21,1.181299859279576,-0.067540931152557
42+
10.0,0.0325355773188947,-1.232794267610029e-21,1.1896759995014154,-0.0674208818404867
43+
10.5,0.0372054744229639,-1.2470041563884788e-21,1.189133433306183,-0.0692679925714252
44+
11.0,0.0441832190788797,-1.2828706185025538e-21,1.1875712414485422,-0.0739531725836439
45+
11.5,0.0528183231960532,-1.3302488476203426e-21,1.1850876840205773,-0.0801921936062471
46+
12.0,0.0624602986838954,-1.3789940374099341e-21,1.1817810211143729,-0.0867008273683394
47+
12.5,0.0742566292803452,-1.433366612863428e-21,1.1679087624369973,-0.0941403849694034
48+
13.0,0.088907203547694,-1.4986779338953496e-21,1.1392200860184896,-0.1032402342413439
49+
13.5,0.1050901406318811,-1.5663595965574256e-21,1.104050754435393,-0.1128182320118979
50+
14.0,0.1214835596788457,-1.6278431969013822e-21,1.0707365302642493,-0.1216922351088023
51+
14.5,0.1393968397552119,-1.6778081057743264e-21,1.0407056899781189,-0.1293305571068038
52+
15.0,0.1590650543975536,-1.722268328504924e-21,1.0096896000655085,-0.1364631706963764
53+
15.5,0.1775548644567351,-1.7696574128672416e-21,0.9774786581261288,-0.1438004213788477
54+
16.0,0.1919329307836206,-1.8284089066353454e-21,0.9438632617596906,-0.1520526546555453
55+
16.5,0.203232606090166,-1.900079491549716e-21,0.9092321872293124,-0.1611787571831155
56+
17.0,0.2143889288649201,-1.980597122465185e-21,0.8740961053107327,-0.1706707679195053
57+
17.5,0.2253210886236354,-2.0699522568273426e-21,0.8384282553725938,-0.180538760817993
58+
18.0,0.2359482748820647,-2.168135352081781e-21,0.8022018767835378,-0.190792809831857
59+
18.5,0.2461896771559607,-2.275136865674092e-21,0.7653902089122069,-0.2014429889143758
60+
19.0,0.2559644849610761,-2.3909472550498657e-21,0.7279664911272431,-0.2124993720188276
61+
19.5,0.2651918878131636,-2.5155569776546938e-21,0.6899039627972886,-0.2239720330984911
62+
20.0,0.273791075227976,-2.6489564909341693e-21,0.6511758632909855,-0.2358710461066446
63+
20.5,0.281681236721266,-2.7911362523338815e-21,0.6117554319769761,-0.2482064849965665
64+
21.0,0.2887815618087863,-2.942086719299423e-21,0.5716159082239023,-0.2609884237215353
65+
21.5,0.2950112400062896,-3.101798349276385e-21,0.5307305314004064,-0.2742269362348293
66+
22.0,0.3002894608295286,-3.2702615997103588e-21,0.4890725408751303,-0.287932096489727
67+
22.5,0.304535413794256,-3.447466928046934e-21,0.4466151760167164,-0.3021139784395067
68+
23.0,0.3076682884162247,-3.633404791731706e-21,0.4033316761938067,-0.316782656037447
69+
23.5,0.3096072742111871,-3.828065648210263e-21,0.3591952807750433,-0.3319482032368263
70+
24.0,0.3102715606948962,-4.031439954928197e-21,0.3141792291290685,-0.3476206939909228
71+
24.5,0.3095803373831047,-4.2435181693311005e-21,0.2682567606245242,-0.3638102022530151
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
Model:
2+
VSM: Vortex Step Method
3+
LLT: Lifting Line Theory
4+
PanelDistribution:
5+
LINEAR: Linear distribution
6+
COSINE: Cosine distribution
7+
COSINE_VAN_GARREL: van Garrel cosine distribution
8+
SPLIT_PROVIDED: Split provided sections
9+
UNCHANGED: Keep original sections
10+
InitialGammaDistribution:
11+
ELLIPTIC: Elliptic distribution
12+
ZEROS: Constant distribution
13+
14+
wings:
15+
- name: main_wing
16+
n_panels: 40
17+
n_groups: 40
18+
spanwise_panel_distribution: LINEAR
19+
spanwise_direction: [0.0, 1.0, 0.0]
20+
remove_nan: true
21+
solver_settings:
22+
n_panels: 40
23+
n_groups: 40
24+
aerodynamic_model_type: VSM
25+
density: 1.225 # air density [kg/m³]
26+
max_iterations: 1500
27+
rtol: 1e-5 # relative error [-]
28+
tol_reference_error: 0.001
29+
relaxation_factor: 0.03 # relaxation factor for convergence
30+
artificial_damping: false # whether to apply artificial damping
31+
k2: 0.1 # artificial damping parameter
32+
k4: 0.0 # artificial damping parameter
33+
type_initial_gamma_distribution: ELLIPTIC
34+
core_radius_fraction: 1e-20
35+
mu: 1.81e-5 # dynamic viscosity [N·s/m²]
36+
calc_only_f_and_gamma: false # whether to only output f and gamma

examples/pyramid_model.jl

Lines changed: 6 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -1,136 +1,16 @@
11
using LinearAlgebra
22
using VortexStepMethod
33
using ControlPlots
4-
using YAML
5-
using CSV
6-
using DataFrames
74

8-
9-
function read_yaml(yaml_file_path)
10-
# Read the YAML file to get the sections
11-
yaml_data = YAML.load_file(yaml_file_path)
12-
13-
# Extract headers and data
14-
headers = yaml_data["wing_sections"]["headers"]
15-
data_rows = yaml_data["wing_sections"]["data"]
16-
17-
# Convert YAML data to the expected format
18-
sections = []
19-
for row in data_rows
20-
# Create a dictionary mapping headers to values
21-
section_dict = Dict(zip(headers, row))
22-
23-
# Keep airfoil_id as integer for CSV filename lookup
24-
airfoil_id = section_dict["airfoil_id"]
25-
26-
# Extract coordinates
27-
le_coord = [section_dict["LE_x"], section_dict["LE_y"], section_dict["LE_z"]]
28-
te_coord = [section_dict["TE_x"], section_dict["TE_y"], section_dict["TE_z"]]
29-
30-
section = (
31-
airfoil_id = airfoil_id,
32-
le_coord = le_coord,
33-
te_coord = te_coord
34-
)
35-
push!(sections, section)
36-
end
37-
38-
return sections
39-
end
40-
41-
function load_polar_data(airfoil_id, polars_dir)
42-
"""
43-
Load polar data from CSV file for given airfoil_id.
44-
Expected CSV format: columns named alpha, cl, cd, cm
45-
"""
46-
csv_filename = "$(airfoil_id).csv"
47-
csv_filepath = joinpath(polars_dir, csv_filename)
48-
49-
if !isfile(csv_filepath)
50-
@warn "Polar file not found: $csv_filepath. Using INVISCID model instead."
51-
return nothing, INVISCID
52-
end
53-
54-
try
55-
df = CSV.read(csv_filepath, DataFrame)
56-
57-
# Verify required columns exist
58-
required_cols = ["alpha", "cl", "cd", "cm"]
59-
missing_cols = setdiff(required_cols, names(df))
60-
if !isempty(missing_cols)
61-
@warn "Missing columns $missing_cols in $csv_filepath. Using INVISCID model instead."
62-
return nothing, INVISCID
63-
end
64-
65-
# Create aero_data tuple
66-
aero_data = (df.alpha, df.cl, df.cd, df.cm)
67-
return aero_data, POLAR_VECTORS
68-
69-
catch e
70-
@warn "Error reading polar file $csv_filepath: $e. Using INVISCID model instead."
71-
return nothing, INVISCID
72-
end
73-
end
74-
75-
76-
function instantiate_from_yaml(yaml_file_path, polars_dir; n_panels=20, spanwise_distribution=LINEAR)
77-
"""
78-
Create a wing geometry from YAML file with polar data loaded from CSV files.
79-
80-
# Arguments
81-
- `yaml_file_path`: Path to YAML file containing wing section definitions
82-
- `polars_dir`: Path to directory containing polar CSV files (named <airfoil_id>.csv)
83-
- `n_panels`: Number of panels for the wing (default: 20)
84-
- `spanwise_distribution`: Panel distribution type (default: LINEAR)
85-
86-
# Returns
87-
- `BodyAerodynamics`: Initialized aerodynamics object containing the wing
88-
89-
# Example
90-
```julia
91-
yaml_path = "pyramid.yaml"
92-
polars_dir = "/path/to/polars"
93-
body_aero = instantiate_from_yaml(yaml_path, polars_dir; n_panels=30)
94-
```
95-
"""
96-
# Create wing with specified panel distribution
97-
wing = Wing(n_panels, spanwise_distribution=spanwise_distribution)
98-
99-
# Read sections from YAML file
100-
sections = read_yaml(yaml_file_path)
101-
102-
# Add each section to the wing
103-
for section in sections
104-
# Load polar data for this airfoil
105-
aero_data, aero_model = load_polar_data(section.airfoil_id, polars_dir)
106-
107-
println("Section airfoil_id $(section.airfoil_id): Using $(aero_model) model")
108-
109-
add_section!(wing,
110-
section.le_coord, # Leading edge coordinate
111-
section.te_coord, # Trailing edge coordinate
112-
aero_model, # Aerodynamic model (POLAR_VECTORS or INVISCID)
113-
aero_data) # Aerodynamic data tuple or nothing
114-
end
115-
116-
# Initialize and return aerodynamics object
117-
body_aero = BodyAerodynamics([wing])
118-
return body_aero
119-
end
120-
121-
# getting the project_dir
5+
# settings
1226
project_dir = dirname(dirname(pathof(VortexStepMethod))) # Go up one level from src to project root
123-
yaml_file_path = joinpath(project_dir, "data", "pyramid_model", "pyramid.yaml")
124-
polars_dir = joinpath(project_dir, "data", "pyramid_model", "polars")
125-
126-
sections = read_yaml(yaml_file_path)
127-
println("Read sections from YAML file: $(length(sections)) sections")
128-
println("Sections: $(sections)")
7+
yaml_geometry_path = joinpath(project_dir, "data", "pyramid_model", "geometry.yaml")
1298

130-
body_aero = instantiate_from_yaml(yaml_file_path, polars_dir; n_panels=20)
131-
println("Created wing geometry with $(length(body_aero.panels)) panels")
9+
# Create wing geometry from YAML (following RamAirWing pattern)
10+
wing = YamlWing(yaml_geometry_path; n_panels=20, spanwise_distribution=LINEAR)
11+
body_aero = BodyAerodynamics([wing])
13212

133-
# Plotting Geometrys
13+
# Plotting Geometry
13414
PLOT = true
13515
USE_TEX = false
13616
PLOT && plot_geometry(

src/VortexStepMethod.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ using Xfoil
2626

2727
# Export public interface
2828
export VSMSettings, WingSettings, SolverSettings, vs
29-
export Wing, Section, RamAirWing, reinit!
29+
export Wing, Section, RamAirWing, YamlWing, reinit!
3030
export BodyAerodynamics
3131
export Solver, solve, solve_base!, solve!, VSMSolution, linearize
3232
export calculate_results
@@ -270,6 +270,7 @@ include("settings.jl")
270270
include("wing_geometry.jl")
271271
include("polars.jl")
272272
include("ram_geometry.jl")
273+
include("yaml_geometry.jl")
273274
include("filament.jl")
274275
include("panel.jl")
275276
include("body_aerodynamics.jl")

0 commit comments

Comments
 (0)