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