/home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/vof/vof_hybridsolver_ops.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/equation_systems/vof/vof_hybridsolver_ops.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
vof_hybridsolver_ops.H
Go to the documentation of this file.
1#ifndef VOF_HYBRIDSOLVER_OPS_H_
2#define VOF_HYBRIDSOLVER_OPS_H_
3
4#include <AMReX_FArrayBox.H>
6#include <cmath>
7
8namespace amr_wind::multiphase {
9
11 const int nlevels,
12 amr_wind::IntField& f_iblank,
13 amr_wind::Field& f_vof,
14 amr_wind::Field& f_vof_new)
15{
16 // Sharpen data from nalu-wind (in iblank regions)
17 for (int lev = 0; lev < nlevels; ++lev) {
18 auto& iblank = f_iblank(lev);
19 auto& vof = f_vof(lev);
20 const auto& vof_new = f_vof_new(lev);
21
22 for (amrex::MFIter mfi(iblank); mfi.isValid(); ++mfi) {
23 const auto& gbx = mfi.growntilebox();
24 const amrex::Array4<const int>& native_flag =
25 iblank.const_array(mfi);
26 const amrex::Array4<amrex::Real>& volfrac = vof.array(mfi);
27 const amrex::Array4<const amrex::Real>& vfmasked =
28 vof_new.const_array(mfi);
29 amrex::ParallelFor(
30 gbx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept {
31 // In iblanked regions, sharpen VOF and limit it
32 volfrac(i, j, k) = (native_flag(i, j, k) > 0)
33 ? volfrac(i, j, k)
34 : vfmasked(i, j, k);
35 });
36 }
37 }
38}
39
40} // namespace amr_wind::multiphase
41
42#endif // VOF_HYBRIDSOLVER_OPS.H
Definition Field.H:116
Definition IntField.H:20
Definition height_functions.H:8
static void replace_masked_vof(const int nlevels, amr_wind::IntField &f_iblank, amr_wind::Field &f_vof, amr_wind::Field &f_vof_new)
Definition vof_hybridsolver_ops.H:10