Go to the documentation of this file.00001 #include "copyright.h"
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <math.h>
00015 #include <stdio.h>
00016 #include <stdlib.h>
00017 #include "defs.h"
00018 #include "athena.h"
00019 #include "globals.h"
00020 #include "prototypes.h"
00021
00022 #ifdef ISOTHERMAL
00023 #error : The shu-osher test only works for adiabatic EOS.
00024 #endif
00025 #ifndef HYDRO
00026 #error : The shu-osher test only works for hydro.
00027 #endif
00028
00029
00030
00031
00032 void problem(DomainS *pDomain)
00033 {
00034 GridS *pGrid=(pDomain->Grid);
00035 int i,il,iu,js,ks;
00036 Real dl,pl,ul,vl,wl,x1,x2,x3;
00037
00038
00039 iu = pGrid->ie + nghost;
00040 il = pGrid->is - nghost;
00041 js = pGrid->js;
00042 ks = pGrid->ks;
00043
00044 if (pGrid->Nx[1] > 1 || pGrid->Nx[2] > 1) {
00045 ath_error("Shu Osher test only works for 1D problem in x1-direction\n");
00046 }
00047
00048
00049 dl = 3.857143;
00050 ul = 2.629369;
00051 pl = 10.33333;
00052 wl = 0.0;
00053 vl = 0.0;
00054
00055 for (i=il; i<=iu; i++) {
00056
00057 cc_pos(pGrid,i,js,ks,&x1,&x2,&x3);
00058
00059 if (x1 < -0.8) {
00060 pGrid->U[ks][js][i].d = dl;
00061 pGrid->U[ks][js][i].M1 = ul*dl;
00062 pGrid->U[ks][js][i].M2 = vl*dl;
00063 pGrid->U[ks][js][i].M3 = wl*dl;
00064 pGrid->U[ks][js][i].E = pl/Gamma_1 + 0.5*dl*(ul*ul + vl*vl + wl*wl);
00065 }
00066 else {
00067 pGrid->U[ks][js][i].d = 1.0 + 0.2*sin(5.0*PI*x1);
00068 pGrid->U[ks][js][i].M1 = 0.0;
00069 pGrid->U[ks][js][i].M2 = 0.0;
00070 pGrid->U[ks][js][i].M3 = 0.0;
00071 pGrid->U[ks][js][i].E = 1.0/Gamma_1;
00072 }
00073 }
00074
00075 return;
00076 }
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 void problem_write_restart(MeshS *pM, FILE *fp)
00090 {
00091 return;
00092 }
00093
00094 void problem_read_restart(MeshS *pM, FILE *fp)
00095 {
00096 return;
00097 }
00098
00099 ConsFun_t get_usr_expr(const char *expr)
00100 {
00101 return NULL;
00102 }
00103
00104 VOutFun_t get_usr_out_fun(const char *name){
00105 return NULL;
00106 }
00107
00108 void Userwork_in_loop(MeshS *pM)
00109 {
00110 }
00111
00112 void Userwork_after_loop(MeshS *pM)
00113 {
00114 }