AMReX-Hydro
AMReX-based hydro routines for low Mach number flows
Loading...
Searching...
No Matches
hydro_plic_K.H File Reference
#include <AMReX_Algorithm.H>
#include <AMReX_Array4.H>
#include <AMReX_Geometry.H>
#include <AMReX_REAL.H>
#include <cmath>
#include <limits>
Include dependency graph for hydro_plic_K.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  PLIC

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool PLIC::is_mixed (const amrex::Real f) noexcept
 Whether a cell with volume fraction f holds the interface.
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void PLIC::sort3 (const amrex::Real a, const amrex::Real b, const amrex::Real c, amrex::Real &lo, amrex::Real &mid, amrex::Real &hi) noexcept
 a, b and c in ascending order, as lo <= mid <= hi.
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real PLIC::trig_root (const amrex::Real p, const amrex::Real q) noexcept
 The root of the cubic of volume_intercept in its two upper volume ranges, in the trigonometric form of Scardovelli & Zaleski, without the constant offset of the range.
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real PLIC::volume_intercept (const amrex::Real b1, const amrex::Real b2, const amrex::Real b3, const amrex::Real volF)
 Analytic plane constant alpha such that the region m1*x1 + m2*x2 + m3*x3 <= alpha of the unit cube has volume volF. Requires m1,m2,m3 >= 0 and m1+m2+m3 = 1. Any one (2D) or two (grid-aligned) coefficients may be zero.
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real PLIC::cut_volume (const amrex::Real m1, const amrex::Real m2, const amrex::Real m3, const amrex::Real alpha, const amrex::Real r0, const amrex::Real dr0)
 Liquid volume fraction of the sub-box [r0, r0+dr0] x [0,1] x [0,1] of the unit cube cut by m1*x1 + m2*x2 + m3*x3 <= alpha. The result is normalized by the sub-box volume dr0. Coefficients may have any sign; m3 = 0 gives the 2D result.
template<typename Phi>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real PLIC::cell_fraction (const int i, const int j, const int k, amrex::GeometryData const &geomdata, Phi const &phi, const int nsub=8)
 Liquid volume fraction of cell (i,j,k) for an implicit surface phi(x) > 0 inside the liquid, by midpoint sampling on nsub^dim sub-cells. Intended for problem initialization.
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real PLIC::plane_fraction (const int i, const int j, const int k, amrex::GeometryData const &geomdata, const amrex::Real n[AMREX_SPACEDIM], const amrex::Real d)
 Exact liquid volume fraction of cell (i,j,k) for the half space n.x <= d (physical coordinates, n need not be normalized). Intended for problem initialization.

Variables

static constexpr amrex::Real PLIC::pure_tol = 1.0e-8_rt

Detailed Description

Geometric kernels of the piecewise-linear interface calculation (PLIC).

The interface in a cell is the plane m.x = alpha in unit-cube cell coordinates, with the liquid on the side m.x <= alpha (m points out of the liquid). The volume <-> plane-constant relations are the analytic ones of Scardovelli & Zaleski (JCP 164, 2000).

Derived from Kynema-SGF (formerly AMR-Wind), src/equation_systems/vof, BSD 3-Clause License, Copyright (c) 2020, Alliance for Energy Innovation and Regents of the University of California. Changes: 2D variants, per-face flux evaluation, AMReX-Hydro conventions, normal schemes as template parameters.