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