diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index 8ad9a47b89ee2af9c53e7874d0ebe499093a0359..b590eb31cd67383146216cfbdc4f211a38397137 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -989,11 +989,15 @@ private: labelList& neighbour ) const; - //- Rotates a face by an amount nPos - face rotateFace + //- Create an empty fvMesh + autoPtr<fvMesh> createDummyMesh ( - const face& f, - const label nPos + const IOobject& io, + const wordList& patchTypes, + const wordList& patchNames, + const labelList& patchSizes, + const labelList& patchStarts, + const labelList& procNeighbours ) const; //- Rotate the faces on processor patches if necessary diff --git a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C index 49c4fe71fa7aaa135d9d828c15f89cbe3a458073..ab7ce33f8563760f144c6aff33f6893a1a7e0078 100644 --- a/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C +++ b/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshIO.C @@ -562,27 +562,61 @@ void Foam::conformalVoronoiMesh::writeMesh } -Foam::face Foam::conformalVoronoiMesh::rotateFace +Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh ( - const face& f, - const label nPos + const IOobject& io, + const wordList& patchTypes, + const wordList& patchNames, + const labelList& patchSizes, + const labelList& patchStarts, + const labelList& procNeighbours ) const { - face newF(f.size()); + autoPtr<fvMesh> meshPtr + ( + new fvMesh + ( + io, + xferCopy(pointField()), + xferCopy(faceList()), + xferCopy(cellList()) + ) + ); + fvMesh& mesh = meshPtr(); - forAll(f, fp) - { - label fp1 = (fp + nPos) % f.size(); + List<polyPatch*> patches(patchStarts.size()); - if (fp1 < 0) + forAll(patches, patchI) + { + if (patchTypes[patchI] == processorPolyPatch::typeName) { - fp1 += f.size(); + patches[patchI] = new processorPolyPatch + ( + patchNames[patchI], + 0, //patchSizes[p], + 0, //patchStarts[p], + patchI, + mesh.boundaryMesh(), + Pstream::myProcNo(), + procNeighbours[patchI] + ); + } + else + { + patches[patchI] = polyPatch::New + ( + patchTypes[patchI], + patchNames[patchI], + 0, //patchSizes[p], + 0, //patchStarts[p], + patchI, + mesh.boundaryMesh() + ).ptr(); } - - newF[fp1] = f[fp]; } + mesh.addFvPatches(patches); - return newF; + return meshPtr; } @@ -599,51 +633,28 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches const labelList& procNeighbours ) const { - fvMesh tempMesh + // Create dummy mesh with correct proc boundaries to do sorting + autoPtr<fvMesh> sortMeshPtr ( - IOobject + createDummyMesh ( - meshName, - instance, - runTime_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - xferCopy(pointField()), - xferCopy(faceList()), - xferCopy(cellList()) - ); - - List<polyPatch*> patches(patchStarts.size()); - - forAll(patches, p) - { - if (patchTypes[p] == processorPolyPatch::typeName) - { - patches[p] = new processorPolyPatch - ( - patchNames[p], - patchSizes[p], - patchStarts[p], - p, - tempMesh.boundaryMesh(), - Pstream::myProcNo(), - procNeighbours[p] - ); - } - else - { - patches[p] = polyPatch::New + IOobject ( - patchTypes[p], - patchNames[p], - patchSizes[p], - patchStarts[p], - p, - tempMesh.boundaryMesh() - ).ptr(); - } - } + meshName, + instance, + runTime_, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + patchTypes, + patchNames, + patchSizes, + patchStarts, + procNeighbours + ) + ); + const fvMesh& sortMesh = sortMeshPtr(); // Rotation on new faces. labelList rotation(faces.size(), 0); @@ -651,11 +662,13 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches PstreamBuffers pBufs(Pstream::nonBlocking); // Send ordering - forAll(patches, patchI) + forAll(sortMesh.boundaryMesh(), patchI) { - if (isA<processorPolyPatch>(*patches[patchI])) + const polyPatch& pp = sortMesh.boundaryMesh()[patchI]; + + if (isA<processorPolyPatch>(pp)) { - static_cast<processorPolyPatch*>(patches[patchI])->initOrder + refCast<const processorPolyPatch>(pp).initOrder ( pBufs, primitivePatch @@ -677,15 +690,17 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches // Receive and calculate ordering bool anyChanged = false; - forAll(patches, patchI) + forAll(sortMesh.boundaryMesh(), patchI) { - if (isA<processorPolyPatch>(*patches[patchI])) + const polyPatch& pp = sortMesh.boundaryMesh()[patchI]; + + if (isA<processorPolyPatch>(pp)) { labelList patchFaceMap(patchSizes[patchI], -1); labelList patchFaceRotation(patchSizes[patchI], 0); bool changed = - static_cast<processorPolyPatch*>(patches[patchI])->order + refCast<const processorPolyPatch>(pp).order ( pBufs, primitivePatch @@ -727,7 +742,7 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches { if (rotation[faceI] != 0) { - faces[faceI] = rotateFace(faces[faceI], rotation[faceI]); + faces[faceI] = faces[faceI].rotateFace(rotation[faceI]); } } } diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 3211df15140eb845406ef9fff78a882eab66029c..5a593f0bf1840bfbaa95278cb18ce65ac2b80d64 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -633,6 +633,27 @@ Foam::face Foam::face::reverseFace() const } +Foam::face Foam::face::rotateFace(const label nPos) const +{ + const labelList& f = *this; + labelList newList(size()); + + forAll(f, fp) + { + label fp1 = (fp + nPos) % f.size(); + + if (fp1 < 0) + { + fp1 += f.size(); + } + + newList[fp1] = f[fp]; + } + + return face(xferMove(newList)); +} + + Foam::label Foam::face::which(const label globalIndex) const { const labelList& f = *this; diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index c1c9716c03f4f55ee1f62e232f94b168d20c8c1e..3b2ffcc757a961435746c72843260f66b882343b 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -197,6 +197,9 @@ public: // The starting points of the original and reverse face are identical. face reverseFace() const; + //- Rotate face by number of positions + face rotateFace(const label nPos) const; + //- Navigation through face vertices //- Which vertex on face (face index given a global index) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C index 9b14aae0df11d22cfe663da68cfcd164a8efddd1..58a897666b51489b796780d25628ebcaefa395f9 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.C @@ -1890,30 +1890,6 @@ void Foam::polyTopoChange::calcFaceZonePointMap } -Foam::face Foam::polyTopoChange::rotateFace -( - const face& f, - const label nPos -) -{ - face newF(f.size()); - - forAll(f, fp) - { - label fp1 = (fp + nPos) % f.size(); - - if (fp1 < 0) - { - fp1 += f.size(); - } - - newF[fp1] = f[fp]; - } - - return newF; -} - - void Foam::polyTopoChange::reorderCoupledFaces ( const bool syncParallel, @@ -2024,7 +2000,7 @@ void Foam::polyTopoChange::reorderCoupledFaces { if (rotation[faceI] != 0) { - faces_[faceI] = rotateFace(faces_[faceI], rotation[faceI]); + faces_[faceI] = faces_[faceI].rotateFace(rotation[faceI]); } } } diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H index 6feac49d7574d00f00067bf47cc797b8d083318a..476a406223c6ffd925d8b81e4d44ec8219b09280 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/polyTopoChange.H @@ -363,9 +363,6 @@ class polyTopoChange // Coupling - //- Rotate face by number of positions - static face rotateFace(const face& f, const label nPos); - //- Do all coupled patch face reordering void reorderCoupledFaces ( diff --git a/src/sampling/probes/patchProbes.C b/src/sampling/probes/patchProbes.C index 3b56f6d229fa9d82e46914680d937465f0de21df..4d81b9a661ca9521e5e5d6dd9a46d961e664e087 100644 --- a/src/sampling/probes/patchProbes.C +++ b/src/sampling/probes/patchProbes.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -202,6 +202,7 @@ Foam::patchProbes::patchProbes // Not easy to workaround (apart from feeding through flag into constructor) // so clear out any cells found for now. elementList_.clear(); + faceList_.clear(); read(dict); } @@ -222,6 +223,12 @@ void Foam::patchProbes::write() sampleAndWrite(sphericalTensorFields_); sampleAndWrite(symmTensorFields_); sampleAndWrite(tensorFields_); + + sampleAndWriteSurfaceFields(surfaceScalarFields_); + sampleAndWriteSurfaceFields(surfaceVectorFields_); + sampleAndWriteSurfaceFields(surfaceSphericalTensorFields_); + sampleAndWriteSurfaceFields(surfaceSymmTensorFields_); + sampleAndWriteSurfaceFields(surfaceTensorFields_); } } diff --git a/src/sampling/probes/patchProbes.H b/src/sampling/probes/patchProbes.H index 8371d8b9c22420a793ed6ba135aa10fa8fa48f67..096015f19af006e6e4642314ae1ba110f5095686 100644 --- a/src/sampling/probes/patchProbes.H +++ b/src/sampling/probes/patchProbes.H @@ -74,11 +74,24 @@ class patchProbes ); + //- Sample and write a particular surface field + template<class Type> + void sampleAndWrite + ( + const GeometricField<Type, fvsPatchField, surfaceMesh>& + ); + + //- Sample and write all the fields of the given type template <class Type> void sampleAndWrite(const fieldGroup<Type>&); + //- Sample and write all the surface fields of the given type + template<class Type> + void sampleAndWriteSurfaceFields(const fieldGroup<Type>&); + + //- Sample a volume field at all locations template<class Type> tmp<Field<Type> > sample @@ -87,6 +100,14 @@ class patchProbes ) const; + //- Sample a surface field at all locations + template<class Type> + tmp<Field<Type> > sample + ( + const GeometricField<Type, fvsPatchField, surfaceMesh>& + ) const; + + //- Sample a single field on all sample locations template <class Type> tmp<Field<Type> > sample(const word& fieldName) const; diff --git a/src/sampling/probes/patchProbesTemplates.C b/src/sampling/probes/patchProbesTemplates.C index 48d3c44b4d470bd62fa3045fc87d412a994c56bb..898fdf254c6c2f05f92e28e7fd98d03f636f5a73 100644 --- a/src/sampling/probes/patchProbesTemplates.C +++ b/src/sampling/probes/patchProbesTemplates.C @@ -54,6 +54,30 @@ void Foam::patchProbes::sampleAndWrite } +template<class Type> +void Foam::patchProbes::sampleAndWrite +( + const GeometricField<Type, fvsPatchField, surfaceMesh>& sField +) +{ + Field<Type> values(sample(sField)); + + if (Pstream::master()) + { + unsigned int w = IOstream::defaultPrecision() + 7; + OFstream& probeStream = *probeFilePtrs_[sField.name()]; + + probeStream << setw(w) << sField.time().value(); + + forAll(values, probeI) + { + probeStream << ' ' << setw(w) << values[probeI]; + } + probeStream << endl; + } +} + + template <class Type> void Foam::patchProbes::sampleAndWrite ( @@ -106,6 +130,58 @@ void Foam::patchProbes::sampleAndWrite } +template<class Type> +void Foam::patchProbes::sampleAndWriteSurfaceFields +( + const fieldGroup<Type>& fields +) +{ + forAll(fields, fieldI) + { + if (loadFromFiles_) + { + sampleAndWrite + ( + GeometricField<Type, fvsPatchField, surfaceMesh> + ( + IOobject + ( + fields[fieldI], + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ), + mesh_ + ) + ); + } + else + { + objectRegistry::const_iterator iter = mesh_.find(fields[fieldI]); + + if + ( + iter != objectRegistry::end() + && iter()->type() + == GeometricField<Type, fvsPatchField, surfaceMesh>::typeName + ) + { + sampleAndWrite + ( + mesh_.lookupObject + <GeometricField<Type, fvsPatchField, surfaceMesh> > + ( + fields[fieldI] + ) + ); + } + } + } +} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> @@ -159,4 +235,39 @@ Foam::patchProbes::sample(const word& fieldName) const } +template<class Type> +Foam::tmp<Foam::Field<Type> > +Foam::patchProbes::sample +( + const GeometricField<Type, fvsPatchField, surfaceMesh>& sField +) const +{ + const Type unsetVal(-VGREAT*pTraits<Type>::one); + + tmp<Field<Type> > tValues + ( + new Field<Type>(this->size(), unsetVal) + ); + + Field<Type>& values = tValues(); + + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + + forAll(*this, probeI) + { + label faceI = elementList_[probeI]; + + if (faceI >= 0) + { + label patchI = patches.whichPatch(faceI); + label localFaceI = patches[patchI].whichFace(faceI); + values[probeI] = sField.boundaryField()[patchI][localFaceI]; + } + } + + Pstream::listCombineGather(values, isNotEqOp<Type>()); + Pstream::listCombineScatter(values); + + return tValues; +} // ************************************************************************* // diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C index b0a073e1e400b8b3cef254c9e0b1f06bbca603f2..f15a1f5575c0b190c30f165c0923c27fde12a49c 100644 --- a/src/sampling/probes/probes.C +++ b/src/sampling/probes/probes.C @@ -41,16 +41,45 @@ void Foam::probes::findElements(const fvMesh& mesh) elementList_.clear(); elementList_.setSize(size()); + faceList_.clear(); + faceList_.setSize(size()); + forAll(*this, probeI) { const vector& location = operator[](probeI); - elementList_[probeI] = mesh.findCell(location); + const label cellI = mesh.findCell(location); + + elementList_[probeI] = cellI; - if (debug && elementList_[probeI] != -1) + if (cellI != -1) + { + const labelList& cellFaces = mesh.cells()[cellI]; + const vector& cellCentre = mesh.cellCentres()[cellI]; + scalar minDistance = GREAT; + label minFaceID = -1; + forAll (cellFaces, i) + { + label faceI = cellFaces[i]; + vector dist = mesh.faceCentres()[faceI] - cellCentre; + if (mag(dist) < minDistance) + { + minDistance = mag(dist); + minFaceID = faceI; + } + } + faceList_[probeI] = minFaceID; + } + else + { + faceList_[probeI] = -1; + } + + if (debug && (elementList_[probeI] != -1 || faceList_[probeI] != -1)) { Pout<< "probes : found point " << location - << " in cell " << elementList_[probeI] << endl; + << " in cell " << elementList_[probeI] + << " and face " << faceList_[probeI] << endl; } } @@ -60,25 +89,36 @@ void Foam::probes::findElements(const fvMesh& mesh) { const vector& location = operator[](probeI); label cellI = elementList_[probeI]; + label faceI = faceList_[probeI]; // Check at least one processor with cell. reduce(cellI, maxOp<label>()); + reduce(faceI, maxOp<label>()); if (cellI == -1) { if (Pstream::master()) { - WarningIn("probes::read()") + WarningIn("findElements::findElements(const fvMesh&)") << "Did not find location " << location << " in any cell. Skipping location." << endl; } } + else if (faceI == -1) + { + if (Pstream::master()) + { + WarningIn("probes::findElements(const fvMesh&)") + << "Did not find location " << location + << " in any face. Skipping location." << endl; + } + } else { // Make sure location not on two domains. if (elementList_[probeI] != -1 && elementList_[probeI] != cellI) { - WarningIn("probes::read()") + WarningIn("probes::findElements(const fvMesh&)") << "Location " << location << " seems to be on multiple domains:" << " cell " << elementList_[probeI] @@ -89,6 +129,20 @@ void Foam::probes::findElements(const fvMesh& mesh) << " a processor patch. Change the location slightly" << " to prevent this." << endl; } + + if (faceList_[probeI] != -1 && faceList_[probeI] != faceI) + { + WarningIn("probes::findElements(const fvMesh&)") + << "Location " << location + << " seems to be on multiple domains:" + << " cell " << faceList_[probeI] + << " on my domain " << Pstream::myProcNo() + << " and face " << faceI << " on some other domain." + << endl + << "This might happen if the probe location is on" + << " a processor patch. Change the location slightly" + << " to prevent this." << endl; + } } } } @@ -109,6 +163,12 @@ Foam::label Foam::probes::prepare() currentFields.insert(symmTensorFields_); currentFields.insert(tensorFields_); + currentFields.insert(surfaceScalarFields_); + currentFields.insert(surfaceVectorFields_); + currentFields.insert(surfaceSphericalTensorFields_); + currentFields.insert(surfaceSymmTensorFields_); + currentFields.insert(surfaceTensorFields_); + if (debug) { Info<< "Probing fields:" << currentFields << nl @@ -239,6 +299,12 @@ void Foam::probes::write() sampleAndWrite(sphericalTensorFields_); sampleAndWrite(symmTensorFields_); sampleAndWrite(tensorFields_); + + sampleAndWriteSurfaceFields(surfaceScalarFields_); + sampleAndWriteSurfaceFields(surfaceVectorFields_); + sampleAndWriteSurfaceFields(surfaceSphericalTensorFields_); + sampleAndWriteSurfaceFields(surfaceSymmTensorFields_); + sampleAndWriteSurfaceFields(surfaceTensorFields_); } } diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 1c2761e3499d2d785a306a36cc684fe05f8a3a58..2bcebe16749041bc7a88803e2c09f369ad39e666 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -42,7 +42,8 @@ SourceFiles #include "polyMesh.H" #include "pointField.H" #include "volFieldsFwd.H" - +#include "surfaceFieldsFwd.H" +#include "surfaceMesh.H" #include "wordReList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -104,16 +105,26 @@ protected: // Calculated - //- Categorized scalar/vector/tensor fields + //- Categorized scalar/vector/tensor vol fields fieldGroup<scalar> scalarFields_; fieldGroup<vector> vectorFields_; fieldGroup<sphericalTensor> sphericalTensorFields_; fieldGroup<symmTensor> symmTensorFields_; fieldGroup<tensor> tensorFields_; + //- Categorized scalar/vector/tensor surf fields + fieldGroup<scalar> surfaceScalarFields_; + fieldGroup<vector> surfaceVectorFields_; + fieldGroup<sphericalTensor> surfaceSphericalTensorFields_; + fieldGroup<symmTensor> surfaceSymmTensorFields_; + fieldGroup<tensor> surfaceTensorFields_; + // Cells to be probed (obtained from the locations) labelList elementList_; + // Faces to be probed + labelList faceList_; + //- Current open files HashPtrTable<OFstream> probeFilePtrs_; @@ -145,10 +156,22 @@ private: const GeometricField<Type, fvPatchField, volMesh>& ); + + //- Sample and write a particular surface field + template<class Type> + void sampleAndWrite + ( + const GeometricField<Type, fvsPatchField, surfaceMesh>& + ); + //- Sample and write all the fields of the given type template<class Type> void sampleAndWrite(const fieldGroup<Type>&); + //- Sample and write all the surface fields of the given type + template<class Type> + void sampleAndWriteSurfaceFields(const fieldGroup<Type>&); + //- Disallow default bitwise copy construct probes(const probes&); @@ -242,9 +265,21 @@ public: const GeometricField<Type, fvPatchField, volMesh>& ) const; - //- Sample a single field on all sample locations + //- Sample a single vol field on all sample locations template <class Type> tmp<Field<Type> > sample(const word& fieldName) const; + + //- Sample a single scalar field on all sample locations + template <class Type> + tmp<Field<Type> > sampleSurfaceFields(const word& fieldName) const; + + //- Sample a surface field at all locations + template<class Type> + tmp<Field<Type> > sample + ( + const GeometricField<Type, fvsPatchField, surfaceMesh>& + ) const; + }; diff --git a/src/sampling/probes/probesGrouping.C b/src/sampling/probes/probesGrouping.C index ddc77cfe823a8432fefb105753071c0b326f6493..1ad09613f35f6e78404558c94afa76f479f0ae09 100644 --- a/src/sampling/probes/probesGrouping.C +++ b/src/sampling/probes/probesGrouping.C @@ -25,6 +25,7 @@ License #include "probes.H" #include "volFields.H" +#include "surfaceFields.H" #include "IOobjectList.H" #include "stringListOps.H" @@ -37,6 +38,12 @@ void Foam::probes::clearFieldGroups() sphericalTensorFields_.clear(); symmTensorFields_.clear(); tensorFields_.clear(); + + surfaceScalarFields_.clear(); + surfaceVectorFields_.clear(); + surfaceSphericalTensorFields_.clear(); + surfaceSymmTensorFields_.clear(); + surfaceTensorFields_.clear(); } @@ -71,6 +78,31 @@ Foam::label Foam::probes::appendFieldGroup tensorFields_.append(fieldName); return 1; } + else if (fieldType == surfaceScalarField::typeName) + { + surfaceScalarFields_.append(fieldName); + return 1; + } + else if (fieldType == surfaceVectorField::typeName) + { + surfaceVectorFields_.append(fieldName); + return 1; + } + else if (fieldType == surfaceSphericalTensorField::typeName) + { + surfaceSphericalTensorFields_.append(fieldName); + return 1; + } + else if (fieldType == surfaceSymmTensorField::typeName) + { + surfaceSymmTensorFields_.append(fieldName); + return 1; + } + else if (fieldType == surfaceTensorField::typeName) + { + surfaceTensorFields_.append(fieldName); + return 1; + } return 0; } diff --git a/src/sampling/probes/probesTemplates.C b/src/sampling/probes/probesTemplates.C index 5eaa64dda82577e762824edb3297764ca8a1fd42..3c03d7dcff60bf8d57f54aad8d57b299b14c4c0b 100644 --- a/src/sampling/probes/probesTemplates.C +++ b/src/sampling/probes/probesTemplates.C @@ -25,6 +25,7 @@ License #include "probes.H" #include "volFields.H" +#include "surfaceFields.H" #include "IOmanip.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -86,11 +87,32 @@ void Foam::probes::sampleAndWrite } -template <class Type> +template<class Type> void Foam::probes::sampleAndWrite ( - const fieldGroup<Type>& fields + const GeometricField<Type, fvsPatchField, surfaceMesh>& vField ) +{ + Field<Type> values(sample(vField)); + + if (Pstream::master()) + { + unsigned int w = IOstream::defaultPrecision() + 7; + OFstream& os = *probeFilePtrs_[vField.name()]; + + os << setw(w) << vField.time().value(); + + forAll(values, probeI) + { + os << ' ' << setw(w) << values[probeI]; + } + os << endl; + } +} + + +template <class Type> +void Foam::probes::sampleAndWrite(const fieldGroup<Type>& fields) { forAll(fields, fieldI) { @@ -138,6 +160,54 @@ void Foam::probes::sampleAndWrite } +template<class Type> +void Foam::probes::sampleAndWriteSurfaceFields(const fieldGroup<Type>& fields) +{ + forAll(fields, fieldI) + { + if (loadFromFiles_) + { + sampleAndWrite + ( + GeometricField<Type, fvsPatchField, surfaceMesh> + ( + IOobject + ( + fields[fieldI], + mesh_.time().timeName(), + mesh_, + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ), + mesh_ + ) + ); + } + else + { + objectRegistry::const_iterator iter = mesh_.find(fields[fieldI]); + + if + ( + iter != objectRegistry::end() + && iter()->type() + == GeometricField<Type, fvsPatchField, surfaceMesh>::typeName + ) + { + sampleAndWrite + ( + mesh_.lookupObject + <GeometricField<Type, fvsPatchField, surfaceMesh> > + ( + fields[fieldI] + ) + ); + } + } + } +} + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class Type> @@ -185,4 +255,48 @@ Foam::probes::sample(const word& fieldName) const } +template<class Type> +Foam::tmp<Foam::Field<Type> > +Foam::probes::sample +( + const GeometricField<Type, fvsPatchField, surfaceMesh>& vField +) const +{ + const Type unsetVal(-VGREAT*pTraits<Type>::one); + + tmp<Field<Type> > tValues + ( + new Field<Type>(this->size(), unsetVal) + ); + + Field<Type>& values = tValues(); + + forAll(*this, probeI) + { + if (faceList_[probeI] >= 0) + { + values[probeI] = vField[faceList_[probeI]]; + } + } + + Pstream::listCombineGather(values, isNotEqOp<Type>()); + Pstream::listCombineScatter(values); + + return tValues; +} + + +template<class Type> +Foam::tmp<Foam::Field<Type> > +Foam::probes::sampleSurfaceFields(const word& fieldName) const +{ + return sample + ( + mesh_.lookupObject<GeometricField<Type, fvsPatchField, surfaceMesh> > + ( + fieldName + ) + ); +} + // ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/U b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/U new file mode 100644 index 0000000000000000000000000000000000000000..b6507db443dcd3e12f13ba5ec1f196bc2fc36d4b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/U @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (3.1 0 0); + +boundaryField +{ + outlet + { + type inletOutlet; + inletValue uniform (0 0 0); + inlet uniform (0 0 0); + } + inlet + { + type fixedValue; + value uniform (3.1 0 0); + } + up + { + type symmetryPlane; + } + hole + { + type fixedValue; + value uniform (0 0 0); + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/kl b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/kl new file mode 100644 index 0000000000000000000000000000000000000000..496477b8a6596e3c31f281f1b516662595c7a526 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/kl @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object kl; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + up + { + type symmetryPlane; + } + hole + { + type fixedValue; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/kt b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/kt new file mode 100644 index 0000000000000000000000000000000000000000..265bd65e66f967426d383ecd7d09665fdfd75687 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/kt @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object kt; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + outlet + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + up + { + type symmetryPlane; + } + hole + { + type fixedValue; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/nut b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/nut new file mode 100644 index 0000000000000000000000000000000000000000..e2a11d2cffc99cd11b2cca0fadae84fda1a64b3a --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/nut @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + up + { + type symmetryPlane; + } + hole + { + type nutLowReWallFunction; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/omega b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/omega new file mode 100644 index 0000000000000000000000000000000000000000..9ed9c7a2dc0853983ef82932a00f881186564dd5 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/omega @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object omega; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 0 -1 0 0 0 0 ]; + +internalField uniform 1e-5; + +boundaryField +{ + inlet + { + type fixedValue; + value $internalField; + } + outlet + { + type inletOutlet; + inletValue $internalField; + value $internalField; + } + up + { + type symmetryPlane; + } + hole + { + type fixedValue; + value $internalField; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/p b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/p new file mode 100644 index 0000000000000000000000000000000000000000..fbb21d38abc95c5d5e7a7548c5f839272bc9ebc8 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/0/p @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + outlet + { + type fixedValue; + value uniform 0; + } + up + { + type symmetryPlane; + } + hole + { + type zeroGradient; + } + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allclean b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..213da0de109463e68173277f9235bc6c5077a544 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0/polyMesh + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..84cff2e93401b0173649153b31af9f8af003c006 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/Allrun @@ -0,0 +1,29 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application directory +application=`getApplication` + +runApplication blockMesh +transformPoints -scale '(1.6666 1 1)' + +cp system/changeDictionaryDict.X system/changeDictionaryDict +runApplication changeDictionary -instance system +runApplication mirrorMesh +rm log.mirrorMesh + +rm log.changeDictionary +cp system/changeDictionaryDict.Y system/changeDictionaryDict +runApplication changeDictionary -instance system + +runApplication mirrorMesh +cp -rf 0/polyMesh constant/ + +runApplication topoSet +runApplication createPatch -overwrite +runApplication $application + +# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/RASProperties b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..88b1e501ac636cd3da87755fc926a6c76da7d2fd --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kkLOmega; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..64e4d59a024a09314d0dff56ee5f257e7807b55e --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/polyMesh/blockMeshDict @@ -0,0 +1,136 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.1; + +vertices +( + (0.5 0 0) //0 + (2 0 0) //1 + (5 0 0) //2 + (5 1.414214 0) //3 + (1.414214 1.414214 0) //4 + (0.353553 0.353553 0) //5 + (5 3 0) //6 + (1.414214 3 0) //7 + (0 3 0) //8 + (0 2 0) //9 + (0 0.5 0) //10 + (0.5 0 0.5) //11 + (2 0 0.5) //12 + (5 0 0.5) //13 + (5 1.414214 0.5) //14 + (1.414214 1.414214 0.5) //15 + (0.353553 0.353553 0.5) //16 + (5 3 0.5) //17 + (1.414214 3 0.5) //18 + (0 3 0.5) //19 + (0 2 0.5) //20 + (0 0.5 0.5) //21 +); + +blocks +( + hex (5 4 9 10 16 15 20 21) (70 70 1) simpleGrading (17 1 1) + hex (0 1 4 5 11 12 15 16) (70 70 1) simpleGrading (17 1 1) + hex (1 2 3 4 12 13 14 15) (25 70 1) simpleGrading (3 1 1) + hex (4 3 6 7 15 14 17 18) (25 10 1) simpleGrading (3 2 1) + hex (9 4 7 8 20 15 18 19) (70 10 1) simpleGrading (1 2 1) +); + +edges +( + arc 0 5 (0.469846 0.17101 0) + arc 5 10 (0.17101 0.469846 0) + arc 1 4 (1.87938 0.68404 0) + arc 4 9 (0.68404 1.87938 0) + arc 11 16 (0.469846 0.17101 0.5) + arc 16 21 (0.17101 0.469846 0.5) + arc 12 15 (1.87938 0.68404 0.5) + arc 15 20 (0.68404 1.87938 0.5) +); + +boundary +( + left + { + type symmetryPlane; + faces + ( + (8 9 20 19) + (9 10 21 20) + ); + } + outlet + { + type patch; + faces + ( + (2 3 14 13) + (3 6 17 14) + ); + } + down + { + type symmetryPlane; + faces + ( + (0 1 12 11) + (1 2 13 12) + ); + } + up + { + type symmetryPlane; + faces + ( + (7 8 19 18) + (6 7 18 17) + ); + } + hole + { + type wall; + faces + ( + (10 5 16 21) + (5 0 11 16) + ); + } + frontAndBack + { + type empty; + faces + ( + (10 9 4 5) + (5 4 1 0) + (1 4 3 2) + (4 7 6 3) + (4 9 8 7) + (21 16 15 20) + (16 11 12 15) + (12 13 14 15) + (15 14 17 18) + (15 18 19 20) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/polyMesh/boundary b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..ff3254a0cb60dfcc732d8651e9cc43f1738c5533 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/polyMesh/boundary @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "0/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + outlet + { + type patch; + nFaces 320; + startFace 99370; + } + up + { + type symmetryPlane; + nFaces 380; + startFace 99690; + } + hole + { + type wall; + nFaces 560; + startFace 100070; + } + frontAndBack + { + type empty; + nFaces 100000; + startFace 100630; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/transportProperties b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..8b877028016d5451022c1dadd19f26ea1bb11309 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/transportProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1.86e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + m m [ 0 0 1 0 0 0 0 ] 1; + n n [ 0 0 0 0 0 0 0 ] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + k k [ 0 0 1 0 0 0 0 ] 0; + n n [ 0 0 0 0 0 0 0 ] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..e7fa28c74a5fead3fbcdd79b5587ef684e8bacb4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict new file mode 100644 index 0000000000000000000000000000000000000000..f179288734c2a338aab3cc50651f48faa6352029 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + mirrorMeshDict + { + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (0 -1 0); + } + } +} +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict.X b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict.X new file mode 100644 index 0000000000000000000000000000000000000000..799d18406934437765cc12ce54c7a77b8971bd64 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict.X @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + mirrorMeshDict + { + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (-1 0 0); + } + } +} +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict.Y b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict.Y new file mode 100644 index 0000000000000000000000000000000000000000..f179288734c2a338aab3cc50651f48faa6352029 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/changeDictionaryDict.Y @@ -0,0 +1,28 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object changeDictionaryDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dictionaryReplacement +{ + mirrorMeshDict + { + pointAndNormalDict + { + basePoint (0 0 0); + normalVector (0 -1 0); + } + } +} +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/controlDict b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..45f5f375b2e849ae978ea7207d8208020370cdf7 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/controlDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pimpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 0.5; + +deltaT 0.001; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +adjustTimeStep yes; + +maxCo 0.2; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/createPatchDict b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/createPatchDict new file mode 100644 index 0000000000000000000000000000000000000000..2a4e08aa1237c254e834bca2cfb1110b4d61dab1 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/createPatchDict @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object createPatchDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +pointSync false; + +patches +( + { + // Name of new patch + name inlet; + + // Dictionary to construct new patch from + patchInfo + { + type patch; + } + + // How to construct: either from 'patches' or 'set' + constructFrom set; + + // If constructFrom = set : name of faceSet + set f0; + } +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..5bfe52ccaee08bd833a74978f36323a867847f2e --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSchemes @@ -0,0 +1,74 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; + grad(U) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss limitedLinearV 1; + div(phi,kl) Gauss limitedLinear 1; + div(phi,kt) Gauss limitedLinear 1; + div(phi,omega) Gauss limitedLinear 1; + div(phi,R) Gauss limitedLinear 1; + div(R) Gauss linear; + div(phi,nuTilda) Gauss limitedLinear 1; + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,U) Gauss linear corrected; + laplacian((1|A(U)),p) Gauss linear corrected; + laplacian(alphaTEff,omega) Gauss linear corrected; + laplacian(alphaTEff,kt) Gauss linear corrected; + laplacian(nu,kl) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(U) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSolution b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..b7fb9bc5f9a83540f52af46e349ba8d0ff3e97ed --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/fvSolution @@ -0,0 +1,83 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-06; + relTol 0.01; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + solver GAMG; + tolerance 1e-06; + relTol 0; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + "(U|kl|kt|omega)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-06; + relTol 0.01; + } + + "(U|kl|kt|omega)Final" + { + $U; + tolerance 1e-06; + relTol 0; + } +} + +PIMPLE +{ + nOuterCorrectors 1; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + +relaxationFactors +{ + fields + { + } + equations + { + "U.*" 1; + "kl.*" 1; + "kt.*" 1; + "omega.*" 1; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/mirrorMeshDict b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/mirrorMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..e76258a42accb79c03ec92ed87da0c3647edfee6 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/mirrorMeshDict @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object mirrorMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +planeType pointAndNormal; + +pointAndNormalDict +{ + basePoint ( 0 0 0 ); + normalVector ( 0 -1 0 ); +} + +planeTolerance 1e-06; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/topoSetDict b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/topoSetDict new file mode 100644 index 0000000000000000000000000000000000000000..1c633c6e7bba9eaca5f1f351b027343e53ecbe90 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/elipsekkLOmega/system/topoSetDict @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object topoSetDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +actions +( + { + name f0; + type faceSet; + action new; + source boxToFace; + sourceInfo + { + box (-0.84 -0.31 -0.01)(-0.82 0.31 0.06); + } + } +); + +// ************************************************************************* //