-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcapillary_wall.h
78 lines (65 loc) · 3.02 KB
/
capillary_wall.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef CAPILLARY_WALL_H
#define CAPILLARY_WALL_H
#define MULTIPLE_GHOSTS YES
/* Macros to refer to the indexes of RBox rbox_center_capWall[]
depending on the capillary wall(boundary) region you need
IF YOU ADD A NEW ONE: increase the size of RBox rbox_center_capWall[]
inside capillary_wall.c*/
#define CAP_WALL_INTERNAL 0
#define CAP_WALL_EXTERNAL 1
#define CAP_WALL_CORNER_INTERNAL 2
#define CAP_WALL_CORNER_EXTERNAL 3
/* Variables defined for keeping information on the geometry of the capillary:
*/
double extern const zcap, dzcap, rcap;
// Actual values used inside the simulation for zcap, rcap, dzcap;
double extern zcap_real, rcap_real, dzcap_real;
int extern capillary_not_set;
int extern i_cap_inter_end, j_cap_inter_end, j_elec_start;
/* Variables defined for computation of energy conservation:
en_res_in : energy gained by resistivity (resistive part of poynting flux
through the boundary)
en_tc_in : energy gained by conduction through boundary
en_adv_in: energy gained by advection of the total energy rhough boundary*/
double extern en_tc_in, en_adv_in, en_res_in;
/* ********************************************************************* */
/*! [Ema]The Corr structure contains the correction to the solution 3D array
to apply when advancing different directions (useful to have multiple ghost cells
located on the same internal cell)
********************************************************************* */
typedef struct CORR{
double **Vc; /**< The main three-index data array used for cell-centered
primitive variables. The index order is
<tt>Vc[nv][pp]</tt> where \c nv gives the variable
index while \c pp \c is the index counting the cell where
one employes the correction (Corr struct resembles a sparse
matrix).*/
int *i; /* k,j and i arrays are the
locations of the cells to correct in the x_3,
x_2 and x_1 direction. Which means that, for each pp you have to correct
location i[pp],j[pp],k[pp] by overwriting Vs[nv][pp]
to d-Vs[nv][k][j][i] for every nv*/
int *j;
int *k;
int Npoints; // number of points to be corrected (pp will be always <=Npoints-1)
} Corr;
//int extern idx_rcap, idx_zcap, idx_start_electr;
// For correcting the internal boundary and putting a double ghost on the wall
// corner cell at the capillary exit
Corr extern d_correction[3];
int SetRemarkableIdxs(Grid *grid);
int FindIdxClosest(double *vec, int Nvec, double v);
// void alloc_Data(Data *data);
Data* alloc_Data();
void copy_Data_Vc(Data *d_target, const Data *d_source);
void free_Data(Data *data);
// RBox *GetRBoxCap(int side, int vpos);
void SetRBox_capWall(int Nghost);
void ReflectiveBoundCap (double ****q, int nv, int s, int side, int vpos);
void ZeroBoundCap (double ****q, int nv, int s, int side, int vpos);
void SetNotEvolvedVar (int nv);
int IsOutCone(double angle, double r, double z);
#if MULTIPLE_GHOSTS == YES
void ApplyMultipleGhosts(const Data*, int);
#endif
#endif