99#include "../include/var_struc.h"
100#include "../include/file_io.h"
101#include "../include/finite_volume.h"
102#include "../include/meshing.h"
105#ifdef DOXYGEN_PREDEFINED
125#define CV_INIT_FV_RESET_MEM(v, N) \
127 CV.v = (double **)malloc(N * sizeof(double *)); \
130 printf("NOT enough memory! %s\n", #v); \
134 for(k = 0; k < N; ++k) \
136 CV.v[k] = (double *)malloc(Md * sizeof(double)); \
137 if(CV.v[k] == NULL) \
139 printf("NOT enough memory! %s[%d]\n", #v, k); \
144 memmove(CV.v[0]+1, FV0.v, Ncell * sizeof(double)); \
164int main(
int argc,
char *argv[])
166 int k, j, retval = 0;
168 for(k = 1; k <
N_CONF; k++)
171 char * scheme = NULL;
187 const int Ncell = (int)
config[3];
188 const int Md = Ncell+2;
189 const int order = (int)
config[9];
191 int M = atoi(argv[4]);
192 if(M != 1 && M != 2 && M != 3)
194 printf(
"Wrong spatial dimension number!\n");
204 double * cpu_time = (
double *)malloc(N *
sizeof(
double));
205 R = (
double **)malloc(N *
sizeof(
double *));
208 printf(
"NOT enough memory! CPU_time\n");
214 printf(
"NOT enough memory! R\n");
218 for(k = 0; k < N; ++k)
220 R[k] = (
double *)malloc(Md *
sizeof(
double));
223 printf(
"NOT enough memory! R[%d]\n", k);
232#ifdef MULTIFLUID_BASICS
235 for(k = 1; k < N; ++k)
241 CV.
E = (
double **)malloc(N *
sizeof(
double *));
244 printf(
"NOT enough memory! E\n");
248 for(k = 0; k < N; ++k)
250 CV.
E[k] = (
double *)malloc(Md *
sizeof(
double));
253 printf(
"NOT enough memory! E[%d]\n", k);
258 for(j = 1; j <= Ncell; ++j)
260#ifdef MULTIFLUID_BASICS
263 CV.
E[0][j] = 0.5*CV.
U[0][j]*CV.
U[0][j] + CV.
P[0][j]/(
gamma-1.0)/CV.
RHO[0][j];
276 printf(
"NOT appropriate order of the scheme! The order is %d.\n", order);
281 memmove(R[N_plot-1], rmv.RR, (Ncell+1) *
sizeof(
double));
283 file_1D_write(Ncell+1, N_plot, CV, R, cpu_time, argv[2], time_plot);
289 FV0.
RHO = CV.
RHO[N_plot-1];
290 FV0.
U = CV.
U[N_plot-1];
291 FV0.
P = CV.
P[N_plot-1];
301 for(k = 0; k < N; ++k)
322#ifdef MULTIFLUID_BASICS
325 for(k = 0; k < N; ++k)
struct flu_var initialize_1D(const char *name, int *N, int *N_plot, double *time_plot[])
This function reads the 1-D initial data file of density/velocity/pressure and performs some other in...
void file_1D_write(const int m, const int N, const struct cell_var_stru CV, double *X[], const double *cpu_time, const char *problem, const double time_plot[])
This function write the 1-D solution into output '.dat' files.
void file_1D_write_HDF5(const int m, const int N, const struct cell_var_stru CV, double *X[], const double *cpu_time, const char *problem, double time_plot[])
This function write the 1-D solution into HDF5 output '.h5' files.
void file_radial_write_TEC(const struct flu_var FV, const double *R, const char *problem, const double time)
This function write the radially symmetric 2-D solution into Tecplot output '.tec' files.
void GRP_solver_radial_LAG_source(struct cell_var_stru CV, struct radial_mesh_var *rmv, double *R[], const int M, double *cpu_time, const char *problem, int N_T, int *N_plot, double time_plot[])
This function use GRP scheme to solve radially(cylindrically) symmetric compressible flows of motion ...
int main(int argc, char *argv[])
This is the main function which constructs the main structure of the radially symmetric Lagrangian hy...
#define CV_INIT_FV_RESET_MEM(v, N)
double config[N_CONF]
Initial configuration data array.
void radial_mesh_update(struct radial_mesh_var *rmv)
This function updates radially symmetric meshing variables after each time step update.
struct radial_mesh_var radial_mesh_init(const char *example)
This function initializes radially symmetric meshing variables.
void radial_mesh_mem_free(struct radial_mesh_var *rmv)
This function free memory for storing radially symmetric meshing variables.
pointer structure of VARiables on STRUctural computational grid CELLs.
double ** E
specific total energy.
double ** P
density, velocity components in direction x and y, pressure.
pointer structure of FLUid VARiables array.
void arg_preprocess(const int argc_least, const int argc, char *argv[], char *scheme)
This is a functions preprocesses ARGuments.
#define N_CONF
Define the number of configuration parameters.