ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_Constants.H
Go to the documentation of this file.
1 #ifndef ERF_CONSTANTS_H_
2 #define ERF_CONSTANTS_H_
3 
4 #include <AMReX_REAL.H>
5 
6 constexpr amrex::Real PI = 3.14159265358979323846264338327950288;
7 constexpr amrex::Real PIoTwo = PI/2.0;
8 
9 // Physical Constants
10 constexpr amrex::Real R_d = 287.0; // dry air constant for dry air [J/(kg-K)]
11 constexpr amrex::Real R_v = 461.505; // water vapor constant for water vapor [J/(kg-K)]
12 constexpr amrex::Real Cp_d = 1004.5; // We have set this so that with qv=0 we get identically gamma = 1.4
13 constexpr amrex::Real Cp_v = 1859.0;
14 constexpr amrex::Real Cp_l = 4200.0;
15 
16 constexpr amrex::Real L_v = 2.5e6; // latent heat of vaporization (J / kg)
17 
18 constexpr amrex::Real p_0 = 1.0e5; // reference surface pressure [Pa]
19 constexpr amrex::Real Gamma = 1.4; // c_p / c_v [-]
20 constexpr amrex::Real KAPPA = 0.41; // von Karman constant
21 constexpr amrex::Real CONST_GRAV = 9.81;
22 
23 // Derived Constants
24 constexpr amrex::Real ip_0 = 1./p_0;
25 constexpr amrex::Real iR_d = 1./R_d;
26 constexpr amrex::Real iGamma = 1./Gamma;
27 
28 constexpr amrex::Real rhor = 1000.; // Density of water, kg/m3
29 constexpr amrex::Real rhos = 100.; // Density of snow, kg/m3
30 constexpr amrex::Real rhog = 400.; // Density of graupel, kg/m3
31 constexpr amrex::Real tbgmin = 253.16; // Minimum temperature for cloud water., K
32 constexpr amrex::Real tbgmax = 273.16; // Maximum temperature for cloud ice, K
33 constexpr amrex::Real tprmin = 268.16; // Minimum temperature for rain, K
34 constexpr amrex::Real tprmax = 283.16; // Maximum temperature for snow+graupel, K
35 constexpr amrex::Real tgrmin = 223.16; // Minimum temperature for graupel, K
36 constexpr amrex::Real tgrmax = 283.16; // Maximum temperature for graupel, K
37 
38 constexpr amrex::Real a_rain = 842.; // Coeff.for rain term vel
39 constexpr amrex::Real b_rain = 0.8; // Fall speed exponent for rain
40 constexpr amrex::Real a_snow = 4.84; // Coeff.for snow term vel
41 constexpr amrex::Real b_snow = 0.25; // Fall speed exponent for snow
42 constexpr amrex::Real a_grau = 94.5; // Lin (1983) (rhog=400)
43 constexpr amrex::Real b_grau = 0.5; // Fall speed exponent for graupel
44 
45 // Autoconversion
46 constexpr amrex::Real qcw0 = 1.e-3; // Threshold for water autoconversion, g/g
47 constexpr amrex::Real qci0 = 1.e-4; // Threshold for ice autoconversion, g/g
48 constexpr amrex::Real alphaelq = 1.e-3; // autoconversion of cloud water rate coef
49 constexpr amrex::Real betaelq = 1.e-3; // autoconversion of cloud ice rate coef
50 
51 constexpr amrex::Real erccoef = 1.0; // Rain/Cloud water collection efficiency
52 constexpr amrex::Real esccoef = 1.0; // Snow/Cloud water collection efficiency
53 constexpr amrex::Real esicoef = 0.1; // Snow/cloud ice collection efficiency
54 constexpr amrex::Real egccoef = 1.0; // Graupel/Cloud water collection efficiency
55 constexpr amrex::Real egicoef = 0.1; // Graupel/Cloud ice collection efficiency
56 
57 constexpr amrex::Real nzeror = 8.e6; // Intercept coeff. for rain
58 constexpr amrex::Real nzeros = 3.e6; // Intersept coeff. for snow
59 constexpr amrex::Real nzerog = 4.e6; // Intersept coeff. for graupel
60 constexpr amrex::Real qp_threshold = 1.e-8; // minimal rain/snow water content
61 
62 constexpr amrex::Real boltz = 1.38065e-23;
63 constexpr amrex::Real avogadro = 6.02214e26;
64 constexpr amrex::Real mwdair = 28.966;
65 constexpr amrex::Real mwwv = 18.016;
66 constexpr amrex::Real lcond = 2.501e6;
67 constexpr amrex::Real lfus = 2.11727e3;
68 constexpr amrex::Real lsub = lcond+lfus;
69 constexpr amrex::Real rair = boltz*avogadro/mwdair;
70 constexpr amrex::Real rh20 = rair/mwwv;
71 constexpr amrex::Real rga = 1.0/CONST_GRAV;
72 
73 constexpr amrex::Real diffelq = 2.21e-05; // Diffusivity of water vapor, m2/s
74 constexpr amrex::Real therco = 2.40e-02; // Thermal conductivity of air, J/m/s/K
75 constexpr amrex::Real muelq = 1.717e-05; // Dynamic viscosity of air
76 
77 constexpr amrex::Real a_bg = 1.0/(tbgmax-tbgmin);
78 constexpr amrex::Real a_pr = 1.0/(tprmax-tprmin);
79 constexpr amrex::Real a_gr = 1.0/(tgrmax-tgrmin);
80 
81 constexpr amrex::Real crain = b_rain / 4.0;
82 constexpr amrex::Real csnow = b_snow / 4.0;
83 constexpr amrex::Real cgrau = b_grau / 4.0;
84 
85 constexpr amrex::Real lat_vap = 2.5e6; // Latent heat of vaporization (J/kg)
86 constexpr amrex::Real lat_ice = 3.337e5; // latent heat of fusion (J/kg)
87 constexpr amrex::Real Rd_on_Rv = R_d/R_v;
88 constexpr amrex::Real tmelt = 273.15; // melting temp.
89 constexpr amrex::Real h2otrip = 273.15; // Triple point temperature of water (K)
90 constexpr amrex::Real tboil = 373.16; // Boiling point of water at 1 atm (K)
91 constexpr amrex::Real ttrice = 20.00; // transition range from es over H2O to es over ice
92 constexpr amrex::Real epsilo = Rd_on_Rv;
93 constexpr amrex::Real omeps = 1. - epsilo;
94 constexpr amrex::Real rhoh2o = 1.000e3; // density of liquid water
95 #endif
constexpr amrex::Real csnow
Definition: ERF_Constants.H:82
constexpr amrex::Real rhog
Definition: ERF_Constants.H:30
constexpr amrex::Real tprmax
Definition: ERF_Constants.H:34
constexpr amrex::Real a_bg
Definition: ERF_Constants.H:77
constexpr amrex::Real R_v
Definition: ERF_Constants.H:11
constexpr amrex::Real muelq
Definition: ERF_Constants.H:75
constexpr amrex::Real KAPPA
Definition: ERF_Constants.H:20
constexpr amrex::Real lfus
Definition: ERF_Constants.H:67
constexpr amrex::Real tboil
Definition: ERF_Constants.H:90
constexpr amrex::Real a_gr
Definition: ERF_Constants.H:79
constexpr amrex::Real lat_vap
Definition: ERF_Constants.H:85
constexpr amrex::Real qci0
Definition: ERF_Constants.H:47
constexpr amrex::Real nzerog
Definition: ERF_Constants.H:59
constexpr amrex::Real Cp_d
Definition: ERF_Constants.H:12
constexpr amrex::Real Rd_on_Rv
Definition: ERF_Constants.H:87
constexpr amrex::Real cgrau
Definition: ERF_Constants.H:83
constexpr amrex::Real tbgmax
Definition: ERF_Constants.H:32
constexpr amrex::Real betaelq
Definition: ERF_Constants.H:49
constexpr amrex::Real iR_d
Definition: ERF_Constants.H:25
constexpr amrex::Real a_grau
Definition: ERF_Constants.H:42
constexpr amrex::Real rga
Definition: ERF_Constants.H:71
constexpr amrex::Real lsub
Definition: ERF_Constants.H:68
constexpr amrex::Real avogadro
Definition: ERF_Constants.H:63
constexpr amrex::Real alphaelq
Definition: ERF_Constants.H:48
constexpr amrex::Real rhoh2o
Definition: ERF_Constants.H:94
constexpr amrex::Real esicoef
Definition: ERF_Constants.H:53
constexpr amrex::Real diffelq
Definition: ERF_Constants.H:73
constexpr amrex::Real therco
Definition: ERF_Constants.H:74
constexpr amrex::Real b_grau
Definition: ERF_Constants.H:43
constexpr amrex::Real epsilo
Definition: ERF_Constants.H:92
constexpr amrex::Real mwdair
Definition: ERF_Constants.H:64
constexpr amrex::Real egccoef
Definition: ERF_Constants.H:54
constexpr amrex::Real boltz
Definition: ERF_Constants.H:62
constexpr amrex::Real egicoef
Definition: ERF_Constants.H:55
constexpr amrex::Real b_rain
Definition: ERF_Constants.H:39
constexpr amrex::Real mwwv
Definition: ERF_Constants.H:65
constexpr amrex::Real tmelt
Definition: ERF_Constants.H:88
constexpr amrex::Real lcond
Definition: ERF_Constants.H:66
constexpr amrex::Real rair
Definition: ERF_Constants.H:69
constexpr amrex::Real qcw0
Definition: ERF_Constants.H:46
constexpr amrex::Real ip_0
Definition: ERF_Constants.H:24
constexpr amrex::Real tprmin
Definition: ERF_Constants.H:33
constexpr amrex::Real qp_threshold
Definition: ERF_Constants.H:60
constexpr amrex::Real PI
Definition: ERF_Constants.H:6
constexpr amrex::Real p_0
Definition: ERF_Constants.H:18
constexpr amrex::Real ttrice
Definition: ERF_Constants.H:91
constexpr amrex::Real nzeror
Definition: ERF_Constants.H:57
constexpr amrex::Real iGamma
Definition: ERF_Constants.H:26
constexpr amrex::Real tgrmax
Definition: ERF_Constants.H:36
constexpr amrex::Real lat_ice
Definition: ERF_Constants.H:86
constexpr amrex::Real tbgmin
Definition: ERF_Constants.H:31
constexpr amrex::Real rhos
Definition: ERF_Constants.H:29
constexpr amrex::Real esccoef
Definition: ERF_Constants.H:52
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:21
constexpr amrex::Real Cp_l
Definition: ERF_Constants.H:14
constexpr amrex::Real PIoTwo
Definition: ERF_Constants.H:7
constexpr amrex::Real rhor
Definition: ERF_Constants.H:28
constexpr amrex::Real rh20
Definition: ERF_Constants.H:70
constexpr amrex::Real a_rain
Definition: ERF_Constants.H:38
constexpr amrex::Real nzeros
Definition: ERF_Constants.H:58
constexpr amrex::Real Cp_v
Definition: ERF_Constants.H:13
constexpr amrex::Real R_d
Definition: ERF_Constants.H:10
constexpr amrex::Real a_snow
Definition: ERF_Constants.H:40
constexpr amrex::Real crain
Definition: ERF_Constants.H:81
constexpr amrex::Real b_snow
Definition: ERF_Constants.H:41
constexpr amrex::Real L_v
Definition: ERF_Constants.H:16
constexpr amrex::Real omeps
Definition: ERF_Constants.H:93
constexpr amrex::Real h2otrip
Definition: ERF_Constants.H:89
constexpr amrex::Real erccoef
Definition: ERF_Constants.H:51
constexpr amrex::Real tgrmin
Definition: ERF_Constants.H:35
constexpr amrex::Real Gamma
Definition: ERF_Constants.H:19
constexpr amrex::Real a_pr
Definition: ERF_Constants.H:78