30 for (
int l = 0;
l <
nl;
l++) {
49 for (
int l = 0;
l <
nl;
l++)
60 alpha[0] = 200./69.,
alpha[1] = 168070./109503.;
61 beta[0] = 20./69.,
beta[1] = 49./69.;
67 alpha[1] = 21884919./16356250.;
68 alpha[2] = 2624395780083./1792301911300.;
70 beta[1] = 19663./65425.;
71 beta[2] = 14641./26170.;
76 alpha[0] = 3.483931265467430;
77 alpha[1] = 1.916127288169944;
78 alpha[2] = 1.710830494276016;
79 beta[0] = 0.0569717048168878;
80 beta[1] = 0.2367448039534642;
81 beta[2] = 0.7062834912296478;
85 alpha[0] = 2.962285714285714;
86 alpha[1] = 1.350414737345379;
87 alpha[2] = 1.185189693944078;
88 alpha[3] = 1.472922288188395;
89 beta[0] = 0.0822857142857143;
90 beta[1] = 0.1806217280518879;
91 beta[2] = 0.2639407055948642;
92 beta[3] = 0.4731518520675335;
95 alpha[0] = 2.974434611602751;
96 alpha[1] = 1.364709853835999;
97 alpha[2] = 1.176733678121684;
98 alpha[3] = 1.143228438965934;
99 alpha[4] = 1.490559988000380;
100 beta[0] = 0.0540806293018682;
101 beta[1] = 0.1209195157421197;
102 beta[2] = 0.1769793771848123;
103 beta[3] = 0.2310497798249295;
104 beta[4] = 0.4169706979462702;
107 for (
int l = 0;
l <
nl;
l++)
125 alpha[0] = 3.569011576135351,
alpha[1] = 17.93213572854291;
126 gammap[0] = 1.314297124600639,
gammap[1] = 8.11587147030185;
144 alpha[0] = 618.4548736462094;
145 alpha[1] = 4.337984496124031;
146 alpha[2] = 9.782144219763449;
147 gammap[0] = 33.44576523031203;
148 gammap[1] = 4.741971207087486;
149 gammap[2] = 6.894753476611884;
184 for (
int l = 0;
l <
nl - 1;
l++)
251 double *
a,
double (*
b)[2],
double *
c)
255 for (
int _h = 0;
_h < 1;
_h++) {
275 double *
a,
double (*
b)[2],
double *
c)
278 for (
int _h = 0;
_h < 1;
_h++) {
296 double *
a,
double *
b,
double *
c,
double *
d)
355 double *
a,
double *
b,
double *
c,
double *
d)
408 (
zc +
h[]/2. -
zl -
h[-1]/2.)*(
s[-1] -
phi[-1]))/
424 for (
int l = 1;
l <
nl;
l++) {
430 for (
int l =
nl - 2;
l >= 0;
l--) {
498 for (
int l = 1;
l <
nl;
l++) {
504 for (
int l =
nl - 2;
l >= 0;
l--) {
549 res[] +=
h[]*((
s[1] -
s[-1])*(
zr +
h[1] -
zl -
h[-1]) -
553 res[] +=
h[]*((
zr +
h[1]/2. -
z -
h[]/2.)*
555 (
z +
h[]/2. -
zl -
h[-1]/2.)*
667 nrelax = 4, res =
NULL, minlevel = 1, tolerance =
TOLERANCE);
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).
vector q[]
The primitive variables are the momentum , pressure , density , (face) specific volume ,...
scalar * list_clone(scalar *l)
#define face_gradient_x(a, i)
static number sq(number x)
scalar * list_append(scalar *list, scalar s)
define sysmalloc malloc define syscalloc calloc define sysrealloc realloc define sysfree free define systrdup strdup define line calloc(n, s) @ define prealloc(p
scalar phi[]
The electric potential and the volume charge density are scalars while the permittivity and conductiv...
scalar scalar coord coord double bc
define neighborp(k, l, o) neighbor(k
void(* restriction)(Point, scalar)
void vertical_viscosity(Point point, double h, vector *ul, double dt)
For stability, we discretise the viscous friction term implicitly as.
void event_pressure(void)
Event: pressure (i++)
static void coeffs1(Point point, scalar *hl, double *a, double(*b)[2], double *c)
void correct_qz(double dt, const scalar phis)
static trace void relax_nh1(scalar *phil, scalar *rhsl, int lev, void *data)
static double residual_nh3(scalar *phil, scalar *rhsl, scalar *resl, void *data)
static void matrix(Point point, scalar *phil, scalar *rhsl, double *a, double *b, double *c, double *d)
static double residual_nh(scalar *phil, scalar *rhsl, scalar *resl, void *data)
void event_viscous_term(void)
Event: viscous_term (i++)
static void matrix1(Point point, scalar *phil, scalar *rhsl, double *a, double *b, double *c, double *d)
void event_cleanup(void)
Event: cleanup (i = end, last)
void event_defaults(void)
Event: defaults (i = 0)
static trace void relax_nh(scalar *phil, scalar *rhsl, int lev, void *data)
static double residual_nh2(scalar *phil, scalar *rhsl, scalar *resl, void *data)
static void coeffs2(Point point, scalar *hl, double *a, double(*b)[2], double *c)
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...
Information about the convergence of the solver is returned in a structure.