MoDeNa  1.0
Software framework facilitating sequential multi-scale modelling
coalescenceSource.H
Go to the documentation of this file.
1 
13 void coalescenceSource(double *, double *, double *, int &, int *);
14 
16 (
17  double *sc, double *we, double *vi, int &nNodes, int *mOrder
18 )
19 {
20  int counter = 0;
21  double k;
22  int i, j;
23  double coalescenceRate;
24  while (counter < 2*nNodes)
25  {
26  sc[counter] = 0.0;
27  k = static_cast<double>(mOrder[counter]);
28 
29  coalescenceRate = coalescenceKernel();
30 
31  if (counter == 0)
32  {
33  for (i = 0; i < nNodes; i++)
34  {
35  for (j = 0; j < nNodes; j++)
36  {
37  if (vi[i]*vi[j] != 0)
38  {
39  sc[counter] +=
40  (
41  coalescenceRate*(vi[i] + vi[j])*we[i]*we[j]*(-1.0)
42  );
43  }
44  else
45  {
46  sc[counter] = 0.0;
47  }
48  }
49  }
50  }
51  else if (counter == 1)
52  {
53  sc[counter] = 0.0;
54  }
55  else
56  {
57  for (i = 0; i < nNodes; i++)
58  {
59  for (j = 0; j < nNodes; j++)
60  {
61  if (vi[i]*vi[j] != 0)
62  {
63  sc[counter] +=
64  (
65  coalescenceRate*(vi[i] + vi[j])*we[i]*we[j]
66  *(Foam::pow((vi[i] + vi[j]),k)
67  - Foam::pow(vi[i],k) - Foam::pow(vi[j],k))
68  );
69  }
70  else
71  {
72  sc[counter] = 0.0;
73  }
74  }
75  }
76  }
77  counter++;
78  }
79 }
void coalescenceSource(double *, double *, double *, int &, int *)
double coalescenceKernel()