FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

boundaryTreatment.H

Go to the documentation of this file.
00001 if (isA<wallPolyPatch>(pbMesh[patch(face())]))
00002 {
00003     keepParcel = sDB.wall().wallTreatment(*this, face());
00004 
00005     if (sDB.twoD())
00006     {
00007         scalar vs = U() & sDB.axisOfSymmetry();
00008         vector Us = U() - (vs * sDB.axisOfSymmetry());
00009         scalar magUs = mag(Us);
00010         scalar v1 = Us & n();
00011         scalar magV1 = mag(v1);
00012         U() = (magUs/magV1)*v1*n() + vs*sDB.axisOfSymmetry();
00013     }
00014 }
00015 else if (isA<wedgePolyPatch>(pbMesh[patch(face())]))
00016 {
00017     // check if parcel is trying to move out of the domain
00018     label patchi = patch(face());
00019     label patchFacei = patchFace(patchi, face());
00020     const polyPatch& patch = mesh.boundaryMesh()[patchi];
00021     vector nf = patch.faceAreas()[patchFacei];
00022 
00023     scalar Un = U() & nf;
00024     if (Un > 0)
00025     {
00026         scalar Un2 = U() & n(); 
00027         U() -= 2.0*Un2*n();
00028     }
00029 }
00030 else if (isA<symmetryPolyPatch>(pbMesh[patch(face())]))
00031 {
00032     // check if parcel is trying to move out of the domain
00033     label patchi = patch(face());
00034     label patchFacei = patchFace(patchi, face());
00035     const polyPatch& patch = mesh.boundaryMesh()[patchi];
00036     vector nf = patch.faceAreas()[patchFacei];
00037 
00038     scalar Un = U() & nf;
00039     if (Un > 0)
00040     {
00041         if (sDB.twoD())
00042         {
00043             U() -= 2.0*(U() & n())*n();
00044         }
00045         else
00046         {
00047             nf /= mag(nf);
00048             U() -= 2.0*(U() & nf)*nf;
00049         }
00050     }
00051 }
00052 else if (isType<polyPatch>(pbMesh[patch(face())]))
00053 {
00054     // Parcel has hit an inlet or outlet or some such so throw it away
00055     keepParcel = false;
00056 }
00057 
00058 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines