nearWallDistNoSearch.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "nearWallDistNoSearch.H"
00028 #include "fvMesh.H"
00029 #include "wallPoint.H"
00030 #include "wallFvPatch.H"
00031 #include "surfaceFields.H"
00032
00033
00034
00035 void Foam::nearWallDistNoSearch::doAll()
00036 {
00037 const volVectorField& cellCentres = mesh_.C();
00038 const fvPatchList& patches = mesh_.boundary();
00039
00040 forAll(patches, patchI)
00041 {
00042 fvPatchScalarField& ypatch = operator[](patchI);
00043
00044 if (patches[patchI].type() == wallFvPatch::typeName)
00045 {
00046 const unallocLabelList& faceCells = patches[patchI].faceCells();
00047
00048 const fvPatchVectorField& patchCentres
00049 = cellCentres.boundaryField()[patchI];
00050
00051 const fvsPatchVectorField& Apatch
00052 = mesh_.Sf().boundaryField()[patchI];
00053
00054 const fvsPatchScalarField& magApatch
00055 = mesh_.magSf().boundaryField()[patchI];
00056
00057 forAll(patchCentres, facei)
00058 {
00059 ypatch[facei] =
00060 (
00061 Apatch[facei] &
00062 (
00063 patchCentres[facei]
00064 - cellCentres[faceCells[facei]]
00065 )
00066 )/magApatch[facei];
00067 }
00068 }
00069 else
00070 {
00071 ypatch = 0.0;
00072 }
00073 }
00074 }
00075
00076
00077
00078
00079 Foam::nearWallDistNoSearch::nearWallDistNoSearch(const Foam::fvMesh& mesh)
00080 :
00081 volScalarField::GeometricBoundaryField
00082 (
00083 mesh.boundary(),
00084 mesh.V(),
00085 calculatedFvPatchScalarField::typeName
00086 ),
00087 mesh_(mesh)
00088 {
00089 doAll();
00090 }
00091
00092
00093
00094
00095 Foam::nearWallDistNoSearch::~nearWallDistNoSearch()
00096 {}
00097
00098
00099
00100
00101 void Foam::nearWallDistNoSearch::correct()
00102 {
00103 if (mesh_.changing())
00104 {
00105
00106 forAll(mesh_.boundary(), patchI)
00107 {
00108 operator[](patchI).setSize(mesh_.boundary()[patchI].size());
00109 }
00110 }
00111
00112 doAll();
00113 }
00114
00115
00116
Copyright © 2000-2009 OpenCFD Ltd