wallDistData.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 "wallDistData.H"
00028 #include "patchDataWave.H"
00029 #include "wallPolyPatch.H"
00030 #include "emptyFvPatchFields.H"
00031
00032
00033
00034
00035 template<class TransferType>
00036 Foam::wallDistData<TransferType>::wallDistData
00037 (
00038 const Foam::fvMesh& mesh,
00039 GeometricField<Type, fvPatchField, volMesh>& field,
00040 const bool correctWalls
00041 )
00042 :
00043 volScalarField
00044 (
00045 IOobject
00046 (
00047 "y",
00048 mesh.time().timeName(),
00049 mesh
00050 ),
00051 mesh,
00052 dimensionedScalar("y", dimLength, GREAT)
00053 ),
00054 cellDistFuncs(mesh),
00055 field_(field),
00056 correctWalls_(correctWalls),
00057 nUnset_(0)
00058 {
00059 correct();
00060 }
00061
00062
00063
00064
00065 template<class TransferType>
00066 Foam::wallDistData<TransferType>::~wallDistData()
00067 {}
00068
00069
00070
00071
00072
00073 template<class TransferType>
00074 void Foam::wallDistData<TransferType>::correct()
00075 {
00076 const polyMesh& mesh = cellDistFuncs::mesh();
00077
00078
00079
00080
00081
00082
00083 labelHashSet wallPatchIDs(getPatchIDs(wallPolyPatch::typeName));
00084
00085
00086 UPtrList<Field<Type> > patchData(mesh.boundaryMesh().size());
00087
00088 forAll(field_.boundaryField(), patchI)
00089 {
00090 patchData.set(patchI, &field_.boundaryField()[patchI]);
00091 }
00092
00093
00094 patchDataWave<TransferType> wave
00095 (
00096 mesh,
00097 wallPatchIDs,
00098 patchData,
00099 correctWalls_
00100 );
00101
00102
00103 transfer(wave.distance());
00104
00105 field_.transfer(wave.cellData());
00106
00107
00108 forAll(boundaryField(), patchI)
00109 {
00110 scalarField& waveFld = wave.patchDistance()[patchI];
00111
00112 if (boundaryField()[patchI].type() != emptyFvPatchScalarField::typeName)
00113 {
00114 boundaryField()[patchI].transfer(waveFld);
00115
00116 Field<Type>& wavePatchData = wave.patchData()[patchI];
00117
00118 field_.boundaryField()[patchI].transfer(wavePatchData);
00119 }
00120 }
00121
00122
00123 nUnset_ = wave.nUnset();
00124 }
00125
00126
00127
Copyright © 2000-2009 OpenCFD Ltd