97 for (
int _i = 0;
_i < _N;
_i++)
131 if (!is_constant(
a.
x)) {
133 for (
int _i = 0;
_i < _N;
_i++)
160 if (constant(
mu.
x) != 0.) {
161 for (
int _i = 0;
_i < _N;
_i++)
165 for (
int _i = 0;
_i < _N;
_i++)
175 for (
int _i = 0;
_i < _N;
_i++)
210 for (
int _i = 0;
_i < _N;
_i++) {
216 if (constant(
lambda) == 0.)
229 rhs[] += div/(
dt*Delta);
247 for (
int _i = 0;
_i < _N;
_i++) {
258 for (
int _i = 0;
_i < _N;
_i++)
260 g.
x[] =
rho[]*(gf.
x[] + gf.
x[1])/(2.*
cm[]);
277 event (
"properties");
vector g[]
We store the combined pressure gradient and acceleration field in g*.
void event_pressure(void)
The equation for the pressure is a Poisson–Helmoltz problem which we will solve with the multigrid so...
void event_stability(void)
Event: stability (i++,last)
double dtmax
The timestep is computed using the CFL condition on the face velocity field.
event acceleration(i++, last)
This event can be overloaded to add acceleration terms.
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
void event_init(void)
Event: init (i = 0)
event vof(i++, last)
Tracers (including momentum ) are advected by these events.
scalar ps[]
The equation of state is defined by the pressure field ps and .
void event_defaults(void)
Event: defaults (i = 0)
void event_properties(void)
The equation of state (i.e.
vector uf[]
We allocate the (face) velocity field.
void event_adapt(void)
After mesh adaptation fluid properties need to be updated.
event end_timestep(i++, last)
Some derived solvers need to hook themselves at the end of the timestep.
event set_dtmax(i++, last) dtmax
event tracer_advection(i++, last)
trace double timestep(void)
static number sq(number x)
void event(const char *name)
Information about the convergence of the solver is returned in a structure.
#define poisson(...)
Finally, we overload the poisson() function called by [two-phase.h]() with our new function.
trace mgstats viscosity(vector u, vector mu, scalar rho, double dt, int nrelax=4, scalar *res=NULL)