-
Notifications
You must be signed in to change notification settings - Fork 6
/
farm.yaml
725 lines (642 loc) · 21.6 KB
/
farm.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
tabs:
- Farm
frames:
# ==== Simulation frames ====
- name: frame_farmsetup
tab: Farm
title: Wind farm setup
- name: frame_farmsetup1
frame: frame_farmsetup
title: Options
row: 2
kwargs:
borderwidth: 0
toggled: True
- name: frame_farmsetup1a
frame: frame_farmsetup1
title: User comments
kwargs:
borderwidth: 0
- name: frame_farmsetup2
frame: frame_farmsetup
title: Actions
row: 3
kwargs:
borderwidth: 0
- name: frame_farmturbines
tab: Farm
title: Wind farm turbine layout
toggled: True
- name: frame_farmturbines1
frame: frame_farmturbines
title: CSV Contents
row: 1
kwargs:
borderwidth: 0
- name: frame_farmturbines2
frame: frame_farmturbines
title: Layout options
row: 2
kwargs:
borderwidth: 0
- name: frame_farmturbines3
frame: frame_farmturbines
title: Actions
row: 3
kwargs:
borderwidth: 0
- name: frame_farmrefinement
tab: Farm
title: Farm refinement zones
toggled: True
- name: frame_farmrefinement1
frame: frame_farmrefinement
title: CSV Contents
row: 1
kwargs:
borderwidth: 0
- name: frame_farmrefinement2
frame: frame_farmrefinement
title: Refinement options
row: 2
kwargs:
borderwidth: 0
- name: frame_farmrefinement3
frame: frame_farmrefinement
title: Actions
row: 3
kwargs:
borderwidth: 0
- name: frame_farmsampling
tab: Farm
title: Farm sampling
toggled: True
- name: frame_farmsampling1
frame: frame_farmsampling
title: CSV Contents
row: 1
kwargs:
borderwidth: 0
- name: frame_farmsampling2
frame: frame_farmsampling
title: Sampling options
row: 2
kwargs:
borderwidth: 0
- name: frame_farmsampling3
frame: frame_farmsampling
title: Actions
row: 3
kwargs:
borderwidth: 0
- name: frame_runsweep
tab: Farm
title: Run parameter sweep
toggled: True
- name: frame_runsweep1
frame: frame_runsweep
title: ABL parameters
row: 1
kwargs:
borderwidth: 0
- name: frame_runsweep2
frame: frame_runsweep
title: Case setup
row: 2
kwargs:
borderwidth: 0
inputwidgets:
- name: farm_setupfile
frame: frame_farmsetup
label: Farm setup file
inputtype: str #filename
row: 1
defaultval: ''
entryopt:
width: 25
fileopenopt:
selecttype: saveas
kwargs:
filetypes:
- ["YAML files", "*.yaml"]
- ["all files", "*.*"]
outputdef:
help: YAML file with all farm inputs
- name: farm_embedamrwindinput
frame: frame_farmsetup1
label: Embed AMR-Wind input
inputtype: bool
defaultval: True
outputdef:
help: Embed AMR-Wind input file in yaml file
- name: farm_loadembedamrwindinput
frame: frame_farmsetup1
label: Load embeded AMR-Wind input
inputtype: bool
defaultval: True
outputdef:
help: Load embeded AMR-Wind input file
- name: farm_embedturbinetype
frame: frame_farmsetup1
label: Embed turbine type
inputtype: bool
defaultval: True
outputdef:
help: Embed turbine type
- name: farm_usercomments
frame: frame_farmsetup1a
inputtype: textbox
defaultval: |
Add any optional commments here.
entryopt:
width: 50
height: 5
outputdef:
help: "\nUser comments"
farmsetup: farm_usercomments
# -------- Turbine layout inputs -------------------
- name: turbines_csvtextbox
frame: frame_farmturbines1
inputtype: textbox
defaultval: |
# CSV file should have columns with
# name, x, y, type, yaw, hubheight, options
entryopt:
width: 55
height: 10
outputdef:
help: "\nTurbine layout"
farmsetup: turbines_csvtextbox
- name: turbines_csvfile
frame: frame_farmturbines
label: CSV file
inputtype: filename
row: 0
defaultval: ''
entryopt:
width: 25
fileopenopt:
kwargs:
filetypes:
- ["CSV files", "*.csv"]
- ["all files", "*.*"]
outputdef:
help: CSV input file
farmsetup: turbines_csvfile
- name: turbines_deleteprev
frame: frame_farmturbines2
label: Delete existing turbines
inputtype: bool
defaultval: True
outputdef:
help: Remove all existing turbines before adding these
farmsetup: turbines_deleteprev
- name: turbines_coordsys
frame: frame_farmturbines2
label: Turbine coordinate sys
inputtype: str
optionlist: ['xy', 'utm', 'latlong']
defaultval: 'xy'
outputdef:
farmsetup: turbines_coordsys
- name: turbines_autocalccenter
frame: frame_farmturbines2
label: Auto calculate farm center
inputtype: bool
defaultval: True
ctrlelem:
- input: turbines_farmcenter
activewhen: ['', 0]
outputdef:
help: |
Automatically set farm center to be average of all turbine locations
farmsetup: turbines_autocalccenter
- name: turbines_farmcenter
frame: frame_farmturbines2
label: Farm center coords (X,Y)
inputtype: [float, float]
#defaultval: True
outputdef:
farmsetup: turbines_farmcenter
- name: turbines_domainsize
frame: frame_farmturbines2
label: Farm domain size (X,Y,Z)
inputtype: [float, float, float]
outputdef:
help: Size of the computational domain in meters
farmsetup: turbines_domainsize
- name: turbines_createnewdomain
frame: frame_farmturbines2
label: Create new domain
inputtype: bool
defaultval: True
outputdef:
help: Delete previous domain and level 0 mesh, and create new one
farmsetup: turbines_createnewdomain
- name: turbines_freespace
frame: frame_farmturbines2
label: Free space
inputtype: bool
defaultval: False
outputdef:
help: Make the domain free space (no bround)
farmsetup: turbines_freespace
- name: turbines_backgroundmeshsize
frame: frame_farmturbines2
label: Background mesh size [m]
inputtype: float
outputdef:
help: Size of the background mesh in meters (optional)
farmsetup: turbines_backgroundmeshsize
- name: turbines_plotnames
frame: frame_farmturbines2
label: Plot turbine names
inputtype: bool
defaultval: True
outputdef:
help: Plot the turbine names in preview window
# -------- Refinement zone inputs -------------------
- name: refine_csvtextbox
frame: frame_farmrefinement1
inputtype: textbox
defaultval: |
# CSV file should have columns with
# level, upstream, downstream, lateral, below, above, options
entryopt:
width: 55
height: 10
outputdef:
help: "\nRefine inputs"
farmsetup: refine_csvtextbox
- name: refine_csvfile
frame: frame_farmrefinement
label: CSV file
inputtype: filename
row: 0
defaultval: ''
entryopt:
width: 25
fileopenopt:
kwargs:
filetypes:
- ["CSV files", "*.csv"]
- ["all files", "*.*"]
outputdef:
help: CSV input file
farmsetup: refine_csvfile
- name: refine_deleteprev
frame: frame_farmrefinement2
label: Delete existing zones
inputtype: bool
defaultval: True
outputdef:
help: Remove all existing refinement zones before adding these
farmsetup: refine_deleteprev
# -------- Sampling plane/probe inputs -------------------
- name: sampling_csvtextbox
frame: frame_farmsampling1
inputtype: textbox
defaultval: |
# CSV file should have columns with
# upstream, downstream, lateral, below, above, type, options
entryopt:
width: 55
height: 10
outputdef:
help: "\nSampling inputs"
farmsetup: sampling_csvtextbox
- name: sampling_csvfile
frame: frame_farmsampling
label: CSV file
inputtype: filename
row: 0
defaultval: ''
entryopt:
width: 25
fileopenopt:
kwargs:
filetypes:
- ["CSV files", "*.csv"]
- ["all files", "*.*"]
outputdef:
help: CSV input file
farmsetup: sampling_csvfile
- name: sampling_deleteprev
frame: frame_farmsampling2
label: Delete existing sampling probes
inputtype: bool
defaultval: True
outputdef:
help: "Remove all existing sampling probes before adding these"
farmsetup: sampling_deleteprev
# -------- Run wind farm sweep inputs --------------------
- name: sweep_windspeeds
frame: frame_runsweep1
label: Wind speeds
inputtype: str
entryopt:
width: 30
outputdef:
help: "## List of wind speeds to sweep [m/s]"
farmsetup: sweep_windspeeds
- name: sweep_winddirs
frame: frame_runsweep1
label: Wind directions
inputtype: str
entryopt:
width: 30
outputdef:
help: List of wind directions to sweep [deg]
farmsetup: sweep_winddirs
- name: sweep_inflowmode
frame: frame_runsweep2
label: Inflow mode
inputtype: str
optionlist: ['uniform', 'RANS']
defaultval: uniform
outputdef:
help: Type of inflow velocity to wind farm
farmsetup: sweep_inflowmode
- name: sweep_autosetBC
frame: frame_runsweep2
label: Automatically set BC's
inputtype: bool
defaultval: true
outputdef:
help: Automatically setup the boundary conditions for each wind direction
farmsetup: sweep_autosetBC
- name: sweep_caseprefix
frame: frame_runsweep2
label: Case prefix
inputtype: str
defaultval: Case_{CASENUM}
entryopt:
width: 30
outputdef:
help: Case prefix (python format strings allowed)
farmsetup: sweep_caseprefix
- name: sweep_usenewdirs
frame: frame_runsweep2
label: New dir for each case
inputtype: bool
defaultval: true
outputdef:
help: Create a new directory for each case
farmsetup: sweep_usenewdirs
ctrlelem:
- input: sweep_dirprefix
activewhen: ['', 1]
- name: sweep_dirprefix
frame: frame_runsweep2
label: Directory prefix
inputtype: str
defaultval: Case_{CASENUM}
entryopt:
width: 30
outputdef:
help: Directory prefix (python format strings allowed)
farmsetup: sweep_dirprefix
- name: sweep_createsubmitscript
frame: frame_runsweep2
label: Create submission script
inputtype: bool
defaultval: False
outputdef:
help: Create a submission script for each case
farmsetup: sweep_createsubmitscript
- name: sweep_submitjob
frame: frame_runsweep2
label: Submit job
inputtype: bool
defaultval: False
outputdef:
help: Submit each job to the queue
farmsetup: sweep_submitjob
- name: sweep_logfile
frame: frame_runsweep2
label: Logfile
inputtype: filename
defaultval: ''
entryopt:
width: 30
fileopenopt:
selecttype: saveas # open/saveas/directory [optional]
outputdef:
help: Log file to record each run
farmsetup: sweep_logfile
# -------- Hidden/extra inputs ---------------------------
- name: wfarm_embedamrwindinput
frame: frame_farmsampling1
inputtype: textbox
visible: False
entryopt:
width: 55
height: 10
defaultval: |
# This should be the inputs to AMR-Wind
outputdef:
help: "\n___Embedded AMR-Wind input____"
farmsetup: wfarm_embedamrwindinput
buttons:
- name: farmbutton_loadturbines
text: Load/Reload
frame: frame_farmturbines
row: 0
col: 3
command: "partial(self.button_loadcsv, 'turbines_csvfile', 'turbines_csvtextbox')"
- name: farmbutton_applyturbines
text: Create turbines
frame: frame_farmturbines3
row: 1
col: 0
command: "self.turbines_createAllTurbines"
- name: farmbutton_previewturbines
text: Preview
frame: frame_farmturbines3
row: 1
col: 1
command: "self.turbines_previewAllTurbines"
- name: farmbutton_loadrefine
text: Load/Reload
frame: frame_farmrefinement
row: 0
col: 3
command: "partial(self.button_loadcsv, 'refine_csvfile', 'refine_csvtextbox')"
- name: farmbutton_applyrefine
text: Create refinements
frame: frame_farmrefinement3
row: 1
col: 0
command: "self.refine_createAllZones"
- name: farmbutton_loadsampling
text: Load/Reload
frame: frame_farmsampling
row: 0
col: 3
command: "partial(self.button_loadcsv, 'sampling_csvfile', 'sampling_csvtextbox')"
- name: farmbutton_applysampling
text: Create sampling probes
frame: frame_farmsampling3
row: 1
col: 0
command: "self.sampling_createAllProbes"
- name: farmbutton_clearyamlfile
row: 1
col: 2
text: Clear filename
frame: frame_farmsetup
command: "self.button_clearSetupYAMLfile"
- name: farmbutton_saveyaml
row: 2
col: 0
text: Save YAML
frame: frame_farmsetup2
command: "self.button_saveFarmSetupYAML"
- name: farmbutton_loadyaml
row: 2
col: 1
text: Load YAML
frame: frame_farmsetup2
command: "self.button_loadFarmSetupYAML"
- name: farmbutton_resetsetup
row: 2
col: 2
text: Reset inputs
frame: frame_farmsetup2
command: "self.resetFarmSetup"
- name: farmbutton_setupsweep
text: Create cases
frame: frame_runsweep
command: self.sweep_SetupRunParamSweep
#command: self.donothing_button
# --- Help buttons ---
- name: helpbutton_farmturbinecsv
text: "[?]"
frame: frame_farmturbines1 header_frame
help: "Need help?"
row: 0
col: 2
command: "partial(self.showyamlmesg, 'frame_farmturbinecsv')"
buttonoptions:
pady: 0
padx: 1
gridoptions:
sticky: 'NE'
- name: helpbutton_farmrefinecsv
text: "[?]"
frame: frame_farmrefinement1 header_frame
help: "Need help?"
row: 0
col: 2
command: "partial(self.showyamlmesg, 'frame_farmrefinecsv')"
buttonoptions:
pady: 0
padx: 1
gridoptions:
sticky: 'NE'
- name: helpbutton_farmsamplingcsv
text: "[?]"
frame: frame_farmsampling1 header_frame
help: "Need help?"
row: 0
col: 2
command: "partial(self.showyamlmesg, 'frame_farmsamplingcsv')"
buttonoptions:
pady: 0
padx: 1
gridoptions:
sticky: 'NE'
- name: helpbutton_farmsampling
text: "[?]"
frame: frame_farmsampling header_frame
help: "Need help?"
row: 0
col: 2
command: "partial(self.showyamlmesg, 'frame_farmsampling')"
buttonoptions:
pady: 0
padx: 1
gridoptions:
sticky: 'NE'
# Add all help messages and buttons in here
helpwindows:
frame_farmturbinecsv:
options:
#autowidth: True
height: 30
title: Farm Turbine CSV input
mesg: |
### TURBINE LAYOUT SPECIFICATIONS
| column | description | required/optional |
| --- | --- | --- |
| `name` | The name of the turbine (can be arbitrary). | required |
| `x` | The x position of the turbine. | required |
| `y` | The y position of the turbine. | required |
| `type` | The turbine type (must be listed under turbine types tab) | required |
| `yaw` | The turbine yaw heading. If not specified, turbine points directly into the wind | optional |
| `hubheight` | The turbine hub-height. If not specified, uses the default from the turbine type | optional |
| `options` | Optional parameters | optional |
frame_farmrefinecsv:
options:
#autowidth: True
height: 30
title: Farm refinement CSV input
mesg: |
### REFINEMENT SPECIFICATIONS
| column | description | required/optional |
| --- | --- | --- |
| `level` | The mesh level to apply the refinement. | required |
| `upstream` | The number of diameters or meters upstream to apply refinement | required |
| `downstream` | The number of diameters or meters downstream to apply refinement | required |
| `lateral` | The number of diameters or meters off to side of each turbine | required |
| `below` | The number of diameters or meters below the turbine hub-height | required |
| `above` | The number of diameters or meters above the turbine hub-height | required |
| `options` | Any additional options (see below) | optional |
### OPTIONAL INPUTS
| keyword | default | possible values | description |
| --- | --- | --- | --- |
| `orientation` | `winddir` | `winddir`, `nacdir`, `x`, `y` | Which direction the refinement box should be pointed |
| `units` | `diameter` | `diameter`, `meter` | What units the values are in |
| `center` | `turbine` | `turbine`, `farm` | Where the center of the refinement zone is located |
frame_farmsamplingcsv:
options:
#autowidth: True
height: 30
title: Farm sampling CSV input
mesg: |
### SAMPLING SPECIFICATIONS
| Type | Description | Required inputs |
| --- | --- | --- |
| `centerline` | Creates a centerline probe from hub center, starting from upstream to downstream. | `upstream`, `downstream` |
| `rotorplane` | Creates a rotor plane sampling problem start at upstream going to downstream from turbine. | `upstream`, `downstream` |
| `hubheight` | Creates a hub-height plane starting from upstream going to downstream, and with `lateral` width on either side. | `upstream`, `downstream`, `lateral`, `below` |
| `streamwise` | Creates a streamwise plane from upstream to downstream location, starting at a position `below` the centerline to position `above` centerline | `upstream`, `downstream`, `below`, `above` |
### Options
| keyword | default | possible values | description |
| --- | --- | --- | --- |
| `orientation` | winddir | winddir, nacdir, x, y | Which direction the refinement box should be pointed |
| `units` | diameter | diameter, meter | What units the values are in |
| `center` | turbine | turbine, farm | Where the center of the refinement zone is located |
| `usedx` | None | Any float value | Use this spacing between probe points, disregarding `n1` and `n2` |
| `noffsets` | 0 | Any integerr value | Create this number of offset planes |
frame_farmsampling:
options:
#autowidth: True
height: 30
title: Farm Sampling Setup
mesg: |
Sampling parameters
-------------------
# CSV file should have columns with
# name, type, upstream, downstream, lateral, below, above, n1, n2, options
Probe types:
- centerline
- rotorplane
- hubheight
- streamwise
Options:
- orientation: winddir/nacdir/x/y [default:winddir]
- units: diameter/meter [default: diameter]
- center: turbine/farm [default: turbine]
- usedx: Use this mesh spacing [default: None]
- noffsets: Number of offsets [default: 0]