ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_BuoyancyUtils.H
Go to the documentation of this file.
1 #ifndef ERF_BUOYANCY_UTILS_H_
2 #define ERF_BUOYANCY_UTILS_H_
3 
4 #include <ERF_EOS.H>
5 #include <ERF_Constants.H>
6 
7 AMREX_GPU_DEVICE
8 AMREX_FORCE_INLINE
10 buoyancy_dry_anelastic (int& i, int& j, int& k,
11  const amrex::Real& grav_gpu,
12  const amrex::Array4<const amrex::Real>& r0_arr,
13  const amrex::Array4<const amrex::Real>& th0_arr,
14  const amrex::Array4<const amrex::Real>& cell_data)
15 {
16  // Note: this is the same term as the moist anelastic buoyancy when qv = qc = qt = 0
17  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
18  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
19 
20  amrex::Real theta_d_wface = myhalf * (theta_d_lo + theta_d_hi);
21  amrex::Real theta_d0_wface = myhalf * (th0_arr(i,j,k) + th0_arr(i,j,k-1));
22  amrex::Real rho0_wface = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
23 
24  return (-rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface);
25 }
26 
27 AMREX_GPU_DEVICE
28 AMREX_FORCE_INLINE
30 buoyancy_dry_anelastic_eb (int& i, int& j, int& k,
31  const amrex::Real& grav_gpu,
32  const amrex::Array4<const amrex::Real>& r0_arr,
33  const amrex::Array4<const amrex::Real>& th0_arr,
34  const amrex::Array4<const amrex::Real>& cell_data,
35  amrex::Array4<amrex::EBCellFlag const> const& flag)
36 {
37  amrex::Real buoyancy = zero;
38  if (flag(i,j,k).isRegular()) {
39  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
40  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
41  amrex::Real theta_d_wface = myhalf * (theta_d_lo + theta_d_hi);
42  amrex::Real theta_d0_wface = myhalf * (th0_arr(i,j,k) + th0_arr(i,j,k-1));
43  amrex::Real rho0_wface = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
44  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
45  } else if (flag(i,j,k).isSingleValued()) {
46  if (flag(i,j,k-1).isCovered()) {
47  amrex::Real theta_d_hihi = cell_data(i,j,k+1,RhoTheta_comp)/cell_data(i,j,k+1,Rho_comp);
48  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
49  amrex::Real theta_d_wface = myhalf * (three*theta_d_hi - theta_d_hihi);
50  amrex::Real theta_d0_wface = myhalf * (three*th0_arr(i,j,k) - th0_arr(i,j,k+1));
51  amrex::Real rho0_wface = myhalf * (three*r0_arr(i,j,k) - r0_arr(i,j,k+1));
52  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
53  } else if (flag(i,j,k).isCovered()) {
54  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
55  amrex::Real theta_d_lolo = cell_data(i,j,k-2,RhoTheta_comp)/cell_data(i,j,k-2,Rho_comp);
56  amrex::Real theta_d_wface = myhalf * (three*theta_d_lo - theta_d_lolo);
57  amrex::Real theta_d0_wface = myhalf * (three*th0_arr(i,j,k-1) - th0_arr(i,j,k-2));
58  amrex::Real rho0_wface = myhalf * (three*r0_arr(i,j,k-1) - r0_arr(i,j,k-2));
59  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
60  } else {
61  amrex::Real theta_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
62  amrex::Real theta_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
63  amrex::Real theta_d_wface = myhalf * (theta_d_lo + theta_d_hi);
64  amrex::Real theta_d0_wface = myhalf * (th0_arr(i,j,k) + th0_arr(i,j,k-1));
65  amrex::Real rho0_wface = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
66  buoyancy = -rho0_wface * grav_gpu * (theta_d_wface - theta_d0_wface) / theta_d0_wface;
67  }
68  }
69  return buoyancy;
70 }
71 
72 AMREX_GPU_DEVICE
73 AMREX_FORCE_INLINE
75 buoyancy_moist_anelastic (int& i, int& j, int& k,
76  const amrex::Real& grav_gpu,
77  const amrex::Array4<const amrex::Real>& r0_arr,
78  const amrex::Array4<const amrex::Real>& th0_arr,
79  const amrex::Array4<const amrex::Real>& qv0_arr,
80  const amrex::Array4<const amrex::Real>& cell_data,
81  const amrex::Array4<const amrex::Real>& qt_arr)
82 {
83  amrex::Real Fact = (one - RvoRd); // ~= -amrex::Real(0.61)
84 
85  amrex::Real th_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
86  amrex::Real th_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
87 
88  amrex::Real qv_hi = cell_data(i,j,k ,RhoQ1_comp) /cell_data(i,j,k ,Rho_comp);
89  amrex::Real qv_lo = cell_data(i,j,k-1,RhoQ1_comp) /cell_data(i,j,k-1,Rho_comp);
90 
91  amrex::Real qt_hi = qt_arr(i,j,k ) - qv_hi;
92  amrex::Real th_v_hi = th_d_hi * (one - Fact*qt_hi - RvoRd*qt_hi);
93 
94  amrex::Real qt_lo = qt_arr(i,j,k-1) - qv_lo;
95  amrex::Real th_v_lo = th_d_lo * (one - Fact*qt_lo - RvoRd*qt_lo);
96 
97  amrex::Real th_v0_hi = th0_arr(i,j,k ) * (one - Fact*qv0_arr(i,j,k ));
98  amrex::Real th_v0_lo = th0_arr(i,j,k-1) * (one - Fact*qv0_arr(i,j,k-1));
99 
100  amrex::Real qv0_hi = qv0_arr(i,j,k );
101  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
102 
103  amrex::Real q_hi = (qv_hi-qv0_hi) - qt_hi + (th_v_hi - th_v0_hi) / th_v0_hi;
104  amrex::Real q_lo = (qv_lo-qv0_lo) - qt_lo + (th_v_lo - th_v0_lo) / th_v0_lo;
105 
106  amrex::Real qavg = myhalf * (q_hi + q_lo);
107 
108  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
109 
110  return (-r0avg * grav_gpu * qavg);
111 }
112 
113 AMREX_GPU_DEVICE
114 AMREX_FORCE_INLINE
116 buoyancy_rhopert (int& i, int& j, int& k,
117  const amrex::Real& grav_gpu,
118  const amrex::Array4<const amrex::Real>& r0_arr,
119  const amrex::Array4<const amrex::Real>& qv0_arr,
120  const amrex::Array4<const amrex::Real>& cell_data,
121  const amrex::Array4<const amrex::Real>& qt_arr)
122 {
123  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
124  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
125  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
126  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
127  return( grav_gpu * myhalf * ( rhop_hi + rhop_lo ) );
128 }
129 
130 AMREX_GPU_DEVICE
131 AMREX_FORCE_INLINE
133 buoyancy_rhopert_eb (int& i, int& j, int& k,
134  const amrex::Real& grav_gpu,
135  const amrex::Array4<const amrex::Real>& r0_arr,
136  const amrex::Array4<const amrex::Real>& qv0_arr,
137  const amrex::Array4<const amrex::Real>& cell_data,
138  const amrex::Array4<const amrex::Real>& qt_arr,
139  amrex::Array4<amrex::EBCellFlag const> const& flag)
140 {
141  amrex::Real buoyancy = zero;
142  if (flag(i,j,k).isRegular()) {
143  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
144  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
145  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
146  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
147  buoyancy = grav_gpu * myhalf * ( rhop_hi + rhop_lo );
148  } else if (flag(i,j,k).isSingleValued()) {
149  if (flag(i,j,k-1).isCovered()) {
150  amrex::Real rhop_hihi = cell_data(i,j,k+1,Rho_comp) * (one + qt_arr(i,j,k+1)) -
151  r0_arr(i,j,k+1 ) * (one + qv0_arr(i,j,k+1));
152  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
153  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
154  buoyancy = grav_gpu * myhalf * ( three * rhop_hi - rhop_hihi );
155  // buoyancy = grav_gpu * rhop_hi;
156  } else if (flag(i,j,k).isCovered()) {
157  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
158  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
159  amrex::Real rhop_lolo = cell_data(i,j,k-2,Rho_comp) * (one + qt_arr(i,j,k-2)) -
160  r0_arr(i,j,k-2 ) * (one + qv0_arr(i,j,k-2));
161  buoyancy = grav_gpu * myhalf * ( three * rhop_lo - rhop_lolo );
162  // buoyancy = grav_gpu * rhop_lo;
163  } else {
164  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
165  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
166  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
167  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
168  buoyancy = grav_gpu * myhalf * ( rhop_hi + rhop_lo );
169  }
170  }
171  return buoyancy;
172 }
173 
174 AMREX_GPU_DEVICE
175 AMREX_FORCE_INLINE
177 buoyancy_dry_Tpert (int& i, int& j, int& k,
178  const amrex::Real& grav_gpu,
179  const amrex::Real& /*lRdoCp*/,
180  const amrex::Array4<const amrex::Real>& r0_arr,
181  const amrex::Array4<const amrex::Real>& p0_arr,
182  const amrex::Array4<const amrex::Real>& th0_arr,
183  const amrex::Array4<const amrex::Real>& cell_data)
184 {
185  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k), th0_arr(i,j,k), RdoCp);
186  amrex::Real t_hi = getTgivenRandRTh(cell_data(i,j,k ,Rho_comp), cell_data(i,j,k ,RhoTheta_comp));
187 
188  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), th0_arr(i,j,k-1), RdoCp);
189  amrex::Real t_lo = getTgivenRandRTh(cell_data(i,j,k-1,Rho_comp), cell_data(i,j,k-1,RhoTheta_comp));
190 
191  amrex::Real tprime_hi = (t_hi-t0_hi)/t0_hi;
192  amrex::Real tprime_lo = (t_lo-t0_lo)/t0_lo;
193 
194  amrex::Real tp_avg = myhalf * (tprime_hi + tprime_lo);
195  amrex::Real r0_avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
196 
197  return ( -r0_avg * grav_gpu * tp_avg);
198 }
199 
200 AMREX_GPU_DEVICE
201 AMREX_FORCE_INLINE
203 buoyancy_dry_Thpert (int& i, int& j, int& k,
204  const amrex::Real& grav_gpu,
205  const amrex::Array4<const amrex::Real>& r0_arr,
206  const amrex::Array4<const amrex::Real>& th0_arr,
207  const amrex::Array4<const amrex::Real>& cell_prim)
208 {
209  amrex::Real thetaprime_hi = (cell_prim(i,j,k ,PrimTheta_comp) - th0_arr(i,j,k )) / th0_arr(i,j,k );
210  amrex::Real thetaprime_lo = (cell_prim(i,j,k-1,PrimTheta_comp) - th0_arr(i,j,k-1)) / th0_arr(i,j,k-1);
211 
212  amrex::Real thp_avg = myhalf * (thetaprime_hi + thetaprime_lo);
213  amrex::Real r0_avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
214 
215  return ( -r0_avg * grav_gpu * thp_avg);
216 }
217 
218 AMREX_GPU_DEVICE
219 AMREX_FORCE_INLINE
221 buoyancy_moist_Tpert (int& i, int& j, int& k,
222  const int& n_qstate,
223  const amrex::Real& grav_gpu,
224  const amrex::Real& /*lRdoCp*/,
225  const amrex::Array4<const amrex::Real>& r0_arr,
226  const amrex::Array4<const amrex::Real>& th0_arr,
227  const amrex::Array4<const amrex::Real>& qv0_arr,
228  const amrex::Array4<const amrex::Real>& p0_arr,
229  const amrex::Array4<const amrex::Real>& cell_prim,
230  const amrex::Array4<const amrex::Real>& cell_data,
231  const amrex::Array4<const amrex::Real>& qt_arr)
232 {
233  amrex::Real qv_hi = (n_qstate >= 1) ? cell_prim(i,j,k ,PrimQ1_comp) : zero;
234  amrex::Real qv_lo = (n_qstate >= 1) ? cell_prim(i,j,k-1,PrimQ1_comp) : zero;
235 
236  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k ), th0_arr(i,j,k ), RdoCp);
237  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), th0_arr(i,j,k-1), RdoCp);
238 
239  amrex::Real dt_hi = getTgivenRandRTh(cell_data(i,j,k ,Rho_comp), cell_data(i,j,k ,RhoTheta_comp), qv_hi) - t0_hi;
240  amrex::Real dt_lo = getTgivenRandRTh(cell_data(i,j,k-1,Rho_comp), cell_data(i,j,k-1,RhoTheta_comp), qv_lo) - t0_lo;
241 
242  amrex::Real qv0_hi = qv0_arr(i,j,k );
243  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
244 
245  amrex::Real q_hi = epsv * (qv_hi-qv0_hi) - (qt_arr(i,j,k )-qv_hi) + dt_hi/t0_hi;
246  amrex::Real q_lo = epsv * (qv_lo-qv0_lo) - (qt_arr(i,j,k-1)-qv_lo) + dt_lo/t0_lo;
247 
248  amrex::Real qavg = myhalf * (q_hi + q_lo);
249 
250  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
251 
252  return ( -r0avg * grav_gpu * qavg);
253 }
254 
255 AMREX_GPU_DEVICE
256 AMREX_FORCE_INLINE
258 buoyancy_moist_Thpert (int& i, int& j, int& k,
259  const int& n_qstate,
260  const amrex::Real& grav_gpu,
261  const amrex::Array4<const amrex::Real>& r0_arr,
262  const amrex::Array4<const amrex::Real>& th0_arr,
263  const amrex::Array4<const amrex::Real>& qv0_arr,
264  const amrex::Array4<const amrex::Real>& cell_prim,
265  const amrex::Array4<const amrex::Real>& qt_arr)
266 {
267  amrex::Real qv_hi = (n_qstate >= 1) ? cell_prim(i,j,k ,PrimQ1_comp) : zero;
268  amrex::Real qv_lo = (n_qstate >= 1) ? cell_prim(i,j,k-1,PrimQ1_comp) : zero;
269 
270  amrex::Real qt_hi = qt_arr(i,j,k ) - qv_hi;
271  amrex::Real qt_lo = qt_arr(i,j,k-1) - qv_lo;
272 
273  amrex::Real dth_hi = cell_prim(i,j,k ,PrimTheta_comp) - th0_arr(i,j,k );
274  amrex::Real dth_lo = cell_prim(i,j,k-1,PrimTheta_comp) - th0_arr(i,j,k-1);
275 
276  amrex::Real qv0_hi = qv0_arr(i,j,k );
277  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
278 
279  amrex::Real q_hi = epsv * (qv_hi-qv0_hi) - qt_hi + dth_hi/th0_arr(i,j,k );
280  amrex::Real q_lo = epsv * (qv_lo-qv0_lo) - qt_lo + dth_lo/th0_arr(i,j,k-1);
281 
282  amrex::Real qavg = myhalf * (q_hi + q_lo);
283 
284  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
285 
286  return ( -r0avg * grav_gpu * qavg);
287 }
288 
289 // **************************************************************************************
290 // Routines below this line are not currently used
291 // **************************************************************************************
292 
293 AMREX_GPU_DEVICE
294 AMREX_FORCE_INLINE
296 buoyancy_dry_anelastic_T (int& i, int& j, int& k,
297  const amrex::Real& grav_gpu,
298  const amrex::Real& /*RdoCp*/,
299  const amrex::Array4<const amrex::Real>& r0_arr,
300  const amrex::Array4<const amrex::Real>& p0_arr,
301  const amrex::Array4<const amrex::Real>& cell_data)
302 {
303  amrex::Real rt0_hi = getRhoThetagivenP(p0_arr(i,j,k));
304  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k), rt0_hi/r0_arr(i,j,k), RdoCp);
305  amrex::Real t_hi = getTgivenPandTh(p0_arr(i,j,k), cell_data(i,j,k,RhoTheta_comp)/r0_arr(i,j,k), RdoCp);
306  amrex::Real q_hi = (t_hi-t0_hi)/t0_hi;
307 
308  amrex::Real rt0_lo = getRhoThetagivenP(p0_arr(i,j,k-1));
309  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), rt0_lo/r0_arr(i,j,k-1), RdoCp);
310  amrex::Real t_lo = getTgivenPandTh(p0_arr(i,j,k-1), cell_data(i,j,k-1,RhoTheta_comp)/r0_arr(i,j,k-1), RdoCp);
311  amrex::Real q_lo = (t_lo-t0_lo)/t0_lo;
312 
313  amrex::Real r0_q_avg = myhalf * (r0_arr(i,j,k) * q_hi + r0_arr(i,j,k-1) * q_lo);
314  return (-r0_q_avg * grav_gpu);
315 }
316 
317 #endif
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_anelastic(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr)
Definition: ERF_BuoyancyUtils.H:75
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Thpert(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_prim)
Definition: ERF_BuoyancyUtils.H:203
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Tpert(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Real &, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &p0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_data)
Definition: ERF_BuoyancyUtils.H:177
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr)
Definition: ERF_BuoyancyUtils.H:116
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Tpert(int &i, int &j, int &k, const int &n_qstate, const amrex::Real &grav_gpu, const amrex::Real &, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &p0_arr, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr)
Definition: ERF_BuoyancyUtils.H:221
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Thpert(int &i, int &j, int &k, const int &n_qstate, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_prim, const amrex::Array4< const amrex::Real > &qt_arr)
Definition: ERF_BuoyancyUtils.H:258
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic_T(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Real &, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &p0_arr, const amrex::Array4< const amrex::Real > &cell_data)
Definition: ERF_BuoyancyUtils.H:296
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic_eb(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_data, amrex::Array4< amrex::EBCellFlag const > const &flag)
Definition: ERF_BuoyancyUtils.H:30
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert_eb(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &qv0_arr, const amrex::Array4< const amrex::Real > &cell_data, const amrex::Array4< const amrex::Real > &qt_arr, amrex::Array4< amrex::EBCellFlag const > const &flag)
Definition: ERF_BuoyancyUtils.H:133
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic(int &i, int &j, int &k, const amrex::Real &grav_gpu, const amrex::Array4< const amrex::Real > &r0_arr, const amrex::Array4< const amrex::Real > &th0_arr, const amrex::Array4< const amrex::Real > &cell_data)
Definition: ERF_BuoyancyUtils.H:10
constexpr amrex::Real epsv
Definition: ERF_Constants.H:53
constexpr amrex::Real three
Definition: ERF_Constants.H:11
constexpr amrex::Real one
Definition: ERF_Constants.H:9
constexpr amrex::Real zero
Definition: ERF_Constants.H:8
constexpr amrex::Real myhalf
Definition: ERF_Constants.H:13
constexpr amrex::Real RvoRd
Definition: ERF_Constants.H:56
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:54
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getRhoThetagivenP(const amrex::Real p, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:172
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenRandRTh(const amrex::Real rho, const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:46
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenPandTh(const amrex::Real P, const amrex::Real th, const amrex::Real rdOcp)
Definition: ERF_EOS.H:32
#define PrimQ1_comp
Definition: ERF_IndexDefines.H:58
#define Rho_comp
Definition: ERF_IndexDefines.H:36
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:37
#define PrimTheta_comp
Definition: ERF_IndexDefines.H:55
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:42
amrex::Real Real
Definition: ERF_ShocInterface.H:19