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

mapPatch.H

Go to the documentation of this file.
00001     if(planeMapping && targetPatchNamePresent && cut.cut())
00002     {
00003         //Map variables U, phi & k
00004         //Info << typeInfo("isoLESmodel") << endl;
00005         //Info << "SGS model" << sgsModel.type() << endl;
00006 
00007         scalarField planek(cutCells.size());
00008         scalarField planeNuTilda(cutCells.size());
00009         vectorField planeU(cutCells.size());
00010 
00011         forAll(cutCells, cCellsI)
00012         {
00013             if(sgsModel.type() == "SpalartAllmaras")
00014             {
00015                 planeNuTilda[cCellsI] = sgsModel.nuTilda()()[cutCells[cCellsI]];
00016             }
00017             else
00018             {
00019                 planek[cCellsI] = sgsModel.k()()[cutCells[cCellsI]];
00020             }
00021             planeU[cCellsI] = U[cutCells[cCellsI]];
00022         }
00023 
00024         if(sgsModel.type() == "SpalartAllmaras")
00025         {
00026             Info << "Mapping NuTilda." << endl;
00027             sgsModel.nuTilda()().boundaryField()[targetPatchNumber] ==
00028             interPatch.faceInterpolate(planeNuTilda)();
00029         }
00030         else
00031         {
00032             Info << "Mapping k." << endl;
00033             sgsModel.k()().boundaryField()[targetPatchNumber] ==
00034             interPatch.faceInterpolate(planek)();
00035         }
00036         
00037         U.boundaryField()[targetPatchNumber] ==
00038             interPatch.faceInterpolate(planeU)();
00039 
00040 /*         sgsModel.k()().boundaryField()[targetPatchNumber] == 
00041          toPatchInter.pointToFaceInterpolate
00042          (
00043              interPatch.pointInterpolate
00044              (
00045                  planePatchInter.faceToPointInterpolate
00046                  (
00047                      planek
00048                  )
00049              )
00050          );
00051 
00052          U.boundaryField()[targetPatchNumber] == 
00053          toPatchInter.pointToFaceInterpolate
00054          (
00055              interPatch.pointInterpolate
00056              (
00057                  planePatchInter.faceToPointInterpolate
00058                  (
00059                      planeU
00060                  )
00061              )
00062          );
00063 
00064 */
00065           
00066         scalar Q = sum
00067         (
00068             mesh.Sf().boundaryField()[targetPatchNumber]
00069             & U.boundaryField()[targetPatchNumber]
00070         );
00071 
00072         scalar Qbar = sum
00073         (
00074             mesh.Sf().boundaryField()[targetPatchNumber] &
00075             Ubar.value()
00076         );
00077                 
00078         U.boundaryField()[targetPatchNumber] ==
00079             U.boundaryField()[targetPatchNumber] * (Qbar/Q);
00080         
00081         Info << "Mass flux correction factor: " << (Qbar/Q) << endl; 
00082 
00083         phi.boundaryField()[targetPatchNumber] ==
00084         (
00085             mesh.Sf().boundaryField()[targetPatchNumber] &
00086             U.boundaryField()[targetPatchNumber]
00087         );
00088     }
00089 
00090 
00091 
00092 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines