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  amrex::Real const& 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  amrex::Real const& 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  amrex::Real const& grav_gpu,
77  amrex::Real const& rv_over_rd,
78  const amrex::Array4<const amrex::Real>& r0_arr,
79  const amrex::Array4<const amrex::Real>& th0_arr,
80  const amrex::Array4<const amrex::Real>& qv0_arr,
81  const amrex::Array4<const amrex::Real>& cell_data,
82  const amrex::Array4<const amrex::Real>& qt_arr)
83 {
84  amrex::Real Fact = (one - rv_over_rd); // = -amrex::Real(0.61)
85 
86  amrex::Real th_d_hi = cell_data(i,j,k ,RhoTheta_comp)/cell_data(i,j,k ,Rho_comp);
87  amrex::Real th_d_lo = cell_data(i,j,k-1,RhoTheta_comp)/cell_data(i,j,k-1,Rho_comp);
88 
89  amrex::Real qv_hi = cell_data(i,j,k ,RhoQ1_comp) /cell_data(i,j,k ,Rho_comp);
90  amrex::Real qv_lo = cell_data(i,j,k-1,RhoQ1_comp) /cell_data(i,j,k-1,Rho_comp);
91 
92  amrex::Real qt_hi = qt_arr(i,j,k ) - qv_hi;
93  amrex::Real th_v_hi = th_d_hi * (one - Fact*qt_hi - rv_over_rd*qt_hi);
94 
95  amrex::Real qt_lo = qt_arr(i,j,k-1) - qv_lo;
96  amrex::Real th_v_lo = th_d_lo * (one - Fact*qt_lo - rv_over_rd*qt_lo);
97 
98  amrex::Real th_v0_hi = th0_arr(i,j,k ) * (one - Fact*qv0_arr(i,j,k ));
99  amrex::Real th_v0_lo = th0_arr(i,j,k-1) * (one - Fact*qv0_arr(i,j,k-1));
100 
101  amrex::Real qv0_hi = qv0_arr(i,j,k );
102  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
103 
104  amrex::Real q_hi = (qv_hi-qv0_hi) - qt_hi + (th_v_hi - th_v0_hi) / th_v0_hi;
105  amrex::Real q_lo = (qv_lo-qv0_lo) - qt_lo + (th_v_lo - th_v0_lo) / th_v0_lo;
106 
107  amrex::Real qavg = myhalf * (q_hi + q_lo);
108 
109  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
110 
111  return (-r0avg * grav_gpu * qavg);
112 }
113 
114 AMREX_GPU_DEVICE
115 AMREX_FORCE_INLINE
117 buoyancy_rhopert (int& i, int& j, int& k,
118  amrex::Real const& grav_gpu,
119  const amrex::Array4<const amrex::Real>& r0_arr,
120  const amrex::Array4<const amrex::Real>& qv0_arr,
121  const amrex::Array4<const amrex::Real>& cell_data,
122  const amrex::Array4<const amrex::Real>& qt_arr)
123 {
124  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
125  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
126  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
127  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
128  return( grav_gpu * myhalf * ( rhop_hi + rhop_lo ) );
129 }
130 
131 AMREX_GPU_DEVICE
132 AMREX_FORCE_INLINE
134 buoyancy_rhopert_eb (int& i, int& j, int& k,
135  amrex::Real const& grav_gpu,
136  const amrex::Array4<const amrex::Real>& r0_arr,
137  const amrex::Array4<const amrex::Real>& qv0_arr,
138  const amrex::Array4<const amrex::Real>& cell_data,
139  const amrex::Array4<const amrex::Real>& qt_arr,
140  amrex::Array4<amrex::EBCellFlag const> const& flag)
141 {
142  amrex::Real buoyancy = zero;
143  if (flag(i,j,k).isRegular()) {
144  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
145  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
146  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
147  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
148  buoyancy = grav_gpu * myhalf * ( rhop_hi + rhop_lo );
149  } else if (flag(i,j,k).isSingleValued()) {
150  if (flag(i,j,k-1).isCovered()) {
151  amrex::Real rhop_hihi = cell_data(i,j,k+1,Rho_comp) * (one + qt_arr(i,j,k+1)) -
152  r0_arr(i,j,k+1 ) * (one + qv0_arr(i,j,k+1));
153  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
154  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
155  buoyancy = grav_gpu * myhalf * ( three * rhop_hi - rhop_hihi );
156  // buoyancy = grav_gpu * rhop_hi;
157  } else if (flag(i,j,k).isCovered()) {
158  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
159  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
160  amrex::Real rhop_lolo = cell_data(i,j,k-2,Rho_comp) * (one + qt_arr(i,j,k-2)) -
161  r0_arr(i,j,k-2 ) * (one + qv0_arr(i,j,k-2));
162  buoyancy = grav_gpu * myhalf * ( three * rhop_lo - rhop_lolo );
163  // buoyancy = grav_gpu * rhop_lo;
164  } else {
165  amrex::Real rhop_hi = cell_data(i,j,k ,Rho_comp) * (one + qt_arr(i,j,k )) -
166  r0_arr(i,j,k ) * (one + qv0_arr(i,j,k ));
167  amrex::Real rhop_lo = cell_data(i,j,k-1,Rho_comp) * (one + qt_arr(i,j,k-1)) -
168  r0_arr(i,j,k-1 ) * (one + qv0_arr(i,j,k-1));
169  buoyancy = grav_gpu * myhalf * ( rhop_hi + rhop_lo );
170  }
171  }
172  return buoyancy;
173 }
174 
175 AMREX_GPU_DEVICE
176 AMREX_FORCE_INLINE
178 buoyancy_dry_Tpert (int& i, int& j, int& k,
179  amrex::Real const& grav_gpu,
180  amrex::Real const& rd_over_cp,
181  const amrex::Array4<const amrex::Real>& r0_arr,
182  const amrex::Array4<const amrex::Real>& p0_arr,
183  const amrex::Array4<const amrex::Real>& th0_arr,
184  const amrex::Array4<const amrex::Real>& cell_data)
185 {
186  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k), th0_arr(i,j,k), rd_over_cp);
187  amrex::Real t_hi = getTgivenRandRTh(cell_data(i,j,k ,Rho_comp), cell_data(i,j,k ,RhoTheta_comp));
188 
189  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), th0_arr(i,j,k-1), rd_over_cp);
190  amrex::Real t_lo = getTgivenRandRTh(cell_data(i,j,k-1,Rho_comp), cell_data(i,j,k-1,RhoTheta_comp));
191 
192  amrex::Real tprime_hi = (t_hi-t0_hi)/t0_hi;
193  amrex::Real tprime_lo = (t_lo-t0_lo)/t0_lo;
194 
195  amrex::Real tp_avg = myhalf * (tprime_hi + tprime_lo);
196  amrex::Real r0_avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
197 
198  return ( -r0_avg * grav_gpu * tp_avg);
199 }
200 
201 AMREX_GPU_DEVICE
202 AMREX_FORCE_INLINE
204 buoyancy_dry_Thpert (int& i, int& j, int& k,
205  amrex::Real const& grav_gpu,
206  const amrex::Array4<const amrex::Real>& r0_arr,
207  const amrex::Array4<const amrex::Real>& th0_arr,
208  const amrex::Array4<const amrex::Real>& cell_prim)
209 {
210  amrex::Real thetaprime_hi = (cell_prim(i,j,k ,PrimTheta_comp) - th0_arr(i,j,k )) / th0_arr(i,j,k );
211  amrex::Real thetaprime_lo = (cell_prim(i,j,k-1,PrimTheta_comp) - th0_arr(i,j,k-1)) / th0_arr(i,j,k-1);
212 
213  amrex::Real thp_avg = myhalf * (thetaprime_hi + thetaprime_lo);
214  amrex::Real r0_avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
215 
216  return ( -r0_avg * grav_gpu * thp_avg);
217 }
218 
219 AMREX_GPU_DEVICE
220 AMREX_FORCE_INLINE
222 buoyancy_moist_Tpert (int& i, int& j, int& k,
223  const int& n_qstate,
224  amrex::Real const& grav_gpu,
225  amrex::Real const& rd_over_cp,
226  const amrex::Array4<const amrex::Real>& r0_arr,
227  const amrex::Array4<const amrex::Real>& th0_arr,
228  const amrex::Array4<const amrex::Real>& qv0_arr,
229  const amrex::Array4<const amrex::Real>& p0_arr,
230  const amrex::Array4<const amrex::Real>& cell_prim,
231  const amrex::Array4<const amrex::Real>& cell_data,
232  const amrex::Array4<const amrex::Real>& qt_arr)
233 {
234  amrex::Real qv_hi = (n_qstate >= 1) ? cell_prim(i,j,k ,PrimQ1_comp) : zero;
235  amrex::Real qv_lo = (n_qstate >= 1) ? cell_prim(i,j,k-1,PrimQ1_comp) : zero;
236 
237  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k ), th0_arr(i,j,k ), rd_over_cp);
238  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), th0_arr(i,j,k-1), rd_over_cp);
239 
240  amrex::Real dt_hi = getTgivenRandRTh(cell_data(i,j,k ,Rho_comp), cell_data(i,j,k ,RhoTheta_comp), qv_hi) - t0_hi;
241  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;
242 
243  amrex::Real qv0_hi = qv0_arr(i,j,k );
244  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
245 
246  amrex::Real q_hi = amrex::Real(0.61) * (qv_hi-qv0_hi) - (qt_arr(i,j,k )-qv_hi) + dt_hi/t0_hi;
247  amrex::Real q_lo = amrex::Real(0.61) * (qv_lo-qv0_lo) - (qt_arr(i,j,k-1)-qv_lo) + dt_lo/t0_lo;
248 
249  amrex::Real qavg = myhalf * (q_hi + q_lo);
250 
251  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
252 
253  return ( -r0avg * grav_gpu * qavg);
254 }
255 
256 AMREX_GPU_DEVICE
257 AMREX_FORCE_INLINE
259 buoyancy_moist_Thpert (int& i, int& j, int& k,
260  const int& n_qstate,
261  amrex::Real const& grav_gpu,
262  const amrex::Array4<const amrex::Real>& r0_arr,
263  const amrex::Array4<const amrex::Real>& th0_arr,
264  const amrex::Array4<const amrex::Real>& qv0_arr,
265  const amrex::Array4<const amrex::Real>& cell_prim,
266  const amrex::Array4<const amrex::Real>& qt_arr)
267 {
268  amrex::Real qv_hi = (n_qstate >= 1) ? cell_prim(i,j,k ,PrimQ1_comp) : zero;
269  amrex::Real qv_lo = (n_qstate >= 1) ? cell_prim(i,j,k-1,PrimQ1_comp) : zero;
270 
271  amrex::Real qt_hi = qt_arr(i,j,k ) - qv_hi;
272  amrex::Real qt_lo = qt_arr(i,j,k-1) - qv_lo;
273 
274  amrex::Real dth_hi = cell_prim(i,j,k ,PrimTheta_comp) - th0_arr(i,j,k );
275  amrex::Real dth_lo = cell_prim(i,j,k-1,PrimTheta_comp) - th0_arr(i,j,k-1);
276 
277  amrex::Real qv0_hi = qv0_arr(i,j,k );
278  amrex::Real qv0_lo = qv0_arr(i,j,k-1);
279 
280  amrex::Real q_hi = amrex::Real(0.61) * (qv_hi-qv0_hi) - qt_hi + dth_hi/th0_arr(i,j,k );
281  amrex::Real q_lo = amrex::Real(0.61) * (qv_lo-qv0_lo) - qt_lo + dth_lo/th0_arr(i,j,k-1);
282 
283  amrex::Real qavg = myhalf * (q_hi + q_lo);
284 
285  amrex::Real r0avg = myhalf * (r0_arr(i,j,k) + r0_arr(i,j,k-1));
286 
287  return ( -r0avg * grav_gpu * qavg);
288 }
289 
290 // **************************************************************************************
291 // Routines below this line are not currently used
292 // **************************************************************************************
293 
294 AMREX_GPU_DEVICE
295 AMREX_FORCE_INLINE
297 buoyancy_dry_anelastic_T (int& i, int& j, int& k,
298  amrex::Real const& grav_gpu,
299  amrex::Real const& rd_over_cp,
300  const amrex::Array4<const amrex::Real>& r0_arr,
301  const amrex::Array4<const amrex::Real>& p0_arr,
302  const amrex::Array4<const amrex::Real>& cell_data)
303 {
304  amrex::Real rt0_hi = getRhoThetagivenP(p0_arr(i,j,k));
305  amrex::Real t0_hi = getTgivenPandTh(p0_arr(i,j,k), rt0_hi/r0_arr(i,j,k), rd_over_cp);
306  amrex::Real t_hi = getTgivenPandTh(p0_arr(i,j,k), cell_data(i,j,k,RhoTheta_comp)/r0_arr(i,j,k), rd_over_cp);
307  amrex::Real q_hi = (t_hi-t0_hi)/t0_hi;
308 
309  amrex::Real rt0_lo = getRhoThetagivenP(p0_arr(i,j,k-1));
310  amrex::Real t0_lo = getTgivenPandTh(p0_arr(i,j,k-1), rt0_lo/r0_arr(i,j,k-1), rd_over_cp);
311  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), rd_over_cp);
312  amrex::Real q_lo = (t_lo-t0_lo)/t0_lo;
313 
314  amrex::Real r0_q_avg = myhalf * (r0_arr(i,j,k) * q_hi + r0_arr(i,j,k-1) * q_lo);
315  return (-r0_q_avg * grav_gpu);
316 }
317 
318 #endif
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_anelastic(int &i, int &j, int &k, amrex::Real const &grav_gpu, amrex::Real const &rv_over_rd, 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_moist_Tpert(int &i, int &j, int &k, const int &n_qstate, amrex::Real const &grav_gpu, amrex::Real const &rd_over_cp, 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:222
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_moist_Thpert(int &i, int &j, int &k, const int &n_qstate, amrex::Real const &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:259
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic(int &i, int &j, int &k, amrex::Real const &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
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert_eb(int &i, int &j, int &k, amrex::Real const &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:134
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Thpert(int &i, int &j, int &k, amrex::Real const &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:204
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_Tpert(int &i, int &j, int &k, amrex::Real const &grav_gpu, amrex::Real const &rd_over_cp, 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:178
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_rhopert(int &i, int &j, int &k, amrex::Real const &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:117
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic_T(int &i, int &j, int &k, amrex::Real const &grav_gpu, amrex::Real const &rd_over_cp, 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:297
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real buoyancy_dry_anelastic_eb(int &i, int &j, int &k, amrex::Real const &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
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
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