2 volVectorField::GeometricBoundaryField& Upatches = U.boundaryField();
4 const volTensorField::GeometricBoundaryField& gradUpatches =
7 const surfaceVectorField::GeometricBoundaryField& Apatches =
8 mesh.Sf().boundaryField();
9 const surfaceScalarField::GeometricBoundaryField& magApatches =
10 mesh.magSf().boundaryField();
12 vectorField nGradPatch = Apatches[gradPatch]/magApatches[gradPatch];
14 vectorField nDirPatch = Apatches[dirPatch]/magApatches[dirPatch];
17 contactPair.updateContact(U);
18 reversePair.updateContact(U);
20 const scalarField& touchFraction = contactPair.touchFraction();
22 const scalarField& reverseFraction = reversePair.touchFraction();
24 //Info << "touchFraction: " << touchFraction << endl;
26 // Mark contact surfaces
27 contactArea.boundaryField()[dirPatch] = touchFraction;
28 contactArea.boundaryField()[gradPatch] = reverseFraction;
30 // Cast will fall over in incorrect
31 directionMixedFvPatchVectorField& UpatchDir =
32 refCast<directionMixedFvPatchVectorField>(Upatches[dirPatch]);
34 // set the traction and value for directionMixed patch
35 UpatchDir.valueFraction() =
36 (1.0 - urf)*UpatchDir.valueFraction()
37 + I*urf*touchFraction;
39 // UpatchDir.value() = contactPair.slaveDisplacement();
41 UpatchDir.refValue() =
45 (nDirPatch & UpatchDir) + urf*touchFraction*touchTolerance,
46 (nDirPatch & contactPair.slaveDisplacement())
49 // traction[dirPatch] = 0 because there's no friction!!
51 // set the traction for the gradient patch (using the new valueFraction!)
53 vectorField newTraction =
56 reversePair.slavePressure
62 gradUpatches[dirPatch]
63 + gradUpatches[dirPatch].T()
65 + I*(lambda.value()*tr(gradUpatches[dirPatch]))
76 // gradUpatches[dirPatch]
77 // + gradUpatches[dirPatch].T()
79 // + I*(lambda.value()*tr(gradUpatches[dirPatch]))
80 // ) & nDirPatch)*rho.value()
84 (1.0 - urf)*traction[gradPatch]
85 + urf*newTraction*reverseFraction;