REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
REMORA_InitAnalyticProb_BoundaryLayer.H
Go to the documentation of this file.
1
2
// Whether this run carries a passive dye tracer. nComp() cannot answer this: with
3
// biology active and no dye, Tracer_comp is the first biology component, so testing
4
// nComp() would write the dye initial value into NO3.
5
const
bool
l_do_dye
= (
remora
.num_passive_scalars() > 0);
6
auto
T0
=
m_solverChoice
.T0;
7
auto
S0
=
m_solverChoice
.S0;
8
9
auto
geomdata
=
geom
.data();
10
11
const
int
khi
=
geomdata
.Domain().bigEnd()[2];
12
13
for
(
MFIter
mfi
(
mf_cons
,
TilingIfNotGPU
());
mfi
.isValid(); ++
mfi
)
14
{
15
const
Box &
bx
=
mfi
.tilebox();
16
AMREX_ALWAYS_ASSERT
(
bx
.length()[2] ==
khi
+1);
17
18
Array4< Real>
const
&
state
=
mf_cons
.array(
mfi
);
19
Array4< Real>
const
&
x_vel
=
mf_xvel
.array(
mfi
);
20
Array4< Real>
const
&
y_vel
=
mf_yvel
.array(
mfi
);
21
22
Array4<const Real>
const
& z_r =
remora
.vec_z_r[
lev
]->const_array(
mfi
);
23
24
ParallelFor
(
grow
(
bx
,IntVect(1,1,0)), [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
25
{
26
const
Real
z
= z_r(
i
,
j
,
k
);
27
Real
val1
= std::tanh(Real(1.1) *
z
+ Real(11.0));
28
state
(
i
,
j
,
k
,
Temp_comp
)=
T0
+Real(6.25)*
val1
;
29
state
(
i
,
j
,
k
,
Salt_comp
)=
S0
-Real(0.75)*
val1
;
30
31
if
(
l_do_dye
) {
state
(
i
,
j
,
k
,
Tracer_comp
) =
zero
; }
32
});
33
34
const
Box&
xbx
=
surroundingNodes
(
bx
,0);
35
const
Box&
ybx
=
surroundingNodes
(
bx
,1);
36
ParallelFor
(
xbx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
37
{
38
x_vel
(
i
,
j
,
k
) =
zero
;
39
});
40
ParallelFor
(
ybx
, [=]
AMREX_GPU_DEVICE
(
int
i
,
int
j
,
int
k
)
noexcept
41
{
42
y_vel
(
i
,
j
,
k
) =
zero
;
43
});
44
}
45
Gpu::streamSynchronize();
zero
constexpr amrex::Real zero
Definition
REMORA_Constants.H:6
Coord::z
@ z
Temp_comp
#define Temp_comp
Definition
REMORA_IndexDefines.H:10
Tracer_comp
#define Tracer_comp
Definition
REMORA_IndexDefines.H:12
Salt_comp
#define Salt_comp
Definition
REMORA_IndexDefines.H:11
setVal
mf_h setVal(geomdata.ProbHi(2))
AMREX_ALWAYS_ASSERT
AMREX_ALWAYS_ASSERT(!NSPeriodic||!EWPeriodic)
T0
auto T0
Definition
REMORA_InitAnalyticProb_BoundaryLayer.H:6
geomdata
auto geomdata
Definition
REMORA_InitAnalyticProb_BoundaryLayer.H:9
khi
const int khi
Definition
REMORA_InitAnalyticProb_BoundaryLayer.H:11
S0
auto S0
Definition
REMORA_InitAnalyticProb_BoundaryLayer.H:7
l_do_dye
const bool l_do_dye
Definition
REMORA_InitAnalyticProb_BoundaryLayer.H:5
val1
Real val1
Definition
REMORA_InitAnalyticProb_DoubleGyre.H:12
Source
Prob
REMORA_InitAnalyticProb_BoundaryLayer.H
Generated by
1.9.8