40#define NO_1D_COMPRESSION 1
85# define mu(f) (mu1*mu2/(clamp(f,0,1)*(mu2 - mu1) + mu1))
94# define lambdav(f) (clamp(f,0,1)*(lambdav1 - lambdav2) + lambdav2)
132 for (
int _c = 0;
_c < 4;
_c++) {
177 for (
int _s = 0;
_s < 1;
_s++)
183 for (
int _s = 0;
_s < 1;
_s++) {
197 display (
"draw_vof (c = 'f');");
198 display (
"squares (color = 'rhov', spread = -1);");
211 event (
"properties");
225 for (
int _s = 0;
_s < 1;
_s++)
226 s.gradient =
f.gradient;
259 q2.x.gradient =
q1.x.gradient;
305 for (
int _s = 0;
_s < 1;
_s++) {
315 for (
int _s = 0;
_s < 1;
_s++) {
363 double ff = (
f[] +
f[-1])/2.;
518 (
u.y[1,-1] +
u.y[1,0])/4. -
519 (
u.y[-1,-1] +
u.y[-1,0])/4.)/
Delta;
523 ueijk.z[] =
uf.z[]*(
u.x[] -
u.x[0,0,-1] +
524 (
u.z[1,0,-1] +
u.z[1,0,0])/4. -
525 (
u.z[-1,0,-1] +
u.z[-1,0,0])/4.)/
Delta;
vector uf[]
We allocate the (face) velocity field.
scalar * tracers
Here we set the gradient functions for each tracer (as defined in the user-provided tracers list).
double dtmax
The timestep is computed using the CFL condition on the face velocity field.
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
scalar ps[]
The equation of state is defined by the pressure field ps and .
trace void momentum(vector u, scalar h, vector du)
void display(const char *commands, bool overwrite=false)
scalar * list_concat(scalar *l1, scalar *l2)
static number sq(number x)
scalar * list_copy(scalar *l)
static number clamp(number x, number a, number b)
static scalar * interfaces1
void event_stability(void)
Event: stability (i++)
#define lambdav(f)
The volumetric viscosity uses arithmetic average by default.
void event_end_timestep(void)
Event: end_timestep (i++)
double sound_speed(Point point)
These functions are provided by the Equation Of State.
void event_vof(void)
Event: vof (i++)
#define mu(f)
By default the Harmonic mean is used to compute the phase-averaged dynamic viscosity.
void event_init(void)
Event: init (i = 0)
double mu1
The dynamic viscosities for each phase, as well as the volumetric viscosity coefficients.
void fE_refine(Point point, scalar fE)
double bulk_compressibility(Point point)
void event_cleanup(void)
At the end of the simulation we clean the tracer list.
void event_defaults(void)
Event: defaults (i = 0)
void event_properties(void)
Event: properties (i++)
double average_pressure(Point point)
double CFLac
The timestep can be limited by a CFL based on the speed of sound.
void event_tracer_advection(void)
We set the list of interfaces back to its default value.
double internal_energy(Point point, double fc)
void event(const char *name)
#define rho(f)
The density and viscosity are defined using arithmetic averages by default.
static void refine_linear(Point point, scalar s)
void set_prolongation(scalar s, void(*prolongation)(Point, scalar))
double energy(double *PE=NULL, double *KE=NULL)
scalar * interfaces
The height functions are stored in the vector field associated with each VOF tracer.
double minmod2(double s0, double s1, double s2)
void vof_advection(scalar *interfaces, int i)