9#include "../include/var_struc.h"
10#include "../include/inter_process.h"
11#include "../include/riemann_solver.h"
21 const int dim = (int)
config[0];
22 const double delta = 0.2;
51 const int dim = (int)
config[0];
77 const int dim = (int)
config[0];
78 const double eps =
config[4];
79 const double n_x = ifv->
n_x, n_y = ifv->
n_y;
80 double gamma_mid = ifv->
gamma;
88 u = ifv->
U *n_x + ifv->
V *n_y;
89 u_R = ifv_R->
U*n_x + ifv_R->
V*n_y;
90 ifv->
V = -ifv->
U *n_y + ifv->
V *n_x;
91 ifv_R->
V = -ifv_R->
U*n_y + ifv_R->
V*n_x;
96 double wave_speed[2], dire[6], mid[6], star[6];
103 double rho_mid = mid[0], p_mid = mid[3], u_mid = mid[1], v_mid = mid[2];
104#ifdef MULTIFLUID_BASICS
105 double phi_mid = mid[4], z_a_mid = mid[5];
106 gamma_mid = mid[1] > 0.0 ? ifv->
gamma : ifv_R->
gamma;
111 ifv->
F_rho = rho_mid*u_mid;
112 ifv->
F_u = ifv->
F_rho*u_mid + p_mid;
116 u_mid = mid[1]*n_x - mid[2]*n_y;
117 v_mid = mid[1]*n_y + mid[2]*n_x;
118 ifv->
F_rho = rho_mid*(u_mid*n_x + v_mid*n_y);
119 ifv->
F_u = ifv->
F_rho*u_mid + p_mid*n_x;
120 ifv->
F_v = ifv->
F_rho*v_mid + p_mid*n_y;
122 ifv->
F_e = (gamma_mid/(gamma_mid-1.0))*p_mid/rho_mid + 0.5*u_mid*u_mid;
124 ifv->
F_e += 0.5*v_mid*v_mid;
127#ifdef MULTIFLUID_BASICS
128 ifv->F_phi = ifv->
F_rho * phi_mid;
130 ifv->F_gamma = ifv->
F_rho*gamma_mid;
131 ifv->F_e_a = z_a_mid/(
config[6]-1.0)*p_mid/rho_mid + 0.5*phi_mid*u_mid*u_mid;
133 ifv->F_e_a += 0.5*phi_mid*v_mid*v_mid;
134 ifv->F_e_a = ifv->
F_rho*ifv->F_e_a;
136 ifv->U_qt_add_c = ifv->
F_rho*u_mid*phi_mid;
138 ifv->V_qt_add_c = ifv->
F_rho*v_mid*phi_mid;
139 ifv->U_qt_star = p_mid*n_x;
140 ifv->V_qt_star = p_mid*n_y;
141 ifv->P_star = p_mid/rho_mid*ifv->
F_rho;
160 const double eps =
config[4];
161 const double n_x = ifv->
n_x, n_y = ifv->
n_y;
162 double gamma_mid = ifv->
gamma;
167 double u, u_R, d_u, d_u_R, t_u, t_u_R;
168 u = ifv->
U *n_x + ifv->
V *n_y;
169 u_R = ifv_R->
U *n_x + ifv_R->
V *n_y;
170 d_u = ifv->
d_u *n_x + ifv->
d_v *n_y;
171 d_u_R = ifv_R->
d_u*n_x + ifv_R->
d_v*n_y;
172 t_u = ifv->
t_u *n_x + ifv->
t_v *n_y;
173 t_u_R = ifv_R->
t_u*n_x + ifv_R->
t_v*n_y;
174 ifv->
V = -ifv->
U *n_y + ifv->
V *n_x;
175 ifv_R->
V = -ifv_R->
U *n_y + ifv_R->
V *n_x;
176 ifv->
d_v = -ifv->
d_u *n_y + ifv->
d_v *n_x;
177 ifv_R->
d_v = -ifv_R->
d_u*n_y + ifv_R->
d_v*n_x;
178 ifv->
t_v = -ifv->
t_u *n_y + ifv->
t_v *n_x;
179 ifv_R->
t_v = -ifv_R->
t_u*n_y + ifv_R->
t_v*n_x;
187 double wave_speed[2], dire[6], mid[6], star[6];
198 double rho_mid, p_mid, u_mid, v_mid;
199 rho_mid = mid[0] + 0.5*tau*dire[0];
200 u_mid = (mid[1] + 0.5*tau*dire[1])*n_x - (mid[2] + 0.5*tau*dire[2])*n_y;
201 v_mid = (mid[1] + 0.5*tau*dire[1])*n_y + (mid[2] + 0.5*tau*dire[2])*n_x;
202 p_mid = mid[3] + 0.5*tau*dire[3];
203#ifdef MULTIFLUID_BASICS
204 double phi_mid, z_a_mid;
205 phi_mid = mid[5] + 0.5*tau*dire[5];
206 z_a_mid = mid[4] + 0.5*tau*dire[4];
207 gamma_mid = 1.0/(z_a_mid/(
config[6]-1.0)+(1.0-z_a_mid)/(
config[106]-1.0))+1.0;
210 ifv->
F_rho = rho_mid*(u_mid*n_x + v_mid*n_y);
211 ifv->
F_u = ifv->
F_rho*u_mid + p_mid*n_x;
212 ifv->
F_v = ifv->
F_rho*v_mid + p_mid*n_y;
213 ifv->
F_e = (gamma_mid/(gamma_mid-1.0))*p_mid/rho_mid + 0.5*(u_mid*u_mid + v_mid*v_mid);
216 ifv->
U_int = (mid[1] + tau*dire[1])*n_x - (mid[2] + tau*dire[2])*n_y;
217 ifv->
V_int = (mid[1] + tau*dire[1])*n_y + (mid[2] + tau*dire[2])*n_x;
218 ifv->
RHO_int = mid[0] + tau*dire[0];
219 ifv->
P_int = mid[3] + tau*dire[3];
221#ifdef MULTIFLUID_BASICS
222 ifv->F_phi = ifv->
F_rho*phi_mid;
224 ifv->F_gamma = ifv->
F_rho*gamma_mid;
225 ifv->F_e_a = z_a_mid/(
config[6]-1.0)*p_mid/rho_mid + 0.5*phi_mid*(u_mid*u_mid + v_mid*v_mid);
226 ifv->F_e_a = ifv->
F_rho*ifv->F_e_a;
227 ifv->PHI = mid[5] + tau*dire[5];
228 ifv->Z_a = mid[4] + tau*dire[4];
230 ifv->U_qt_add_c = ifv->
F_rho*u_mid*phi_mid;
231 ifv->V_qt_add_c = ifv->
F_rho*v_mid*phi_mid;
232 ifv->U_qt_star = p_mid*n_x;
233 ifv->V_qt_star = p_mid*n_y;
234 ifv->P_star = p_mid/rho_mid*ifv->
F_rho;
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.
void HLL_flux(struct i_f_var *ifv, struct i_f_var *ifv_R)
This function calculate Eulerian fluxes of 2-D Euler equations by HLL solver.
int Riemann_exact_flux(struct i_f_var *ifv, struct i_f_var *ifv_R)
This function calculate Eulerian fluxes of 2-D Euler equations by Riemann solver.
void Roe_flux(struct i_f_var *ifv, struct i_f_var *ifv_R)
This function calculate Eulerian fluxes of Euler equations by Roe solver.
double config[N_CONF]
Initial configuration data array.
int star_dire_check(double *mid, double *dire, const int dim)
This function checks whether fluid variables of mid[] and dire[] are within the value range.
void HLL_2D_solver(double *F, double *lambda_max, const struct i_f_var *ifv_L, const struct i_f_var *ifv_R)
A HLL approxiamate Riemann solver for unsteady compressible inviscid single-component flow in two spa...
void Roe_2D_solver(double *F, double *lambda_max, const struct i_f_var *ifv_L, const struct i_f_var *ifv_R, const double delta)
An approxiamate Riemann solver of Roe for unsteady compressible inviscid single-component flow in two...
void Roe_solver(double *F, double *lambda_max, const struct i_f_var *ifv_L, const struct i_f_var *ifv_R, const double delta)
An approxiamate Riemann solver of Roe for unsteady compressible inviscid single-component flow in one...
void linear_GRP_solver_Edir_Q1D(double *wave_speed, double *D, double *U, double *U_star, const struct i_f_var *ifv_L, const struct i_f_var *ifv_R, const double eps, const double atc)
A Quasi-1D direct Eulerian GRP solver for unsteady compressible inviscid two-component flow in two sp...
Interfacial Fluid VARiables.
double V
primitive variable values at t_{n}.
double V_int
interfacial primitive variables at t_{n+1}.
double lambda_v
grid moving velocity components in direction x and y.
double n_y
x- and y-coordinates of the interfacial unit normal vector.
double gamma
specific heat ratio.
double F_v
interfacial fluxes at t_{n+1/2}.