Skip to content

Commit 0be921d

Browse files
tomchorglwagnersimone-silvestri
authored
Implement scale-invariant dynamic Smagorinsky (#3642)
* got the bones in place * bugfix and added first attempt at AveragingProcedure * finally working * added validation script * bit of cleanup * change abstract type names and add inbounds * simpler averaging type * bugfix in Base.summary * cleanup * Update src/TurbulenceClosures/turbulence_closure_implementations/scale_invariant_smagorinsky.jl Co-authored-by: Gregory L. Wagner <[email protected]> * change calculation of averaged fields * automate validation script * start with well-resolved noise * plot Smagorinsky coefficient * bugfix in validation * rename validation file * forgot inbounds macro * fix interpolation * simpler notation for names * fewer calculations * delete extra line * shortcutuser shortcut for directional averaging * add update_frequency to ScaleInvariantSmag * added a couple of validation scripts * put wall flow into a function and added some plotting code * finished plotting in wall_flow * removed python script * added stop_time to options * added type for averaging * changed order of types * abstracted update_frequency type * run a test case only * made it work on GPUs * pass velocities to DiffusivityFields * bugfix * bugfix * rename update_interval * bugfix * bugfix and cleanup * better IC and difference scheme in wall_flow * plot 2D snapshots and 1D means * longer stop_time * update validation scripts * improve plotting 3d turbulence validation * change advection to WENO * Generalize SmagorinskyLilly to have averaged coefficients * Use const AG = AbstractGrid * Speed up by writing out LM MM more * Add optional dims to DirectionalAveraging * fix simple_smag.jl and add more @time statements * adapt 3d_turbulence_smagorinsky.jl to new style * cleanup old code * first step towards optimization * further remove strain calculation * remove extra interpolation * pre-calculate strain rates * don't modify DiffusivityFields * standardize notation for strain rate * show methods for DirectionallyAvaragedCoefficient * retest validation scripts * fix validation * generalize filter using interpolations and improve nomenclature * Move Smagorinsky to dedicated module plus rename * Remove SmagorinskyLilly * Implement LagrangianAveraging * Update src/TurbulenceClosures/turbulence_closure_implementations/Smagorinskys/scale_invariant_operators.jl Co-authored-by: Simone Silvestri <[email protected]> * Update src/TurbulenceClosures/turbulence_closure_implementations/Smagorinskys/scale_invariant_operators.jl Co-authored-by: Simone Silvestri <[email protected]> * Fix operator bugs * Import with_Traers * Import tracer diffusivities * Fix LillyCoefficient constructor bug * Fix another bug in LillyCoefficient * another lilly coeff bug * Add visualization script * Add comparison script * Special-case SmagLilly * and show and summary methods for Smagorinsky closure and coefficients * fix docs and time stepping tests * added docstrings and exported new constructors * clarifications for lagrangian averaging procedure * add tests and improve validation * Update viz script * more tests for dynamic smagorinskys * more tests for dynamic smagorinskys * cleanup * no need to export at the submodule level * clean up old comments * remove obsolete script * Improve formatting * Better syntax with DynamicSmagorinsky * Get name into TurbulenceClosures * Defaults * fix test * formatting and correct info message for test * add info message * more detailed info * dig into whats causing the hopld up * another info statement * change info * change up info statements * more changing info statements * shift info statements around a bit more * restrict tests to catch error * uncomment steps line * no distributed tests * more info statements * more info statements * more info statements * shift info statements * shift info again * skip _compute_ll_MM! launch * simplify _compute_LM_MM * try another definition * does a simplified version work? * a bit more complexity * another variation * another variation * another variation * simplify call to off diagonal Mij * cleanup and simplify formulation with constants * avoid nested call * revert changes * add back GPU test * forgot to initialize gpu env * test time stepping * remove info statements * skip a couple of DynamicSmag tests * import dynamic smag * skip another dynamic smag test * fix test * add back into statement * skip another test * bring back tests * bring back distributed tests * add dependencies back * Update test/test_time_stepping.jl Co-authored-by: Gregory L. Wagner <[email protected]> * Update test/test_turbulence_closures.jl Co-authored-by: Gregory L. Wagner <[email protected]> --------- Co-authored-by: Gregory L. Wagner <[email protected]> Co-authored-by: Simone Silvestri <[email protected]> Co-authored-by: glwagner <[email protected]>
1 parent dd82211 commit 0be921d

23 files changed

+1412
-285
lines changed

.buildkite/pipeline.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ steps:
2323
architecture: GPU
2424
retry:
2525
automatic:
26-
- exit_status: 1
26+
- exit_status: 1
2727
limit: 1
2828

2929
- label: "🏕️ initialize cpu environment"
@@ -44,7 +44,7 @@ steps:
4444
architecture: CPU
4545
retry:
4646
automatic:
47-
- exit_status: 1
47+
- exit_status: 1
4848
limit: 1
4949

5050
#####
@@ -63,7 +63,7 @@ steps:
6363
architecture: GPU
6464
retry:
6565
automatic:
66-
- exit_status: 1
66+
- exit_status: 1
6767
limit: 1
6868
depends_on: "init_gpu"
6969

@@ -78,7 +78,7 @@ steps:
7878
architecture: CPU
7979
retry:
8080
automatic:
81-
- exit_status: 1
81+
- exit_status: 1
8282
limit: 1
8383
depends_on: "init_cpu"
8484

@@ -98,7 +98,7 @@ steps:
9898
architecture: GPU
9999
retry:
100100
automatic:
101-
- exit_status: 1
101+
- exit_status: 1
102102
limit: 1
103103
depends_on: "init_gpu"
104104

@@ -113,7 +113,7 @@ steps:
113113
architecture: CPU
114114
retry:
115115
automatic:
116-
- exit_status: 1
116+
- exit_status: 1
117117
limit: 1
118118
depends_on: "init_cpu"
119119

@@ -129,7 +129,7 @@ steps:
129129
architecture: GPU
130130
retry:
131131
automatic:
132-
- exit_status: 1
132+
- exit_status: 1
133133
limit: 1
134134
depends_on: "init_gpu"
135135

@@ -144,7 +144,7 @@ steps:
144144
architecture: CPU
145145
retry:
146146
automatic:
147-
- exit_status: 1
147+
- exit_status: 1
148148
limit: 1
149149
depends_on: "init_cpu"
150150

@@ -160,7 +160,7 @@ steps:
160160
architecture: GPU
161161
retry:
162162
automatic:
163-
- exit_status: 1
163+
- exit_status: 1
164164
limit: 1
165165
depends_on: "init_gpu"
166166

@@ -175,7 +175,7 @@ steps:
175175
architecture: CPU
176176
retry:
177177
automatic:
178-
- exit_status: 1
178+
- exit_status: 1
179179
limit: 1
180180
depends_on: "init_cpu"
181181

@@ -191,7 +191,7 @@ steps:
191191
architecture: GPU
192192
retry:
193193
automatic:
194-
- exit_status: 1
194+
- exit_status: 1
195195
limit: 1
196196
depends_on: "init_gpu"
197197

@@ -206,7 +206,7 @@ steps:
206206
architecture: CPU
207207
retry:
208208
automatic:
209-
- exit_status: 1
209+
- exit_status: 1
210210
limit: 1
211211
depends_on: "init_cpu"
212212

@@ -226,7 +226,7 @@ steps:
226226
architecture: GPU
227227
retry:
228228
automatic:
229-
- exit_status: 1
229+
- exit_status: 1
230230
limit: 1
231231
depends_on: "init_gpu"
232232

@@ -241,7 +241,7 @@ steps:
241241
architecture: CPU
242242
retry:
243243
automatic:
244-
- exit_status: 1
244+
- exit_status: 1
245245
limit: 1
246246
depends_on: "init_cpu"
247247

@@ -261,7 +261,7 @@ steps:
261261
architecture: GPU
262262
retry:
263263
automatic:
264-
- exit_status: 1
264+
- exit_status: 1
265265
limit: 1
266266
depends_on: "init_gpu"
267267

@@ -276,7 +276,7 @@ steps:
276276
architecture: CPU
277277
retry:
278278
automatic:
279-
- exit_status: 1
279+
- exit_status: 1
280280
limit: 1
281281
depends_on: "init_cpu"
282282

@@ -296,7 +296,7 @@ steps:
296296
architecture: GPU
297297
retry:
298298
automatic:
299-
- exit_status: 1
299+
- exit_status: 1
300300
limit: 1
301301
depends_on: "init_gpu"
302302

@@ -311,7 +311,7 @@ steps:
311311
architecture: CPU
312312
retry:
313313
automatic:
314-
- exit_status: 1
314+
- exit_status: 1
315315
limit: 1
316316
depends_on: "init_cpu"
317317

@@ -331,7 +331,7 @@ steps:
331331
architecture: GPU
332332
retry:
333333
automatic:
334-
- exit_status: 1
334+
- exit_status: 1
335335
limit: 1
336336
depends_on: "init_gpu"
337337

@@ -346,7 +346,7 @@ steps:
346346
architecture: CPU
347347
retry:
348348
automatic:
349-
- exit_status: 1
349+
- exit_status: 1
350350
limit: 1
351351
depends_on: "init_cpu"
352352

@@ -366,7 +366,7 @@ steps:
366366
architecture: GPU
367367
retry:
368368
automatic:
369-
- exit_status: 1
369+
- exit_status: 1
370370
limit: 1
371371
depends_on: "init_gpu"
372372

@@ -381,7 +381,7 @@ steps:
381381
architecture: CPU
382382
retry:
383383
automatic:
384-
- exit_status: 1
384+
- exit_status: 1
385385
limit: 1
386386
depends_on: "init_cpu"
387387

@@ -401,7 +401,7 @@ steps:
401401
architecture: GPU
402402
retry:
403403
automatic:
404-
- exit_status: 1
404+
- exit_status: 1
405405
limit: 1
406406
depends_on: "init_gpu"
407407

@@ -416,7 +416,7 @@ steps:
416416
architecture: CPU
417417
retry:
418418
automatic:
419-
- exit_status: 1
419+
- exit_status: 1
420420
limit: 1
421421
depends_on: "init_cpu"
422422

@@ -436,7 +436,7 @@ steps:
436436
architecture: GPU
437437
retry:
438438
automatic:
439-
- exit_status: 1
439+
- exit_status: 1
440440
limit: 1
441441
depends_on: "init_gpu"
442442

@@ -451,7 +451,7 @@ steps:
451451
architecture: CPU
452452
retry:
453453
automatic:
454-
- exit_status: 1
454+
- exit_status: 1
455455
limit: 1
456456
depends_on: "init_cpu"
457457

@@ -471,7 +471,7 @@ steps:
471471
architecture: GPU
472472
retry:
473473
automatic:
474-
- exit_status: 1
474+
- exit_status: 1
475475
limit: 1
476476
depends_on: "init_gpu"
477477

@@ -486,7 +486,7 @@ steps:
486486
architecture: CPU
487487
retry:
488488
automatic:
489-
- exit_status: 1
489+
- exit_status: 1
490490
limit: 1
491491
depends_on: "init_cpu"
492492

@@ -506,7 +506,7 @@ steps:
506506
architecture: GPU
507507
retry:
508508
automatic:
509-
- exit_status: 1
509+
- exit_status: 1
510510
limit: 1
511511
depends_on: "init_gpu"
512512

@@ -521,7 +521,7 @@ steps:
521521
architecture: CPU
522522
retry:
523523
automatic:
524-
- exit_status: 1
524+
- exit_status: 1
525525
limit: 1
526526
depends_on: "init_cpu"
527527

@@ -541,7 +541,7 @@ steps:
541541
architecture: GPU
542542
retry:
543543
automatic:
544-
- exit_status: 1
544+
- exit_status: 1
545545
limit: 1
546546
depends_on: "init_gpu"
547547

@@ -556,7 +556,7 @@ steps:
556556
architecture: CPU
557557
retry:
558558
automatic:
559-
- exit_status: 1
559+
- exit_status: 1
560560
limit: 1
561561
depends_on: "init_cpu"
562562

@@ -576,7 +576,7 @@ steps:
576576
architecture: GPU
577577
retry:
578578
automatic:
579-
- exit_status: 1
579+
- exit_status: 1
580580
limit: 1
581581
depends_on: "init_gpu"
582582

@@ -591,7 +591,7 @@ steps:
591591
architecture: CPU
592592
retry:
593593
automatic:
594-
- exit_status: 1
594+
- exit_status: 1
595595
limit: 1
596596
depends_on: "init_cpu"
597597

@@ -607,7 +607,7 @@ steps:
607607
architecture: GPU
608608
retry:
609609
automatic:
610-
- exit_status: 1
610+
- exit_status: 1
611611
limit: 1
612612
depends_on: "init_gpu"
613613

@@ -622,7 +622,7 @@ steps:
622622
architecture: CPU
623623
retry:
624624
automatic:
625-
- exit_status: 1
625+
- exit_status: 1
626626
limit: 1
627627
depends_on: "init_cpu"
628628

@@ -642,7 +642,7 @@ steps:
642642
architecture: GPU
643643
retry:
644644
automatic:
645-
- exit_status: 1
645+
- exit_status: 1
646646
limit: 1
647647
depends_on: "init_gpu"
648648

@@ -657,7 +657,7 @@ steps:
657657
architecture: CPU
658658
retry:
659659
automatic:
660-
- exit_status: 1
660+
- exit_status: 1
661661
limit: 1
662662
depends_on: "init_cpu"
663663

@@ -677,7 +677,7 @@ steps:
677677
architecture: GPU
678678
retry:
679679
automatic:
680-
- exit_status: 1
680+
- exit_status: 1
681681
limit: 1
682682
depends_on: "init_gpu"
683683

@@ -692,7 +692,7 @@ steps:
692692
architecture: CPU
693693
retry:
694694
automatic:
695-
- exit_status: 1
695+
- exit_status: 1
696696
limit: 1
697697
depends_on: "init_cpu"
698698

docs/oceananigans.bib

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,4 +967,15 @@ @article{Shchepetkin2005
967967
pages={347--404},
968968
year={2005},
969969
doi={10.1016/j.ocemod.2004.08.002}
970-
}
970+
}
971+
972+
@article{BouZeid05,
973+
author = {Bou-Zeid, Elie and Meneveau, Charles and Parlange, Marc},
974+
title = "{A scale-dependent Lagrangian dynamic model for large eddy simulation of complex turbulent flows}",
975+
journal = {Physics of Fluids},
976+
volume = {17},
977+
number = {2},
978+
pages = {025105},
979+
year = {2005},
980+
doi = {10.1063/1.1839152},
981+
}

docs/src/model_setup/turbulent_diffusivity_closures_and_les_models.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ To use the default Smagorinsky-Lilly LES closure, we write
6565
julia> using Oceananigans.TurbulenceClosures
6666
6767
julia> closure = SmagorinskyLilly()
68-
SmagorinskyLilly: C=0.16, Cb=1.0, Pr=1.0
68+
Smagorinsky closure with
69+
├── coefficient = LillyCoefficient(smagorinsky = 0.16, reduction_factor = 1.0)
70+
└── Pr = 1.0
6971
```
7072

7173
The parameters `C`, `Cb`, and `Pr` may alternatively be specified explicitly.

0 commit comments

Comments
 (0)