-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathupdateIbMask.H
More file actions
73 lines (65 loc) Β· 1.89 KB
/
Copy pathupdateIbMask.H
File metadata and controls
73 lines (65 loc) Β· 1.89 KB
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
ibMask.internalField() = 0.0;
forAll(mesh.boundaryMesh(), patchI)
{
if (isA<immersedBoundaryPolyPatch>(mesh.boundaryMesh()[patchI]))
{
const immersedBoundaryPolyPatch& ibPatch = refCast
<
const immersedBoundaryPolyPatch
>
(
mesh.boundaryMesh()[patchI]
);
const labelList& ibCells = ibPatch.ibCells();
forAll(ibCells, cellI)
{
if (ibCells[cellI] < mesh.nCells())
{
ibMask[ibCells[cellI]] = 1.0;
}
}
const labelList& deadCells = ibPatch.deadCells();
forAll(deadCells, cellI)
{
if (deadCells[cellI] < mesh.nCells())
{
ibMask[deadCells[cellI]] = 1.0;
}
}
}
}
if (Pstream::parRun())
{
forAll(mesh.boundaryMesh(), patchI)
{
if (isA<processorFvPatch>(mesh.boundary()[patchI]))
{
const labelList& faceCells = mesh.boundary()[patchI].faceCells();
forAll(faceCells, faceI)
{
label cellI = faceCells[faceI];
if (cellI < mesh.nCells())
{
if (ibMask[cellI] == 1.0)
{
ibMask[cellI] = 3.0;
}
else if (ibMask[cellI] == 0.0)
{
ibMask[cellI] = 2.0;
}
}
}
}
}
}
ibMask.correctBoundaryConditions();
if (runTime.outputTime())
{
label ibmCells = sum(pos(ibMask.internalField() - 0.5));
label procCells = sum(pos(ibMask.internalField() - 1.5));
label intersectionCells = sum(pos(ibMask.internalField() - 2.5));
Info<< "ibMask updated: IBM=" << ibmCells
<< ", Proc=" << procCells
<< ", Intersection=" << intersectionCells << endl;
}