-
Notifications
You must be signed in to change notification settings - Fork 9
/
choices.h
809 lines (627 loc) · 13.1 KB
/
choices.h
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
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
/*! \file ko.h
\brief default choices
*/
#pragma once
#define RESTARTGENERALINDICES
//small and big numbers
#define SMALL 1.e-80
#define BIG (1./SMALL)
#define NUMEPSILON DBL_EPSILON
// hydrogen fraction
#ifndef HFRAC
#define HFRAC 1.
#endif
// helium fraction
#ifndef HEFRAC
#define HEFRAC 0.
#endif
// metallicity
#ifndef MFRAC
#define MFRAC (1.-HFRAC-HEFRAC)
#endif
// weighted average of inverse of atomic weight, default solar
#ifndef A_INV_MEAN
#define A_INV_MEAN 0.0570490404519
#endif
// weighted average of nuclear charge squared divided by atomic weight, default solar
#ifndef Z2divA_MEAN
#define Z2divA_MEAN 5.14445150955
#endif
// Gas mean molecular weight
#ifndef MU_GAS
#define MU_GAS (1./(0.5 + 1.5*HFRAC + 0.25*HEFRAC + A_INV_MEAN*MFRAC))
#endif
// Ion mean molecular weight
#ifndef MU_I
#define MU_I (1./(HFRAC + 0.25*HEFRAC + A_INV_MEAN*MFRAC))
#endif
// Electron mean molecular weight
// ANDREW TODO: only assume H and He ionized?
#ifndef MU_E
#define MU_E (2./(1. + HFRAC))
#endif
// Adiabatic index of mixed gas
#ifndef GAMMA
#define GAMMA (5./3.)
#endif
#define GAMMAM1 (GAMMA-1.)
// Electron Adiabatic index
#ifndef GAMMAE
#define GAMMAE (5./3.)
#endif
// Ion Adiabatic index
#ifndef GAMMAI
#define GAMMAI (5./3.)
#endif
// Black hole mass
#ifndef MASS
#define MASS 1./MSUNCM
#endif
#ifndef MASSCM
#define MASSCM (MASS*MSUNCM)
#endif
#ifndef BHSPIN
#define BHSPIN 0.
#endif
/****** Frames/coordinates ******/
#ifndef MYCOORDS2
#define MYCOORDS2 MYCOORDS
#endif
#ifndef OUTCOORDS
#define OUTCOORDS MYCOORDS
#endif
#ifndef RADCLOSURECOORDS
#define RADCLOSURECOORDS MYCOORDS
#endif
#ifndef SILOCOORDS
#define SILOCOORDS MINKCOORDS
#endif
// Velocity choices
#ifndef VELPRIM
#define VELPRIM VELR
#endif
#ifndef VELPRIMRAD
#define VELPRIMRAD VELR
#endif
#ifndef OUTVEL
#define OUTVEL VEL3
#endif
/********Simulation run ***********/
//maximum number of outputs
#ifndef NOUTSTOP
#define NOUTSTOP 1e50
#endif
//maximum number of steps
#ifndef NSTEPSTOP
#define NSTEPSTOP 1e50
#endif
//maximum time
#ifndef TMAX
#define TMAX 1.e50
#endif
//verbose level
#ifndef VERBOSE0
#define VERBOSE0 0
#endif
//time stepping
#ifndef TIMESTEPPING
#define TIMESTEPPING RK2IMEX
#endif
//flux method
#ifndef FLUXMETHOD
#define FLUXMETHOD LAXF_FLUX
#endif
//integration order
#ifndef INT_ORDER
#define INT_ORDER 1
#endif
//flux-limiter: Use basic Minmod as the default
#ifndef FLUXLIMITER
#define FLUXLIMITER 0
#endif
//midway between MinMod and MC slope limiter
#ifndef MINMOD_THETA
#define MINMOD_THETA 1.5
#endif
//whether to include metric determinant into the fluxes
#ifndef GDETIN
#define GDETIN 1
#endif
//radiation source term
#ifndef EXPLICIT_LAB_RAD_SOURCE
#ifndef EXPLICIT_SUBSTEP_RAD_SOURCE
#ifndef IMPLICIT_LAB_RAD_SOURCE
#define IMPLICIT_LAB_RAD_SOURCE
#endif
#endif
#endif
//Radiation closure (no choices beyond M1 anymore)
#ifndef RADCLOSURE
#define RADCLOSURE M1CLOSURE
#endif
//whether to allow reducing implicit_lab to explicit
#ifndef ALLOW_EXPLICIT_RAD_SOURCE
#define ALLOW_EXPLICIT_RAD_SOURCE 0
#endif
//electron-ion heating
#ifndef ELECTRONIONHEATTYPE
#define ELECTRONIONHEATTYPE ELECTRONIONHEATTYPE_THROUGHUINT
#endif
//number of input arguments in the command line
#ifndef NUM_INPUTARG
#define NUM_INPUTARG 0
#endif
//shuffle loops
#ifndef SHUFFLELOOPS
#define SHUFFLELOOPS 0
#endif
/*******number of evolved variables********/
//number of nth electron bins
#ifndef NRELBIN
#define NRELBIN 0
#endif
//number of hydro variables
#ifndef EVOLVEELECTRONS
#define NVHD (6)
#else
#ifdef RELELECTRONS
#define NVHD (6+2+NRELBIN)
#else
#define NVHD (6+2)
#endif
#endif
//number of magneto-hydro variables
#ifdef MAGNFIELD
#ifdef FORCEFREE
#define NVMHD (NVHD+7)
#else
#define NVMHD (NVHD+3)
#endif
#else
#define NVMHD (NVHD)
#endif
#ifdef RADIATION
//number of radiative quantities per fluid
#ifndef EVOLVEPHOTONNUMBER
#define NRADVAR 4
#else
#define NRADVAR 5
#endif
//number of total variables
#define NV (NVMHD+NRADVAR)
#else //no RADIATION
//number of total variables
#define NV (NVMHD)
#define NRADVAR 4 //not used
#endif
//number of averaged quantities
#ifndef NAVGVARS
#define NAVGVARS (180+3*NV)
#endif
/****** Initialization *********/
//atmosphere initialization parameters
#ifndef RHOATMMIN
#define RHOATMMIN 1.
#endif
#ifndef ERADATMMIN
#define ERADATMMIN 1.
#endif
#ifndef UINTATMMIN
#define UINTATMMIN 1.e-2
#endif
/****** Fixups *****************/
//Defaults for TRANSMITTING_YBC
#ifdef TRANSMITTING_YBC
#ifndef myCYLCOORDS
#ifndef CORRECT_POLARAXIS
#define CORRECT_POLARAXIS
#endif
#ifdef MAGNFIELD
#ifndef CORRECTMAGNFIELD
#define CORRECTMAGNFIELD
#endif
#endif
#ifndef NCCORRECTPOLAR
#define NCCORRECTPOLAR 1
#endif
#endif //ifdef myCYLCOORDS
#endif //ifdef TRANSMITTING_YBC
#ifndef NCCORRECTPOLAR
#define NCCORRECTPOLAR 2
#endif
#ifndef ALLOWENTROPYU2P
#define ALLOWENTROPYU2P 1
#endif
#ifndef DOFIXUPS
#define DOFIXUPS 1
#endif
#ifndef DOU2PRADFIXUPS
#define DOU2PRADFIXUPS 0
#endif
#ifndef DOU2PMHDFIXUPS
#define DOU2PMHDFIXUPS 0
#endif
#ifndef DORADIMPFIXUPS
#define DORADIMPFIXUPS 0
#endif
/****** Floors *******/
//min uint over rho
#ifndef UURHORATIOMIN
#define UURHORATIOMIN 1.e-10
#endif
//uint over rho for u2p_cold
#ifndef UURHORATIOU2PCOLD
#define UURHORATIOU2PCOLD 1.e-10
#endif
//max uint over rho
#ifndef UURHORATIOMAX
#define UURHORATIOMAX 1.e2
#endif
//min Erad over rho
#ifndef EERHORATIOMIN
#define EERHORATIOMIN 1.e-30
#endif
//max Erad over rho
#ifndef EERHORATIOMAX
#define EERHORATIOMAX 1.e30
#endif
//min Erad over uint
#ifndef EEUURATIOMIN
#define EEUURATIOMIN 1.e-30
#endif
//max Erad over uint
#ifndef EEUURATIOMAX
#define EEUURATIOMAX 1.e30
#endif
//min absolute Erad
#ifndef ERADFLOOR
#define ERADFLOOR (10.*SMALL)
#endif
//min B^2 over uint
#ifndef B2UURATIOMIN
#define B2UURATIOMIN 0.
#endif
//max B^2 over uint
#ifndef B2UURATIOMAX
#define B2UURATIOMAX 100.
#endif
//max B^2 over Ehat
#ifndef B2EERATIOMAX
#define B2EERATIOMAX 100.
#endif
//min B^2 over rho
#ifndef B2RHOFLOORFRAME
#define B2RHOFLOORFRAME ZAMOFRAME
#endif
#ifndef B2RHORATIOMIN
#define B2RHORATIOMIN 0.
#endif
//max B^2 over rho
#ifndef B2RHORATIOMAX
#define B2RHORATIOMAX 100.
#endif
//absolute density floor
#ifndef RHOFLOOR
#define RHOFLOOR 1.e-50
#endif
//absolute energy floor
#ifndef UUFLOOR
#define UUFLOOR 1.e-50
#endif
//absolute rad energy floor
#ifndef EEFLOOR
#define EEFLOOR 1.e-50
#endif
//maximum lorentz factor of fluid frame
#ifndef GAMMAMAXHD
#define GAMMAMAXHD 100.
#endif
//maximum lorentz factor or radiation frame
#ifndef GAMMAMAXRAD
#define GAMMAMAXRAD 100.
#endif
//at what point above which assume gamma^2=1.0
#ifndef GAMMASMALLLIMIT
#define GAMMASMALLLIMIT (1.0-1E-10)
#endif
//max Te/Tgas
#ifndef TEMPEMAXIMALFRACTION
#define TEMPEMAXIMALFRACTION 1000.
#endif
//max Ti/Tgas
#ifndef TEMPIMAXIMALFRACTION
#define TEMPIMAXIMALFRACTION 1000.
#endif
//minimal ratio of electron to gas energy
#ifndef UEUINTMINRATIO
#define UEUINTMINRATIO 0.01
#endif
//minimal ratio of ion to gas energy
#ifndef UIUINTMINRATIO
#define UIUINTMINRATIO 0.01
#endif
//minimal temperature for electrons
#ifndef TEMPEMINIMAL
#define TEMPEMINIMAL 1.e2
#endif
//minimal ratio of electrons to gas temperature
#ifndef TEMPEMINIMALFRACTION
#define TEMPEMINIMALFRACTION 1.e-5
#endif
//minimal temperature for ions
#ifndef TEMPIMINIMAL
#define TEMPIMINIMAL 1.e2
#endif
//minimal ratio of ions to gas temperature
#ifndef TEMPIMINIMALFRACTION
#define TEMPIMINIMALFRACTION 1.e-5
#endif
//entropy mixing limiter
#ifndef LIMITFACTORINMIXING
#define LIMITFACTORINMIXING 1.
#endif
#ifndef NONRELMHDENTROPYCUT
#define NONRELMHDENTROPYCUT 1.e-7
#endif
//whether to check if the advection operator keeps entropy increasing,
//if not invert with the independently evolved entropy
#ifndef VERIFYENTROPYAFTERADVECTION
#define VERIFYENTROPYAFTERADVECTION 0
#endif
#ifndef CHECKENTROPYAFTEREXPLICITFACTOR
#define CHECKENTROPYAFTEREXPLICITFACTOR 1.e-5
#endif
//maximum fraction of relativistic electron energy to total
#ifndef MAX_RELEL_FRAC_U
#define MAX_RELEL_FRAC_U 0.95
#endif
//maximum fraction of relativistic electron pressure to total
#ifndef MAX_RELEL_FRAC_P
#define MAX_RELEL_FRAC_P 0.95
#endif
//maximum fraction of relativistic electrons to total
#ifndef MAX_RELEL_FRAC_N
#define MAX_RELEL_FRAC_N 0.95
#endif
/******* output ********/
#ifndef OUTOUTPUT
#define OUTOUTPUT 0
#endif
#ifndef SCAOUTPUT
#define SCAOUTPUT 0
#endif
#ifndef RADOUTPUT
#define RADOUTPUT 0
#endif
#ifndef AVGOUTPUT
#define AVGOUTPUT 0
#endif
#ifndef SILOOUTPUT
#define SILOOUTPUT 0
#endif
#ifndef GRIDOUTPUT
#define GRIDOUTPUT 0
#endif
#ifndef SIMOUTPUT
#define SIMOUTPUT 0
#endif
#ifndef ALLSTEPSOUTPUT
#define ALLSTEPSOUTPUT 0
#endif
#ifndef DTOUT2
#define DTOUT2 DTOUT1
#endif
#ifndef DTOUT3
#define DTOUT3 DTOUT1
#endif
#ifndef DTOUT4
#define DTOUT4 DTOUT1
#endif
//number of output scalars
#ifndef NSCALARS
#define NSCALARS 13
#endif
//number of profiles
#ifndef NRADPROFILES
#define NRADPROFILES (68-1)
#endif
#ifndef NTHPROFILES
#define NTHPROFILES 8
#endif
//number of box scalars
#ifndef NBOXSCALARS
#define NBOXSCALARS 44
#endif
#ifndef NBOXCORRSCALARS
#define NBOXCORRSCALARS 10
#endif
#ifndef NBOXVERTSCALARS
#define NBOXVERTSCALARS 26
#endif
#ifndef VARRADIUS
#define VARRADIUS 100.
#endif
#ifndef NVARCUTS
#define NVARCUTS 20
#endif
#ifndef NVARVARSPERCUT
#define NVARVARSPERCUT 2
#endif
#ifndef NVARSCALARS
#define NVARSCALARS (NVARCUTS*NVARVARSPERCUT)
#endif
#ifndef NANARELRADPROFILES
#define NANARELRADPROFILES 4
#endif
#ifndef IMAGETYPE
#define IMAGETYPE "gif"
#endif
/*********U2P implicit solver *****/
#ifndef U2PCONV
#define U2PCONV 1.e-10
#endif
#ifndef U2P_EQS
#define U2P_EQS U2P_EQS_NOBLE
#endif
#ifndef U2P_SOLVER
#define U2P_SOLVER U2P_SOLVER_W
#endif
/********Rad implicit solver *******/
#ifndef FORCEUEQPINIMPLICIT
#define FORCEUEQPINIMPLICIT 1
#endif
#ifndef OPDAMPINIMPLICIT
#define OPDAMPINIMPLICIT 0
#endif
#ifndef OPDAMPMAXLEVELS
#define OPDAMPMAXLEVELS 5.
#endif
#ifndef OPDAMPFACTOR
#define OPDAMPFACTOR 3.
#endif
#ifndef RADIMPLICITTHRESHOLD
#define RADIMPLICITTHRESHOLD 1.e-2
#endif
#ifndef RADIMPLICITDAMPINGFACTOR
#define RADIMPLICITDAMPINGFACTOR 3.
#endif
#ifndef RADIMPLICITMAXNPHCHANGE
#define RADIMPLICITMAXNPHCHANGE 1.e10
#endif
#ifndef RADIMPLICITMAXNECHANGE
#define RADIMPLICITMAXNECHANGE 1.e5
#endif
#ifndef RADIMPLICITMAXTRADCHANGE
#define RADIMPLICITMAXTRADCHANGE 10.
#endif
#ifndef IMPLICITMAXTGASCHANGE
#define IMPLICITMAXTGASCHANGE 10.
#endif
#ifndef RADIMPLICITMAXENCHANGEDOWN
#define RADIMPLICITMAXENCHANGEDOWN 10.
#endif
#ifndef RADIMPLICITMAXENCHANGEUP
#define RADIMPLICITMAXENCHANGEUP 10.
#endif
#ifndef RADIMPLICITMAXTECHANGE
#define RADIMPLICITMAXTECHANGE 10.
#endif
#ifndef MAXRADIMPDAMPING
#define MAXRADIMPDAMPING 1.e-5
#endif
#ifndef RADIMPCONVREL
#define RADIMPCONVREL 1.e-6
#endif
#ifndef RADIMPCONVRELERR
#define RADIMPCONVRELERR (1.e-5)
#endif
#ifndef RADIMPCONVRELENTR
#define RADIMPCONVRELENTR 1.e-6
#endif
#ifndef RADIMPCONVRELENTRERR
#define RADIMPCONVRELENTRERR 1.e-4
#endif
#ifndef RADIMPCONV
#define RADIMPCONV 1.e-10
#endif
#ifndef RADIMPENTRCONV
#define RADIMPENTRCONV 1.e-5
#endif
#ifndef RADIMPEPS
#define RADIMPEPS 1.e-6
#endif
#ifndef RADIMPMAXITER
#define RADIMPMAXITER 50
#endif
/*********metric********/
#ifndef MKSR0
#define MKSR0 0.
#endif
#ifndef MODYFIKUJKRZYSIE
#if (GDETIN==1)
#define MODYFIKUJKRZYSIE 1
#else
#define MODYFIKUJKRZYSIE 0
#endif
#endif
/*********viscosity********/
#ifndef HDVISCOSITY
#define HDVISCOSITY NOVISCOSITY
#endif
#ifndef RADVISCOSITY
#define RADVISCOSITY NOVISCOSITY
#endif
#ifndef MAXRADVISCVEL
#define MAXRADVISCVEL 1.
#endif
/*********synchrotron*********/
#ifdef SYNCHROTRON
// TODO -- do we want synchrotron bridge functions on by default?
//#ifndef NO_SYNCHROTRON_BRIDGE_FUNCTIONS
//#define USE_SYNCHROTRON_BRIDGE_FUNCTIONS
//#endif
#ifndef MAXDIFFTRADS
#define MAXDIFFTRADS 1.e2
#endif
#endif
#ifndef SYNCHROTRONALLOWEDTRATIO_RELEL
#define SYNCHROTRONALLOWEDTRATIO_RELEL 1.e30
#endif
#ifndef SYNCHROTRONALLOWEDTRATIO
#define SYNCHROTRONALLOWEDTRATIO 1.e30
#endif
/*********comptonization*********/
// comptonization is on by default
#ifdef RADIATION
#ifndef NO_COMPTONIZATION
#define COMPTONIZATION
#define COMPTONIZATIONFLAG
#endif
#endif
/*******battery and dynamo********/
#ifndef DYNAMORADIUS
#define DYNAMORADIUS rISCOBL
#endif
#ifndef BATTERYMULTIPLIER
#define BATTERYMULTIPLIER 1.
#endif
#ifndef COUPLING_MEASURE_THRESHOLD
#define COUPLING_MEASURE_THRESHOLD 0.01
#endif
#ifndef COUPLING_MEASURE_THRESHOLD_SHARPNESS
#define COUPLING_MEASURE_THRESHOLD_SHARPNESS 0.5
#endif
/*******nonthermal electrons********/
#ifdef RELELECTRONS
#ifndef RELEL_MINMOD_THETA
#define RELEL_MINMOD_THETA 1.8 //midway between MinMod and MC slope limiter
#endif
#ifndef RELEL_INJ_MIN
#define RELEL_INJ_MIN RELGAMMAMIN
#endif
#ifndef RELEL_INJ_MAX
#define RELEL_INJ_MAX RELGAMMAMAX
#endif
#endif
/**********MPI***********/
#ifndef MPIMSGBUFSIZE
#define MPIMSGBUFSIZE 12
#endif
#ifndef MPI4CORNERS //required by MAGNFIELD
#ifdef MAGNFIELD
#define MPI4CORNERS
#endif
#endif
#ifdef MPI4CORNERS
#undef MPIMSGBUFSIZE
#if (TNX>1 && TNY>1 && TNY>1) //3d
#define MPIMSGBUFSIZE 52
#else //2d
#define MPIMSGBUFSIZE 20
#endif
#endif
#ifndef MPI
#ifndef OUTPUTPERCORE
#define OUTPUTPERCORE
#endif
#endif