59 static const double cmin = 0.5;
88 if (
cm[] == 0. || (!
s.inverse &&
f[] <= 0.) || (
s.inverse &&
f[] >= 1.))
89 for (
int _c = 0;
_c < 4;
_c++)
95 double sc =
s.inverse ?
s[]/(1. -
f[]) :
s[]/
f[],
cmc = 4.*
cm[];
96 for (
int _c = 0;
_c < 4;
_c++) {
100 s[] *=
s.inverse ? 1. -
f[] :
f[];
112 for (
int _c = 0;
_c < 1;
_c++) {
116 for (
int _t = 0;
_t < 1;
_t++) {
133 for (
int _c = 0;
_c < 1;
_c++) {
135 for (
int _t = 0;
_t < 1;
_t++)
178 for (
int _t = 0;
_t < 1;
_t++) {
208 int i = -(
s + 1.)/2.;
230 double cf = (
c[
i] <= 0. ||
c[
i] >= 1.) ?
c[
i] :
232 (
coord){-0.5, -0.5, -0.5},
266 "src/vof.h:%d: warning: CFL must be <= 0.5 for VOF (cfl - 0.5 = %g)\n",
332 for (
int _c = 0;
_c < 1;
_c++) {
343 for (
int _t = 0;
_t < 1;
_t++) {
344#if !NO_1D_COMPRESSION
359#if !NO_1D_COMPRESSION
363 tc[] =
c[] < 0.5 ?
t[]/(1. -
c[]) : 0.;
365 tc[] =
c[] > 0.5 ?
t[]/
c[] : 0.;
vector g[]
We store the combined pressure gradient and acceleration field in g*.
double zero(double s0, double s1, double s2)
scalar * list_add(scalar *list, scalar s)
static int sign(number x)
scalar * list_append(scalar *list, scalar s)
scalar f[]
The primary fields are:
scalar cs[]
The volume and area fractions are stored in these fields.
void fraction_refine(Point point, scalar c)
double rectangle_fraction(coord n, double alpha, coord a, coord b)
VOF algorithms require the computation of volume fractions on (rectangular) parts of the initial squa...
static void restriction_volume_average(Point point, scalar s)
void set_prolongation(scalar s, void(*prolongation)(Point, scalar))
void set_restriction(scalar s, void(*restriction)(Point, scalar))
double dt
These come from the multilayer solver.
scalar * interfaces
We will need basic functions for volume fraction computations.
void event_vof(void) vof_advection(interfaces
Event: vof (i++)
void event_stability(void)
We need to make sure that the CFL is smaller than 0.5 to ensure stability of the VOF scheme.
void vof_advection(scalar *interfaces, int i)
scalar * tracers
If we are also transporting tracers associated with , we need to compute their gradient i....
void event_defaults(void)
On trees, we need to setup the appropriate prolongation and refinement functions for the volume fract...
reconstruction(c, n, alpha)
We reconstruct the interface normal and the intercept for each cell.
static void vof_concentration_refine(Point point, scalar s)
On trees, VOF concentrations need to be refined properly i.e.
vector uf
We allocate the (face) velocity field.