1 #ifndef ERF_TERRAIN_METRIC_H_
2 #define ERF_TERRAIN_METRIC_H_
5 #include <AMReX_Geometry.H>
6 #include <AMReX_MultiFab.H>
14 void init_zlevels (amrex::Vector<amrex::Vector<amrex::Real>> & zlevels_stag,
15 amrex::Vector<amrex::Vector<amrex::Real>> & stretched_dz_h,
16 amrex::Vector<amrex::Gpu::DeviceVector<amrex::Real>> & stretched_dz_d,
17 amrex::Vector<amrex::Geometry>
const& geom,
18 amrex::Vector<amrex::IntVect>
const& ref_ratio,
19 const amrex::Real grid_stretching_ratio,
20 const amrex::Real zsurf,
21 const amrex::Real dz0);
24 amrex::MultiFab& z_phys_nd,
25 amrex::Vector<amrex::Real>
const& z_levels_h,
26 amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2>& phys_bc_type);
29 amrex::MultiFab& z_phys_nd,
30 amrex::Vector<amrex::Real>
const& z_levels_h);
40 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
41 const amrex::Array4<const amrex::Real>& z_nd)
43 amrex::Real dzInv = cellSizeInv[2];
44 amrex::Real met_h_zeta = 0.25 * dzInv *
45 ( z_nd(i+1,j,k+1) + z_nd(i+1,j+1,k+1) + z_nd(i,j,k+1) + z_nd(i,j+1,k+1)
46 -z_nd(i+1,j,k ) - z_nd(i+1,j+1,k ) - z_nd(i,j,k ) - z_nd(i,j+1,k ) );
55 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
56 const amrex::Array4<const amrex::Real>& z_nd)
58 amrex::Real dxInv = cellSizeInv[0];
59 amrex::Real met_h_xi = 0.25 * dxInv *
60 ( z_nd(i+1,j,k) + z_nd(i+1,j+1,k) + z_nd(i+1,j,k+1) + z_nd(i+1,j+1,k+1)
61 -z_nd(i ,j,k) - z_nd(i ,j+1,k) - z_nd(i ,j,k+1) - z_nd(i ,j+1,k+1) );
70 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
71 const amrex::Array4<const amrex::Real>& z_nd)
73 amrex::Real dyInv = cellSizeInv[1];
74 amrex::Real met_h_eta = 0.25 * dyInv *
75 ( z_nd(i,j+1,k) + z_nd(i+1,j+1,k) + z_nd(i,j+1,k+1) + z_nd(i+1,j+1,k+1)
76 -z_nd(i,j ,k) - z_nd(i+1,j ,k) - z_nd(i,j ,k+1) - z_nd(i+1,j ,k+1) );
88 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
89 const amrex::Array4<const amrex::Real>& z_nd)
91 amrex::Real dzInv = cellSizeInv[2];
92 amrex::Real met_h_zeta = 0.5 * dzInv * ( z_nd(i,j,k+1) + z_nd(i,j+1,k+1)
93 - z_nd(i,j,k ) - z_nd(i,j+1,k ) );
102 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
103 const amrex::Array4<const amrex::Real>& z_nd)
105 amrex::Real dxInv = cellSizeInv[0];
106 amrex::Real met_h_xi = 0.125 * dxInv *
107 ( z_nd(i+1,j,k) + z_nd(i+1,j,k+1) + z_nd(i+1,j+1,k) + z_nd(i+1,j+1,k+1)
108 -z_nd(i-1,j,k) - z_nd(i-1,j,k+1) - z_nd(i-1,j+1,k) - z_nd(i-1,j+1,k+1) );
117 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
118 const amrex::Array4<const amrex::Real>& z_nd)
120 amrex::Real dyInv = cellSizeInv[1];
121 amrex::Real met_h_eta = 0.5 * dyInv * ( z_nd(i,j+1,k ) + z_nd(i,j+1,k+1)
122 - z_nd(i,j ,k ) - z_nd(i,j ,k+1) );
131 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
132 const amrex::Array4<const amrex::Real>& z_nd)
134 amrex::Real dzInv = cellSizeInv[2];
135 amrex::Real met_h_zeta = 0.5 * dzInv * ( z_nd(i,j,k+1) + z_nd(i+1,j,k+1)
136 - z_nd(i,j,k ) - z_nd(i+1,j,k ) );
145 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
146 const amrex::Array4<const amrex::Real>& z_nd)
148 amrex::Real dxInv = cellSizeInv[0];
149 amrex::Real met_h_xi = 0.5 * dxInv * ( z_nd(i+1,j,k) + z_nd(i+1,j,k+1)
150 -z_nd(i ,j,k) - z_nd(i ,j,k+1) );
159 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
160 const amrex::Array4<const amrex::Real>& z_nd)
162 amrex::Real dyInv = cellSizeInv[1];
163 amrex::Real met_h_eta = 0.125 * dyInv *
164 ( z_nd(i,j+1,k) + z_nd(i,j+1,k+1) + z_nd(i+1,j+1,k) + z_nd(i+1,j+1,k+1)
165 -z_nd(i,j-1,k) - z_nd(i,j-1,k+1) - z_nd(i+1,j-1,k) - z_nd(i+1,j-1,k+1) );
174 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
175 const amrex::Array4<const amrex::Real>& z_nd)
177 amrex::Real dzInv = cellSizeInv[2];
178 amrex::Real met_h_zeta = 0.125 * dzInv *
179 ( z_nd(i,j,k+1) + z_nd(i+1,j,k+1) + z_nd(i,j+1,k+1) + z_nd(i+1,j+1,k+1)
180 -z_nd(i,j,k-1) - z_nd(i+1,j,k-1) - z_nd(i,j+1,k-1) - z_nd(i+1,j+1,k-1) );
189 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
190 const amrex::Array4<const amrex::Real>& z_nd)
192 amrex::Real dxInv = cellSizeInv[0];
193 amrex::Real met_h_xi = 0.5 * dxInv * ( z_nd(i+1,j,k) + z_nd(i+1,j+1,k)
194 -z_nd(i ,j,k) - z_nd(i ,j+1,k) );
203 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
204 const amrex::Array4<const amrex::Real>& z_nd)
206 amrex::Real dyInv = cellSizeInv[1];
207 amrex::Real met_h_eta = 0.5 * dyInv * ( z_nd(i,j+1,k) + z_nd(i+1,j+1,k)
208 -z_nd(i,j ,k) - z_nd(i+1,j ,k) );
222 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
223 const amrex::Array4<const amrex::Real>& z_nd)
225 amrex::Real dzInv = cellSizeInv[2];
226 amrex::Real met_h_zeta = dzInv * (z_nd(i,j,k+1) - z_nd(i,j,k));
235 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
236 const amrex::Array4<const amrex::Real>& z_nd)
238 amrex::Real dxInv = cellSizeInv[0];
239 amrex::Real met_h_xi = 0.25 * dxInv *
240 ( z_nd(i+1,j,k) + z_nd(i+1,j,k+1)
241 -z_nd(i-1,j,k) - z_nd(i-1,j,k+1) );
250 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
251 const amrex::Array4<const amrex::Real>& z_nd)
253 amrex::Real dyInv = cellSizeInv[1];
254 amrex::Real met_h_eta = 0.25 * dyInv *
255 ( z_nd(i,j+1,k) + z_nd(i,j+1,k+1)
256 -z_nd(i,j-1,k) - z_nd(i,j-1,k+1) );
267 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
268 const amrex::Array4<const amrex::Real>& z_nd)
270 amrex::Real dzInv = cellSizeInv[2];
271 amrex::Real met_h_zeta = 0.25 * dzInv * ( z_nd(i,j,k+1) + z_nd(i,j+1,k+1)
272 -z_nd(i,j,k-1) - z_nd(i,j+1,k-1) );
281 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
282 const amrex::Array4<const amrex::Real>& z_nd)
284 amrex::Real dxInv = cellSizeInv[0];
285 amrex::Real met_h_xi = 0.25 * dxInv *
286 ( z_nd(i+1,j+1,k) + z_nd(i+1,j ,k)
287 -z_nd(i-1,j+1,k) - z_nd(i-1,j ,k) );
296 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
297 const amrex::Array4<const amrex::Real>& z_nd)
299 amrex::Real dyInv = cellSizeInv[1];
300 amrex::Real met_h_eta = dyInv * ( z_nd(i,j+1,k) - z_nd(i,j,k) );
311 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
312 const amrex::Array4<const amrex::Real>& z_nd)
314 amrex::Real dzInv = cellSizeInv[2];
315 amrex::Real met_h_zeta = 0.25 * dzInv * ( z_nd(i,j,k+1) + z_nd(i+1,j,k+1)
316 -z_nd(i,j,k-1) - z_nd(i+1,j,k-1) );
325 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
326 const amrex::Array4<const amrex::Real>& z_nd)
328 amrex::Real dxInv = cellSizeInv[0];
329 amrex::Real met_h_xi = dxInv * ( z_nd(i+1,j,k) - z_nd(i,j,k) );
338 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& cellSizeInv,
339 const amrex::Array4<const amrex::Real>& z_nd)
341 amrex::Real dyInv = cellSizeInv[1];
342 amrex::Real met_h_eta = 0.25 * dyInv *
343 ( z_nd(i+1,j+1,k) + z_nd(i,j+1,k)
344 -z_nd(i+1,j-1,k) - z_nd(i,j-1,k) );
353 const amrex::Array4<const amrex::Real>& z_nd)
355 const amrex::Real z_cc = 0.125*( z_nd(i ,j ,k ) + z_nd(i ,j ,k+1) +
356 + z_nd(i+1,j ,k ) + z_nd(i ,j ,k+1)
357 + z_nd(i ,j+1,k ) + z_nd(i ,j+1,k+1)
358 + z_nd(i+1,j+1,k ) + z_nd(i ,j+1,k+1));
362 const amrex::Real z0_cc = 0.25*( z_nd(i ,j ,0) + z_nd(i ,j+1,0)
363 + z_nd(i+1,j ,0) + z_nd(i+1,j+1,0));
365 return (z_cc - z0_cc);
375 const amrex::Array4<const amrex::Real> u_arr,
376 const amrex::Array4<const amrex::Real> v_arr,
377 const amrex::Array4<const amrex::Real> z_nd,
378 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dxInv)
381 amrex::Real met_zlo_xi = 0.5 * dxInv[0] *
382 ( z_nd(i+1,j+1,k ) + z_nd(i+1,j ,k )
383 -z_nd(i ,j+1,k ) - z_nd(i ,j ,k ) );
386 amrex::Real met_zlo_eta = 0.5 * dxInv[1] *
387 ( z_nd(i+1,j+1,k ) + z_nd(i ,j+1,k )
388 -z_nd(i+1,j ,k ) - z_nd(i ,j ,k ) );
392 amrex::Real u = (k == 0) ? 1.5 * (0.5*(u_arr(i,j,k)+u_arr(i+1,j,k))) - 0.5*(0.5*(u_arr(i,j,k+1)+u_arr(i+1,j,k+1))) :
393 0.25 * ( u_arr(i,j,k-1) + u_arr(i+1,j,k-1) + u_arr(i,j,k) + u_arr(i+1,j,k) );
394 amrex::Real v = (k == 0) ? 1.5 * (0.5*(v_arr(i,j,k)+v_arr(i,j+1,k))) - 0.5*(0.5*(v_arr(i,j,k+1)+v_arr(i,j+1,k+1))) :
395 0.25 * ( v_arr(i,j,k-1) + v_arr(i,j+1,k-1) + v_arr(i,j,k) + v_arr(i,j+1,k) );
397 amrex::Real
omega = w - met_zlo_xi * u - met_zlo_eta * v;
408 amrex::Real u, amrex::Real v,
409 const amrex::Array4<const amrex::Real>& z_nd,
410 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dxInv)
413 amrex::Real met_zlo_xi = 0.5 * dxInv[0] *
414 ( z_nd(i+1,j+1,k ) + z_nd(i+1,j ,k )
415 -z_nd(i ,j+1,k ) - z_nd(i ,j ,k ) );
418 amrex::Real met_zlo_eta = 0.5 * dxInv[1] *
419 ( z_nd(i+1,j+1,k ) + z_nd(i ,j+1,k )
420 -z_nd(i+1,j ,k ) - z_nd(i ,j ,k ) );
422 amrex::Real w =
omega + met_zlo_xi * u + met_zlo_eta * v;
433 const amrex::Array4<const amrex::Real>& u_arr,
434 const amrex::Array4<const amrex::Real>& v_arr,
435 const amrex::Array4<const amrex::Real>& z_nd,
436 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dxInv)
439 amrex::Real u = (k == 0) ? 1.5 * (0.5*(u_arr(i,j,k)+u_arr(i+1,j,k))) - 0.5*(0.5*(u_arr(i,j,k+1)+u_arr(i+1,j,k+1))) :
440 0.25 * ( u_arr(i,j,k-1) + u_arr(i+1,j,k-1) + u_arr(i,j,k) + u_arr(i+1,j,k) );
441 amrex::Real v = (k == 0) ? 1.5 * (0.5*(v_arr(i,j,k)+v_arr(i,j+1,k))) - 0.5*(0.5*(v_arr(i,j,k+1)+v_arr(i,j+1,k+1))) :
442 0.25 * ( v_arr(i,j,k-1) + v_arr(i,j+1,k-1) + v_arr(i,j,k) + v_arr(i,j+1,k) );
457 const amrex::Real& flux,
458 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dxInv,
459 const amrex::Array4<const amrex::Real>& zphys_arr,
460 const amrex::Array4<amrex::Real>& phi1_arr,
461 const amrex::Array4<amrex::Real>& phi2_arr,
462 const amrex::Array4<amrex::Real>& phi3_arr)
466 amrex::Real InvNorm = 1.0 / std::sqrt(1.0 + h_xi*h_xi + h_eta*h_eta);
467 phi1_arr(i,j,klo) = -h_xi * flux * InvNorm;
468 phi2_arr(i,j,klo) = -h_eta * flux * InvNorm;
469 phi3_arr(i,j,klo) = flux * InvNorm;
478 const amrex::Real& flux,
479 const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM>& dxInv,
480 const amrex::Array4<const amrex::Real>& zphys_arr,
481 const amrex::Array4<const amrex::Real>& u_arr,
482 const amrex::Array4<const amrex::Real>& v_arr,
483 const amrex::Array4<const amrex::Real>& w_arr,
484 const amrex::Array4<amrex::Real>& tau11_arr,
485 const amrex::Array4<amrex::Real>& tau22_arr,
486 const amrex::Array4<amrex::Real>& tau33_arr,
487 const amrex::Array4<amrex::Real>& tau12_arr,
488 const amrex::Array4<amrex::Real>& tau21_arr,
489 const amrex::Array4<amrex::Real>& tau13_arr,
490 const amrex::Array4<amrex::Real>& tau31_arr,
491 const amrex::Array4<amrex::Real>& tau23_arr,
492 const amrex::Array4<amrex::Real>& tau32_arr)
495 amrex::Array1D<amrex::Real,0,2> n_hat;
498 amrex::Array1D<amrex::Real,0,2> t_hat_1;
499 amrex::Array1D<amrex::Real,0,2> t_hat_2;
500 amrex::Array1D<amrex::Real,0,2> u_t_hat;
503 amrex::Array1D<amrex::Real,0,2> a_hat;
506 amrex::Array2D<amrex::Real,0,2,0,2> R_mat;
513 amrex::Real Inormn = 1./std::sqrt(1.0 + h_xi*h_xi + h_eta*h_eta);
514 n_hat(0) = -Inormn*h_xi; n_hat(1) = -Inormn*h_eta; n_hat(2) = Inormn;
517 amrex::Real Inorm1 = 1./std::sqrt(1.0 + h_xi*h_xi);
518 amrex::Real Inorm2 = 1./std::sqrt(1.0 + h_eta*h_eta);
519 t_hat_1(0) = Inorm1; t_hat_2(1) = Inorm2;
520 t_hat_1(2) = Inorm1*h_xi; t_hat_2(2) = Inorm2*h_eta;
523 amrex::Real Norm_u_t = 0.0;
524 amrex::Real mag1 = (u_arr(i,j,klo) + h_xi *w_arr(i,j,klo))*Inorm1;
525 amrex::Real mag2 = (v_arr(i,j,klo) + h_eta*w_arr(i,j,klo))*Inorm2;
526 for (
int icol(0); icol<3; ++icol) {
527 u_t_hat(icol) = mag1*t_hat_1(icol) + mag2*t_hat_2(icol);
528 Norm_u_t += u_t_hat(icol)*u_t_hat(icol);
530 for (
int icol(0); icol<3; ++icol) {
531 u_t_hat(icol) /= std::sqrt(Norm_u_t);
535 a_hat(0) = n_hat(1)*u_t_hat(2) - n_hat(2)*u_t_hat(1);
536 a_hat(1) = -(n_hat(0)*u_t_hat(2) - n_hat(2)*u_t_hat(0));
537 a_hat(2) = n_hat(1)*u_t_hat(1) - n_hat(1)*u_t_hat(0);
542 for (
int icol(0); icol<3; ++icol) {
543 R_mat(icol,jrow) = u_t_hat(icol);
546 for (
int icol(0); icol<3; ++icol) {
547 R_mat(icol,jrow) = a_hat(icol);
550 for (
int icol(0); icol<3; ++icol) {
551 R_mat(icol,jrow) = n_hat(icol);
555 tau11_arr(i,j,klo) = 2.0*R_mat(0,0)*R_mat(2,0)*flux;
556 tau22_arr(i,j,klo) = 2.0*R_mat(0,1)*R_mat(2,1)*flux;
557 tau33_arr(i,j,klo) = 2.0*R_mat(0,2)*R_mat(2,2)*flux;
559 tau12_arr(i,j,klo) = (R_mat(0,0)*R_mat(2,1) + R_mat(2,0)*R_mat(0,1))*flux;
560 tau21_arr(i,j,klo) = tau12_arr(i,j,klo);
562 tau13_arr(i,j,klo) = (R_mat(0,0)*R_mat(2,2) + R_mat(0,2)*R_mat(2,0))*flux;
563 tau31_arr(i,j,klo) = tau13_arr(i,j,klo);
565 tau23_arr(i,j,klo) = (R_mat(0,1)*R_mat(2,2) + R_mat(0,2)*R_mat(2,1))*flux;
566 tau32_arr(i,j,klo) = tau23_arr(i,j,klo);
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtEdgeCenterJ(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:295
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtEdgeCenterK(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:234
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtEdgeCenterJ(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:280
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtIface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:101
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterJ(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:266
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterK(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:221
void init_zlevels(amrex::Vector< amrex::Vector< amrex::Real >> &zlevels_stag, amrex::Vector< amrex::Vector< amrex::Real >> &stretched_dz_h, amrex::Vector< amrex::Gpu::DeviceVector< amrex::Real >> &stretched_dz_d, amrex::Vector< amrex::Geometry > const &geom, amrex::Vector< amrex::IntVect > const &ref_ratio, const amrex::Real grid_stretching_ratio, const amrex::Real zsurf, const amrex::Real dz0)
AMREX_FORCE_INLINE AMREX_GPU_DEVICE amrex::Real Compute_h_zeta_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:39
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtEdgeCenterI(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:310
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_Zrel_AtCellCenter(const int &i, const int &j, const int &k, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:352
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:69
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtKface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:173
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real WFromOmega(int i, int j, int k, amrex::Real omega, amrex::Real u, amrex::Real v, const amrex::Array4< const amrex::Real > &z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv)
Definition: ERF_TerrainMetrics.H:407
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void rotate_scalar_flux(const int &i, const int &j, const int &klo, const amrex::Real &flux, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv, const amrex::Array4< const amrex::Real > &zphys_arr, const amrex::Array4< amrex::Real > &phi1_arr, const amrex::Array4< amrex::Real > &phi2_arr, const amrex::Array4< amrex::Real > &phi3_arr)
Definition: ERF_TerrainMetrics.H:454
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real OmegaFromW(int i, int j, int k, amrex::Real w, const amrex::Array4< const amrex::Real > u_arr, const amrex::Array4< const amrex::Real > v_arr, const amrex::Array4< const amrex::Real > z_nd, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv)
Definition: ERF_TerrainMetrics.H:374
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtIface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:87
AMREX_GPU_DEVICE AMREX_FORCE_INLINE void rotate_stress_tensor(const int &i, const int &j, const int &klo, const amrex::Real &flux, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &dxInv, const amrex::Array4< const amrex::Real > &zphys_arr, const amrex::Array4< const amrex::Real > &u_arr, const amrex::Array4< const amrex::Real > &v_arr, const amrex::Array4< const amrex::Real > &w_arr, const amrex::Array4< amrex::Real > &tau11_arr, const amrex::Array4< amrex::Real > &tau22_arr, const amrex::Array4< amrex::Real > &tau33_arr, const amrex::Array4< amrex::Real > &tau12_arr, const amrex::Array4< amrex::Real > &tau21_arr, const amrex::Array4< amrex::Real > &tau13_arr, const amrex::Array4< amrex::Real > &tau31_arr, const amrex::Array4< amrex::Real > &tau23_arr, const amrex::Array4< amrex::Real > &tau32_arr)
Definition: ERF_TerrainMetrics.H:475
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtJface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:144
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtKface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:188
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtEdgeCenterK(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:249
void init_which_terrain_grid(int lev, const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::Vector< amrex::Real > const &z_levels_h)
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtIface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:116
void init_terrain_grid(int lev, const amrex::Geometry &geom, amrex::MultiFab &z_phys_nd, amrex::Vector< amrex::Real > const &z_levels_h, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtEdgeCenterI(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:324
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_zeta_AtJface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:130
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_xi_AtCellCenter(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:54
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtJface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:158
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtEdgeCenterI(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:337
AMREX_GPU_DEVICE AMREX_FORCE_INLINE amrex::Real Compute_h_eta_AtKface(const int &i, const int &j, const int &k, const amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > &cellSizeInv, const amrex::Array4< const amrex::Real > &z_nd)
Definition: ERF_TerrainMetrics.H:202
@ omega
Definition: ERF_SAM.H:49