/home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/icns/icns_advection.H Source File

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