hydrocode_Radial_Lag 0.3
This is an implementation of fully explict forward Euler scheme for multi-D radially symmetric compressible flows on Lagrangian coordinate
slope_limiter_radial.c
浏览该文件的文档.
1
5#include <stdio.h>
6#include <stdlib.h>
7
8#include "../include/var_struc.h"
9#include "../include/tools.h"
10
11
23void minmod_limiter_radial(const int Ncell, const _Bool i_f_var_get, double s[],
24 const double U[], struct radial_mesh_var *rmv)
25{
26 double const Alpha = config[41]; // the paramater in slope limiters.
27 int const LIMITER_VIP = (int)config[42];
28 double s_L, s_R; // spatial derivatives in coordinate x (slopes)
29
30 //minmod limiter update
31 for(int j = 1; j <= Ncell; ++j) // Reconstruct slopes
32 {
33 if (abs(LIMITER_VIP)==1)
34 {
35 s_L = (U[j] - U[j-1]) / rmv->dRc[j];
36 s_R = (U[j+1] - U[j]) / rmv->dRc[j+1];
37 }
38 else if (abs(LIMITER_VIP)==2)
39 {
40 s_L = (U[j] - U[j-1]) / 2.0 / rmv->DdrR[j];
41 s_R = (U[j+1] - U[j]) / 2.0 / rmv->DdrL[j];
42 }
43 else
44 {
45 fprintf(stderr, "ERROE! No suitable LIMITER_VIP Parameter.\n");
46 exit(2);
47 }
48 if (i_f_var_get)
49 s[j] = minmod3(Alpha*s_L, Alpha*s_R, s[j]);
50 else
51 s[j] = minmod2(s_L, s_R);
52 }
53 s[0] = minmod2(s[0], s[1]);
54 s[Ncell+1] = minmod2(s[Ncell], s[Ncell+1]);
55}
double config[N_CONF]
Initial configuration data array.
Definition: hydrocode.c:123
void minmod_limiter_radial(const int Ncell, const _Bool i_f_var_get, double s[], const double U[], struct radial_mesh_var *rmv)
This function apply the minmod limiter to the slope in radially symmetric case.
double minmod2(const double s_L, const double s_R)
Minmod limiter function of two variables.
Definition: tools.h:44
double minmod3(const double s_L, const double s_R, const double s_m)
Minmod limiter function of three variables.
Definition: tools.h:59