/home/runner/work/kynema-sgf/kynema-sgf/src/equation_systems/icns/icns_advection.H Source File

Kynema-SGF API: /home/runner/work/kynema-sgf/kynema-sgf/src/equation_systems/icns/icns_advection.H Source File
Kynema-SGF API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
icns_advection.H
Go to the documentation of this file.
1#ifndef ICNS_ADVECTION_H
2#define ICNS_ADVECTION_H
3
9
10#include "AMReX_MultiFabUtil.H"
11#include "hydro_MacProjector.H"
12#include "hydro_mol.H"
13#include "hydro_utils.H"
14
16#include "AMReX_REAL.H"
17
18using namespace amrex::literals;
19
20namespace kynema_sgf::pde {
21
23{
24public:
26 amrex::Vector<amrex::Array<const amrex::MultiFab*, ICNS::ndim>>;
27
29 FieldRepo& /*repo*/,
30 FieldBoundaryMgr& /*fb_mgr*/,
31 bool /*has_overset*/,
32 bool /*variable_density*/,
33 bool /*mesh_mapping*/,
34 bool /*is_anelastic*/);
35
36 void set_inflow_velocity(amrex::Real time);
37
38 void operator()(FieldState fstate, amrex::Real dt);
39
40 static void mac_proj_to_uniform_space(
41 const kynema_sgf::FieldRepo& /*repo*/,
42 kynema_sgf::Field& /*u_mac*/,
43 kynema_sgf::Field& /*v_mac*/,
44 kynema_sgf::Field& /*w_mac*/,
45 amrex::Array<amrex::MultiFab*, ICNS::ndim>& /*rho_face*/,
46 amrex::Real /*ovst_fac*/,
47 int /*lev*/);
48
49 [[nodiscard]] amrex::Real rho0() const { return m_rho_0; }
50
51private:
52 void init_projector(const FaceFabPtrVec& /*beta*/);
53 void init_projector(amrex::Real /*beta*/);
54
56 const amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>>&
57 a_umac);
58
61 std::unique_ptr<Hydro::MacProjector> m_mac_proj;
62#ifdef KYNEMA_SGF_USE_FFT
63 std::unique_ptr<Hydro::FFTMacProjector> m_fft_mac_proj;
64 bool m_use_fft{true}; // use fft if possible
65#endif
67 bool m_has_overset{false};
68 bool m_need_init{true};
69 bool m_variable_density{false};
70 bool m_mesh_mapping{false};
71 bool m_is_anelastic{false};
72 amrex::Real m_rho_0{1.0_rt};
73};
74
78template <>
79struct AdvectionOp<ICNS, fvm::Godunov>
80{
82 CFDSim& sim,
83 PDEFields& fields_in,
84 bool has_overset,
85 bool variable_density,
86 bool mesh_mapping,
87 bool is_anelastic)
88 : fields(fields_in)
89 , u_mac(fields_in.repo.get_field("u_mac"))
90 , v_mac(fields_in.repo.get_field("v_mac"))
91 , w_mac(fields_in.repo.get_field("w_mac"))
93 fields.repo,
94 sim.field_boundary_manager(),
95 has_overset,
96 variable_density,
97 mesh_mapping,
98 is_anelastic)
99 , m_flux_x(fields_in.repo.create_scratch_field(
100 ICNS::ndim, 0, kynema_sgf::FieldLoc::XFACE))
101 , m_flux_y(fields_in.repo.create_scratch_field(
102 ICNS::ndim, 0, kynema_sgf::FieldLoc::YFACE))
103 , m_flux_z(fields_in.repo.create_scratch_field(
104 ICNS::ndim, 0, kynema_sgf::FieldLoc::ZFACE))
105 , m_face_x(fields_in.repo.create_scratch_field(
106 ICNS::ndim, 0, kynema_sgf::FieldLoc::XFACE))
107 , m_face_y(fields_in.repo.create_scratch_field(
108 ICNS::ndim, 0, kynema_sgf::FieldLoc::YFACE))
109 , m_face_z(fields_in.repo.create_scratch_field(
110 ICNS::ndim, 0, kynema_sgf::FieldLoc::ZFACE))
111 {
112
113 amrex::ParmParse pp("incflo");
114 pp.query("godunov_type", godunov_type);
115 pp.query("godunov_use_forces_in_trans", godunov_use_forces_in_trans);
116 if (pp.contains("use_ppm") || pp.contains("use_limiter")) {
117 amrex::Abort(
118 "Godunov: use_ppm and use_limiter are deprecated. Please "
119 "update input file");
120 }
121
122 if (amrex::toLower(godunov_type) == "plm") {
124 } else if (amrex::toLower(godunov_type) == "ppm") {
126 } else if (amrex::toLower(godunov_type) == "ppm_nolim") {
128 amrex::Print() << "WARNING: Using advection type ppm_nolim is not "
129 "recommended. Prefer using weno_z."
130 << '\n';
131 } else if (amrex::toLower(godunov_type) == "bds") {
133 // use Godunov for premac, use BDS for postmac. Eventually
134 // there will be a premac BDS
136 } else if (
137 amrex::toLower(godunov_type) == "weno" ||
138 amrex::toLower(godunov_type) == "weno_js") {
140 } else if (amrex::toLower(godunov_type) == "weno_z") {
142 } else {
143 amrex::Abort(
144 "Invalid godunov_type specified. For godunov_type select "
145 "between plm, ppm, ppm_nolim, bds, weno_js, and weno_z. If no "
146 "godunov_type is specified, the default weno_z is used.");
147 }
148
149 // Flux calculation used in multiphase portions of domain
150 pp.query("mflux_type", mflux_type);
151 if (amrex::toLower(mflux_type) == "minmod") {
153 } else if (amrex::toLower(mflux_type) == "upwind") {
155 } else {
156 amrex::Abort("Invalid argument entered for mflux_type.");
157 }
158
159 // Formulation of discrete ICNS equation
160 // 1 = conservative (default), 0 = nonconservative
161 pp.query("icns_conserv", m_cons);
162 iconserv.resize(ICNS::ndim, m_cons);
163
164 // Get copy of verbose
165 pp.query("verbose", m_verbose);
166
167 amrex::ParmParse pp_eq("ICNS");
168 pp_eq.query(
169 "allow_inflow_at_pressure_outflow", m_allow_inflow_on_outflow);
170 }
171
173 const FieldState fstate, const amrex::Real dt, const amrex::Real time)
174 {
175
176 const auto& repo = fields.repo;
177 const auto& geom = repo.mesh().Geom();
178
179 const auto& src_term = fields.src_term;
180 const auto& dof_field = fields.field.state(fstate);
181 auto bcrec_device = dof_field.bcrec_device();
182
183 //
184 // Predict
185 //
192 const bool godunov_use_ppm =
195 int limiter_type;
197 limiter_type = PPM::NoLimiter;
199 limiter_type = PPM::WENOZ;
201 limiter_type = PPM::WENO_JS;
202 } else {
203 limiter_type = PPM::default_limiter;
204 }
205
206 // if state is NPH, then n and n+1 are known, and only
207 // spatial extrapolation is performed
208 const amrex::Real dt_extrap =
209 (fstate == FieldState::NPH) ? 0.0_rt : dt;
210 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
211 HydroUtils::ExtrapVelToFaces(
212 dof_field(lev), src_term(lev), u_mac(lev), v_mac(lev),
213 w_mac(lev), dof_field.bcrec(), bcrec_device.data(),
214 repo.mesh().Geom(lev), dt_extrap, godunov_use_ppm,
216 limiter_type, m_allow_inflow_on_outflow);
217 }
218 } else {
219 amrex::Abort("Invalid godunov scheme");
220 }
221
222 if (m_verbose > 2) {
223 diagnostics::PrintMaxMACVelLocations(repo, "before MAC projection");
224 }
225
226 // Populate boundaries (valid cells) using velocity BCs
227 m_macproj_op.set_inflow_velocity(time);
228
229 // MAC projection
230 m_macproj_op(fstate, dt);
231
232 // Fill mac velocities (ghost cells) using velocity BCs
234 amrex::Array<Field*, AMREX_SPACEDIM> mac_vel = {
235 AMREX_D_DECL(&u_mac, &v_mac, &w_mac)};
236 dof_field.fillpatch_sibling_fields(time, u_mac.num_grow(), mac_vel);
237 }
238
239 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
240 u_mac(lev).FillBoundary(geom[lev].periodicity());
241 v_mac(lev).FillBoundary(geom[lev].periodicity());
242 w_mac(lev).FillBoundary(geom[lev].periodicity());
243 }
244
245 if (m_verbose > 2) {
246 diagnostics::PrintMaxMACVelLocations(repo, "after MAC projection");
247 }
248 }
249
250 void operator()(const FieldState fstate, const amrex::Real dt)
251 {
252 const auto& repo = fields.repo;
253 const auto& geom = repo.mesh().Geom();
254
255 const auto& src_term = fields.src_term;
256 auto& conv_term = fields.conv_term;
257 const auto& dof_field = fields.field.state(fstate);
258 const auto& dof_nph = fields.field.state(kynema_sgf::FieldState::NPH);
259
260 auto& flux_x = *m_flux_x;
261 auto& flux_y = *m_flux_y;
262 auto& flux_z = *m_flux_z;
263 auto& face_x = *m_face_x;
264 auto& face_y = *m_face_y;
265 auto& face_z = *m_face_z;
266
267 const auto& rho_o =
268 repo.get_field("density").state(kynema_sgf::FieldState::Old);
269 const auto& rho_nph =
270 repo.get_field("density").state(kynema_sgf::FieldState::NPH);
271
272 const bool mphase_vof = repo.field_exists("vof");
273
274 //
275 // Advect momentum eqns
276 //
277 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
278
279 // form multifab for transport variable and source term
280 amrex::MultiFab q(
281 dof_field(lev).boxArray(), dof_field(lev).DistributionMap(),
283 amrex::MultiFab::Copy(
284 q, dof_field(lev), 0, 0, ICNS::ndim,
286 amrex::MultiFab fq(
287 src_term(lev).boxArray(), src_term(lev).DistributionMap(),
289 amrex::MultiFab::Copy(
290 fq, src_term(lev), 0, 0, ICNS::ndim, fvm::Godunov::nghost_src);
291 // form multifab for time-correct boundary condition of variable
292 amrex::MultiFab q_nph(
293 dof_field(lev).boxArray(), dof_field(lev).DistributionMap(),
295 amrex::MultiFab::Copy(
296 q_nph, dof_nph(lev), 0, 0, ICNS::ndim,
298
299 // Calculate fluxes using momentum directly
300 if (!mphase_vof) {
301
302 for (int idim = 0; idim < dof_field.num_comp(); ++idim) {
303 amrex::MultiFab::Multiply(
304 q, rho_o(lev), 0, idim, 1, fvm::Godunov::nghost_state);
305 // Source terms at old state during advection calculation
306 amrex::MultiFab::Multiply(
307 fq, rho_o(lev), 0, idim, 1, fvm::Godunov::nghost_src);
308
309 amrex::MultiFab::Multiply(
310 q_nph, rho_nph(lev), 0, idim, 1,
312 }
313 }
314
315 amrex::MFItInfo mfi_info;
316 if (amrex::Gpu::notInLaunchRegion()) {
317 mfi_info.EnableTiling(amrex::IntVect(1024, 1024, 1024))
318 .SetDynamic(true);
319 }
326 const bool is_velocity = true;
327 const bool known_edge_state = false;
328 const bool godunov_use_ppm =
333 int limiter_type;
335 limiter_type = PPM::NoLimiter;
337 limiter_type = PPM::WENOZ;
339 limiter_type = PPM::WENO_JS;
340 } else {
341 limiter_type = PPM::default_limiter;
342 }
343
344 // if state is NPH, then n and n+1 are known, and only
345 // spatial extrapolation is performed
346 const amrex::Real dt_extrap =
347 (fstate == FieldState::NPH) ? 0.0_rt : dt;
348#ifdef AMREX_USE_OMP
349#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
350#endif
351 for (amrex::MFIter mfi(dof_field(lev), mfi_info); mfi.isValid();
352 ++mfi) {
353 const auto& bx = mfi.tilebox();
354 amrex::FArrayBox tmpfab(
355 amrex::grow(bx, 1), 1, amrex::The_Async_Arena());
356 tmpfab.setVal<amrex::RunOn::Device>(0.0_rt);
357 const auto& divu = tmpfab.array();
358 HydroUtils::ComputeFluxesOnBoxFromState(
359 bx, ICNS::ndim, mfi, q.const_array(mfi),
360 q_nph.const_array(mfi), flux_x(lev).array(mfi),
361 flux_y(lev).array(mfi), flux_z(lev).array(mfi),
362 face_x(lev).array(mfi), face_y(lev).array(mfi),
363 face_z(lev).array(mfi), known_edge_state,
364 u_mac(lev).const_array(mfi),
365 v_mac(lev).const_array(mfi),
366 w_mac(lev).const_array(mfi), divu, fq.const_array(mfi),
367 geom[lev], dt_extrap, dof_field.bcrec(),
368 dof_field.bcrec_device().data(), iconserv.data(),
369 godunov_use_ppm, godunov_use_forces_in_trans,
370 is_velocity, fluxes_are_area_weighted,
371 postmac_advection_type, limiter_type,
373 }
374 } else {
375 amrex::Abort("Invalid godunov scheme");
376 }
377 }
378
379 // Multiphase flux operations
380 if (mphase_vof) {
381 // Loop levels
383 repo, ICNS::ndim, iconserv, flux_x, flux_y, flux_z, dof_field,
384 dof_nph, src_term, rho_o, rho_nph, u_mac, v_mac, w_mac,
385 dof_field.bcrec(), dof_field.bcrec_device().data(),
386 rho_o.bcrec(), rho_o.bcrec_device().data(), dt, mflux_scheme,
388 }
389
390 amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>> fluxes(
391 repo.num_active_levels());
392 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
393 fluxes[lev][0] = &flux_x(lev);
394 fluxes[lev][1] = &flux_y(lev);
395 fluxes[lev][2] = &flux_z(lev);
396 }
397
398 // In order to enforce conservation across coarse-fine boundaries we
399 // must be sure to average down the fluxes before we use them
400 for (int lev = repo.num_active_levels() - 1; lev > 0; --lev) {
401 amrex::IntVect rr =
402 geom[lev].Domain().size() / geom[lev - 1].Domain().size();
403 amrex::average_down_faces(
404 GetArrOfConstPtrs(fluxes[lev]), fluxes[lev - 1], rr,
405 geom[lev - 1]);
406 }
407
408 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
409
410#ifdef AMREX_USE_OMP
411#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
412#endif
413 for (amrex::MFIter mfi(dof_field(lev), amrex::TilingIfNotGPU());
414 mfi.isValid(); ++mfi) {
415 const auto& bx = mfi.tilebox();
416
417 HydroUtils::ComputeDivergence(
418 bx, conv_term(lev).array(mfi), flux_x(lev).array(mfi),
419 flux_y(lev).array(mfi), flux_z(lev).array(mfi), ICNS::ndim,
420 geom[lev], static_cast<amrex::Real>(-1.0_rt),
422
423 if (m_cons == 0) {
424 amrex::FArrayBox div_umac(bx, 1, amrex::The_Async_Arena());
425 auto const& divum_arr = div_umac.array();
426 HydroUtils::ComputeDivergence(
427 bx, divum_arr, u_mac(lev).const_array(mfi),
428 v_mac(lev).const_array(mfi),
429 w_mac(lev).const_array(mfi), 1, geom[lev],
430 static_cast<amrex::Real>(1.0_rt), false);
431 HydroUtils::ComputeConvectiveTerm(
432 bx, ICNS::ndim, mfi, dof_field(lev).const_array(mfi),
433 face_x(lev).const_array(mfi),
434 face_y(lev).const_array(mfi),
435 face_z(lev).const_array(mfi), divum_arr,
436 conv_term(lev).array(mfi), iconserv.data(),
438 }
439 }
440 }
441 }
442
447
449
450 std::unique_ptr<ScratchField> m_flux_x;
451 std::unique_ptr<ScratchField> m_flux_y;
452 std::unique_ptr<ScratchField> m_flux_z;
453 std::unique_ptr<ScratchField> m_face_x;
454 std::unique_ptr<ScratchField> m_face_y;
455 std::unique_ptr<ScratchField> m_face_z;
456
457 amrex::Gpu::DeviceVector<int> iconserv;
458
461 std::string godunov_type{"weno_z"};
462 std::string mflux_type{"upwind"};
463 const bool fluxes_are_area_weighted{false};
465 int m_cons{1};
466 int m_verbose{0};
468 std::string premac_advection_type{"Godunov"};
469 std::string postmac_advection_type{"Godunov"};
470};
471
475template <>
476struct AdvectionOp<ICNS, fvm::MOL>
477{
479 CFDSim& sim,
480 PDEFields& fields_in,
481 bool has_overset,
482 bool variable_density,
483 bool mesh_mapping,
484 bool is_anelastic)
485 : fields(fields_in)
486 , u_mac(fields_in.repo.get_field("u_mac"))
487 , v_mac(fields_in.repo.get_field("v_mac"))
488 , w_mac(fields_in.repo.get_field("w_mac"))
489 , m_mesh_mapping(mesh_mapping)
490 , m_macproj_op(
491 fields.repo,
492 sim.field_boundary_manager(),
493 has_overset,
494 variable_density,
496 is_anelastic)
497 {}
498
500 const FieldState fstate,
501 const amrex::Real dt,
502 const amrex::Real /*time*/)
503 {
504
505 const auto& repo = fields.repo;
506 auto& dof_field = fields.field.state(fstate);
507
508 // computation of velocity on faces requires
509 // dof field to be in stretched mesh space
510 if (dof_field.in_uniform_space() && m_mesh_mapping) {
511 dof_field.to_stretched_space();
512 }
513
514 //
515 // Predict velocities
516 //
517
518 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
519 MOL::ExtrapVelToFaces(
520 dof_field(lev), u_mac(lev), v_mac(lev), w_mac(lev),
521 repo.mesh().Geom(lev), dof_field.bcrec(),
522 dof_field.bcrec_device().data());
523 }
524
525 m_macproj_op(fstate, dt);
526 }
527
528 void operator()(const FieldState fstate, const amrex::Real /*unused*/)
529 {
530
531 const auto& repo = fields.repo;
532 const auto& geom = repo.mesh().Geom();
533 auto& conv_term = fields.conv_term.state(fstate);
534 const auto& dof_field = fields.field.state(fstate);
535 const auto& rho = repo.get_field("density").state(fstate);
536
537 //
538 // Advect velocity
539 //
540
541 int nmaxcomp = AMREX_SPACEDIM;
542 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
543
544 amrex::MFItInfo mfi_info;
545 // if (amrex::Gpu::notInLaunchRegion())
546 // mfi_info.EnableTiling(amrex::IntVect(1024,16,16)).SetDynamic(true);
547 if (amrex::Gpu::notInLaunchRegion()) {
548 mfi_info.EnableTiling(amrex::IntVect(1024, 1024, 1024))
549 .SetDynamic(true);
550 }
551#ifdef AMREX_USE_OMP
552#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
553#endif
554 for (amrex::MFIter mfi(dof_field(lev), mfi_info); mfi.isValid();
555 ++mfi) {
556 amrex::Box const& bx = mfi.tilebox();
557 amrex::Box gbx = grow(bx, fvm::MOL::nghost_state);
558
559 // Set up momentum array
560 amrex::FArrayBox qfab(
561 gbx, ICNS::ndim, amrex::The_Async_Arena());
562 const auto& q = qfab.array();
563 // Calculate momentum
564 auto rho_arr = rho(lev).const_array(mfi);
565 auto vel_arr = dof_field(lev).const_array(mfi);
566 amrex::ParallelFor(
567 gbx, ICNS::ndim,
568 [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) {
569 q(i, j, k, n) = rho_arr(i, j, k) * vel_arr(i, j, k, n);
570 });
571 // Doing this explicitly, instead of through a Multiply command,
572 // helps avoid floating-point errors with intel compilers and
573 // mimics the implementation in equation_systems/AdvOp_MOL.H
574
575 amrex::Box tmpbox = amrex::surroundingNodes(bx);
576 const int tmpcomp = nmaxcomp * AMREX_SPACEDIM;
577
578 amrex::FArrayBox tmpfab(
579 tmpbox, tmpcomp, amrex::The_Async_Arena());
580
581 amrex::Array4<amrex::Real> fx = tmpfab.array(0);
582 amrex::Array4<amrex::Real> fy = tmpfab.array(nmaxcomp);
583 amrex::Array4<amrex::Real> fz = tmpfab.array(nmaxcomp * 2);
584
586 lev, bx, AMREX_SPACEDIM, fx, fy, fz, q,
587 u_mac(lev).const_array(mfi), v_mac(lev).const_array(mfi),
588 w_mac(lev).const_array(mfi), dof_field.bcrec().data(),
589 dof_field.bcrec_device().data(), geom);
590
592 bx, AMREX_SPACEDIM, conv_term(lev).array(mfi), fx, fy, fz,
593 geom[lev].InvCellSizeArray());
594 }
595 }
596 }
597
602
604
606};
607
608} // namespace kynema_sgf::pde
609
610#endif /* ICNS_ADVECTION_H */
Definition CFDSim.H:55
Definition FieldBoundary.H:66
Definition Field.H:115
Definition FieldRepo.H:86
Definition icns_advection.H:23
MacProjOp(FieldRepo &, FieldBoundaryMgr &, bool, bool, bool, bool)
Definition icns_advection.cpp:45
amrex::Real m_rho_0
Definition icns_advection.H:72
FieldRepo & m_repo
Definition icns_advection.H:59
std::unique_ptr< Hydro::MacProjector > m_mac_proj
Definition icns_advection.H:61
bool m_has_overset
Definition icns_advection.H:67
MLMGOptions m_options
Definition icns_advection.H:66
bool m_need_init
Definition icns_advection.H:68
void operator()(FieldState fstate, amrex::Real dt)
Definition icns_advection.cpp:206
bool m_variable_density
Definition icns_advection.H:69
amrex::Real rho0() const
Definition icns_advection.H:49
bool m_mesh_mapping
Definition icns_advection.H:70
void init_projector(const FaceFabPtrVec &)
Definition icns_advection.cpp:80
FieldBoundaryMgr & m_fb_mgr
Definition icns_advection.H:60
void set_inflow_velocity(amrex::Real time)
Definition icns_advection.cpp:157
static void mac_proj_to_uniform_space(const kynema_sgf::FieldRepo &, kynema_sgf::Field &, kynema_sgf::Field &, kynema_sgf::Field &, amrex::Array< amrex::MultiFab *, ICNS::ndim > &, amrex::Real, int)
Definition icns_advection.cpp:377
void enforce_inout_solvability(const amrex::Vector< amrex::Array< amrex::MultiFab *, AMREX_SPACEDIM > > &a_umac)
Definition icns_advection.cpp:70
amrex::Vector< amrex::Array< const amrex::MultiFab *, ICNS::ndim > > FaceFabPtrVec
Definition icns_advection.H:25
bool m_is_anelastic
Definition icns_advection.H:71
FieldLoc
Definition FieldDescTypes.H:29
FieldState
Definition FieldDescTypes.H:16
@ ZFACE
Face-centered in z-direction.
Definition FieldDescTypes.H:34
@ XFACE
Face-centered in x-direction (e.g., face normal velocity)
Definition FieldDescTypes.H:32
@ YFACE
Face-centered in y-direction.
Definition FieldDescTypes.H:33
@ NPH
State at (n + 1/2) (intermediate) timestep.
Definition FieldDescTypes.H:20
@ Old
Same as FieldState::N.
Definition FieldDescTypes.H:23
scheme
Definition Godunov.H:8
@ BDS
Definition Godunov.H:12
@ PPM
Definition Godunov.H:10
@ UPWIND
Definition Godunov.H:16
@ PLM
Definition Godunov.H:9
@ WENO_JS
Definition Godunov.H:13
@ MINMOD
Definition Godunov.H:15
@ PPM_NOLIM
Definition Godunov.H:11
@ WENOZ
Definition Godunov.H:14
amrex::Array< amrex::Real, 24 > PrintMaxMACVelLocations(const kynema_sgf::FieldRepo &repo, const std::string &header)
Definition diagnostics.cpp:440
Definition SchemeTraits.H:6
static AMREX_INLINE void hybrid_fluxes(const FieldRepo &repo, const int ncomp, const amrex::Gpu::DeviceVector< int > &iconserv, ScratchField &flux_x, ScratchField &flux_y, ScratchField &flux_z, const Field &dof_field, const Field &dof_nph, const Field &src_term, const Field &rho_o, const Field &rho_nph, const Field &u_mac, const Field &v_mac, const Field &w_mac, amrex::Vector< amrex::BCRec > const &velbc, amrex::BCRec const *velbc_d, amrex::Vector< amrex::BCRec > const &rhobc, amrex::BCRec const *rhobc_d, const amrex::Real dt, godunov::scheme mflux_scheme, bool allow_inflow_on_outflow, bool use_forces_in_trans, bool pre_multiplied_src_term=false)
Definition vof_momentum_flux.H:11
Definition AdvOp_Godunov.H:22
This test case is intended as an evaluation of the momentum advection scheme.
Definition BCInterface.cpp:12
void compute_convective_rate(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &dUdt, amrex::Array4< amrex::Real const > const &fx, amrex::Array4< amrex::Real const > const &fy, amrex::Array4< amrex::Real const > const &fz, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > dxi)
Definition incflo_mol_fluxes.cpp:9
void compute_convective_fluxes(int lev, amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &fx, amrex::Array4< amrex::Real > const &fy, amrex::Array4< amrex::Real > const &fz, amrex::Array4< amrex::Real const > const &q, amrex::Array4< amrex::Real const > const &umac, amrex::Array4< amrex::Real const > const &vmac, amrex::Array4< amrex::Real const > const &wmac, amrex::BCRec const *h_bcrec, amrex::BCRec const *d_bcrec, amrex::Vector< amrex::Geometry > geom)
Definition incflo_mol_fluxes.cpp:29
Definition MLMGOptions.H:27
static constexpr int nghost_src
Number of ghost cells in the source term variable.
Definition SchemeTraits.H:21
static constexpr int nghost_state
Number of ghost in the state variable.
Definition SchemeTraits.H:19
static constexpr int nghost_state
Number of ghost cells in the state variable.
Definition SchemeTraits.H:41
MacProjOp m_macproj_op
Definition icns_advection.H:448
std::unique_ptr< ScratchField > m_face_x
Definition icns_advection.H:453
AdvectionOp(CFDSim &sim, PDEFields &fields_in, bool has_overset, bool variable_density, bool mesh_mapping, bool is_anelastic)
Definition icns_advection.H:81
Field & v_mac
Definition icns_advection.H:445
std::unique_ptr< ScratchField > m_flux_x
Definition icns_advection.H:450
void operator()(const FieldState fstate, const amrex::Real dt)
Definition icns_advection.H:250
Field & w_mac
Definition icns_advection.H:446
void preadvect(const FieldState fstate, const amrex::Real dt, const amrex::Real time)
Definition icns_advection.H:172
amrex::Gpu::DeviceVector< int > iconserv
Definition icns_advection.H:457
godunov::scheme mflux_scheme
Definition icns_advection.H:460
const bool fluxes_are_area_weighted
Definition icns_advection.H:463
bool godunov_use_forces_in_trans
Definition icns_advection.H:464
bool m_allow_inflow_on_outflow
Definition icns_advection.H:467
Field & u_mac
Definition icns_advection.H:444
std::string godunov_type
Definition icns_advection.H:461
PDEFields & fields
Definition icns_advection.H:443
std::unique_ptr< ScratchField > m_flux_y
Definition icns_advection.H:451
int m_cons
Definition icns_advection.H:465
int m_verbose
Definition icns_advection.H:466
std::unique_ptr< ScratchField > m_face_z
Definition icns_advection.H:455
std::unique_ptr< ScratchField > m_flux_z
Definition icns_advection.H:452
std::string postmac_advection_type
Definition icns_advection.H:469
std::string premac_advection_type
Definition icns_advection.H:468
godunov::scheme godunov_scheme
Definition icns_advection.H:459
std::unique_ptr< ScratchField > m_face_y
Definition icns_advection.H:454
std::string mflux_type
Definition icns_advection.H:462
PDEFields & fields
Definition icns_advection.H:598
Field & u_mac
Definition icns_advection.H:599
MacProjOp m_macproj_op
Definition icns_advection.H:605
bool m_mesh_mapping
Definition icns_advection.H:603
void operator()(const FieldState fstate, const amrex::Real)
Definition icns_advection.H:528
AdvectionOp(CFDSim &sim, PDEFields &fields_in, bool has_overset, bool variable_density, bool mesh_mapping, bool is_anelastic)
Definition icns_advection.H:478
void preadvect(const FieldState fstate, const amrex::Real dt, const amrex::Real)
Definition icns_advection.H:499
Field & v_mac
Definition icns_advection.H:600
Field & w_mac
Definition icns_advection.H:601
Definition icns.H:34
static constexpr int ndim
Definition icns.H:40
Definition PDEFields.H:27