28 auto dx = geom.CellSizeArray();
29 auto ProbHiArr = geom.ProbHiArray();
30 auto ProbLoArr = geom.ProbLoArray();
32 amrex::ignore_unused(rho_w_initial_state);
35 const Box& domain = geom.Domain();
36 int domlo_x = domain.smallEnd(0);
37 int domhi_x = domain.bigEnd(0) + 1;
38 int domlo_y = domain.smallEnd(1);
39 int domhi_y = domain.bigEnd(1) + 1;
48 Real xlo_sponge_end = ProbLoArr[0] + hindcast_lateral_sponge_length;
49 Real xhi_sponge_start = ProbHiArr[0] - hindcast_lateral_sponge_length;
50 Real ylo_sponge_end = ProbLoArr[1] + hindcast_lateral_sponge_length;
51 Real yhi_sponge_start = ProbHiArr[1] - hindcast_lateral_sponge_length;
52 Real zhi_sponge_start = ProbHiArr[2] - hindcast_zhi_sponge_length;
54 AMREX_ALWAYS_ASSERT(xlo_sponge_end > ProbLoArr[0]);
55 AMREX_ALWAYS_ASSERT(xhi_sponge_start < ProbHiArr[0]);
56 AMREX_ALWAYS_ASSERT(ylo_sponge_end > ProbLoArr[1]);
57 AMREX_ALWAYS_ASSERT(yhi_sponge_start < ProbHiArr[1]);
59 ParallelFor(tbx, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
61 int ii = amrex::min(amrex::max(i, domlo_x), domhi_x);
62 int jj = amrex::min(amrex::max(j, domlo_y), domhi_y);
64 Real x = ProbLoArr[0] + ii * dx[0];
65 Real y = ProbLoArr[1] + (jj+0.5) * dx[1];
67 Real rho_u_sponge = rho_u_initial_state(i,j,k)*cons_initial_state(i,j,k,0);
69 if (x < xlo_sponge_end) {
70 Real xi = (xlo_sponge_end -
x) / hindcast_lateral_sponge_length;
71 rho_u_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_u(i, j, k) - rho_u_sponge);
74 if (x > xhi_sponge_start) {
75 Real xi = (
x - xhi_sponge_start) / hindcast_lateral_sponge_length;
76 rho_u_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_u(i, j, k) - rho_u_sponge);
79 if (y < ylo_sponge_end) {
80 Real xi = (ylo_sponge_end -
y) / hindcast_lateral_sponge_length;
81 rho_u_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_u(i, j, k) - rho_u_sponge);
84 if (y > yhi_sponge_start) {
85 Real xi = (
y - yhi_sponge_start) / hindcast_lateral_sponge_length;
86 rho_u_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_u(i, j, k) - rho_u_sponge);
91 ParallelFor(tby, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
93 int ii = amrex::min(amrex::max(i, domlo_x), domhi_x);
94 int jj = amrex::min(amrex::max(j, domlo_y), domhi_y);
96 Real x = ProbLoArr[0] + (ii+0.5) * dx[0];
97 Real y = ProbLoArr[1] + jj * dx[1];
99 Real rho_v_sponge = rho_v_initial_state(i,j,k)*cons_initial_state(i,j,k,0);
102 if (x < xlo_sponge_end) {
103 Real xi = (xlo_sponge_end -
x) / hindcast_lateral_sponge_length;
104 rho_v_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_v(i, j, k) - rho_v_sponge);
107 if (x > xhi_sponge_start) {
108 Real xi = (
x - xhi_sponge_start) / hindcast_lateral_sponge_length;
109 rho_v_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_v(i, j, k) - rho_v_sponge);
113 if (y < ylo_sponge_end) {
114 Real xi = (ylo_sponge_end -
y) / hindcast_lateral_sponge_length;
115 rho_v_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_v(i, j, k) - rho_v_sponge);
118 if (y > yhi_sponge_start) {
119 Real xi = (
y - yhi_sponge_start) / hindcast_lateral_sponge_length;
120 rho_v_rhs(i, j, k) -= hindcast_lateral_sponge_strength * xi * xi * (rho_v(i, j, k) - rho_v_sponge);
124 ParallelFor(tbz, [=] AMREX_GPU_DEVICE(
int i,
int j,
int k)
126 Real z = z_phys_nd(i,j,k);
128 if(hindcast_zhi_sponge_damping){
129 if (z > zhi_sponge_start) {
130 Real xi = (
z - zhi_sponge_start) / hindcast_zhi_sponge_length;
131 rho_w_rhs(i, j, k) -= hindcast_zhi_sponge_strength * xi * xi * (rho_w(i, j, k) - 0.0);
amrex::Real Real
Definition: ERF_ShocInterface.H:19
amrex::Real hindcast_lateral_sponge_strength
Definition: ERF_DataStruct.H:955
amrex::Real hindcast_zhi_sponge_length
Definition: ERF_DataStruct.H:956
bool hindcast_zhi_sponge_damping
Definition: ERF_DataStruct.H:957
amrex::Real hindcast_lateral_sponge_length
Definition: ERF_DataStruct.H:955
amrex::Real hindcast_zhi_sponge_strength
Definition: ERF_DataStruct.H:956