Function for computing the stress with constant viscosity and with terrain.
46 gbx.grow(IntVect(0,0,1));
47 temp.resize(gbx,1, The_Async_Arena());
48 Array4<Real> rhoAlpha = temp.array();
51 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
52 rhoAlpha(i,j,k) = cell_data(i, j, k,
Rho_comp) * mu_eff;
56 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
57 rhoAlpha(i,j,k) = mu_eff;
67 bxcc2.grow(IntVect(-1,-1,0));
71 Real OneThird = (1./3.);
72 ParallelFor(bxcc, [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept {
73 tau11(i,j,k) -= OneThird*er_arr(i,j,k);
74 tau22(i,j,k) -= OneThird*er_arr(i,j,k);
75 tau33(i,j,k) -= OneThird*er_arr(i,j,k);
83 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
85 Real met_h_xi,met_h_eta;
89 Real tau31bar = 0.25 * ( tau31(i , j , k ) + tau31(i+1, j , k )
90 + tau31(i , j , k+1) + tau31(i+1, j , k+1) );
91 Real tau32bar = 0.25 * ( tau32(i , j , k ) + tau32(i , j+1, k )
92 + tau32(i , j , k+1) + tau32(i , j+1, k+1) );
93 Real mu_tot = rhoAlpha(i,j,k);
95 tau33(i,j,k) -= met_h_xi*tau31bar + met_h_eta*tau32bar;
96 tau33(i,j,k) *= -mu_tot;
105 Box planexz = tbxxz; planexz.setBig(2, planexz.smallEnd(2) );
107 ParallelFor(planexz,[=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
109 Real met_h_xi,met_h_eta,met_h_zeta;
114 Real tau11lo = 0.5 * ( tau11(i , j , k ) + tau11(i-1, j , k ) );
115 Real tau11hi = 0.5 * ( tau11(i , j , k+1) + tau11(i-1, j , k+1) );
116 Real tau11bar = 1.5*tau11lo - 0.5*tau11hi;
118 Real tau12lo = 0.5 * ( tau12(i , j , k ) + tau12(i , j+1, k ) );
119 Real tau12hi = 0.5 * ( tau12(i , j , k+1) + tau12(i , j+1, k+1) );
120 Real tau12bar = 1.5*tau12lo - 0.5*tau12hi;
122 Real mu_tot = 0.25*( rhoAlpha(i-1, j, k ) + rhoAlpha(i, j, k )
123 + rhoAlpha(i-1, j, k-1) + rhoAlpha(i, j, k-1) );
125 tau13(i,j,k) -= met_h_xi*tau11bar + met_h_eta*tau12bar;
126 tau13(i,j,k) *= -mu_tot;
128 tau31(i,j,k) *= -mu_tot*met_h_zeta;
131 Box planeyz = tbxyz; planeyz.setBig(2, planeyz.smallEnd(2) );
133 ParallelFor(planeyz,[=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
135 Real met_h_xi,met_h_eta,met_h_zeta;
140 Real tau21lo = 0.5 * ( tau21(i , j , k ) + tau21(i+1, j , k ) );
141 Real tau21hi = 0.5 * ( tau21(i , j , k+1) + tau21(i+1, j , k+1) );
142 Real tau21bar = 1.5*tau21lo - 0.5*tau21hi;
144 Real tau22lo = 0.5 * ( tau22(i , j , k ) + tau22(i , j-1, k ) );
145 Real tau22hi = 0.5 * ( tau22(i , j , k+1) + tau22(i , j-1, k+1) );
146 Real tau22bar = 1.5*tau22lo - 0.5*tau22hi;
148 Real mu_tot = 0.25*( rhoAlpha(i, j-1, k ) + rhoAlpha(i, j, k )
149 + rhoAlpha(i, j-1, k-1) + rhoAlpha(i, j, k-1) );
151 tau23(i,j,k) -= met_h_xi*tau21bar + met_h_eta*tau22bar;
152 tau23(i,j,k) *= -mu_tot;
154 tau32(i,j,k) *= -mu_tot*met_h_zeta;
159 Box planexz = tbxxz; planexz.setSmall(2, planexz.bigEnd(2) );
161 ParallelFor(planexz,[=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
163 Real met_h_xi,met_h_eta,met_h_zeta;
168 Real tau11lo = 0.5 * ( tau11(i , j , k-2) + tau11(i-1, j , k-2) );
169 Real tau11hi = 0.5 * ( tau11(i , j , k-1) + tau11(i-1, j , k-1) );
170 Real tau11bar = 1.5*tau11hi - 0.5*tau11lo;
172 Real tau12lo = 0.5 * ( tau12(i , j , k-2) + tau12(i , j+1, k-2) );
173 Real tau12hi = 0.5 * ( tau12(i , j , k-1) + tau12(i , j+1, k-1) );
174 Real tau12bar = 1.5*tau12hi - 0.5*tau12lo;
176 Real mu_tot = 0.25*( rhoAlpha(i-1, j, k ) + rhoAlpha(i, j, k )
177 + rhoAlpha(i-1, j, k-1) + rhoAlpha(i, j, k-1) );
179 tau13(i,j,k) -= met_h_xi*tau11bar + met_h_eta*tau12bar;
180 tau13(i,j,k) *= -mu_tot;
182 tau31(i,j,k) *= -mu_tot*met_h_zeta;
185 Box planeyz = tbxyz; planeyz.setSmall(2, planeyz.bigEnd(2) );
187 ParallelFor(planeyz,[=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
189 Real met_h_xi,met_h_eta,met_h_zeta;
194 Real tau21lo = 0.5 * ( tau21(i , j , k-2) + tau21(i+1, j , k-2) );
195 Real tau21hi = 0.5 * ( tau21(i , j , k-1) + tau21(i+1, j , k-1) );
196 Real tau21bar = 1.5*tau21hi - 0.5*tau21lo;
198 Real tau22lo = 0.5 * ( tau22(i , j , k-2) + tau22(i , j-1, k-2) );
199 Real tau22hi = 0.5 * ( tau22(i , j , k-1) + tau22(i , j-1, k-1) );
200 Real tau22bar = 1.5*tau22hi - 0.5*tau22lo;
202 Real mu_tot = 0.25*( rhoAlpha(i, j-1, k ) + rhoAlpha(i, j, k )
203 + rhoAlpha(i, j-1, k-1) + rhoAlpha(i, j, k-1) );
205 tau23(i,j,k) -= met_h_xi*tau21bar + met_h_eta*tau22bar;
206 tau23(i,j,k) *= -mu_tot;
208 tau32(i,j,k) *= -mu_tot*met_h_zeta;
216 ParallelFor(tbxxz,tbxyz,
217 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
219 Real met_h_xi,met_h_eta,met_h_zeta;
224 Real tau11bar = 0.25 * ( tau11(i , j , k ) + tau11(i-1, j , k )
225 + tau11(i , j , k-1) + tau11(i-1, j , k-1) );
226 Real tau12bar = 0.25 * ( tau12(i , j , k ) + tau12(i , j+1, k )
227 + tau12(i , j , k-1) + tau12(i , j+1, k-1) );
228 Real mu_tot = 0.25 * ( rhoAlpha(i-1, j , k ) + rhoAlpha(i , j , k )
229 + rhoAlpha(i-1, j , k-1) + rhoAlpha(i , j , k-1) );
231 tau13(i,j,k) -= met_h_xi*tau11bar + met_h_eta*tau12bar;
232 tau13(i,j,k) *= -mu_tot;
234 tau31(i,j,k) *= -mu_tot*met_h_zeta;
236 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
238 Real met_h_xi,met_h_eta,met_h_zeta;
243 Real tau21bar = 0.25 * ( tau21(i , j , k ) + tau21(i+1, j , k )
244 + tau21(i , j , k-1) + tau21(i+1, j , k-1) );
245 Real tau22bar = 0.25 * ( tau22(i , j , k ) + tau22(i , j-1, k )
246 + tau22(i , j , k-1) + tau22(i , j-1, k-1) );
247 Real mu_tot = 0.25 * ( rhoAlpha(i , j-1, k ) + rhoAlpha(i , j , k )
248 + rhoAlpha(i , j-1, k-1) + rhoAlpha(i , j , k-1) );
250 tau23(i,j,k) -= met_h_xi*tau21bar + met_h_eta*tau22bar;
251 tau23(i,j,k) *= -mu_tot;
253 tau32(i,j,k) *= -mu_tot*met_h_zeta;
258 ParallelFor(bxcc,tbxxy,
259 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
261 Real met_h_zeta = detJ(i,j,k);
262 Real mu_tot = rhoAlpha(i,j,k);
264 tau11(i,j,k) *= -mu_tot*met_h_zeta;
265 tau22(i,j,k) *= -mu_tot*met_h_zeta;
267 [=] AMREX_GPU_DEVICE (
int i,
int j,
int k) noexcept
271 Real mu_tot = 0.25*( rhoAlpha(i-1, j , k) + rhoAlpha(i, j , k)
272 + rhoAlpha(i-1, j-1, k) + rhoAlpha(i, j-1, k) );
274 tau12(i,j,k) *= -mu_tot*met_h_zeta;
275 tau21(i,j,k) *= -mu_tot*met_h_zeta;
#define Rho_comp
Definition: ERF_IndexDefines.H:36
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_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_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
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_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_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_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_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