47 int ndims = solver->
ndims;
48 int ghosts= solver->
ghosts;
51 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
53 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
60 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
62 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
132 int ndims = solver->
ndims;
134 int ghosts = solver->
ghosts;
136 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
137 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
138 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
144 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
146 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
168 double eigL,eigC,eigR;
170 eigL = D[k*_MODEL_NVARS_+k];
172 eigR = D[k*_MODEL_NVARS_+k];
174 eigC = D[k*_MODEL_NVARS_+k];
176 if ((eigL > 0) && (eigC > 0) && (eigR > 0)) fc[k] = fcL[k];
177 else if ((eigL < 0) && (eigC < 0) && (eigR < 0)) fc[k] = fcR[k];
180 fc[k] = 0.5 * (fcL[k] + fcR[k] + alpha * (ucL[k]-ucR[k]));
186 MatVecMult3(_MODEL_NVARS_,(fI+_MODEL_NVARS_*p),R,fc);
229 int ndims = solver->
ndims;
231 int ghosts = solver->
ghosts;
233 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
234 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
235 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
241 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
243 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
265 double eigL,eigC,eigR;
267 eigL = D[k*_MODEL_NVARS_+k];
269 eigR = D[k*_MODEL_NVARS_+k];
271 eigC = D[k*_MODEL_NVARS_+k];
274 fc[k] = 0.5 * (fcL[k] + fcR[k] + alpha * (ucL[k]-ucR[k]));
278 MatVecMult3(_MODEL_NVARS_,(fI+_MODEL_NVARS_*p),R,fc);
310 int ndims = solver->
ndims;
313 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
314 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
315 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
321 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
323 double rho,v,e,P,c,gamma=param->
gamma,term,Mach;
328 Mach = v/sqrt(gamma*P/rho);
334 }
else if (Mach < 1.0) {
337 c = sqrt(gamma*P/rho);
338 term = rho/(2.0*gamma);
340 fp[0] = term * (2*gamma*v + c - v);
341 fp[1] = term * (2*(gamma-1.0)*v*v + (v+c)*(v+c));
342 fp[2] = term * ((gamma-1.0)*v*v*v + 0.5*(v+c)*(v+c)*(v+c) + ((3.0-gamma)*(v+c)*c*c)/(2.0*(gamma-1.0)));
345 c = sqrt(gamma*P/rho);
346 term = rho/(2.0*gamma);
348 fm[0] = term * (v - c);
349 fm[1] = term * (v-c) * (v-c);
350 fm[2] = term * (0.5*(v-c)*(v-c)*(v-c) + ((3.0-gamma)*(v-c)*c*c)/(2.0*(gamma-1.0)));
393 int ndims = solver->
ndims;
394 int ghosts= solver->
ghosts;
397 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
398 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
399 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
408 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
411 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
417 for (k = 0; k <
_MODEL_NVARS_; k++) udiff[k] = 0.5 * (uR[_MODEL_NVARS_*p+k] - uL[_MODEL_NVARS_*p+k]);
419 double rho, uvel, E, P, c;
422 c = param->
gamma*P/rho;
426 c = param->
gamma*P/rho;
430 c = param->
gamma*P/rho;
431 double alphaavg = c +
absolute(uvel);
434 double alpha = kappa*
max3(alphaL,alphaR,alphaavg);
437 fI[_MODEL_NVARS_*p+k] = 0.5 * (fL[_MODEL_NVARS_*p+k]+fR[_MODEL_NVARS_*p+k]) - alpha*udiff[k];
470 int ndims = solver->
ndims;
471 int ghosts= solver->
ghosts;
475 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
476 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
477 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
484 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
486 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
551 int ndims = solver->
ndims;
553 int ghosts = solver->
ghosts;
556 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
557 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
558 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
564 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
566 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
588 double eigL,eigC,eigR;
590 eigL = (k == 0? 0.0 : D[k*_MODEL_NVARS_+k]);
592 eigR = (k == 0? 0.0 : D[k*_MODEL_NVARS_+k]);
594 eigC = (k == 0? 0.0 : D[k*_MODEL_NVARS_+k]);
596 if ((eigL > 0) && (eigC > 0) && (eigR > 0)) fc[k] = fcL[k];
597 else if ((eigL < 0) && (eigC < 0) && (eigR < 0)) fc[k] = fcR[k];
600 fc[k] = 0.5 * (fcL[k] + fcR[k] + alpha * (ucL[k]-ucR[k]));
606 MatVecMult3(_MODEL_NVARS_,(fI+_MODEL_NVARS_*p),R,fc);
640 int ndims = solver->
ndims;
642 int ghosts = solver->
ghosts;
645 int index_outer[ndims], index_inter[ndims], bounds_outer[ndims], bounds_inter[ndims];
646 _ArrayCopy1D_(dim,bounds_outer,ndims); bounds_outer[dir] = 1;
647 _ArrayCopy1D_(dim,bounds_inter,ndims); bounds_inter[dir] += 1;
653 for (index_inter[dir] = 0; index_inter[dir] < bounds_inter[dir]; index_inter[dir]++) {
655 int indexL[ndims];
_ArrayCopy1D_(index_inter,indexL,ndims); indexL[dir]--;
677 double eigL,eigC,eigR;
679 eigL = (k == 0? 0.0 : D[k*_MODEL_NVARS_+k]);
681 eigR = (k == 0? 0.0 : D[k*_MODEL_NVARS_+k]);
683 eigC = (k == 0? 0.0 : D[k*_MODEL_NVARS_+k]);
686 fc[k] = 0.5 * (fcL[k] + fcR[k] + alpha * (ucL[k]-ucR[k]));
690 MatVecMult3(_MODEL_NVARS_,(fI+_MODEL_NVARS_*p),R,fc);
#define _ArraySetValue_(x, size, value)
int Euler1DUpwindSWFS(double *, double *, double *, double *, double *, double *, int, void *, double)
#define _Euler1DGetFlowVar_(u, rho, v, e, P, p)
#define _ArrayIncrementIndex_(N, imax, i, done)
#define _Euler1DRightEigenvectors_(u, R, p, dir)
#define MatMult3(N, A, X, Y)
#define _ArrayCopy1D3_(x, y, size)
#define _ArrayIndex1D_(N, imax, i, ghost, index)
Contains function definitions for common mathematical functions.
int Euler1DUpwinddFLLF(double *, double *, double *, double *, double *, double *, int, void *, double)
#define _Euler1DRoeAverage_(uavg, uL, uR, p)
#define _ArrayCopy1D_(x, y, size)
int Euler1DUpwindRF(double *, double *, double *, double *, double *, double *, int, void *, double)
#define _Euler1DEigenvalues_(u, D, p, dir)
Contains structure definition for hypar.
int Euler1DUpwindLLF(double *, double *, double *, double *, double *, double *, int, void *, double)
int Euler1DUpwinddFRoe(double *, double *, double *, double *, double *, double *, int, void *, double)
Some basic definitions and macros.
Contains macros and function definitions for common array operations.
int Euler1DUpwindRoe(double *, double *, double *, double *, double *, double *, int, void *, double)
1D Euler Equations (inviscid, compressible flows)
Structure containing all solver-specific variables and functions.
Structure containing variables and parameters specific to the 1D Euler equations. This structure cont...
#define MatVecMult3(N, y, A, x)
int Euler1DUpwinddFRF(double *, double *, double *, double *, double *, double *, int, void *, double)
#define _ArrayAdd1D_(x, a, b, size)
Contains macros and function definitions for common matrix multiplication.
int Euler1DUpwindRusanov(double *, double *, double *, double *, double *, double *, int, void *, double)
#define _Euler1DLeftEigenvectors_(u, L, p, dir)