HyPar  1.0
Finite-Difference Hyperbolic-Parabolic PDE Solver on Cartesian Grids
boundaryconditions.h
Go to the documentation of this file.
1 
6 #ifndef _BC_H_
7 #define _BC_H_
8 
9 #include <basic.h>
10 
12 #define _PERIODIC_ "periodic"
13 
14 #define _EXTRAPOLATE_ "extrapolate"
15 
16 #define _DIRICHLET_ "dirichlet"
17 
18 #define _REFLECT_ "reflect"
19 
20 #define _SPONGE_ "sponge"
21 
22 /* some BC types unique to the euler/navier-stokes systems */
24 #define _NOSLIP_WALL_ "noslip-wall"
25 
26 #define _THERMAL_NOSLIP_WALL_ "thermal-noslip-wall"
27 
28 #define _SLIP_WALL_ "slip-wall"
29 
30 #define _THERMAL_SLIP_WALL_ "thermal-slip-wall"
31 
32 #define _SUBSONIC_INFLOW_ "subsonic-inflow"
33 
34 #define _SUBSONIC_OUTFLOW_ "subsonic-outflow"
35 
39 #define _SUBSONIC_AMBIVALENT_ "subsonic-ambivalent"
40 
41 #define _SUPERSONIC_INFLOW_ "supersonic-inflow"
42 
43 #define _SUPERSONIC_OUTFLOW_ "supersonic-outflow"
44 
45 #define _TURBULENT_SUPERSONIC_INFLOW_ "turbulent-supersonic-inflow"
46 
47 /* some BC types unique to the NUMA system */
49 #define _NO_FLUX_BC_ "numa-nfbc"
50 
51 /* some BC types unique to the shallow water system */
53 #define _SW_SLIP_WALL_ "shallow-water-slip-wall"
54 
55 #define _SW_NOSLIP_WALL_ "shallow-water-noslip-wall"
56 
68 typedef struct domain_boundaries {
69 
71  char bctype [_MAX_STRING_SIZE_];
73  int dim;
75  int face;
77  double *xmin;
79  double *xmax;
80 
82  int *is, *ie;
85  int (*BCFunctionU) (void*,void*,int,int,int*,int,double*,double);
86 
87  double *DirichletValue;
88  double *SpongeValue;
93  char UnsteadyDirichletFilename[_MAX_STRING_SIZE_];
94 
95  /* variables specific to Navier-Stokes/Euler equations BCs */
96  double gamma,
97  FlowDensity,
98  *FlowVelocity,
99  FlowPressure;
101  /* variables specific to the thermal slip-wall boundary condition */
106  char UnsteadyTemperatureFilename[_MAX_STRING_SIZE_];
107 
108 #if defined(HAVE_CUDA)
111  int *gpu_bounds, *gpu_is, *gpu_ie;
113 #endif
114 
116 
117 /* Functions */
118 int BCInitialize(void*, int);
119 int BCCleanup (void*, int);
121 /* Boundary condition implementations for the solution vector U */
123 int BCPeriodicU (void*,void*,int,int,int*,int,double*,double);
125 int BCExtrapolateU (void*,void*,int,int,int*,int,double*,double);
127 int BCDirichletU (void*,void*,int,int,int*,int,double*,double);
129 int BCReflectU (void*,void*,int,int,int*,int,double*,double);
131 int BCNoslipWallU (void*,void*,int,int,int*,int,double*,double);
133 int BCThermalNoslipWallU (void*,void*,int,int,int*,int,double*,double);
135 int BCSlipWallU (void*,void*,int,int,int*,int,double*,double);
137 int BCThermalSlipWallU (void*,void*,int,int,int*,int,double*,double);
139 int BCSubsonicInflowU (void*,void*,int,int,int*,int,double*,double);
141 int BCSubsonicOutflowU (void*,void*,int,int,int*,int,double*,double);
143 int BCSubsonicAmbivalentU (void*,void*,int,int,int*,int,double*,double);
145 int BCSupersonicInflowU (void*,void*,int,int,int*,int,double*,double);
147 int BCSupersonicOutflowU (void*,void*,int,int,int*,int,double*,double);
149 int BCTurbulentSupersonicInflowU (void*,void*,int,int,int*,int,double*,double);
151 int BCNoFluxU (void*,void*,int,int,int*,int,double*,double);
153 int BCSWSlipWallU (void*,void*,int,int,int*,int,double*,double);
154 
156 int BCSpongeSource (void*,int,int,int,int*,double*,double*,double*);
158 int BCSpongeUDummy (void*,void*,int,int,int*,int,double*,double);
159 
161 int BCReadTemperatureData(void*,void*,int,int,int*);
163 int BCReadTurbulentInflowData(void*,void*,int,int,int*);
164 
165 #if defined(HAVE_CUDA)
166 
167 # if __cplusplus
168 extern "C" {
169 # endif
170 
172 int gpuBCPeriodicU (void*,void*,int,int,int*,int,double*,double);
174 int gpuBCSlipWallU (void*,void*,int,int,int*,int,double*,double);
175 
176 # if __cplusplus
177 }
178 # endif
179 
180 #endif
181 
182 #endif
int BCSupersonicInflowU(void *, void *, int, int, int *, int, double *, double)
int BCInitialize(void *, int)
Definition: BCInitialize.c:12
int BCSpongeSource(void *, int, int, int, int *, double *, double *, double *)
Definition: BCSponge.c:26
int BCNoFluxU(void *, void *, int, int, int *, int, double *, double)
Definition: BCNoFlux.c:22
int BCCleanup(void *, int)
Definition: BCCleanup.c:12
int BCSpongeUDummy(void *, void *, int, int, int *, int, double *, double)
Definition: BCSponge.c:73
int gpuBCPeriodicU(void *, void *, int, int, int *, int, double *, double)
Some basic definitions and macros.
Structure containing the variables and function pointers defining a boundary.
double * UnsteadyDirichletData
int BCPeriodicU(void *, void *, int, int, int *, int, double *, double)
Definition: BCPeriodic.c:19
int BCThermalNoslipWallU(void *, void *, int, int, int *, int, double *, double)
int BCSlipWallU(void *, void *, int, int, int *, int, double *, double)
Definition: BCSlipWall.c:22
int BCSubsonicAmbivalentU(void *, void *, int, int, int *, int, double *, double)
int BCNoslipWallU(void *, void *, int, int, int *, int, double *, double)
Definition: BCNoslipWall.c:20
int BCReflectU(void *, void *, int, int, int *, int, double *, double)
Definition: BCReflect.c:14
#define _MAX_STRING_SIZE_
Definition: basic.h:14
double * UnsteadyTimeLevels
int BCSubsonicInflowU(void *, void *, int, int, int *, int, double *, double)
int BCReadTurbulentInflowData(void *, void *, int, int, int *)
Definition: BCIO.c:19
int BCSWSlipWallU(void *, void *, int, int, int *, int, double *, double)
Definition: BCSWSlipWall.c:21
int BCSubsonicOutflowU(void *, void *, int, int, int *, int, double *, double)
int BCDirichletU(void *, void *, int, int, int *, int, double *, double)
Definition: BCDirichlet.c:13
int gpuBCSlipWallU(void *, void *, int, int, int *, int, double *, double)
int BCSupersonicOutflowU(void *, void *, int, int, int *, int, double *, double)
int BCExtrapolateU(void *, void *, int, int, int *, int, double *, double)
Definition: BCExtrapolate.c:13
int BCThermalSlipWallU(void *, void *, int, int, int *, int, double *, double)
double * UnsteadyTemperatureData
int BCTurbulentSupersonicInflowU(void *, void *, int, int, int *, int, double *, double)
int BCReadTemperatureData(void *, void *, int, int, int *)
Definition: BCIO.c:147