HydroCODE_1D 0.1
This is a implementation of fully explict forward Euler scheme for 1-D Euler equations of motion on Lagrangian/Eulerian coordinate
var_struc.h
浏览该文件的文档.
1
6#ifndef VARSTRUC_H
7#define VARSTRUC_H
8
9#ifdef MULTIFLUID_BASICS
10#undef MULTIFLUID_BASICS
15#define MULTIFLUID_BASICS
16#endif
17#ifdef LAGRANGIAN_MAIRE
18#undef LAGRANGIAN_MAIRE
23#define LAGRANGIAN_MAIRE
24#endif
25#ifdef RADIAL_BASICS
26#undef RADIAL_BASICS
31#define RADIAL_BASICS
32#endif
33
35#ifndef EPS
36#define EPS 1e-9
37#endif
38
40#ifndef N_CONF
41#define N_CONF 400
42#endif
43
44extern double config[];
45
46
48typedef struct flu_var {
49 double * RHO, * U, * V, * P;
50#ifdef MULTIFLUID_BASICS
51 double * Z_a;
52 double * PHI, * gamma;
53#ifdef MULTIPHASE_BASICS
54 double * RHO_b, * U_b, * V_b, * P_b;
55#endif
56#endif
58
59
61typedef struct cell_var_stru {
62 double ** E;
63 double ** RHO, ** U, ** V, ** P;
64 double * d_rho, * d_u, * d_v, * d_p;
65 double **s_rho, **s_u, **s_v, **s_p;
66 double **t_rho, **t_u, **t_v, **t_p;
67 double **rhoIx, **uIx, **vIx, **pIx;
68 double **rhoIy, **uIy, **vIy, **pIy;
69 double **F_rho, **F_e, **F_u, **F_v;
70 double **G_rho, **G_e, **G_u, **G_v;
71#ifdef MULTIFLUID_BASICS
72 double ** gamma;
73#endif
75
76
78typedef struct cell_var {
84 int **cell_cell;
85 double * vol;
86 double **n_x, **n_y;
87 double * X_c, * Y_c;
88 double ** F_rho, ** F_e, ** F_u, ** F_v;
89 double * U_rho, * U_e, * U_u, * U_v;
90 double ** RHO_p, ** U_p, ** V_p, ** P_p;
93#ifdef MULTIFLUID_BASICS
94 double **F_e_a, *U_e_a, **Z_a_p, *gradx_z_a, *grady_z_a;
95 double **F_phi, *U_phi, **PHI_p, *gradx_phi, *grady_phi;
96 double **F_gamma, *U_gamma, **gamma_p, *gradx_gamma, *grady_gamma;
97 double **P_star;
98 double **U_qt_star, **V_qt_star;
99 double **U_qt_add_c, **V_qt_add_c;
100#endif
101#ifdef MULTIPHASE_BASICS_abandoned
102 double **RHO_star, **gamma_star, **P_star;
103 double **RHO_minus_c, **gamma_minus_c, **P_minus_c, **U_qt_minus_c, **V_qt_minus_c;
104 double **RHO_add_c, **gamma_add_c, **P_add_c;
105 double **u_star, **u_minus_c, **u_add_c;
106#endif
107#ifdef LAGRANGIAN_MAIRE
108 double **F_p_x, **F_p_y;
109 double **dt_U_p, **dt_V_p, **dt_F_p_x, **dt_F_p_y;
110 double *c, *dist_p;
111#endif
113
114
116typedef struct i_f_var {
117 double n_x, n_y;
118 double delta_x, delta_y;
119 double length;
121 double gamma;
122 double RHO, P, U, V;
124 double F_rho, F_e, F_u, F_v;
125 double U_rho, U_e, U_u, U_v;
126 double d_rho, d_e, d_u, d_v, d_p;
127 double t_rho, t_e, t_u, t_v, t_p;
128#ifdef MULTIFLUID_BASICS
129 double Z_a, d_z_a, t_z_a, F_e_a, U_e_a;
130 double PHI, d_phi, t_phi, F_phi, U_phi;
131 double d_gamma, t_gamma, F_gamma, U_gamma;
132 double P_star;
133 double U_qt_star, V_qt_star;
134 double U_qt_add_c, V_qt_add_c;
135#endif
136#ifdef MULTIPHASE_BASICS_abandoned
137 double RHO_star, gamma_star;
138 double RHO_minus_c, gamma_minus_c, P_minus_c, U_qt_minus_c, V_qt_minus_c;
139 double RHO_add_c, gamma_add_c, P_add_c;
140 double u_star, u_minus_c, u_add_c;
141#endif
143
144
146typedef struct b_f_var {
147 double H;
148 double RHO, P, U, V;
149 double SRHO, SP, SU, SV;
150 double TRHO, TP, TU, TV;
152
153
155typedef struct mesh_var {
156 int num_pt;
158 int **cell_pt;
159 int * cell_type;
164 int num_border[10];
173 double *normal_v;
174 double *X, *Y;
176 void (*bc)(struct cell_var * cv, const struct mesh_var * mv, struct flu_var * FV, double t);
178
179
180#ifdef RADIAL_BASICS
182typedef struct radial_mesh_var {
183 double * Rb;
184 double * Lb;
185 double * RR;
186 double * DdrL;
187 double * DdrR;
188 double * Ddr;
189 double * dRc;
190 double * vol;
191} Radial_Mesh_Variable;
192#endif
193
194#endif
Fluid VARiables at Boundary in one direction.
Definition: var_struc.h:146
double SRHO
Definition: var_struc.h:149
double V
primitive variables on the ghost grid cell at boundary.
Definition: var_struc.h:148
double SV
spatial derivatives in coordinate x (slopes).
Definition: var_struc.h:149
double TRHO
Definition: var_struc.h:150
double RHO
Definition: var_struc.h:148
double U
Definition: var_struc.h:148
double P
Definition: var_struc.h:148
double SU
Definition: var_struc.h:149
double SP
Definition: var_struc.h:149
double H
cell width of the ghost grid at boundary.
Definition: var_struc.h:147
double TV
spatial derivatives in coordinate y (slopes).
Definition: var_struc.h:150
double TU
Definition: var_struc.h:150
double TP
Definition: var_struc.h:150
pointer structure of VARiables on STRUctural computational grid CELLs.
Definition: var_struc.h:61
double ** G_rho
Definition: var_struc.h:70
double ** E
specific total energy.
Definition: var_struc.h:62
double ** U
Definition: var_struc.h:63
double * d_u
Definition: var_struc.h:64
double ** rhoIy
Definition: var_struc.h:68
double * d_v
Definition: var_struc.h:64
double ** t_rho
Definition: var_struc.h:66
double ** F_v
numerical fluxes at (x_{j-1/2}, t_{n}).
Definition: var_struc.h:69
double ** pIx
interfacial variable values in coordinate x at t_{n+1}.
Definition: var_struc.h:67
double ** s_rho
Definition: var_struc.h:65
double ** RHO
Definition: var_struc.h:63
double ** vIy
Definition: var_struc.h:68
double ** s_u
Definition: var_struc.h:65
double ** F_e
Definition: var_struc.h:69
double ** t_u
Definition: var_struc.h:66
double ** G_v
numerical fluxes at (y_{j-1/2}, t_{n}).
Definition: var_struc.h:70
double ** F_u
Definition: var_struc.h:69
double * d_p
spatial derivatives in one dimension.
Definition: var_struc.h:64
double ** G_e
Definition: var_struc.h:70
double ** F_rho
Definition: var_struc.h:69
double ** s_v
Definition: var_struc.h:65
double ** t_v
Definition: var_struc.h:66
double ** G_u
Definition: var_struc.h:70
double ** rhoIx
Definition: var_struc.h:67
double ** uIy
Definition: var_struc.h:68
double ** V
Definition: var_struc.h:63
double ** s_p
spatial derivatives in coordinate x (slopes).
Definition: var_struc.h:65
double ** uIx
Definition: var_struc.h:67
double ** vIx
Definition: var_struc.h:67
double ** pIy
interfacial variable values in coordinate y at t_{n+1}.
Definition: var_struc.h:68
double ** P
density, velocity components in direction x and y, pressure.
Definition: var_struc.h:63
double * d_rho
Definition: var_struc.h:64
double ** t_p
spatial derivatives in coordinate y (slopes).
Definition: var_struc.h:66
pointer structure of VARiables on unstructured computational grid CELLs.
Definition: var_struc.h:78
double ** P_p
Definition: var_struc.h:90
double ** V_p
Definition: var_struc.h:90
double * Y_c
x- and y-coordinates of the center point of grid cells.
Definition: var_struc.h:87
int ** cell_cell
Topological relationships between grid cells.
Definition: var_struc.h:84
double * U_u
Definition: var_struc.h:89
double * X_c
Definition: var_struc.h:87
double ** F_v
interfacial fluxes.
Definition: var_struc.h:88
double * gradx_v
spatial derivatives in coordinate x (gradients).
Definition: var_struc.h:91
double * U_rho
Definition: var_struc.h:89
double ** U_p
Definition: var_struc.h:90
double * gradx_u
Definition: var_struc.h:91
double ** F_e
Definition: var_struc.h:88
double * U_v
conservative variables.
Definition: var_struc.h:89
double ** F_u
Definition: var_struc.h:88
double ** n_y
x- and y-coordinates of the interfacial unit normal vector.
Definition: var_struc.h:86
double ** F_rho
Definition: var_struc.h:88
double * U_e
Definition: var_struc.h:89
double * grady_v
spatial derivatives in coordinate y (gradients).
Definition: var_struc.h:92
double * gradx_rho
Definition: var_struc.h:91
double ** n_x
Definition: var_struc.h:86
double * grady_e
Definition: var_struc.h:92
double * grady_rho
Definition: var_struc.h:92
double * gradx_e
Definition: var_struc.h:91
double ** RHO_p
Definition: var_struc.h:90
double * grady_u
Definition: var_struc.h:92
double * vol
area(volume) of each grid cell.
Definition: var_struc.h:85
pointer structure of FLUid VARiables array.
Definition: var_struc.h:48
double * P
Definition: var_struc.h:49
double * RHO
Definition: var_struc.h:49
double * U
Definition: var_struc.h:49
double * V
Definition: var_struc.h:49
Interfacial Fluid VARiables.
Definition: var_struc.h:116
double t_e
Definition: var_struc.h:127
double t_rho
Definition: var_struc.h:127
double V
primitive variable values at t_{n}.
Definition: var_struc.h:122
double V_int
interfacial primitive variables at t_{n+1}.
Definition: var_struc.h:123
double lambda_v
grid moving velocity components in direction x and y.
Definition: var_struc.h:120
double RHO
Definition: var_struc.h:122
double t_v
Definition: var_struc.h:127
double d_p
normal spatial derivatives.
Definition: var_struc.h:126
double U_int
Definition: var_struc.h:123
double delta_x
Definition: var_struc.h:118
double U
Definition: var_struc.h:122
double n_y
x- and y-coordinates of the interfacial unit normal vector.
Definition: var_struc.h:117
double t_p
tangential spatial derivatives OR spatial derivatives in Lagrangian coordinate ξ.
Definition: var_struc.h:127
double gamma
specific heat ratio.
Definition: var_struc.h:121
double P
Definition: var_struc.h:122
double d_e
Definition: var_struc.h:126
double F_rho
Definition: var_struc.h:124
double delta_y
distance from the interfacial center to the grid cell center in direction x and y.
Definition: var_struc.h:118
double length
length of the interface.
Definition: var_struc.h:119
double U_u
Definition: var_struc.h:125
double RHO_int
Definition: var_struc.h:123
double n_x
Definition: var_struc.h:117
double d_rho
Definition: var_struc.h:126
double F_e
Definition: var_struc.h:124
double d_u
Definition: var_struc.h:126
double t_u
Definition: var_struc.h:127
double F_u
Definition: var_struc.h:124
double U_rho
Definition: var_struc.h:125
double U_e
Definition: var_struc.h:125
double F_v
interfacial fluxes at t_{n+1/2}.
Definition: var_struc.h:124
double lambda_u
Definition: var_struc.h:120
double U_v
interfacial conservative variables at t_{n}.
Definition: var_struc.h:125
double d_v
Definition: var_struc.h:126
double P_int
Definition: var_struc.h:123
MESHing VARiables.
Definition: var_struc.h:155
int * border_pt
Serial number of each grid node on the connected boundary in the clockwise direction.
Definition: var_struc.h:165
int * cell_type
Definition: var_struc.h:159
int * period_cell
Serial number of ghost grid cells at the periodic boundary.
Definition: var_struc.h:172
int num_ghost
Total number of ghost grid cells.
Definition: var_struc.h:157
int num_border[10]
num_border[0] is the total number of connected boundaries on the entire computational domain.
Definition: var_struc.h:164
void(* bc)(struct cell_var *cv, const struct mesh_var *mv, struct flu_var *FV, double t)
Pointer to the boundary condition function.
Definition: var_struc.h:176
double * normal_v
Definition: var_struc.h:173
double * X
Definition: var_struc.h:174
int ** cell_pt
Serial number of each grid node on a grid cell in the clockwise direction.
Definition: var_struc.h:158
int * border_cond
Boudary condition indicator of i-th grid cell interface at the boundary.
Definition: var_struc.h:171
int num_pt
Total number of grid nodes.
Definition: var_struc.h:156
double * Y
Definition: var_struc.h:174
struct mesh_var Mesh_Variable
MESHing VARiables.
struct i_f_var Interface_Fluid_Variable
Interfacial Fluid VARiables.
struct cell_var Cell_Variable
pointer structure of VARiables on unstructured computational grid CELLs.
struct flu_var Fluid_Variable
pointer structure of FLUid VARiables array.
struct b_f_var Boundary_Fluid_Variable
Fluid VARiables at Boundary in one direction.
double config[]
Initial configuration data array.
Definition: hydrocode.c:111
struct cell_var_stru Cell_Variable_Structured
pointer structure of VARiables on STRUctural computational grid CELLs.