87# define neumann_pressure(i) (alpha.n[i] ? a.n[i]*fm.n[i]/alpha.n[i] : \
88 a.n[i]*rho[]/(cm[] + SEPS))
90# define neumann_pressure(i) (a.n[i]*fm.n[i]/alpha.n[i])
144 p.nodump =
pf.nodump =
true;
175 for (
int _s = 0;
_s < 1;
_s++) {
180 for (
int _s = 0;
_s < 1;
_s++)
217 event (
"properties");
284 du.x[] =
u.x.gradient (
u.x[-1],
u.x[],
u.x[1])/
Delta;
300 int i = -(
s + 1.)/2.;
304 double fyy =
u.y[
i] < 0. ?
u.x[
i,1] -
u.x[
i] :
u.x[
i] -
u.x[
i,-1];
309 if (
fm.z[
i,0,0] &&
fm.z[
i,0,1]) {
310 double fzz =
u.z[
i] < 0. ?
u.x[
i,0,1] -
u.x[
i] :
u.x[
i] -
u.x[
i,0,-1];
362 if (constant(
mu.
x) != 0.) {
471 event (
"properties");
trace double timestep(void)
trace void advection(scalar *tracers, vector u, double dt, scalar *src=NULL)
The function below uses the tracer_fluxes function to integrate the advection equation,...
void event_advection_term(void)
Event: advection_term (i++,last)
void event_acceleration(void)
Event: acceleration (i++,last)
void event_default_display(void) display("squares (color
We had some objects to display by default.
void event_stability(void)
Event: stability (i++,last)
event properties(i++, last)
The fluid properties such as specific volume (fields and ) or dynamic viscosity (face field ) – at t...
double dtmax
After user initialisation, we initialise the face velocity and fluid properties.
void event_projection(void)
To get the pressure field at time we project the face velocity field (which will also be used for tr...
scalar p[]
The primary variables are the centered pressure field and the centered velocity field .
event tracer_diffusion(i++, last)
const vector mu
In the case of variable density, the user will need to define both the face and centered specific vol...
void event_init(void)
Event: init (i = 0)
#define neumann_pressure(i)
void event_viscous_term(void)
The viscous term is computed implicitly.
event vof(i++, last)
If we are using VOF or diffuse tracers, we need to advance them (to time ) here.
void event_defaults(void)
For embedded boundaries on trees, we need to define the pressure gradient for prolongation of pressur...
vector uf[]
We allocate the (face) velocity field.
void event_adapt(void)
Event: adapt (i++,last)
event end_timestep(i++, last)
Some derived solvers need to hook themselves at the end of the timestep.
void centered_gradient(scalar p, vector g)
event set_dtmax(i++, last) dtmax
event tracer_advection(i++, last)
static void correction(double dt)
void display(const char *commands, bool overwrite=false)
scalar * list_add(scalar *list, scalar s)
static int sign(number x)
trace bool squares(char *color, char *z=NULL, double min=0, double max=0, double spread=0, bool linear=false, Colormap map=jet, float fc[3]={0}, float lc[3]={0}, bool expr=false, coord n={0, 0, 1}, double alpha=0, float lw=1, bool cbar=false, float size=15, float pos[2]={-.95, -.95}, char *label="", double lscale=1, bool horizontal=false, bool border=false, bool mid=false, float fsize=50, char *format="%g", int levels=50)
static void restriction_embed_linear(Point point, scalar s)
static void refine_embed_linear(Point point, scalar s)
scalar cs[]
The volume and area fractions are stored in these fields.
macro2 double neumann(double expr, Point point=point, scalar s=_s, bool *data=data)
macro2 double dirichlet(double expr, Point point=point, scalar s=_s, bool *data=data)
For ease of use, we replace the Neumann and Dirichlet functions with macros so that they can be used ...
trace int fractions_cleanup(scalar c, vector s, double smin=0., bool opposite=false)
void event(const char *name)
trace mgstats project(vector uf, scalar p, const vector alpha=unityf, double dt=1., int nrelax=4)
Information about the convergence of the solver is returned in a structure.
void refine_face_solenoidal(Point point, scalar s)
void refine_face(Point point, scalar s)
trace mgstats viscosity(vector u, vector mu, scalar rho, double dt, int nrelax=4, scalar *res=NULL)