REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_BoundaryLayer.H
Go to the documentation of this file.
1
2 auto T0 = m_solverChoice.T0;
3 auto S0 = m_solverChoice.S0;
4
5 auto geomdata = geom.data();
6
7 const int khi = geomdata.Domain().bigEnd()[2];
8
9 for (MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi)
10 {
11 const Box &bx = mfi.tilebox();
12 AMREX_ALWAYS_ASSERT(bx.length()[2] == khi+1);
13
14 Array4< Real> const& state = mf_cons.array(mfi);
15 Array4< Real> const& x_vel = mf_xvel.array(mfi);
16 Array4< Real> const& y_vel = mf_yvel.array(mfi);
17
18 Array4<const Real> const& z_r = remora.vec_z_r[lev]->const_array(mfi);
19
20 ParallelFor(grow(bx,IntVect(1,1,0)), [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
21 {
22 const Real z = z_r(i,j,k);
23 Real val1 = std::tanh(1.1_rt * z + 11.0_rt);
24 state(i,j,k,Temp_comp)=T0+6.25_rt*val1;
25 state(i,j,k,Salt_comp)=S0-0.75_rt*val1;
26
27 state(i, j, k, Tracer_comp) = 0.0_rt;
28 });
29
30 const Box& xbx = surroundingNodes(bx,0);
31 const Box& ybx = surroundingNodes(bx,1);
32 ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
33 {
34 x_vel(i, j, k) = 0.0_rt;
35 });
36 ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
37 {
38 y_vel(i, j, k) = 0.0_rt;
39 });
40 }
41 Gpu::streamSynchronize();
#define Temp_comp
#define Tracer_comp
#define Salt_comp
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)