forked from liukan12/backpulse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init_dustcake_concentration
60 lines (57 loc) · 1.68 KB
/
init_dustcake_concentration
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
#include "udf.h"
#define INIT_DUST_CONCENTRATION 5e-5
#define POROUS_Z_ID 13
#define POROUS_FACE_ID 17
/*initial the dpm concentration*/
DEFINE_ON_DEMAND(name)
{
Domain *domain;
Thread *dusthread0;
Thread *dusthread1;
Thread *dustfacethread;
real x[ND_ND];
cell_t C0;
cell_t C1;
face_t f;
int n;
domain=Get_Domain(1);
dusthread0 = Lookup_Thread(domain, POROUS_Z_ID);
Message("your dusthread0 is %d \n",THREAD_ID(dusthread0));
dustfacethread = Lookup_Thread(domain, POROUS_FACE_ID);
Message("your dusthread0 is %d \n",THREAD_ID(dustfacethread));
C0 = F_C0(f, dustfacethread);
Message("your C0 is %d \n",C0);
C1 = F_C1(f, dustfacethread);
Message("your C1 is %d \n",C1);
dusthread1 = F_C1_THREAD(f,dustfacethread);
Message("your dusthread1 is %d \n",THREAD_ID(dusthread1));
/* begin_c_loop(C1, dusthread1)
{
{
c_face_loop(C1, dusthread1, n)
{
if (THREAD_ID(C_FACE_THREAD(C1, dusthread1, n)) == POROUS_FACE_ID)
{
C_CENTROID(x, C1, dusthread1);
if (sqrt(x[0]*x[0]+x[1]*x[1])>0.1){ */
C_DPMS_CONCENTRATION(C1, dusthread1) = INIT_DUST_CONCENTRATION;
C_DPMS_CONCENTRATION(C0, dusthread1) = INIT_DUST_CONCENTRATION;
begin_c_loop(C1, dusthread1)
{
C_CENTROID(x, C1, dusthread1);
{
c_face_loop(C1, dusthread1, n)
{
if (THREAD_ID(C_FACE_THREAD(C1, dusthread1, n)) == POROUS_FACE_ID)
{
if (x[2]>0.7&&x[2]<0.9)
{
Message("your cell id is %d \n",C_INDEX(C1,dusthread1));
C_DPMS_CONCENTRATION(C1, dusthread1) = INIT_DUST_CONCENTRATION;
}
}
}
}
}
end_c_loop(C1, dusthread1)
}