REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticSMFlux_DoubleGyre.H
Go to the documentation of this file.
1 const auto prob_lo = geomdata.ProbLo();
2 const auto prob_hi = geomdata.ProbHi();
3 const auto dx = geomdata.CellSize();
4
5 //If we had wind stress and bottom stress we would need to set these:
6 Real pi = 3.14159265359_rt;
7
8 const Real yextent = prob_hi[1] - prob_lo[1];
9 const Real windamp = -0.05_rt / m_solverChoice.rho0;
10 const Real val1 = 2.0_rt * pi / yextent;
11 const Real prob_lo_y = prob_lo[1];
12 const Real dy = dx[1];
13 for ( MFIter mfi((mf_sustr), TilingIfNotGPU()); mfi.isValid(); ++mfi )
14 {
15 const Box& bx = mfi.tilebox();
16 [[maybe_unused]] const Box& xbx = surroundingNodes(bx,0);
17 const Box& xbx2 = mfi.grownnodaltilebox(0, IntVect(NGROW,NGROW,0));
18
19 Array4<Real> const& sustr = mf_sustr.array(mfi);
20 ParallelFor(xbx2, [=] AMREX_GPU_DEVICE(int i, int j, int /*k*/) noexcept
21 {
22 const Real y = prob_lo_y + (j + 0.5) * dy;// - ycent;
23
24 sustr(i,j,0) = windamp * std::cos(val1 * y);
25 });
26 }
27 mf_svstr.setVal(0.0_rt);
#define NGROW