11 Vector<MultiFab>& S_old,
12 Vector<MultiFab>& S_data,
13 const double old_step_time,
14 const double old_stage_time,
15 const double new_stage_time,
18 BL_PROFILE(
"slow_rhs_fun_pre");
31 if (verbose) Print() << std::setprecision(timeprecision)
32 <<
"Making slow rhs at time " << old_stage_time
33 <<
" for fast variables advancing from " << old_step_time
34 <<
" to " << new_stage_time << std::endl;
36 double slow_dt = new_stage_time - old_step_time;
38 const GpuArray<Real, AMREX_SPACEDIM>
dxInv = fine_geom.InvCellSizeArray();
43 YAFluxRegister* fr_as_crse =
nullptr;
44 YAFluxRegister* fr_as_fine =
nullptr;
45 if (solverChoice.coupling_type == CouplingType::TwoWay && finest_level > 0) {
46 if (level < finest_level) {
47 fr_as_crse = getAdvFluxReg(level+1);
51 if (nrk == 0) { fr_as_crse->reset(); }
54 fr_as_fine = getAdvFluxReg(level);
63 MultiFab* forest_drag = (solverChoice.do_forest_drag) ?
64 m_forest_drag[level]->get_drag_field() :
nullptr;
65 MultiFab* frontal_area = (solverChoice.do_forest_drag) ?
66 m_forest_drag[level]->get_frontal_area() :
nullptr;
69 MultiFab* terrain_blank = (solverChoice.terrain_type == TerrainType::ImmersedForcing ||
70 solverChoice.buildings_type == BuildingsType::ImmersedForcing) ?
71 terrain_blanking[level].
get() :
nullptr;
72 MultiFab* terrain_blank_xface = (solverChoice.terrain_type == TerrainType::ImmersedForcing ||
73 solverChoice.buildings_type == BuildingsType::ImmersedForcing) ?
74 terrain_blanking_xface[level].
get() :
nullptr;
75 MultiFab* terrain_blank_yface = (solverChoice.terrain_type == TerrainType::ImmersedForcing ||
76 solverChoice.buildings_type == BuildingsType::ImmersedForcing) ?
77 terrain_blanking_yface[level].
get() :
nullptr;
78 MultiFab* terrain_blank_zface = (solverChoice.terrain_type == TerrainType::ImmersedForcing ||
79 solverChoice.buildings_type == BuildingsType::ImmersedForcing) ?
80 terrain_blanking_zface[level].
get() :
nullptr;
85 int n_qstate_into_total = micro->Get_Qstate_Moist_Size() - micro->Get_Qstate_Moist_NumConc_Size();
89 MultiFab p0_to_use, base_to_use;
90 MultiFab *zpn_to_use, *zpc_to_use, *ax_to_use, *ay_to_use, *az_to_use, *dJ_to_use;
93 std::unique_ptr<MultiFab> z_t_pert;
94 if ( solverChoice.terrain_type == TerrainType::MovingFittedMesh )
101 zpn_to_use = z_phys_nd_src[level].get();
102 zpc_to_use = z_phys_cc_src[level].get();
103 ax_to_use = ax_src[level].get();
104 ay_to_use = ay_src[level].get();
105 az_to_use = az_src[level].get();
106 dJ_to_use = detJ_cc_src[level].get();
111 zpn_to_use = z_phys_nd[level].get();
112 zpc_to_use = z_phys_cc[level].get();
113 ax_to_use = ax[level].get();
114 ay_to_use = ay[level].get();
115 az_to_use = az[level].get();
116 dJ_to_use = detJ_cc[level].get();
120 bool l_use_IF = (solverChoice.terrain_type == TerrainType::ImmersedForcing ||
121 solverChoice.buildings_type == BuildingsType::ImmersedForcing);
122 Table1D<Real> r_avg_to_pass = l_use_IF ? r_plane_avg[level].table() : Table1D<Real>();
123 Table1D<Real> t_avg_to_pass = l_use_IF ? t_plane_avg[level].table() : Table1D<Real>();
129 S_data, S_prim, cc_src, base_state[level], zpc_to_use,
130 xvel_new, yvel_new, zvel_new,
131 qheating_rates[level].
get(),
132 terrain_blank, fine_geom, solverChoice,
134 rhotheta_src[level].
get(), rhoqt_src[level].
get(),
135 dptr_wbar_sub, d_rayleigh_ptrs_at_lev, d_sinesq_at_lev,
137 r_avg_to_pass, t_avg_to_pass,
139 true, ib_wall_hfx[level].
get(), ib_wall_ktarget[level].
get(), ib_wall_qfx[level].
get());
147 m_dust_model->add_sources(level, cc_src, S_data[
IntVars::cons], *dJ_to_use, fine_geom, slow_dt);
158 Vector<const MultiFab*> mf_mx(finest_level+1), mf_my(finest_level+1);
159 for (
int lev = 0; lev <= finest_level; ++lev) {
163 m_mass_source->update_geometry(finest_level, Geom(), grids, dmap, ref_ratio,
164 z_phys_nd, detJ_cc, mf_mx, mf_my,
165 [
this] (
int lev, MultiFab& slab) { fill_surface_nodes(lev, slab); });
166 m_mass_source->add_sources(level, cc_src, S_data[
IntVars::cons], zpn_to_use,
167 fine_geom, old_stage_time);
179 if (m_fire_coupler && level == m_fire_coupler->level()) {
181 m_fire_coupler->add_sources(cc_src,
193 if (ibseb_params.enable && ibseb_params.couple_heat &&
194 level <
static_cast<int>(m_ibseb.size()) && m_ibseb[level]) {
195 m_ibseb[level]->add_heat_flux_to_source(cc_src, S_data[
IntVars::cons], fine_geom,
196 solverChoice.c_p, solverChoice.rdOcp);
200 if (solverChoice.nudging_from_observations &&
obs_nudging) {
201 obs_nudging->add_theta_source(level, old_stage_time,
static_cast<Real
>(slow_dt), fine_geom,
208 #if defined(ERF_USE_NETCDF)
209 if ( solverChoice.use_real_bcs && (level==0) &&
212 Real bdy_factor = solverChoice.bdy_nudge_factor;
213 Real l_rdOcp = solverChoice.rdOcp;
214 Real l_c_p = solverChoice.c_p;
215 int moist_nudge_type = solverChoice.bdy_moist_nudge_type;
216 int num_q = micro->Get_Qstate_Moist_Size() - micro->Get_Qstate_Moist_NumConc_Size();
218 (solverChoice.moisture_type != MoistureType::Morrison_NoIce &&
219 solverChoice.moisture_type != MoistureType::SAM_NoIce) );
220 add_moist_nudging_terms(S_data[
IntVars::cons], cc_src, num_q, slow_dt,
221 old_stage_time, start_time,
222 start_bdy_time, final_bdy_time, bdy_time_interval,
223 bdy_factor, real_width, geom[level],
224 bdy_data_xlo, bdy_data_xhi, bdy_data_ylo, bdy_data_yhi,
225 m_r2d, l_c_p, l_rdOcp,
226 solverChoice.moisture_indices,
227 solverChoice.use_wrf_bdy_density, moist_nudge_type);
234 if (solverChoice.do_forest_drag && solverChoice.forest_biophysics &&
235 solverChoice.forest_biophysics_heat && frontal_area) {
238 xvel_new, yvel_new, zvel_new,
239 frontal_area, base_to_use,
247 base_to_use,
qt, *zpc_to_use,
249 get_eb(level), gradp[level]);
254 if (MultiFab* P_reflux = momentum_reflux_pressure(level)) {
255 momentum_reflux_add_slow(level, *P_reflux, S_data[
IntVars::cons], p0_to_use,
qt,
258 static_cast<Real
>(slow_dt));
265 int num_q = micro->Get_Qstate_Moist_Size() - micro->Get_Qstate_Moist_NumConc_Size();
266 make_buoyancy(level, S_data, S_prim,
qt, buoyancy, fine_geom, solverChoice, base_to_use,
267 num_q, get_eb(level), solverChoice.compressibility_type[level] == CompressibilityType::Anelastic);
273 S_data, zpn_to_use, zpc_to_use, stretched_dz_h[level],
274 xvel_new, yvel_new, zvel_new,
275 xmom_src, ymom_src, zmom_src,
276 base_to_use, forest_drag, terrain_blank,
277 terrain_blank_xface, terrain_blank_yface, terrain_blank_zface,
278 cosPhi_m[level].
get(), sinPhi_m[level].
get(), fine_geom, solverChoice,
280 (solverChoice.have_geo_wind_profile) ? d_u_geos[level].data():
nullptr,
281 (solverChoice.have_geo_wind_profile) ? d_v_geos[level].data():
nullptr,
282 dptr_wbar_sub, d_rayleigh_ptrs_at_lev, d_sinesq_at_lev, d_sinesq_stag_at_lev,
283 d_sponge_ptrs_at_lev,
284 (solverChoice.hindcast_lateral_forcing? &forecast_state_interp[level] :
nullptr),
285 sounding_at_level(level), lsf_at_level(level), lsf_data[level],
286 get_eb(level),
true);
288 #ifdef ERF_USE_MOVING_BODIES
290 if (m_structure_model && level == m_structure_model->level(finest_level)) {
291 m_structure_model->add_momentum_sources(level, xmom_src, ymom_src, zmom_src);
294 if (m_structure_model && level < m_structure_model->level(finest_level) &&
295 level <
static_cast<int>(m_structure_crse_src.size()) &&
296 m_structure_crse_src[level][0].isDefined()) {
297 MultiFab::Add(xmom_src, m_structure_crse_src[level][0], 0, 0, 1, 0);
298 MultiFab::Add(ymom_src, m_structure_crse_src[level][1], 0, 0, 1, 0);
299 MultiFab::Add(zmom_src, m_structure_crse_src[level][2], 0, 0, 1, 0);
305 if (momentum_reflux_enabled()) {
306 momentum_reflux_add_sources(level, xmom_src, ymom_src);
310 if (solverChoice.nudging_from_observations &&
obs_nudging) {
311 obs_nudging->add_momentum_sources(level, old_stage_time,
static_cast<Real
>(slow_dt), fine_geom,
313 xmom_src, ymom_src, zmom_src, zpn_to_use,
314 terrain_blank_xface, terrain_blank_yface,
315 terrain_blank_zface);
322 xflux_imask[level], yflux_imask[level], zflux_imask[level],
323 thin_xforce[level], thin_yforce[level], thin_zforce[level]);
330 Array<const MultiFab*,AMREX_SPACEDIM> upw_dir{AMREX_D_DECL(
nullptr,
nullptr,
nullptr)};
331 const bool l_pi_src = (solverChoice.compressibility_type[level] == CompressibilityType::PseudoIncompressible &&
332 solverChoice.terrain_type != TerrainType::EB);
334 for (
auto* m : {&pi_adv_rt[level], &pi_src[level]}) {
335 if (!*m || (*m)->boxArray() != grids[level] || (*m)->DistributionMap() != dmap[level]) {
336 *m = std::make_unique<MultiFab>(grids[level], dmap[level], 1, 0);
337 (*m)->setVal(zero_d);
342 define_pi_upw_dir(level);
343 for (
int idim = 0; idim < AMREX_SPACEDIM; ++idim) {
344 MultiFab::Copy(*pi_upw_dir_stage[level][idim], *pi_upw_dir[level][idim], 0, 0, 1, 0);
345 upw_dir[idim] = pi_upw_dir_stage[level][idim].get();
353 S_prim,
qt, avg_xmom[level], avg_ymom[level], avg_zmom[level], upw_dir,
354 l_pi_src ? pi_adv_rt[level].
get() :
nullptr,
355 xvel_new, yvel_new, zvel_new,
356 z_t_rk[level], cc_src, xmom_src, ymom_src, zmom_src, buoyancy,
357 (level > 0) ? &zmom_crse_rhs[level] :
nullptr,
358 Tau[level], Tau_corr[level], Tau_EB[level],
359 SmnSmn, eddyDiffs, Hfx1, Hfx2, Hfx3, Q1fx1, Q1fx2, Q1fx3, Q2fx3, Diss, mf_surface_fluxes,
360 Hfx3_EB, fine_geom, solverChoice, m_SurfaceLayer, domain_bcs_type_d, domain_bcs_type,
361 *zpn_to_use, *zpc_to_use, *ax_to_use, *ay_to_use, *az_to_use, *dJ_to_use,
362 stretched_dz_d[level], gradp[level],
363 mapfac[level], get_eb(level), physbnd_mask,
364 native_shoc_driver[level].
get(),
365 fr_as_crse, fr_as_fine, &base_to_use,
366 cloud_chamber_config.active ? &cloud_chamber_config :
nullptr,
367 cloud_chamber_budget.get(),
368 ib_wall_face13[level].get(), ib_wall_face23[level].get(),
369 ib_wall_face33[level].get(), ib_wall_hfx[level].get(),
370 walldist[level].get());
375 if (solverChoice.compressibility_type[level] != CompressibilityType::FullyCompressible) {
376 if (level < finest_level) { cf_anelastic_record(level, nrk); }
377 if (level > 0) { cf_anelastic_stage_registration(level, nrk); }
380 if ((solverChoice.vert_implicit_fac[level][nrk] > zero_d) && solverChoice.implicit_before_substep) {
381 const Real stage_dt =
static_cast<Real
>(slow_dt);
388 MultiFab::Saxpy(scratch, stage_dt, S_rhs[
IntVars::cons], 0, 0, 2, 0);
389 scratch.FillBoundary(geom[level].periodicity());
403 if (solverChoice.implicit_momentum_diffusion) {
405 MultiFab::Saxpy(scratch_xmom, stage_dt, S_rhs[
IntVars::xmom], 0, 0, 1, 0);
406 scratch_xmom.FillBoundary(geom[level].periodicity());
409 MultiFab::Saxpy(scratch_ymom, stage_dt, S_rhs[
IntVars::ymom], 0, 0, 1, 0);
410 scratch_ymom.FillBoundary(geom[level].periodicity());
417 const bool l_mom = solverChoice.implicit_momentum_diffusion;
418 Vector<MultiFab*> scratch_mom = {l_mom ? &scratch_xmom :
nullptr,
419 l_mom ? &scratch_ymom :
nullptr,
421 FillCoarseFineGhostsForImplicit(level, new_stage_time, scratch, {
RhoTheta_comp}, scratch_mom);
433 MultiFab::Saxpy(scratch, -one_d, S_old[
IntVars::cons], 1, 1, 1, 0);
434 scratch.mult(one_d / stage_dt);
437 if (solverChoice.implicit_momentum_diffusion) {
438 MultiFab::Saxpy(scratch_xmom, -one_d, S_old[
IntVars::xmom], 0, 0, 1, 0);
439 scratch_xmom.mult(one_d / stage_dt);
440 MultiFab::Copy(S_rhs[
IntVars::xmom], scratch_xmom, 0, 0, 1, 0);
442 MultiFab::Saxpy(scratch_ymom, -one_d, S_old[
IntVars::ymom], 0, 0, 1, 0);
443 scratch_ymom.mult(one_d / stage_dt);
444 MultiFab::Copy(S_rhs[
IntVars::ymom], scratch_ymom, 0, 0, 1, 0);
448 if (solverChoice.turbChoice[level].uses_native_shoc() && native_shoc_driver[level]) {
459 MultiFab::Subtract(*pi_src[level], *pi_adv_rt[level], 0, 0, 1, 0);
465 if ( solverChoice.terrain_type == TerrainType::MovingFittedMesh )
478 MultiFab* r0_new = &r_hse_new;
479 MultiFab* p0_new = &p_hse_new;
480 MultiFab* pi0_new = &pi_hse_new;
481 MultiFab* th0_new = &th_hse_new;
486 MultiFab rt0(
p0->boxArray(),
p0->DistributionMap(),1,1);
487 MultiFab rt0_new(
p0->boxArray(),
p0->DistributionMap(),1,1);
488 MultiFab r0_temp(
p0->boxArray(),
p0->DistributionMap(),1,1);
495 double dt_base = new_stage_time - old_step_time;
497 const Real l_rdOcp = solverChoice.rdOcp;
500 #pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
505 for ( MFIter mfi(*
p0,
TileNoZ()); mfi.isValid(); ++mfi)
507 const Array4<Real > rt0_arr = rt0.array(mfi);
508 const Array4<Real > rt0_tmp_arr = rt0_new.array(mfi);
510 const Array4<Real const> r0_arr =
r0->const_array(mfi);
511 const Array4<Real > r0_new_arr = r0_new->array(mfi);
512 const Array4<Real > r0_tmp_arr = r0_temp.array(mfi);
514 const Array4<Real const> p0_arr =
p0->const_array(mfi);
515 const Array4<Real > p0_new_arr = p0_new->array(mfi);
516 const Array4<Real > pi0_new_arr = pi0_new->array(mfi);
517 const Array4<Real > th0_new_arr = th0_new->array(mfi);
519 const Array4<Real >& z_t_arr = z_t_rk[level]->array(mfi);
521 const Array4<Real const>& dJ_old_arr = detJ_cc[level]->const_array(mfi);
522 const Array4<Real const>& dJ_new_arr = detJ_cc_new[level]->const_array(mfi);
523 const Array4<Real const>& dJ_src_arr = detJ_cc_src[level]->const_array(mfi);
526 Box gbx = mfi.tilebox(); gbx.grow(2,1);
531 r0_tmp_arr(i,j,k) = r0_new_arr(i,j,k);
534 const int klo_base = fine_geom.Domain().smallEnd(2);
538 Box gbx2 = mfi.tilebox();
541 Real zflux_r_lo = -z_t_arr(i,j,k ) *
myhalf * (r0_tmp_arr(i,j,k) + r0_tmp_arr(i,j,k-1));
542 Real zflux_r_hi = -z_t_arr(i,j,k+1) *
myhalf * (r0_tmp_arr(i,j,k) + r0_tmp_arr(i,j,k+1));
549 zflux_r_lo = -z_t_arr(i,j,k) *
550 ( Real(1.875)*r0_tmp_arr(i,j,k) - Real(1.25)*r0_tmp_arr(i,j,k+1)
551 + Real(0.375)*r0_tmp_arr(i,j,k+2) );
554 Real zflux_rt_lo = zflux_r_lo *
myhalf * (rt0_tmp_arr(i,j,k)/r0_tmp_arr(i,j,k) + rt0_tmp_arr(i,j,k-1)/r0_tmp_arr(i,j,k-1));
555 Real zflux_rt_hi = zflux_r_hi *
myhalf * (rt0_tmp_arr(i,j,k)/r0_tmp_arr(i,j,k) + rt0_tmp_arr(i,j,k+1)/r0_tmp_arr(i,j,k+1));
558 zflux_rt_lo = zflux_r_lo *
559 ( Real(1.875)*(rt0_tmp_arr(i,j,k )/r0_tmp_arr(i,j,k ))
560 - Real(1.25)*(rt0_tmp_arr(i,j,k+1)/r0_tmp_arr(i,j,k+1))
561 + Real(0.375)*(rt0_tmp_arr(i,j,k+2)/r0_tmp_arr(i,j,k+2)) );
564 Real invdetJ =
one / dJ_src_arr(i,j,k);
566 Real src_r = - invdetJ * ( zflux_r_hi - zflux_r_lo ) *
dxInv[2];
567 Real src_rt = - invdetJ * ( zflux_rt_hi - zflux_rt_lo ) *
dxInv[2];
569 Real dt_b =
static_cast<Real
>(dt_base);
570 Real rho0_new = dJ_old_arr(i,j,k) * r0_arr(i,j,k) + dt_b * dJ_src_arr(i,j,k) * src_r;
571 Real rt0_tmp_new = dJ_old_arr(i,j,k) * rt0_arr(i,j,k) + dt_b * dJ_src_arr(i,j,k) * src_rt;
573 r0_new_arr(i,j,k) = rho0_new / dJ_new_arr(i,j,k);
574 rt0_tmp_new /= dJ_new_arr(i,j,k);
578 th0_new_arr(i,j,k) = rt0_tmp_new / r0_new_arr(i,j,k);
587 (*physbcs_base_new[level])(base_state_new[level],0,
BaseState::num_comps,base_state_new[level].nGrowVect());
590 #ifdef ERF_USE_NETCDF
592 if (solverChoice.use_real_bcs && (level == 0)) {
593 const Real bdy_factor = solverChoice.bdy_nudge_factor;
599 Real l_rdOcp = solverChoice.rdOcp;
600 Real l_c_p = solverChoice.c_p;
602 start_bdy_time, final_bdy_time, bdy_time_interval,
603 bdy_factor, real_width, fine_geom,
605 bdy_data_xlo, bdy_data_xhi,
606 bdy_data_ylo, bdy_data_yhi,
607 m_r2d, l_c_p, l_rdOcp,
608 solverChoice.use_wrf_bdy_density,
609 solverChoice.bdy_rho_nudge_factor);
void add_thin_body_sources(MultiFab &xmom_src, MultiFab &ymom_src, MultiFab &zmom_src, std::unique_ptr< iMultiFab > &xflux_imask_lev, std::unique_ptr< iMultiFab > &yflux_imask_lev, std::unique_ptr< iMultiFab > &zflux_imask_lev, std::unique_ptr< MultiFab > &thin_xforce_lev, std::unique_ptr< MultiFab > &thin_yforce_lev, std::unique_ptr< MultiFab > &thin_zforce_lev)
Definition: ERF_AddThinBodySources.cpp:27
AMREX_INLINE void AddCanopyBiophysicsHeatSources(amrex::MultiFab &cell_source, const amrex::MultiFab &S_data, const amrex::MultiFab &xvel, const amrex::MultiFab &yvel, const amrex::MultiFab &zvel, const amrex::MultiFab *frontal_area, const amrex::MultiFab &base_state, const SolverChoice &solver_choice)
Definition: ERF_CanopyBiophysics.H:28
@ m_y
Definition: ERF_DataStruct.H:41
@ m_x
Definition: ERF_DataStruct.H:40
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getRhoThetagivenP(const amrex::Real p, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:172
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getExnergivenRTh(const amrex::Real rhotheta, const amrex::Real rdOcp, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:156
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:81
The atmosphere side of the fire coupling, shared by every fire engine.
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:62
pp_for_pert_vels get("prob_type", prob_type)
amrex::GpuArray< Real, AMREX_SPACEDIM > dxInv
Definition: ERF_InitCustomPertVels_ParticleTests.H:16
AMREX_ALWAYS_ASSERT(bx.length()[2]==khi+1)
void realbdy_compute_interior_ghost_rhs(const double &elapsed_time, const double &start_time, const double &delta_t_d, const double &start_bdy_time, const double &final_bdy_time, const double &bdy_time_interval, const Real &nudge_factor, int width, const Geometry &geom, Vector< MultiFab > &S_rhs, Vector< MultiFab > &S_cur_data, Vector< Vector< FArrayBox >> &bdy_data_xlo, Vector< Vector< FArrayBox >> &bdy_data_xhi, Vector< Vector< FArrayBox >> &bdy_data_ylo, Vector< Vector< FArrayBox >> &bdy_data_yhi, std::unique_ptr< ReadBndryPlanes > &m_r2d, const Real &c_p, const Real &rdOcp, const bool use_wrf_bdy_density, const Real &bdy_rho_nudge_factor)
Definition: ERF_InteriorGhostCells.cpp:162
void make_buoyancy(int lev, const Vector< MultiFab > &S_data, const MultiFab &S_prim, const MultiFab &qt, MultiFab &buoyancy, const Geometry geom, const SolverChoice &solverChoice, const MultiFab &base_state, const int n_qstate, const eb_ &ebfact, const int anelastic)
Definition: ERF_MakeBuoyancy.cpp:36
void make_gradp_pert(int level, const SolverChoice &solverChoice, const Geometry &geom, Vector< MultiFab > &S_data, const MultiFab &base_state, const MultiFab &qt, const MultiFab &z_phys_cc, Vector< std::unique_ptr< MultiFab >> &mapfac, const eb_ &ebfact, Vector< MultiFab > &gradp)
Definition: ERF_MakeGradP.cpp:122
void make_mom_sources(int level, double time_d, double dt, const Vector< MultiFab > &S_data, const MultiFab *z_phys_nd, const MultiFab *z_phys_cc, Vector< Real > &stretched_dz_h, const MultiFab &xvel, const MultiFab &yvel, const MultiFab &wvel, MultiFab &xmom_src, MultiFab &ymom_src, MultiFab &zmom_src, const MultiFab &base_state, MultiFab *forest_drag, MultiFab *terrain_blank, MultiFab *terrain_blank_xface, MultiFab *terrain_blank_yface, MultiFab *terrain_blank_zface, MultiFab *cosPhi_mf, MultiFab *sinPhi_mf, const Geometry geom, const SolverChoice &solverChoice, Vector< std::unique_ptr< MultiFab >> &, const Real *dptr_u_geos, const Real *dptr_v_geos, const Real *dptr_wbar_sub, const Vector< Real * > d_rayleigh_ptrs_at_lev, const amrex::Real *d_sinesq_at_lev, const amrex::Real *d_sinesq_stag_at_lev, const Vector< Real * > d_sponge_ptrs_at_lev, const Vector< MultiFab > *forecast_state_at_lev, const InputSoundingData &input_sounding_data, const LargeScaleForcingData &lsf_data, std::unique_ptr< amrex::MultiFab > &lsf_tendencies, const eb_ &ebfact, bool is_slow_step)
Definition: ERF_MakeMomSources.cpp:41
void make_sources(int level, int, double dt, double time_d, const Vector< MultiFab > &S_data, const MultiFab &S_prim, MultiFab &source, const MultiFab &base_state, const MultiFab *z_phys_cc, const MultiFab &xvel, const MultiFab &yvel, const MultiFab &zvel, const MultiFab *qheating_rates, MultiFab *terrain_blank, const Geometry geom, const SolverChoice &solverChoice, Vector< std::unique_ptr< MultiFab >> &mapfac, const MultiFab *rhotheta_src, const MultiFab *rhoqt_src, const Real *dptr_wbar_sub, const Vector< Real * > d_rayleigh_ptrs_at_lev, const Real *d_sinesq_at_lev, TurbulentPerturbation &turbPert, const Table1D< Real > r_plane_avg, const Table1D< Real > t_plane_avg, const MultiFab *forest_drag, const MultiFab *cons_old, bool is_slow_step, MultiFab *ib_wall_hfx, MultiFab *ib_wall_ktarget, MultiFab *ib_wall_qfx)
Definition: ERF_MakeSources.cpp:39
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
constexpr amrex::Real myhalf
Definition: ERF_NumericalConstants.H:41
void erf_slow_rhs_pre(int level, int finest_level, int nrk, double dt, Vector< MultiFab > &S_rhs, Vector< MultiFab > &S_old, Vector< MultiFab > &S_data, const MultiFab &S_prim, const MultiFab &qt, MultiFab &avg_xmom, MultiFab &avg_ymom, MultiFab &avg_zmom, const Array< const MultiFab *, AMREX_SPACEDIM > &upw_dir, MultiFab *pi_adv_rt, const MultiFab &xvel, const MultiFab &yvel, const MultiFab &zvel, std::unique_ptr< MultiFab > &z_t_mf, const MultiFab &cc_src, const MultiFab &xmom_src, const MultiFab &ymom_src, const MultiFab &zmom_src, const MultiFab &buoyancy, const MultiFab *zmom_crse_rhs, Vector< std::unique_ptr< MultiFab >> &Tau_lev, Vector< std::unique_ptr< MultiFab >> &Tau_corr_lev, Vector< Vector< std::unique_ptr< MultiFab >>> &Tau_EB, MultiFab *SmnSmn, MultiFab *eddyDiffs, MultiFab *Hfx1, MultiFab *Hfx2, MultiFab *Hfx3, MultiFab *Q1fx1, MultiFab *Q1fx2, MultiFab *Q1fx3, MultiFab *Q2fx3, MultiFab *, MultiFab *mf_surface_fluxes, MultiFab *Hfx3_EB, const Geometry geom, const SolverChoice &solverChoice, const amrex::Vector< std::unique_ptr< SurfaceLayer >> &SurfLayer, const Gpu::DeviceVector< BCRec > &domain_bcs_type_d, const Vector< BCRec > &domain_bcs_type_h, const MultiFab &z_phys_nd, const MultiFab &z_phys_cc, const MultiFab &ax, const MultiFab &ay, const MultiFab &az, const MultiFab &detJ, Gpu::DeviceVector< Real > &stretched_dz_d, Vector< MultiFab > &gradp, Vector< std::unique_ptr< MultiFab >> &mapfac, const eb_ &ebfact, const Vector< iMultiFab > &physbnd_mask, ShocDriver *native_shoc_lev, YAFluxRegister *fr_as_crse, YAFluxRegister *fr_as_fine, const MultiFab *cloud_chamber_base_state, const erf_cloud_chamber::Config *cloud_chamber_config, CloudChamberBudget *cloud_budget, const MultiFab *ib_wall_face13, const MultiFab *ib_wall_face23, const MultiFab *ib_wall_face33, const MultiFab *ib_wall_hfx, const MultiFab *walldist)
Definition: ERF_SlowRhsPre.cpp:76
auto slow_rhs_fun_pre
Definition: ERF_TI_slow_rhs_pre.H:10
auto make_pi_stage
Definition: ERF_TI_utils.H:4
auto update_terrain_stage
Definition: ERF_TI_utils.H:137
AMREX_FORCE_INLINE amrex::IntVect TileNoZ()
Definition: ERF_TileNoZ.H:11
void cons_to_prim(const MultiFab &cons_state, MultiFab &S_prim, int ng)
Definition: ERF_Utils.cpp:17
void make_qt(const MultiFab &cons_state, MultiFab &qt, int n_qstate_into_total)
Definition: ERF_Utils.cpp:112
@ num_comps
Definition: ERF_IndexDefines.H:114
@ pi0_comp
Definition: ERF_IndexDefines.H:111
@ p0_comp
Definition: ERF_IndexDefines.H:110
@ th0_comp
Definition: ERF_IndexDefines.H:112
@ r0_comp
Definition: ERF_IndexDefines.H:109
@ ymom
Definition: ERF_IndexDefines.H:251
@ cons
Definition: ERF_IndexDefines.H:249
@ zmom
Definition: ERF_IndexDefines.H:252
@ xmom
Definition: ERF_IndexDefines.H:250
@ None
Definition: ERF_LSM_Types.H:6
@ qt
Definition: ERF_Kessler.H:30
real(c_double), parameter p0
Definition: ERF_module_model_constants.F90:40
real(kind=kind_phys), parameter, private r0
Definition: ERF_module_mp_wdm6.F90:75
Definition: ERF_ObsNudging.cpp:22