/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 // cppcheck-suppress constVariableReference
257 auto& conv_term = fields.conv_term;
258 const auto& dof_field = fields.field.state(fstate);
259 const auto& dof_nph = fields.field.state(kynema_sgf::FieldState::NPH);
260
261 auto& flux_x = *m_flux_x;
262 auto& flux_y = *m_flux_y;
263 auto& flux_z = *m_flux_z;
264 auto& face_x = *m_face_x;
265 auto& face_y = *m_face_y;
266 auto& face_z = *m_face_z;
267
268 const auto& rho_o =
269 repo.get_field("density").state(kynema_sgf::FieldState::Old);
270 const auto& rho_nph =
271 repo.get_field("density").state(kynema_sgf::FieldState::NPH);
272
273 const bool mphase_vof = repo.field_exists("vof");
274
275 //
276 // Advect momentum eqns
277 //
278 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
279
280 // form multifab for transport variable and source term
281 amrex::MultiFab q(
282 dof_field(lev).boxArray(), dof_field(lev).DistributionMap(),
284 amrex::MultiFab::Copy(
285 q, dof_field(lev), 0, 0, ICNS::ndim,
287 amrex::MultiFab fq(
288 src_term(lev).boxArray(), src_term(lev).DistributionMap(),
290 amrex::MultiFab::Copy(
291 fq, src_term(lev), 0, 0, ICNS::ndim, fvm::Godunov::nghost_src);
292 // form multifab for time-correct boundary condition of variable
293 amrex::MultiFab q_nph(
294 dof_field(lev).boxArray(), dof_field(lev).DistributionMap(),
296 amrex::MultiFab::Copy(
297 q_nph, dof_nph(lev), 0, 0, ICNS::ndim,
299
300 // Calculate fluxes using momentum directly
301 if (!mphase_vof) {
302
303 for (int idim = 0; idim < dof_field.num_comp(); ++idim) {
304 amrex::MultiFab::Multiply(
305 q, rho_o(lev), 0, idim, 1, fvm::Godunov::nghost_state);
306 // Source terms at old state during advection calculation
307 amrex::MultiFab::Multiply(
308 fq, rho_o(lev), 0, idim, 1, fvm::Godunov::nghost_src);
309
310 amrex::MultiFab::Multiply(
311 q_nph, rho_nph(lev), 0, idim, 1,
313 }
314 }
315
316 amrex::MFItInfo mfi_info;
317 if (amrex::Gpu::notInLaunchRegion()) {
318 mfi_info.EnableTiling(amrex::IntVect(1024, 1024, 1024))
319 .SetDynamic(true);
320 }
327 const bool is_velocity = true;
328 const bool known_edge_state = false;
329 const bool godunov_use_ppm =
334 int limiter_type;
336 limiter_type = PPM::NoLimiter;
338 limiter_type = PPM::WENOZ;
340 limiter_type = PPM::WENO_JS;
341 } else {
342 limiter_type = PPM::default_limiter;
343 }
344
345 // if state is NPH, then n and n+1 are known, and only
346 // spatial extrapolation is performed
347 const amrex::Real dt_extrap =
348 (fstate == FieldState::NPH) ? 0.0_rt : dt;
349#ifdef AMREX_USE_OMP
350#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
351#endif
352 for (amrex::MFIter mfi(dof_field(lev), mfi_info); mfi.isValid();
353 ++mfi) {
354 const auto& bx = mfi.tilebox();
355 amrex::FArrayBox tmpfab(
356 amrex::grow(bx, 1), 1, amrex::The_Async_Arena());
357 tmpfab.setVal<amrex::RunOn::Device>(0.0_rt);
358 const auto& divu = tmpfab.array();
359 HydroUtils::ComputeFluxesOnBoxFromState(
360 bx, ICNS::ndim, mfi, q.const_array(mfi),
361 q_nph.const_array(mfi), flux_x(lev).array(mfi),
362 flux_y(lev).array(mfi), flux_z(lev).array(mfi),
363 face_x(lev).array(mfi), face_y(lev).array(mfi),
364 face_z(lev).array(mfi), known_edge_state,
365 u_mac(lev).const_array(mfi),
366 v_mac(lev).const_array(mfi),
367 w_mac(lev).const_array(mfi), divu, fq.const_array(mfi),
368 geom[lev], dt_extrap, dof_field.bcrec(),
369 dof_field.bcrec_device().data(), iconserv.data(),
370 godunov_use_ppm, godunov_use_forces_in_trans,
371 is_velocity, fluxes_are_area_weighted,
372 postmac_advection_type, limiter_type,
374 }
375 } else {
376 amrex::Abort("Invalid godunov scheme");
377 }
378 }
379
380 // Multiphase flux operations
381 if (mphase_vof) {
382 // Loop levels
384 repo, ICNS::ndim, iconserv, flux_x, flux_y, flux_z, dof_field,
385 dof_nph, src_term, rho_o, rho_nph, u_mac, v_mac, w_mac,
386 dof_field.bcrec(), dof_field.bcrec_device().data(),
387 rho_o.bcrec(), rho_o.bcrec_device().data(), dt, mflux_scheme,
389 }
390
391 amrex::Vector<amrex::Array<amrex::MultiFab*, AMREX_SPACEDIM>> fluxes(
392 repo.num_active_levels());
393 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
394 fluxes[lev][0] = &flux_x(lev);
395 fluxes[lev][1] = &flux_y(lev);
396 fluxes[lev][2] = &flux_z(lev);
397 }
398
399 // In order to enforce conservation across coarse-fine boundaries we
400 // must be sure to average down the fluxes before we use them
401 for (int lev = repo.num_active_levels() - 1; lev > 0; --lev) {
402 amrex::IntVect rr =
403 geom[lev].Domain().size() / geom[lev - 1].Domain().size();
404 amrex::average_down_faces(
405 GetArrOfConstPtrs(fluxes[lev]), fluxes[lev - 1], rr,
406 geom[lev - 1]);
407 }
408
409 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
410
411#ifdef AMREX_USE_OMP
412#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
413#endif
414 for (amrex::MFIter mfi(dof_field(lev), amrex::TilingIfNotGPU());
415 mfi.isValid(); ++mfi) {
416 const auto& bx = mfi.tilebox();
417
418 HydroUtils::ComputeDivergence(
419 bx, conv_term(lev).array(mfi), flux_x(lev).array(mfi),
420 flux_y(lev).array(mfi), flux_z(lev).array(mfi), ICNS::ndim,
421 geom[lev], static_cast<amrex::Real>(-1.0_rt),
423
424 if (m_cons == 0) {
425 amrex::FArrayBox div_umac(bx, 1, amrex::The_Async_Arena());
426 auto const& divum_arr = div_umac.array();
427 HydroUtils::ComputeDivergence(
428 bx, divum_arr, u_mac(lev).const_array(mfi),
429 v_mac(lev).const_array(mfi),
430 w_mac(lev).const_array(mfi), 1, geom[lev],
431 static_cast<amrex::Real>(1.0_rt), false);
432 HydroUtils::ComputeConvectiveTerm(
433 bx, ICNS::ndim, mfi, dof_field(lev).const_array(mfi),
434 face_x(lev).const_array(mfi),
435 face_y(lev).const_array(mfi),
436 face_z(lev).const_array(mfi), divum_arr,
437 conv_term(lev).array(mfi), iconserv.data(),
439 }
440 }
441 }
442 }
443
448
450
451 std::unique_ptr<ScratchField> m_flux_x;
452 std::unique_ptr<ScratchField> m_flux_y;
453 std::unique_ptr<ScratchField> m_flux_z;
454 std::unique_ptr<ScratchField> m_face_x;
455 std::unique_ptr<ScratchField> m_face_y;
456 std::unique_ptr<ScratchField> m_face_z;
457
458 amrex::Gpu::DeviceVector<int> iconserv;
459
462 std::string godunov_type{"weno_z"};
463 std::string mflux_type{"upwind"};
464 const bool fluxes_are_area_weighted{false};
466 int m_cons{1};
467 int m_verbose{0};
469 std::string premac_advection_type{"Godunov"};
470 std::string postmac_advection_type{"Godunov"};
471};
472
476template <>
477struct AdvectionOp<ICNS, fvm::MOL>
478{
480 CFDSim& sim,
481 PDEFields& fields_in,
482 bool has_overset,
483 bool variable_density,
484 bool mesh_mapping,
485 bool is_anelastic)
486 : fields(fields_in)
487 , u_mac(fields_in.repo.get_field("u_mac"))
488 , v_mac(fields_in.repo.get_field("v_mac"))
489 , w_mac(fields_in.repo.get_field("w_mac"))
490 , m_mesh_mapping(mesh_mapping)
491 , m_macproj_op(
492 fields.repo,
493 sim.field_boundary_manager(),
494 has_overset,
495 variable_density,
497 is_anelastic)
498 {}
499
501 const FieldState fstate,
502 const amrex::Real dt,
503 const amrex::Real /*time*/)
504 {
505
506 const auto& repo = fields.repo;
507 auto& dof_field = fields.field.state(fstate);
508
509 // computation of velocity on faces requires
510 // dof field to be in stretched mesh space
511 if (dof_field.in_uniform_space() && m_mesh_mapping) {
512 dof_field.to_stretched_space();
513 }
514
515 //
516 // Predict velocities
517 //
518
519 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
520 MOL::ExtrapVelToFaces(
521 dof_field(lev), u_mac(lev), v_mac(lev), w_mac(lev),
522 repo.mesh().Geom(lev), dof_field.bcrec(),
523 dof_field.bcrec_device().data());
524 }
525
526 m_macproj_op(fstate, dt);
527 }
528
529 void operator()(const FieldState fstate, const amrex::Real /*unused*/)
530 {
531
532 const auto& repo = fields.repo;
533 const auto& geom = repo.mesh().Geom();
534 // cppcheck-suppress constVariableReference
535 auto& conv_term = fields.conv_term.state(fstate);
536 const auto& dof_field = fields.field.state(fstate);
537 const auto& rho = repo.get_field("density").state(fstate);
538
539 //
540 // Advect velocity
541 //
542
543 int nmaxcomp = AMREX_SPACEDIM;
544 for (int lev = 0; lev < repo.num_active_levels(); ++lev) {
545
546 amrex::MFItInfo mfi_info;
547 // if (amrex::Gpu::notInLaunchRegion())
548 // mfi_info.EnableTiling(amrex::IntVect(1024,16,16)).SetDynamic(true);
549 if (amrex::Gpu::notInLaunchRegion()) {
550 mfi_info.EnableTiling(amrex::IntVect(1024, 1024, 1024))
551 .SetDynamic(true);
552 }
553#ifdef AMREX_USE_OMP
554#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
555#endif
556 for (amrex::MFIter mfi(dof_field(lev), mfi_info); mfi.isValid();
557 ++mfi) {
558 amrex::Box const& bx = mfi.tilebox();
559 amrex::Box gbx = grow(bx, fvm::MOL::nghost_state);
560
561 // Set up momentum array
562 amrex::FArrayBox qfab(
563 gbx, ICNS::ndim, amrex::The_Async_Arena());
564 const auto& q = qfab.array();
565 // Calculate momentum
566 auto rho_arr = rho(lev).const_array(mfi);
567 auto vel_arr = dof_field(lev).const_array(mfi);
568 amrex::ParallelFor(
569 gbx, ICNS::ndim,
570 [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) {
571 q(i, j, k, n) = rho_arr(i, j, k) * vel_arr(i, j, k, n);
572 });
573 // Doing this explicitly, instead of through a Multiply command,
574 // helps avoid floating-point errors with intel compilers and
575 // mimics the implementation in equation_systems/AdvOp_MOL.H
576
577 amrex::Box tmpbox = amrex::surroundingNodes(bx);
578 const int tmpcomp = nmaxcomp * AMREX_SPACEDIM;
579
580 amrex::FArrayBox tmpfab(
581 tmpbox, tmpcomp, amrex::The_Async_Arena());
582
583 amrex::Array4<amrex::Real> fx = tmpfab.array(0);
584 amrex::Array4<amrex::Real> fy = tmpfab.array(nmaxcomp);
585 amrex::Array4<amrex::Real> fz = tmpfab.array(nmaxcomp * 2);
586
588 lev, bx, AMREX_SPACEDIM, fx, fy, fz, q,
589 u_mac(lev).const_array(mfi), v_mac(lev).const_array(mfi),
590 w_mac(lev).const_array(mfi), dof_field.bcrec().data(),
591 dof_field.bcrec_device().data(), geom);
592
594 bx, AMREX_SPACEDIM, conv_term(lev).array(mfi), fx, fy, fz,
595 geom[lev].InvCellSizeArray());
596 }
597 }
598 }
599
604
606
608};
609
610} // namespace kynema_sgf::pde
611
612#endif /* ICNS_ADVECTION_H */
Definition CFDSim.H:55
Definition FieldBoundary.H:51
Definition Field.H:112
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:10
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:449
std::unique_ptr< ScratchField > m_face_x
Definition icns_advection.H:454
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:446
std::unique_ptr< ScratchField > m_flux_x
Definition icns_advection.H:451
void operator()(const FieldState fstate, const amrex::Real dt)
Definition icns_advection.H:250
Field & w_mac
Definition icns_advection.H:447
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:458
godunov::scheme mflux_scheme
Definition icns_advection.H:461
const bool fluxes_are_area_weighted
Definition icns_advection.H:464
bool godunov_use_forces_in_trans
Definition icns_advection.H:465
bool m_allow_inflow_on_outflow
Definition icns_advection.H:468
Field & u_mac
Definition icns_advection.H:445
std::string godunov_type
Definition icns_advection.H:462
PDEFields & fields
Definition icns_advection.H:444
std::unique_ptr< ScratchField > m_flux_y
Definition icns_advection.H:452
int m_cons
Definition icns_advection.H:466
int m_verbose
Definition icns_advection.H:467
std::unique_ptr< ScratchField > m_face_z
Definition icns_advection.H:456
std::unique_ptr< ScratchField > m_flux_z
Definition icns_advection.H:453
std::string postmac_advection_type
Definition icns_advection.H:470
std::string premac_advection_type
Definition icns_advection.H:469
godunov::scheme godunov_scheme
Definition icns_advection.H:460
std::unique_ptr< ScratchField > m_face_y
Definition icns_advection.H:455
std::string mflux_type
Definition icns_advection.H:463
PDEFields & fields
Definition icns_advection.H:600
Field & u_mac
Definition icns_advection.H:601
MacProjOp m_macproj_op
Definition icns_advection.H:607
bool m_mesh_mapping
Definition icns_advection.H:605
void operator()(const FieldState fstate, const amrex::Real)
Definition icns_advection.H:529
AdvectionOp(CFDSim &sim, PDEFields &fields_in, bool has_overset, bool variable_density, bool mesh_mapping, bool is_anelastic)
Definition icns_advection.H:479
void preadvect(const FieldState fstate, const amrex::Real dt, const amrex::Real)
Definition icns_advection.H:500
Field & v_mac
Definition icns_advection.H:602
Field & w_mac
Definition icns_advection.H:603
Definition icns.H:34
static constexpr int ndim
Definition icns.H:40
Definition PDEFields.H:27