REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_ParticlesOverSeamount.H
Go to the documentation of this file.
1
2 ParmParse pp_prob("remora.prob");
3 Real u_0 = 0.0; pp_prob.query("u_0", u_0);
4 Real v_0 = 0.0; pp_prob.query("v_0", v_0);
5 Real z0 = 0.1; pp_prob.query("z0", z0); // Surface Roughness
6 Real zRef = 80.; pp_prob.query("zRef", zRef); // Reference Height
7 Real uRef = 0.0; pp_prob.query("uRef", uRef); // Reference Wind Speed
8
9 auto geomdata = geom.data();
10 const int khi = geomdata.Domain().bigEnd()[2];
11
12 bool l_use_salt = m_solverChoice.use_salt;
13
14 for (MFIter mfi(mf_cons, TilingIfNotGPU()); mfi.isValid(); ++mfi)
15 {
16 const Box &bx = mfi.tilebox();
17 AMREX_ALWAYS_ASSERT(bx.length()[2] == khi+1);
18
19 Array4< Real> const& state = mf_cons.array(mfi);
20 Array4< Real> const& x_vel = mf_xvel.array(mfi);
21 Array4< Real> const& y_vel = mf_yvel.array(mfi);
22
23 Array4<const Real> const& z_r = remora.vec_z_r[lev]->const_array(mfi);
24
25 Real S0 = m_solverChoice.S0;
26 Real T0 = m_solverChoice.T0;
27 ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
28 {
29 // Geometry (note we must include these here to get the data on device)
30 // const auto prob_lo = geomdata.ProbLo();
31 // const auto dx = geomdata.CellSize();
32
33 // const Real x = prob_lo[0] + (i + 0.5) * dx[0];
34 // const Real y = prob_lo[1] + (j + 0.5) * dx[1];
35 const Real z = z_r(i,j,k);
36
37 state(i, j, k, Temp_comp) = 1.;
38
39 state(i,j,k,Temp_comp)=T0+8.0_rt*std::exp(z/50.0_rt);
40 if (l_use_salt) {
41 state(i,j,k,Salt_comp)=S0;
42 }
43
44 // Set tracer = 0 everywhere
45 state(i, j, k, Tracer_comp) = 0.0_rt;
46 });
47
48 // Construct a box that is on x-faces
49 const Box& xbx = surroundingNodes(bx,0);
50 // Set the x-velocity
51 ParallelFor(xbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
52 {
53 const Real z = -z_r(i,j,k);
54
55 // Set the x-velocity
56 x_vel(i, j, k) = u_0 + uRef * std::log((z + z0)/z0) / std::log((zRef +z0)/z0);
57 });
58
59 // Construct a box that is on y-faces
60 const Box& ybx = surroundingNodes(bx,1);
61
62 // Set the y-velocity
63 ParallelFor(ybx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
64 {
65 y_vel(i, j, k) = 0.0_rt;
66 });
67 }
#define Temp_comp
#define Tracer_comp
#define Salt_comp
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
ParmParse pp_prob("remora.prob")