This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/tutorials/incompressible/simpleFoam/ERCOFTAC_ConicalDiffuser/addSwirlAndRotation/setRotation.H
2012-04-15 13:43:52 -04:00

33 lines
816 B
C
Executable file

// Add rotation/swirl at rotating patches
if (modifyBoundaries)
{
forAll (rotPatches, patchi)
{
label patchID =
mesh.boundaryMesh().findPatchID(rotPatches[patchi]);
if (patchID > -1)
{
const fvPatch& cPatch = mesh.boundary()[patchID];
const vectorField& faceCentres = cPatch.Cf();
U.boundaryField()[patchID] ==
(
U.boundaryField()[patchID]
+ (omega.value() ^ (faceCentres - center.value()))
);
}
else
{
Info<< "Patch " << rotPatches[patchi] << " not found" << endl;
}
}
}
// Add swirl at internal cells
if (modifyInterior)
{
forAll(mesh.C(), celli)
{
U[celli] += omega.value() ^ (mesh.C()[celli] - center.value());
}
}