/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
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 const auto& native_flag_arrs = f_iblank(lev).const_arrays();
19 const auto& volfrac_arrs = f_vof(lev).arrays();
20 const auto& vfmasked_arrs = f_vof_new(lev).const_arrays();
21 amrex::ParallelFor(
22 f_iblank(lev), f_iblank.num_grow(),
23 [=] AMREX_GPU_DEVICE(int nbx, int i, int j, int k) noexcept {
24 // In iblanked regions, sharpen VOF and limit it
25 volfrac_arrs[nbx](i, j, k) =
26 (native_flag_arrs[nbx](i, j, k) > 0)
27 ? volfrac_arrs[nbx](i, j, k)
28 : vfmasked_arrs[nbx](i, j, k);
29 });
30 }
31 amrex::Gpu::streamSynchronize();
32}
33
34} // namespace amr_wind::multiphase
35
36#endif // VOF_HYBRIDSOLVER_OPS.H
Definition Field.H:116
Definition IntField.H:20
const amrex::IntVect & num_grow() const
Number of ghost cells.
Definition IntField.H:37
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