Peano
Loading...
Searching...
No Matches
ProductionRates.h
Go to the documentation of this file.
1// This file is part of the ExaHyPE2 project. For conditions of distribution and
2// use, please see the copyright notice at www.peano-framework.org
3#pragma once
4
5#include "tarch/Assertions.h"
6
7namespace applications {
8 namespace exahype2 {
9 namespace GravityWaves {
10 namespace Airglow {
11 class ProductionRates;
12 } // namespace Airglow
13 } // namespace GravityWaves
14 } // namespace exahype2
15} // namespace applications
16
18
19 /********************************************************************************************************************************
20 * The collection of constants, functions, and lookup tables contained here is based on * Snively et al. "OH and OI
21 *airglow layer modulation by ducted short-period gravity waves: Effects of trapping altitude", 2009.*
22 ********************************************************************************************************************************/
23public:
24 /**************
25 * O(S) Model *
26 **************/
27
28 static double constexpr DELTA = 0.2;
29 static double constexpr ZETA = 0.03;
30
31 static inline GPU_CALLABLE_METHOD double k1(const double temperature) {
32 // three body production of molecular oxygen
33 const double factor = 300.0 / temperature;
34 return 4.7e-33 * factor * factor;
35 }
36
37 static inline GPU_CALLABLE_METHOD double k2() {
38 // quenching of O2(c sum(u)) by O2
39 return 5.0e-13;
40 }
41
42 static inline GPU_CALLABLE_METHOD double k3() {
43 // quenching of O2(c sum(u)) by O
44 return 6.0e-12;
45 }
46
47 static inline GPU_CALLABLE_METHOD double k4(const double temperature) {
48 // quenching of O(S)
49 return 4.0e-12 * tarch::la::pow(tarch::la::E, -865.0 / temperature);
50 }
51
52 static inline GPU_CALLABLE_METHOD double A1() {
53 // Radiative loss of O2(c sum(u))
54 return 2.0e-2;
55 }
56
57 static inline GPU_CALLABLE_METHOD double A2() {
58 // Radiative loss of O(S) at all wave lengths
59 return 1.105;
60 }
61
62 static inline GPU_CALLABLE_METHOD double A5577() {
63 // Radiative loss of O(S) at 557.7nm
64 return 1.06;
65 }
66
67 /***************
68 * OH(v) Model *
69 ***************/
70
71 static inline GPU_CALLABLE_METHOD double branching(const int vibrationalState) {
72// branching rates from Makhlouf et al. 1995, Table 1
73#if !defined(WITH_GPU)
74 assertion1(vibrationalState < 10, vibrationalState);
75 assertion1(vibrationalState > -1, vibrationalState);
76#endif
77
78 switch (vibrationalState) {
79 case 9:
80 return 0.48;
81 case 8:
82 return 0.27;
83 case 7:
84 return 0.17;
85 case 6:
86 return 0.08;
87 default:
88 return 0.0;
89 }
90 }
91
92 static inline GPU_CALLABLE_METHOD double k5(const double temperature, const int vibrationalState) {
93 // production of OH(vibrationalState)
94 return 1.4e-10 * tarch::la::pow(tarch::la::E, -470.0 / temperature) * branching(vibrationalState);
95 }
96
97 static inline GPU_CALLABLE_METHOD double k6(const double temperature) {
98 // three-body production of O3
99 return 6.0e-34 * tarch::la::pow(300.0 / temperature, 2.3);
100 }
101
102 static inline GPU_CALLABLE_METHOD double k7(const int vibrationalState) {
103// quenching OH(v) and O into H and O2
104// rates from Makhlouf et al. "Photochemical-dynamical modeling of the measured response of airglow to gravity waves",
105// 1995, Table 1, k_{8v}
106#if !defined(WITH_GPU)
107 assertion1(vibrationalState < 10, vibrationalState);
108 assertion1(vibrationalState > -1, vibrationalState);
109#endif
110 switch (vibrationalState) {
111 case 0:
112 return 3.9e-11;
113 case 1:
114 return 10.5e-11;
115 default:
116 return 25e-11;
117 }
118 }
119
120 static inline GPU_CALLABLE_METHOD double k8(const int vibrationalState, const int quenchedState) {
121// quenching OH(v) and O2 into OH(v') and O2
122// rates from Adler-Golden "Kinetic parameters for OH nightglow modeling consisent with recent laboratory measurements",
123// 1997, Table 3
124#if !defined(WITH_GPU)
125 assertion1(vibrationalState < 10, vibrationalState);
126 assertion1(vibrationalState > 0, vibrationalState);
127 assertion1(quenchedState < 9, quenchedState);
128 assertion1(quenchedState > -1, quenchedState);
129 assertion2(quenchedState < vibrationalState, vibrationalState, quenchedState);
130#endif
131 if (vibrationalState == 1) {
132 return 2e-13;
133 }
134
135 if (vibrationalState == 2) {
136 if (quenchedState == 0)
137 return 0.0;
138 return 4e-13;
139 }
140
141 if (vibrationalState == 3) {
142 if (quenchedState == 0)
143 return 0.0;
144 if (quenchedState == 1)
145 return 1e-13;
146 return 7e-13;
147 }
148
149 if (vibrationalState == 4) {
150 if (quenchedState == 0)
151 return 0.0;
152 if (quenchedState == 1)
153 return 1e-13;
154 if (quenchedState == 2)
155 return 2e-13;
156 return 10e-13;
157 }
158
159 if (vibrationalState == 5) {
160 if (quenchedState == 0)
161 return 0.0;
162 if (quenchedState == 1)
163 return 1e-13;
164 if (quenchedState == 2)
165 return 2e-13;
166 if (quenchedState == 3)
167 return 6e-13;
168 return 16e-13;
169 }
170
171 if (vibrationalState == 6) {
172 switch (quenchedState) {
173 case 0:
174 return 1e-13;
175 case 1:
176 return 1e-13;
177 case 2:
178 return 3e-13;
179 case 3:
180 return 6e-13;
181 case 4:
182 return 11e-13;
183 case 5:
184 return 22e-13;
185 default:
186 assert(false);
187 }
188 }
189
190
191 if (vibrationalState == 7) {
192 switch (quenchedState) {
193 case 0:
194 return 4e-13;
195 case 1:
196 return 6e-13;
197 case 2:
198 return 9e-13;
199 case 3:
200 return 12e-13;
201 case 4:
202 return 16e-13;
203 case 5:
204 return 23e-13;
205 case 6:
206 return 32e-13;
207 default:
208 assert(false);
209 }
210 }
211
212 if (vibrationalState == 8) {
213 switch (quenchedState) {
214 case 0:
215 return 4e-13;
216 case 1:
217 return 6e-13;
218 case 2:
219 return 8e-13;
220 case 3:
221 return 10e-13;
222 case 4:
223 return 14e-13;
224 case 5:
225 return 19e-13;
226 case 6:
227 return 25e-13;
228 case 7:
229 return 33e-13;
230 default:
231 assert(false);
232 }
233 }
234
235 if (vibrationalState == 9) {
236 switch (quenchedState) {
237 case 0:
238 return 28e-13;
239 case 1:
240 return 29e-13;
241 case 2:
242 return 31e-13;
243 case 3:
244 return 32e-13;
245 case 4:
246 return 34e-13;
247 case 5:
248 return 36e-13;
249 case 6:
250 return 38e-13;
251 case 7:
252 return 40e-13;
253 case 8:
254 return 42e-13;
255 default:
256 assert(false);
257 }
258 }
259
260 return 0.0;
261 }
262
263 static inline GPU_CALLABLE_METHOD double k9(const int vibrationalState) {
264// quenching OH(v) and N2 into OH(v - 1) and N2
265// rates from Adler-Golden "Kinetic parameters for OH nightglow modeling consisent with recent laboratory measurements",
266// 1997, Table 1, k_4(v)
267#if !defined(WITH_GPU)
268 assertion1(vibrationalState < 10, vibrationalState);
269 assertion1(vibrationalState > 0, vibrationalState);
270#endif
271
272 switch (vibrationalState) {
273 case 1:
274 return 0.06e-13;
275 case 2:
276 return 0.1e-13;
277 case 3:
278 return 0.17e-13;
279 case 4:
280 return 0.3e-13;
281 case 5:
282 return 0.52e-13;
283 case 6:
284 return 0.91e-13;
285 case 7:
286 return 1.6e-13;
287 case 8:
288 return 7e-13;
289 case 9:
290 return 4.8e-13;
291 default:
292 assert(false);
293 }
294 }
295
296 /***********************************************************************************************************************************
297 * Einstein Coefficients from Khomich et al. "Airglow as an Indicator of Upper Atmospheric Structure and Dynamics",
298 *2008, Page 146 *
299 ***********************************************************************************************************************************/
300
301 static int constexpr LANGHOFFBANDWIDTH = 5;
302
303 static inline GPU_CALLABLE_METHOD double langhoffEinsteinCoefficients(
304 const int vibrationalState,
305 const int quenchedState
306 ) {
307#if !defined(WITH_GPU)
308 assertion1(vibrationalState < 10, vibrationalState);
309 assertion1(vibrationalState > 0, vibrationalState);
310 assertion1(quenchedState < 9, quenchedState);
311 assertion1(quenchedState > -1, quenchedState);
312 assertion2(quenchedState < vibrationalState, vibrationalState, quenchedState);
313 assertion3(
314 vibrationalState - LANGHOFFBANDWIDTH <= quenchedState,
315 vibrationalState,
316 quenchedState,
318 );
319#endif
320
321 if (vibrationalState == 1) {
322 return 15.0;
323 }
324
325 if (vibrationalState == 2) {
326 if (quenchedState == 0)
327 return 8.5;
328 return 21.0;
329 }
330
331 if (vibrationalState == 3) {
332 if (quenchedState == 0)
333 return 0.69;
334 if (quenchedState == 1)
335 return 23.5;
336 return 19.0;
337 }
338
339 if (vibrationalState == 4) {
340 if (quenchedState == 0)
341 return 0.065;
342 if (quenchedState == 1)
343 return 2.7;
344 if (quenchedState == 2)
345 return 43.0;
346 return 14.0;
347 }
348
349 if (vibrationalState == 5) {
350 if (quenchedState == 0)
351 return 0.011;
352 if (quenchedState == 1)
353 return 0.34;
354 if (quenchedState == 2)
355 return 6.4;
356 if (quenchedState == 3)
357 return 65.0;
358 return 7.0;
359 }
360
361 if (vibrationalState == 6) {
362 if (quenchedState == 1)
363 return 0.055;
364 if (quenchedState == 2)
365 return 0.91;
366 if (quenchedState == 3)
367 return 12.6;
368 if (quenchedState == 4)
369 return 85.0;
370 return 3.0;
371 }
372
373 if (vibrationalState == 7) {
374 if (quenchedState == 2)
375 return 0.19;
376 if (quenchedState == 3)
377 return 2.1;
378 if (quenchedState == 4)
379 return 21.0;
380 if (quenchedState == 5)
381 return 103.0;
382 return 3.0;
383 }
384
385 if (vibrationalState == 8) {
386 if (quenchedState == 3)
387 return 0.42;
388 if (quenchedState == 4)
389 return 4.0;
390 if (quenchedState == 5)
391 return 33.0;
392 if (quenchedState == 6)
393 return 111.0;
394 return 8.0;
395 }
396
397 if (vibrationalState == 9) {
398 if (quenchedState == 4)
399 return 0.96;
400 if (quenchedState == 5)
401 return 6.9;
402 if (quenchedState == 6)
403 return 48.0;
404 if (quenchedState == 7)
405 return 108.0;
406 return 21.0;
407 }
408
409 return 0.0;
410 }
411
412 static int constexpr TURNBULLLOWEBANDWIDTH = 6;
413
414 static inline GPU_CALLABLE_METHOD double turnbullLoweEinsteinCoefficients(
415 const int vibrationalState,
416 const int quenchedState
417 ) {
418#if !defined(WITH_GPU)
419 assertion1(vibrationalState < 10, vibrationalState);
420 assertion1(vibrationalState > 0, vibrationalState);
421 assertion1(quenchedState < 9, quenchedState);
422 assertion1(quenchedState > -1, quenchedState);
423 assertion2(quenchedState < vibrationalState, vibrationalState, quenchedState);
424 assertion3(
425 vibrationalState - TURNBULLLOWEBANDWIDTH <= quenchedState,
426 vibrationalState,
427 quenchedState,
429 );
430#endif
431
432 if (vibrationalState == 1) {
433 return 22.7;
434 }
435
436 if (vibrationalState == 2) {
437 if (quenchedState == 0)
438 return 15.4;
439 return 30.4;
440 }
441
442 if (vibrationalState == 3) {
443 if (quenchedState == 0)
444 return 2.03;
445 if (quenchedState == 1)
446 return 40.3;
447 return 28.1;
448 }
449
450 if (vibrationalState == 4) {
451 if (quenchedState == 0)
452 return 0.3;
453 if (quenchedState == 1)
454 return 7.19;
455 if (quenchedState == 2)
456 return 69.8;
457 return 20.3;
458 }
459
460 if (vibrationalState == 5) {
461 if (quenchedState == 0)
462 return 0.051;
463 if (quenchedState == 1)
464 return 1.32;
465 if (quenchedState == 2)
466 return 15.9;
467 if (quenchedState == 3)
468 return 99.4;
469 return 11.0;
470 }
471
472 if (vibrationalState == 6) {
473 if (quenchedState == 0)
474 return 0.01;
475 if (quenchedState == 1)
476 return 0.27;
477 if (quenchedState == 2)
478 return 34.8;
479 if (quenchedState == 3)
480 return 27.9;
481 if (quenchedState == 4)
482 return 126.0;
483 return 4.0;
484 }
485
486 if (vibrationalState == 7) {
487 if (quenchedState == 1)
488 return 0.063;
489 if (quenchedState == 2)
490 return 0.85;
491 if (quenchedState == 3)
492 return 7.16;
493 if (quenchedState == 4)
494 return 42.9;
495 if (quenchedState == 5)
496 return 145.0;
497 return 2.3;
498 }
499
500 if (vibrationalState == 8) {
501 if (quenchedState == 2)
502 return 0.23;
503 if (quenchedState == 3)
504 return 2.01;
505 if (quenchedState == 4)
506 return 12.7;
507 if (quenchedState == 5)
508 return 60.0;
509 if (quenchedState == 6)
510 return 154.0;
511 return 8.6;
512 }
513
514 if (vibrationalState == 9) {
515 if (quenchedState == 3)
516 return 0.62;
517 if (quenchedState == 4)
518 return 4.05;
519 if (quenchedState == 5)
520 return 19.9;
521 if (quenchedState == 6)
522 return 78.6;
523 if (quenchedState == 7)
524 return 149;
525 return 23.7;
526 }
527
528 return 0.0;
529 }
530
531 static int constexpr GOLDMANBANDWIDTH = 6;
532
533 static inline GPU_CALLABLE_METHOD double goldmanEinsteinCoefficients(
534 const int vibrationalState,
535 const int quenchedState
536 ) {
537#if !defined(WITH_GPU)
538 assertion1(vibrationalState < 10, vibrationalState);
539 assertion1(vibrationalState > 0, vibrationalState);
540 assertion1(quenchedState < 9, quenchedState);
541 assertion1(quenchedState > -1, quenchedState);
542 assertion2(quenchedState < vibrationalState, vibrationalState, quenchedState);
543 assertion3(vibrationalState - GOLDMANBANDWIDTH <= quenchedState, vibrationalState, quenchedState, GOLDMANBANDWIDTH);
544#endif
545
546 if (vibrationalState == 1) {
547 return 17.33;
548 }
549
550 if (vibrationalState == 2) {
551 if (quenchedState == 0)
552 return 10.31;
553 return 23.58;
554 }
555
556 if (vibrationalState == 3) {
557 if (quenchedState == 0)
558 return 1.12;
559 if (quenchedState == 1)
560 return 27.55;
561 return 22.2;
562 }
563
564 if (vibrationalState == 4) {
565 if (quenchedState == 0)
566 return 0.13;
567 if (quenchedState == 1)
568 return 4.12;
569 if (quenchedState == 2)
570 return 48.68;
571 return 16.45;
572 }
573
574 if (vibrationalState == 5) {
575 if (quenchedState == 0)
576 return 0.019;
577 if (quenchedState == 1)
578 return 0.63;
579 if (quenchedState == 2)
580 return 9.43;
581 if (quenchedState == 3)
582 return 70.70;
583 return 9.31;
584 }
585
586 if (vibrationalState == 6) {
587 if (quenchedState == 0)
588 return 0.003;
589 if (quenchedState == 1)
590 return 0.108;
591 if (quenchedState == 2)
592 return 1.74;
593 if (quenchedState == 3)
594 return 17.14;
595 if (quenchedState == 4)
596 return 91.44;
597 return 3.78;
598 }
599
600 if (vibrationalState == 7) {
601 if (quenchedState == 1)
602 return 0.023;
603 if (quenchedState == 2)
604 return 0.37;
605 if (quenchedState == 3)
606 return 3.78;
607 if (quenchedState == 4)
608 return 27.19;
609 if (quenchedState == 5)
610 return 107.25;
611 return 2.27;
612 }
613
614 if (vibrationalState == 8) {
615 if (quenchedState == 2)
616 return 0.088;
617 if (quenchedState == 3)
618 return 0.92;
619 if (quenchedState == 4)
620 return 7.04;
621 if (quenchedState == 5)
622 return 39.09;
623 if (quenchedState == 6)
624 return 116.58;
625 return 7.25;
626 }
627
628 if (vibrationalState == 9) {
629 if (quenchedState == 3)
630 return 0.25;
631 if (quenchedState == 4)
632 return 1.96;
633 if (quenchedState == 5)
634 return 11.72;
635 if (quenchedState == 6)
636 return 51.92;
637 if (quenchedState == 7)
638 return 117.6;
639 return 20.41;
640 }
641
642 return 0.0;
643 }
644
645}; // namespace applications::exahype2::GravityWaves::ChemicalAdvection::ProductionRates
static GPU_CALLABLE_METHOD double branching(const int vibrationalState)
static GPU_CALLABLE_METHOD double k5(const double temperature, const int vibrationalState)
static GPU_CALLABLE_METHOD double k9(const int vibrationalState)
static GPU_CALLABLE_METHOD double langhoffEinsteinCoefficients(const int vibrationalState, const int quenchedState)
static GPU_CALLABLE_METHOD double k8(const int vibrationalState, const int quenchedState)
static GPU_CALLABLE_METHOD double turnbullLoweEinsteinCoefficients(const int vibrationalState, const int quenchedState)
static GPU_CALLABLE_METHOD double k6(const double temperature)
static GPU_CALLABLE_METHOD double k1(const double temperature)
static GPU_CALLABLE_METHOD double goldmanEinsteinCoefficients(const int vibrationalState, const int quenchedState)
static GPU_CALLABLE_METHOD double k7(const int vibrationalState)
static GPU_CALLABLE_METHOD double k4(const double temperature)
This code is taken from the original ExaHyPE project written by colleagues from the University of Tre...
Definition CCZ4Kernels.h:14