85#define kappa(f) (clamp(f,0.,1.)*(kappa1 - kappa2) + kappa2)
147 for (
int _i = 0;
_i <
l;
_i++) {
162 for (
int _i = 0;
_i <
l;
_i++) {
163 T[] = (
T[] + 2.*
cT[])/3.;
164 p[] = (
p[] + 2.*
cp[])/3.;
243#define poisson(...) poisson_thermal(__VA_ARGS__)
280 double ff = (
f[] +
f[-1])/2.;
scalar ps[]
The equation of state is defined by the pressure field ps and .
#define face_gradient_x(a, i)
static number sq(number x)
static number clamp(number x, number a, number b)
scalar f[]
The primary fields are:
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 energy(double *PE=NULL, double *KE=NULL)
We then define the corresponding relaxation and residual functions which will be used by the multigri...
Information about the convergence of the solver is returned in a structure.
void event_acceleration(void)
Event: acceleration (i++)
void event_end_timestep(void)
Event: end_timestep (i++)
double kappa1
... and the thermal conductivities and specific heat capacities.
double thermal_expansion(Point point)
double average_temperature(Point point, double p)
These functions are provided by the Equation Of State.
static double residual_thermal(scalar *al, scalar *bl, scalar *resl, void *data)
static void relax_thermal(scalar *al, scalar *bl, int l, void *data)
void event_defaults(void)
If the thermal conductivities are not-zero, we need to allocate a new field.
mgstats poisson_thermal(scalar p, scalar rhs, const vector alpha, const scalar lambda, double tolerance=0., int nrelax=4, int minlevel=0, scalar *res=NULL)
This is the interface for the coupled solver.