|
2 | 2 | // PRELIMINARIES |
3 | 3 | //---------------------------------------------------------------------- |
4 | 4 |
|
5 | | - // Point Mesh (pMesh) |
6 | | - pointMesh pMesh(mesh); |
| 5 | + // Point Mesh (pMesh) |
| 6 | + pointMesh pMesh(mesh); |
7 | 7 |
|
8 | 8 |
|
9 | | - // Material face area |
10 | | - const surfaceScalarField& magSf (mesh.magSf()); |
| 9 | + // Material face area |
| 10 | + const surfaceScalarField& magSf (mesh.magSf()); |
11 | 11 |
|
12 | 12 |
|
13 | | - // Material face area normal vector |
14 | | - const surfaceVectorField& Sf (mesh.Sf()); |
| 13 | + // Material face area normal vector |
| 14 | + const surfaceVectorField& Sf (mesh.Sf()); |
15 | 15 |
|
16 | | - |
| 16 | + |
17 | 17 | //---------------------------------------------------------------------- |
18 | 18 | // MESH COORDINATES |
19 | 19 | //---------------------------------------------------------------------- |
20 | 20 |
|
21 | | - // Material cell center coordinates |
22 | | - const volVectorField& C = mesh.C(); |
| 21 | + // Material cell center coordinates |
| 22 | + const volVectorField& C = mesh.C(); |
23 | 23 |
|
24 | 24 |
|
25 | | - // Spatial cell center coordinates |
26 | | - volVectorField x |
27 | | - ( |
28 | | - IOobject ("x", mesh), |
29 | | - C |
30 | | - ); |
| 25 | + // Spatial cell center coordinates |
| 26 | + volVectorField x |
| 27 | + ( |
| 28 | + IOobject ("x", mesh), |
| 29 | + C |
| 30 | + ); |
31 | 31 |
|
32 | 32 |
|
33 | | - // Spatial nodal coordinates |
34 | | - pointVectorField xN |
35 | | - ( |
36 | | - IOobject ("xN", mesh), |
37 | | - pMesh, |
38 | | - dimensionedVector ("xN", dimensionSet(0,1,0,0,0,0,0), vector::zero) |
39 | | - ); |
40 | | - xN.primitiveFieldRef() = mesh.points(); |
| 33 | + // Spatial nodal coordinates |
| 34 | + pointVectorField xN |
| 35 | + ( |
| 36 | + IOobject ("xN", mesh), |
| 37 | + pMesh, |
| 38 | + dimensionedVector ("xN", dimensionSet(0,1,0,0,0,0,0), vector::zero) |
| 39 | + ); |
| 40 | + xN.primitiveFieldRef() = mesh.points(); |
41 | 41 |
|
42 | 42 |
|
43 | 43 |
|
44 | | - // Material nodal coordinates |
45 | | - pointVectorField xN_0 |
46 | | - ( |
47 | | - IOobject ("xN_0", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), |
48 | | - xN |
49 | | - ); |
| 44 | + // Material nodal coordinates |
| 45 | + pointVectorField xN_0 |
| 46 | + ( |
| 47 | + IOobject ("xN_0", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), |
| 48 | + xN |
| 49 | + ); |
50 | 50 |
|
51 | 51 |
|
52 | | - // Material face center coordinates |
53 | | - const surfaceVectorField& Cf = mesh.Cf(); |
| 52 | + // Material face center coordinates |
| 53 | + const surfaceVectorField& Cf = mesh.Cf(); |
54 | 54 |
|
55 | 55 |
|
56 | | - // Spatial face center coordinates |
57 | | - surfaceVectorField xF = mesh.Cf(); |
| 56 | + // Spatial face center coordinates |
| 57 | + surfaceVectorField xF = mesh.Cf(); |
58 | 58 |
|
59 | 59 |
|
60 | 60 |
|
61 | 61 | //---------------------------------------------------------------------- |
62 | 62 | // NORMALS |
63 | 63 | //---------------------------------------------------------------------- |
64 | 64 |
|
65 | | - // Material normals |
66 | | - surfaceVectorField N |
67 | | - ( |
68 | | - IOobject ("N", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), |
69 | | - Sf/mesh.magSf() |
70 | | - ); |
| 65 | + // Material normals |
| 66 | + surfaceVectorField N |
| 67 | + ( |
| 68 | + IOobject ("N", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE), |
| 69 | + Sf/mesh.magSf() |
| 70 | + ); |
71 | 71 |
|
72 | 72 |
|
73 | 73 |
|
74 | 74 |
|
75 | 75 | // EDGE TO POINT CONNECTIVITY (edges) |
76 | 76 | //----------------------------------- |
77 | | - const edgeList& edges = mesh.edges(); |
78 | | - |
| 77 | + const edgeList& edges = mesh.edges(); |
| 78 | + |
79 | 79 |
|
80 | 80 |
|
81 | 81 | // MINIMUM EDGE LENGTH FOR CFL NUMBER (h) |
82 | 82 | //--------------------------------------- |
83 | | - dimensionedScalar h ("h", dimensionSet(0,1,0,0,0,0,0), GREAT); |
| 83 | + dimensionedScalar h ("h", dimensionSet(0,1,0,0,0,0,0), GREAT); |
84 | 84 |
|
85 | | - forAll (edges,edgeID) |
86 | | - { |
87 | | - forAll (edges[edgeID],point) |
88 | | - { |
89 | | - const label& pointID = edges[edgeID][point]; |
90 | | - const label& pointID1 = edges[edgeID][point+1]; |
91 | | - const scalar& edgeLength = mag(mesh.points()[pointID]-mesh.points()[pointID1]); |
92 | | - |
93 | | - if (edgeLength < h.value()) |
94 | | - { |
95 | | - h.value() = edgeLength; |
96 | | - } |
97 | | - |
98 | | - break; |
99 | | - } |
100 | | - } |
| 85 | + forAll (edges,edgeID) |
| 86 | + { |
| 87 | + forAll (edges[edgeID],point) |
| 88 | + { |
| 89 | + const label& pointID = edges[edgeID][point]; |
| 90 | + const label& pointID1 = edges[edgeID][point+1]; |
| 91 | + const scalar& edgeLength = mag(mesh.points()[pointID]-mesh.points()[pointID1]); |
| 92 | + |
| 93 | + if (edgeLength < h.value()) |
| 94 | + { |
| 95 | + h.value() = edgeLength; |
| 96 | + } |
| 97 | + |
| 98 | + break; |
| 99 | + } |
| 100 | + } |
101 | 101 |
|
102 | | - if( Pstream::parRun() ) |
103 | | - { |
104 | | - reduce(h.value(), minOp<scalar>()); |
105 | | - } |
| 102 | + if( Pstream::parRun() ) |
| 103 | + { |
| 104 | + reduce(h.value(), minOp<scalar>()); |
| 105 | + } |
106 | 106 |
|
107 | 107 |
|
108 | 108 |
|
109 | 109 |
|
110 | 110 | // BOUNDARY PATCHES |
111 | 111 | //----------------- |
112 | 112 |
|
113 | | - const polyBoundaryMesh& bm = mesh.boundaryMesh(); |
114 | | - const label& symmetricPatchID = bm.findPatchID("symmetric"); |
115 | | - const label& symmetricXpatchID = bm.findPatchID("symmetricX"); |
116 | | - const label& symmetricYpatchID = bm.findPatchID("symmetricY"); |
117 | | - const label& symmetricZpatchID = bm.findPatchID("symmetricZ"); |
| 113 | + const polyBoundaryMesh& bm = mesh.boundaryMesh(); |
| 114 | + const label& symmetricPatchID = bm.findPatchID("symmetric"); |
| 115 | + const label& symmetricXpatchID = bm.findPatchID("symmetricX"); |
| 116 | + const label& symmetricYpatchID = bm.findPatchID("symmetricY"); |
| 117 | + const label& symmetricZpatchID = bm.findPatchID("symmetricZ"); |
118 | 118 |
|
119 | 119 |
|
120 | 120 |
|
121 | 121 | // A INVERSE FOR CALCULATION OF GRADIENT (Ainv) |
122 | 122 | //--------------------------------------------- |
123 | 123 |
|
124 | | - volTensorField Ainv |
125 | | - ( |
126 | | - IOobject("Ainv", mesh), |
127 | | - mesh, |
128 | | - dimensionedTensor("Ainv",dimensionSet(0,2,0,0,0,0,0),tensor::zero) |
129 | | - ); |
| 124 | + volTensorField Ainv |
| 125 | + ( |
| 126 | + IOobject("Ainv", mesh), |
| 127 | + mesh, |
| 128 | + dimensionedTensor("Ainv",dimensionSet(0,2,0,0,0,0,0),tensor::zero) |
| 129 | + ); |
130 | 130 |
|
131 | 131 |
|
132 | | - |
| 132 | + |
133 | 133 |
|
134 | 134 | // Ainv FOR CALCULATION OF GRADIENT FROM CONTACT VALUES (AvCinv) |
135 | 135 | //-------------------------------------------------------------- |
136 | 136 |
|
137 | | - // Initialise AvCinv |
138 | | - volTensorField AvCinv(Ainv); |
| 137 | + // Initialise AvCinv |
| 138 | + volTensorField AvCinv(Ainv); |
139 | 139 |
|
140 | 140 |
|
0 commit comments