|
189 | 189 | for (int i = 0; i <= AMREX_SPACEDIM; ++i) { |
190 | 190 | dUdt[i].setVal(0.0, 0, ncomp_fast[i], dUdt[i].nGrow()); |
191 | 191 | MultiFab::Copy(dUdt[i], F_slow[i], 0, 0, F_slow[i].nComp(), 0); |
192 | | - dUdt[i].FillBoundary(fine_geom.periodicity()); |
193 | 192 | dUdt[i].setDomainBndry(1.234e10, 0, ncomp_fast[i], fine_geom); |
| 193 | + dUdt[i].FillBoundary(fine_geom.periodicity()); |
194 | 194 | } |
195 | 195 |
|
196 | 196 | BCRec const* bc_ptr_d = domain_bcs_type_d.data(); |
| 197 | + IntVect ngv = S_old[IntVars::cons].nGrowVect(); |
| 198 | + |
| 199 | + MultiFab S_pert_cons(ba, dm, S_old[IntVars::cons].nComp(), ngv, MFInfo(), EBFactory(level)); |
| 200 | + MultiFab rt0(ba, dm, 1, ngv, MFInfo(), EBFactory(level)); |
| 201 | + |
| 202 | + // Copy S_old into S_pert |
| 203 | + MultiFab::Copy(S_pert_cons, S_old[IntVars::cons],0,0,S_pert_cons.nComp(), ngv); |
| 204 | + |
| 205 | + // Copy theta0 into rt0 |
| 206 | + MultiFab::Copy(rt0,base_state[level],BaseState::th0_comp,0,1,ngv); |
197 | 207 |
|
198 | | - // Update F_slow by Redistribution. |
| 208 | + // Multiply theta0 by rho0 in rt0 |
| 209 | + MultiFab::Multiply(rt0,base_state[level],BaseState::r0_comp,0,1,ngv); |
199 | 210 |
|
200 | | - redistribute_term ( ncomp_fast[IntVars::cons], fine_geom, F_slow[IntVars::cons], dUdt[IntVars::cons], |
201 | | - S_old[IntVars::cons], EBFactory(level), bc_ptr_d, slow_dt); |
202 | | - redistribute_term ( ncomp_fast[IntVars::xmom], fine_geom, F_slow[IntVars::xmom], dUdt[IntVars::xmom], |
203 | | - S_old[IntVars::xmom], *(get_eb(level).get_u_const_factory()), bc_ptr_d, slow_dt, IntVars::xmom); |
204 | | - redistribute_term ( ncomp_fast[IntVars::ymom], fine_geom, F_slow[IntVars::ymom], dUdt[IntVars::ymom], |
205 | | - S_old[IntVars::ymom], *(get_eb(level).get_v_const_factory()), bc_ptr_d, slow_dt, IntVars::ymom); |
206 | | - redistribute_term ( ncomp_fast[IntVars::zmom], fine_geom, F_slow[IntVars::zmom], dUdt[IntVars::zmom], |
207 | | - S_old[IntVars::zmom], *(get_eb(level).get_w_const_factory()), bc_ptr_d, slow_dt, IntVars::zmom); |
| 211 | + MultiFab::Subtract(S_pert_cons, base_state[level], BaseState::r0_comp,0,1,ngv); |
| 212 | + MultiFab::Subtract(S_pert_cons, rt0 , 0,1,1,ngv); |
208 | 213 |
|
209 | | - // Update state using the updated F_slow. (NOTE: redistribute_term returns RHS not state variables.) |
| 214 | + // Update F_slow for perturbational fast quantites (rho - rho0) and (rho_theta - rho_theta_0) |
| 215 | + redistribute_term(ncomp_fast[IntVars::cons], fine_geom, F_slow[IntVars::cons], dUdt[IntVars::cons], |
| 216 | + S_pert_cons, EBFactory(level), bc_ptr_d, slow_dt); |
210 | 217 |
|
| 218 | + // Update F_slow for momenta |
| 219 | + redistribute_term(ncomp_fast[IntVars::xmom], fine_geom, F_slow[IntVars::xmom], dUdt[IntVars::xmom], |
| 220 | + S_old[IntVars::xmom], *(get_eb(level).get_u_const_factory()), bc_ptr_d, slow_dt, IntVars::xmom); |
| 221 | + redistribute_term(ncomp_fast[IntVars::ymom], fine_geom, F_slow[IntVars::ymom], dUdt[IntVars::ymom], |
| 222 | + S_old[IntVars::ymom], *(get_eb(level).get_v_const_factory()), bc_ptr_d, slow_dt, IntVars::ymom); |
| 223 | + redistribute_term(ncomp_fast[IntVars::zmom], fine_geom, F_slow[IntVars::zmom], dUdt[IntVars::zmom], |
| 224 | + S_old[IntVars::zmom], *(get_eb(level).get_w_const_factory()), bc_ptr_d, slow_dt, IntVars::zmom); |
| 225 | + |
| 226 | + |
| 227 | + // Update state using the updated F_slow. |
211 | 228 | for ( MFIter mfi(S_sum[IntVars::cons],TilingIfNotGPU()); mfi.isValid(); ++mfi) |
212 | 229 | { |
213 | 230 | const Box bx = mfi.tilebox(); |
|
270 | 287 | if (vfrac_w(i,j,k) > 0.0) { |
271 | 288 | ssum[IntVars::zmom](i,j,k) = sold[IntVars::zmom](i,j,k) |
272 | 289 | + slow_dt * fslow[IntVars::zmom](i,j,k); |
| 290 | + |
273 | 291 | } |
274 | 292 | }); |
275 | 293 | } // MFIter |
276 | | - |
277 | 294 | } // EB |
278 | | - |
279 | 295 | } // omp |
280 | 296 |
|
281 | 297 | // Even if we update all the conserved variables we don't need |
|
0 commit comments