43# define lambda ((coord){0, dt*(mu.x[] + mu.x[1] \
44 + mu.y[] + mu.y[0,1])*sq(cs[]) \
45 /(fm.x[] + fm.x[1] + fm.y[] + fm.y[0,1] + SEPS)/(cm[] + SEPS)})
48# define lambda ((coord){0.,0.,0.})
116 res.x[] -=
dt*(
c +
d*
u.x[]);
133 res.x[] -=
dt*(
c +
d*
u.x[]);
vector g[]
We store the combined pressure gradient and acceleration field in g*.
static double antisymmetry(Point point, Point neighbor, scalar s, bool *data)
#define face_gradient_x(a, i)
static number sq(number x)
#define mu(f)
By default the Harmonic mean is used to compute the phase-averaged dynamic viscosity.
double embed_flux(Point point, scalar s, vector mu, double *val)
#define rho(f)
The density and viscosity are defined using arithmetic averages by default.
void(* restriction)(Point, scalar)
trace mgstats mg_solve(scalar *a, scalar *b, double(*residual)(scalar *a, scalar *b, scalar *res, void *data), void(*relax)(scalar *da, scalar *res, int depth, void *data), void *data=NULL, int nrelax=4, scalar *res=NULL, int minlevel=0, double tolerance=TOLERANCE)
The user needs to provide a function which computes the residual field (and returns its maximum) as w...
double(* embed_flux)(Point, scalar, vector, double *)
Information about the convergence of the solver is returned in a structure.
static double residual_diffusion(scalar *a, scalar *b, scalar *resl, void *data)
trace mgstats viscosity(vector u, vector mu, scalar rho, double dt, int nrelax=4, scalar *res=NULL)
static void relax_diffusion(scalar *a, scalar *b, int l, void *data)