40 #include <HashTable.H>
42 #include "emptyFvPatch.H"
43 #include "coupledFvPatch.H"
44 #include "wedgeFvPatch.H"
45 #include "symmetryFvPatch.H"
46 #include "symmetryPlaneFvPatch.H"
56 surfaceScalarField sF = linearInterpolate(iF);
60 Foam::tmp<Foam::surfaceVectorField>
64 tmp<surfaceVectorField> tgradIF(0.0*nf_*fvc::snGrad(iF));
65 surfaceVectorField& gradIF = tgradIF.ref();
67 surfaceScalarField tField = sF*0;
69 faceScalarDer(iF.primitiveField(),sF.primitiveField(),0,tField);
70 gradIF.primitiveFieldRef().replace(0, tField);
71 faceScalarDer(iF.primitiveField(),sF.primitiveField(),1,tField);
72 gradIF.primitiveFieldRef().replace(1, tField);
73 faceScalarDer(iF.primitiveField(),sF.primitiveField(),2,tField);
74 gradIF.primitiveFieldRef().replace(2, tField);
77 forAll(mesh_.boundaryMesh(), ipatch)
79 bool notConstrain =
true;
80 const fvPatch& fvp = mesh_.boundary()[ipatch];
83 isA<emptyFvPatch>(fvp) ||
84 isA<wedgeFvPatch>(fvp) ||
85 isA<coupledFvPatch>(fvp) ||
86 isA<symmetryFvPatch>(fvp) ||
87 isA<symmetryPlaneFvPatch>(fvp)
95 gradIF.boundaryFieldRef()[ipatch] =
96 nf_.boundaryField()[ipatch] *
97 iF.boundaryField()[ipatch].snGrad();
101 if(!Pstream::parRun())
114 List3<scalar> procVfValues(nProcPatches_);
117 faceScalarDer(procVfValues,sF,0,tField);
118 gradIF.boundaryFieldRef().replace(0, tField.boundaryFieldRef());
119 faceScalarDer(procVfValues,sF,1,tField);
120 gradIF.boundaryFieldRef().replace(1, tField.boundaryFieldRef());
121 faceScalarDer(procVfValues,sF,2,tField);
122 gradIF.boundaryFieldRef().replace(2, tField.boundaryFieldRef());
tmp< surfaceVectorField > Grad(const volScalarField &iF)
Calculate gradient of volume scalar function on the faces.