9#include "../include/var_struc.h"
10#include "../include/flux_calc.h"
31 struct b_f_var * bfv_L,
struct b_f_var * bfv_R,
const _Bool Transversal)
33 double const eps =
config[4];
34 double const h_x =
config[10];
35 struct i_f_var ifv_L = {.
n_x = 1.0, .n_y = 0.0}, ifv_R = {.n_x = 1.0, .n_y = 0.0};
39 for(i = 0; i < n; ++i)
40 for(j = 0; j <= m; ++j)
45 ifv_L.
d_u = CV->
s_u[j-1][i];
46 ifv_L.
d_v = CV->
s_v[j-1][i];
47 ifv_L.
d_p = CV->
s_p[j-1][i];
48 ifv_L.
RHO = CV[nt].
RHO[j-1][i] + 0.5*h_x*CV->
s_rho[j-1][i];
49 ifv_L.
U = CV[nt].
U[j-1][i] + 0.5*h_x* CV->
s_u[j-1][i];
50 ifv_L.
V = CV[nt].
V[j-1][i] + 0.5*h_x* CV->
s_v[j-1][i];
51 ifv_L.
P = CV[nt].
P[j-1][i] + 0.5*h_x* CV->
s_p[j-1][i];
56 ifv_L.
d_u = bfv_L[i].
SU;
57 ifv_L.
d_v = bfv_L[i].
SV;
58 ifv_L.
d_p = bfv_L[i].
SP;
59 ifv_L.
RHO = bfv_L[i].
RHO + 0.5*h_x*bfv_L[i].
SRHO;
60 ifv_L.
U = bfv_L[i].
U + 0.5*h_x*bfv_L[i].
SU;
61 ifv_L.
V = bfv_L[i].
V + 0.5*h_x*bfv_L[i].
SV;
62 ifv_L.
P = bfv_L[i].
P + 0.5*h_x*bfv_L[i].
SP;
66 ifv_R.d_rho = CV->
s_rho[j][i];
67 ifv_R.d_u = CV->
s_u[j][i];
68 ifv_R.d_v = CV->
s_v[j][i];
69 ifv_R.d_p = CV->
s_p[j][i];
70 ifv_R.RHO = CV[nt].
RHO[j][i] - 0.5*h_x*CV->
s_rho[j][i];
71 ifv_R.U = CV[nt].
U[j][i] - 0.5*h_x* CV->
s_u[j][i];
72 ifv_R.V = CV[nt].
V[j][i] - 0.5*h_x* CV->
s_v[j][i];
73 ifv_R.P = CV[nt].
P[j][i] - 0.5*h_x* CV->
s_p[j][i];
77 ifv_R.d_rho = bfv_R[i].
SRHO;
78 ifv_R.d_u = bfv_R[i].
SU;
79 ifv_R.d_v = bfv_R[i].
SV;
80 ifv_R.d_p = bfv_R[i].
SP;
81 ifv_R.RHO = bfv_R[i].
RHO - 0.5*h_x*bfv_R[i].
SRHO;
82 ifv_R.U = bfv_R[i].
U - 0.5*h_x*bfv_R[i].
SU;
83 ifv_R.V = bfv_R[i].
V - 0.5*h_x*bfv_R[i].
SV;
84 ifv_R.P = bfv_R[i].
P - 0.5*h_x*bfv_R[i].
SP;
86 if(ifv_L.
P < eps || ifv_R.P < eps || ifv_L.
RHO < eps || ifv_R.RHO < eps)
88 printf(
"<0.0 error on [%d, %d, %d] (nt, x, y) - Reconstruction_x\n", nt, j, i);
91 if(!isfinite(ifv_L.
d_p)|| !isfinite(ifv_R.d_p)|| !isfinite(ifv_L.
d_u)|| !isfinite(ifv_R.d_u)|| !isfinite(ifv_L.
d_v)|| !isfinite(ifv_R.d_v)|| !isfinite(ifv_L.
d_rho)|| !isfinite(ifv_R.d_rho))
93 printf(
"NAN or INFinite error on [%d, %d, %d] (nt, x, y) - d_Slope_x\n", nt, j, i);
103 ifv_L.
t_u = CV->
t_u[j-1][i];
104 ifv_L.
t_v = CV->
t_v[j-1][i];
105 ifv_L.
t_p = CV->
t_p[j-1][i];
110 ifv_L.
t_u = bfv_L[i].
TU;
111 ifv_L.
t_v = bfv_L[i].
TV;
112 ifv_L.
t_p = bfv_L[i].
TP;
116 ifv_R.t_rho = CV->
t_rho[j][i];
117 ifv_R.t_u = CV->
t_u[j][i];
118 ifv_R.t_v = CV->
t_v[j][i];
119 ifv_R.t_p = CV->
t_p[j][i];
123 ifv_R.t_rho = bfv_R[i].
TRHO;
124 ifv_R.t_u = bfv_R[i].
TU;
125 ifv_R.t_v = bfv_R[i].
TV;
126 ifv_R.t_p = bfv_R[i].
TP;
128 if(!isfinite(ifv_L.
t_p)|| !isfinite(ifv_R.t_p)|| !isfinite(ifv_L.
t_u)|| !isfinite(ifv_R.t_u)|| !isfinite(ifv_L.
t_v)|| !isfinite(ifv_R.t_v)|| !isfinite(ifv_L.
t_rho)|| !isfinite(ifv_R.t_rho))
130 printf(
"NAN or INFinite error on [%d, %d, %d] (nt, x, y) - t_Slope_x\n", nt, j, i);
151 printf(
"<0.0 error on [%d, %d, %d] (nt, x, y) - STAR_x\n", nt, j, i);
154 printf(
"NAN or INFinite error on [%d, %d, %d] (nt, x, y) - STA_x\n", nt, j, i);
157 printf(
"NAN or INFinite error on [%d, %d, %d] (nt, x, y) - DIRE_x\n", nt, j, i);
162 CV->
F_u[j][i] = ifv_L.
F_u;
163 CV->
F_v[j][i] = ifv_L.
F_v;
164 CV->
F_e[j][i] = ifv_L.
F_e;
int GRP_2D_flux(struct i_f_var *ifv, struct i_f_var *ifv_R, const double tau)
This function calculate Eulerian fluxes of 2-D Euler equations by 2-D GRP solver.
int flux_generator_x(const int m, const int n, const int nt, const double tau, struct cell_var_stru *CV, struct b_f_var *bfv_L, struct b_f_var *bfv_R, const _Bool Transversal)
This function calculate Eulerian fluxes of 2-D Euler equations in x-direction by 2-D GRP solver.
Fluid VARiables at Boundary.
double SV
spatial derivatives in coordinate x (slopes).
double TV
spatial derivatives in coordinate y (slopes).
pointer structure of VARiables on STRUctural computational grid CELLs.
double ** F_v
numerical fluxes at (x_{j-1/2}, t_{n}).
double ** pIx
interfacial variable values in coordinate x at t_{n+1}.
double ** s_p
spatial derivatives in coordinate x (slopes).
double ** t_p
spatial derivatives in coordinate y (slopes).
Interfacial Fluid VARiables.
double V
variable values at t_{n}.
double V_int
interfacial variables at t_{n+1}.
double t_v
tangential spatial derivatives OR spatial derivatives in Lagrangian coordinate ξ
double F_v
interfacial fluxes at t_{n+1/2}.
double d_v
normal spatial derivatives.
double config[]
Initial configuration data array.