diff --git a/applications/test/directMappedPatch/Make/files b/applications/test/directMappedPatch/Make/files new file mode 100644 index 0000000000000000000000000000000000000000..65f39a47b8e09776cb7c8259d27f73a15663e335 --- /dev/null +++ b/applications/test/directMappedPatch/Make/files @@ -0,0 +1,4 @@ + +testDirectMappedPatch.C + +EXE = $(FOAM_USER_APPBIN)/testDirectMappedPatch diff --git a/applications/test/directMappedPatch/Make/options b/applications/test/directMappedPatch/Make/options new file mode 100644 index 0000000000000000000000000000000000000000..d76bd10c8fa52345df9ce1be79cdeae2b41dde84 --- /dev/null +++ b/applications/test/directMappedPatch/Make/options @@ -0,0 +1,6 @@ +EXE_INC = \ + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude + +EXE_LIBS = \ + -lfiniteVolume diff --git a/applications/test/directMappedPatch/testDirectMappedPatch.C b/applications/test/directMappedPatch/testDirectMappedPatch.C new file mode 100644 index 0000000000000000000000000000000000000000..dd27ff6955d92b5adf9023913b2966b0ee38f748 --- /dev/null +++ b/applications/test/directMappedPatch/testDirectMappedPatch.C @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2007 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Application + testDirectMappedPatch + +Description + Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()). + +\*---------------------------------------------------------------------------*/ + + +#include "argList.H" +#include "fvMesh.H" +#include "volFields.H" +#include "meshTools.H" +#include "Time.H" +#include "OFstream.H" +#include "volFields.H" +#include "directMappedFixedValueFvPatchFields.H" + +using namespace Foam; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +// Main program: + +int main(int argc, char *argv[]) +{ +# include "addTimeOptions.H" +# include "setRootCase.H" +# include "createTime.H" +# include "createMesh.H" + + wordList patchFieldTypes + ( + mesh.boundaryMesh().size(), + calculatedFvPatchVectorField::typeName + ); + + forAll(mesh.boundaryMesh(), patchI) + { + if (isA<directMappedPolyPatch>(mesh.boundaryMesh()[patchI])) + { + patchFieldTypes[patchI] = + directMappedFixedValueFvPatchVectorField::typeName; + } + } + + Pout<< "patchFieldTypes:" << patchFieldTypes << endl; + + volVectorField cc + ( + IOobject + ( + "cc", + runTime.timeName(), + mesh, + IOobject::NO_READ, + IOobject::AUTO_WRITE + ), + mesh, + dimensionedVector("zero", dimLength, vector::zero), + patchFieldTypes + ); + + cc.internalField() = mesh.C().internalField(); + cc.boundaryField().updateCoeffs(); + + forAll(cc.boundaryField(), patchI) + { + if + ( + isA<directMappedFixedValueFvPatchVectorField> + ( + cc.boundaryField()[patchI] + ) + ) + { + Pout<< "Detected a directMapped patch:" << patchI << endl; + + OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj"); + Pout<< "Writing mapped values to " << str.name() << endl; + + label vertI = 0; + const fvPatchVectorField& fvp = cc.boundaryField()[patchI]; + + forAll(fvp, i) + { + meshTools::writeOBJ(str, fvp.patch().Cf()[i]); + vertI++; + meshTools::writeOBJ(str, fvp[i]); + vertI++; + str << "l " << vertI-1 << ' ' << vertI << nl; + } + } + } + + Info<< "End\n" << endl; + + return 0; +} + + +// ************************************************************************* // diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 706866bd2a1df6def0525cd0b00366edeec313c7..67b16d75ea2a5ef7b93f085f898042381f4f6b14 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C @@ -170,6 +170,13 @@ int main(int argc, char *argv[]) const dictionary& layerDict = meshDict.subDict("addLayersControls"); + const scalar mergeDist = getMergeDistance + ( + mesh, + readScalar(meshDict.lookup("mergeTolerance")) + ); + + // Debug // ~~~~~ @@ -192,8 +199,9 @@ int main(int argc, char *argv[]) IOobject ( "abc", // dummy name - mesh.time().constant(), // directory - "triSurface", // instance + //mesh.time().constant(), // instance + mesh.time().findInstance("triSurface", word::null),// instance + "triSurface", // local mesh.time(), // registry IOobject::MUST_READ, IOobject::NO_WRITE @@ -235,6 +243,33 @@ int main(int argc, char *argv[]) << mesh.time().cpuTimeIncrement() << " s" << nl << endl; + // Refinement engine + // ~~~~~~~~~~~~~~~~~ + + Info<< nl + << "Determining initial surface intersections" << nl + << "-----------------------------------------" << nl + << endl; + + // Main refinement engine + meshRefinement meshRefiner + ( + mesh, + mergeDist, // tolerance used in sorting coordinates + surfaces, // for surface intersection refinement + shells // for volume (inside/outside) refinement + ); + Info<< "Calculated surface intersections in = " + << mesh.time().cpuTimeIncrement() << " s" << nl << endl; + + // Some stats + meshRefiner.printMeshInfo(debug, "Initial mesh"); + + meshRefiner.write + ( + debug&meshRefinement::OBJINTERSECTIONS, + mesh.time().path()/mesh.time().timeName() + ); // Add all the surface regions as patches @@ -265,9 +300,8 @@ int main(int argc, char *argv[]) forAll(regNames, i) { - label patchI = meshRefinement::addPatch + label patchI = meshRefiner.addMeshedPatch ( - mesh, regNames[i], wallPolyPatch::typeName ); @@ -308,45 +342,10 @@ int main(int argc, char *argv[]) << exit(FatalError); } - const scalar mergeDist = getMergeDistance - ( - mesh, - readScalar(meshDict.lookup("mergeTolerance")) - ); - - // Mesh distribution engine (uses tolerance to reconstruct meshes) fvMeshDistribute distributor(mesh, mergeDist); - // Refinement engine - // ~~~~~~~~~~~~~~~~~ - - Info<< nl - << "Determining initial surface intersections" << nl - << "-----------------------------------------" << nl - << endl; - - // Main refinement engine - meshRefinement meshRefiner - ( - mesh, - mergeDist, // tolerance used in sorting coordinates - surfaces, // for surface intersection refinement - shells // for volume (inside/outside) refinement - ); - Info<< "Calculated surface intersections in = " - << mesh.time().cpuTimeIncrement() << " s" << nl << endl; - - // Some stats - meshRefiner.printMeshInfo(debug, "Initial mesh"); - - meshRefiner.write - ( - debug&meshRefinement::OBJINTERSECTIONS, - mesh.time().path()/mesh.time().timeName() - ); - @@ -403,11 +402,7 @@ int main(int argc, char *argv[]) if (wantLayers) { - autoLayerDriver layerDriver - ( - meshRefiner, - globalToPatch - ); + autoLayerDriver layerDriver(meshRefiner); // Layer addition parameters layerParameters layerParams(layerDict, mesh.boundaryMesh()); @@ -435,7 +430,7 @@ int main(int argc, char *argv[]) Info<< "End\n" << endl; - return 0; + return(0); } diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C index 5bb4a0ee2d03b8b5a24ec8bbdfb59b2a5ed2c153..9081ceb3ee0571d31463fcaf3764dd0187871de0 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoHexMeshDriver.C @@ -292,6 +292,40 @@ Foam::autoHexMeshDriver::autoHexMeshDriver meshRefinement::checkCoupledFaceZones(mesh_); + // Refinement engine + // ~~~~~~~~~~~~~~~~~ + + { + Info<< nl + << "Determining initial surface intersections" << nl + << "-----------------------------------------" << nl + << endl; + + // Main refinement engine + meshRefinerPtr_.reset + ( + new meshRefinement + ( + mesh, + mergeDist_, // tolerance used in sorting coordinates + surfaces(), + shells() + ) + ); + Info<< "Calculated surface intersections in = " + << mesh_.time().cpuTimeIncrement() << " s" << endl; + + // Some stats + meshRefinerPtr_().printMeshInfo(debug_, "Initial mesh"); + + meshRefinerPtr_().write + ( + debug_&meshRefinement::OBJINTERSECTIONS, + mesh_.time().path()/mesh_.time().timeName() + ); + } + + // Add all the surface regions as patches // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -319,9 +353,8 @@ Foam::autoHexMeshDriver::autoHexMeshDriver forAll(regNames, i) { - label patchI = meshRefinement::addPatch + label patchI = meshRefinerPtr_().addMeshedPatch ( - mesh, regNames[i], wallPolyPatch::typeName ); @@ -404,40 +437,6 @@ Foam::autoHexMeshDriver::autoHexMeshDriver // Mesh distribution engine (uses tolerance to reconstruct meshes) distributorPtr_.reset(new fvMeshDistribute(mesh_, mergeDist_)); } - - - // Refinement engine - // ~~~~~~~~~~~~~~~~~ - - { - Info<< nl - << "Determining initial surface intersections" << nl - << "-----------------------------------------" << nl - << endl; - - // Main refinement engine - meshRefinerPtr_.reset - ( - new meshRefinement - ( - mesh, - mergeDist_, // tolerance used in sorting coordinates - surfaces(), - shells() - ) - ); - Info<< "Calculated surface intersections in = " - << mesh_.time().cpuTimeIncrement() << " s" << endl; - - // Some stats - meshRefinerPtr_().printMeshInfo(debug_, "Initial mesh"); - - meshRefinerPtr_().write - ( - debug_&meshRefinement::OBJINTERSECTIONS, - mesh_.time().path()/mesh_.time().timeName() - ); - } } @@ -522,11 +521,7 @@ void Foam::autoHexMeshDriver::doMesh() const dictionary& shrinkDict = dict_.subDict("shrinkDict"); PtrList<dictionary> surfaceDicts(dict_.lookup("surfaces")); - autoLayerDriver layerDriver - ( - meshRefinerPtr_(), - globalToPatch_ - ); + autoLayerDriver layerDriver(meshRefinerPtr_()); // Get all the layer specific params layerParameters layerParams diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C index 01ab952c165a5997df49085828e556fb41d6d209..55e35269dd2fdea1f8272084eb5f6310e539b051 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.C @@ -75,7 +75,7 @@ Foam::label Foam::autoLayerDriver::mergePatchFacesUndo labelHashSet boundaryCells(mesh.nFaces()-mesh.nInternalFaces()); { - labelList patchIDs(meshRefinement::addedPatches(globalToPatch_)); + labelList patchIDs(meshRefiner_.meshedPatches()); const polyBoundaryMesh& patches = mesh.boundaryMesh(); @@ -2446,14 +2446,9 @@ void Foam::autoLayerDriver::getLayerCellsFaces // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::autoLayerDriver::autoLayerDriver -( - meshRefinement& meshRefiner, - const labelList& globalToPatch -) +Foam::autoLayerDriver::autoLayerDriver(meshRefinement& meshRefiner) : - meshRefiner_(meshRefiner), - globalToPatch_(globalToPatch) + meshRefiner_(meshRefiner) {} diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H index 164fd88ce04e5b06c33ef1c48d8745ea34a8dcc0..12569570069144b603074002ea3ad7af8c3bb91f 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoLayerDriver.H @@ -101,9 +101,6 @@ class autoLayerDriver //- Mesh+surface meshRefinement& meshRefiner_; - //- From surface region to patch - const labelList globalToPatch_; - // Private Member Functions @@ -509,11 +506,7 @@ public: // Constructors //- Construct from components - autoLayerDriver - ( - meshRefinement& meshRefiner, - const labelList& globalToPatch - ); + autoLayerDriver(meshRefinement& meshRefiner); // Member Functions diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C index 9c4e0a17c521b8e06b4b2ecceb18ed80bb917d06..d9c205bfca51dcf0d9142884a2c01030595423a4 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoRefineDriver.C @@ -680,7 +680,7 @@ void Foam::autoRefineDriver::mergePatchFaces ( Foam::cos(45*mathematicalConstant::pi/180.0), Foam::cos(45*mathematicalConstant::pi/180.0), - meshRefinement::addedPatches(globalToPatch_) + meshRefiner_.meshedPatches() ); if (debug) diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C index 011417c29ecd92107e34ff596c9ba506a60cb50a..f27ccdb9f302b88bdc9c5b6990d03d229e9d2e15 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.C @@ -830,35 +830,6 @@ Foam::scalarField Foam::autoSnapDriver::calcSnapDistance } -//// Invert globalToPatch_ to get the patches related to surfaces. -//Foam::labelList Foam::autoSnapDriver::getSurfacePatches() const -//{ -// // Set of patches originating from surface -// labelHashSet surfacePatchSet(globalToPatch_.size()); -// -// forAll(globalToPatch_, i) -// { -// if (globalToPatch_[i] != -1) -// { -// surfacePatchSet.insert(globalToPatch_[i]); -// } -// } -// -// const fvMesh& mesh = meshRefiner_.mesh(); -// -// DynamicList<label> surfacePatches(surfacePatchSet.size()); -// -// for (label patchI = 0; patchI < mesh.boundaryMesh().size(); patchI++) -// { -// if (surfacePatchSet.found(patchI)) -// { -// surfacePatches.append(patchI); -// } -// } -// return surfacePatches.shrink(); -//} - - void Foam::autoSnapDriver::preSmoothPatch ( const snapParameters& snapParams, @@ -1479,7 +1450,7 @@ void Foam::autoSnapDriver::doSnap const_cast<Time&>(mesh.time())++; // Get the labels of added patches. - labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch_)); + labelList adaptPatchIDs(meshRefiner_.meshedPatches()); // Create baffles (pairs of faces that share the same points) // Baffles stored as owner and neighbour face that have been created. diff --git a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H index 5d9b2bc357d0e2dff037bcfccc9d27ae08613114..cdf8673d75d425d82c0633b0a93364c731e42429 100644 --- a/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H +++ b/src/autoMesh/autoHexMesh/autoHexMeshDriver/autoSnapDriver.H @@ -170,9 +170,6 @@ public: const indirectPrimitivePatch& ) const; - ////- Get patches generated for surfaces. - //labelList getSurfacePatches() const; - //- Smooth the mesh (patch and internal) to increase visibility // of surface points (on castellated mesh) w.r.t. surface. void preSmoothPatch diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C index 6a021f9e8a75d0628a811eefa3623f8c77c8b767..eadc22ba3c02f44120033a94fa8e0eaaade974d3 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.C @@ -84,12 +84,15 @@ void Foam::meshRefinement::calcNeighbourData const polyBoundaryMesh& patches = mesh_.boundaryMesh(); + labelHashSet addedPatchIDSet(meshedPatches()); + forAll(patches, patchI) { const polyPatch& pp = patches[patchI]; const unallocLabelList& faceCells = pp.faceCells(); const vectorField::subField faceCentres = pp.faceCentres(); + const vectorField::subField faceAreas = pp.faceAreas(); label bFaceI = pp.start()-mesh_.nInternalFaces(); @@ -102,6 +105,36 @@ void Foam::meshRefinement::calcNeighbourData bFaceI++; } } + else if (addedPatchIDSet.found(patchI)) + { + // Face was introduced from cell-cell intersection. Try to + // reconstruct other side cell(centre). Three possibilities: + // - cells same size. + // - preserved cell smaller. Not handled. + // - preserved cell larger. + forAll(faceCells, i) + { + // Extrapolate the face centre. + vector fn = faceAreas[i]; + fn /= mag(fn)+VSMALL; + + label own = faceCells[i]; + label ownLevel = cellLevel[own]; + label faceLevel = meshCutter_.getAnchorLevel(pp.start()+i); + + // Normal distance from face centre to cell centre + scalar d = ((faceCentres[i] - cellCentres[own]) & fn); + if (faceLevel > ownLevel) + { + // Other cell more refined. Adjust normal distance + d *= 0.5; + } + neiLevel[bFaceI] = cellLevel[ownLevel]; + // Calculate other cell centre by extrapolation + neiCc[bFaceI] = faceCentres[i] + d*fn; + bFaceI++; + } + } else { forAll(faceCells, i) @@ -1195,7 +1228,6 @@ Foam::labelList Foam::meshRefinement::intersectedFaces() const // Helper function to get points used by faces Foam::labelList Foam::meshRefinement::intersectedPoints ( -// const labelList& globalToPatch ) const { const faceList& faces = mesh_.faces(); @@ -1221,9 +1253,10 @@ Foam::labelList Foam::meshRefinement::intersectedPoints } //// Insert all meshed patches. - //forAll(globalToPatch, i) + //labelList adaptPatchIDs(meshedPatches()); + //forAll(adaptPatchIDs, i) //{ - // label patchI = globalToPatch[i]; + // label patchI = adaptPatchIDs[i]; // // if (patchI != -1) // { @@ -1262,27 +1295,6 @@ Foam::labelList Foam::meshRefinement::intersectedPoints } -Foam::labelList Foam::meshRefinement::addedPatches -( - const labelList& globalToPatch -) -{ - labelList patchIDs(globalToPatch.size()); - label addedI = 0; - - forAll(globalToPatch, i) - { - if (globalToPatch[i] != -1) - { - patchIDs[addedI++] = globalToPatch[i]; - } - } - patchIDs.setSize(addedI); - - return patchIDs; -} - - //- Create patch from set of patches Foam::autoPtr<Foam::indirectPrimitivePatch> Foam::meshRefinement::makePatch ( @@ -1653,6 +1665,53 @@ Foam::label Foam::meshRefinement::addPatch } +Foam::label Foam::meshRefinement::addMeshedPatch +( + const word& name, + const word& type +) +{ + label meshedI = findIndex(meshedPatches_, name); + + if (meshedI != -1) + { + // Already there. Get corresponding polypatch + return mesh_.boundaryMesh().findPatchID(name); + } + else + { + // Add patch + label patchI = addPatch(mesh_, name, type); + + // Store + label sz = meshedPatches_.size(); + meshedPatches_.setSize(sz+1); + meshedPatches_[sz] = name; + + return patchI; + } +} + + +Foam::labelList Foam::meshRefinement::meshedPatches() const +{ + labelList patchIDs(meshedPatches_.size()); + forAll(meshedPatches_, i) + { + patchIDs[i] = mesh_.boundaryMesh().findPatchID(meshedPatches_[i]); + + if (patchIDs[i] == -1) + { + FatalErrorIn("meshRefinement::meshedPatches() const") + << "Problem : did not find patch " << meshedPatches_[i] + << abort(FatalError); + } + } + + return patchIDs; +} + + Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions ( const point& keepPoint diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H index 06004c8a6e00bc12c093cb36afb2782638b4b2d3..e0f35934ed00806f67e757294de01814c1361cbe 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinement.H @@ -125,6 +125,10 @@ private: //- user supplied face based data. List<Tuple2<mapType, labelList> > userFaceData_; + //- Meshed patches - are treated differently. Stored as wordList since + // order changes. + wordList meshedPatches_; + // Private Member Functions @@ -400,12 +404,11 @@ private: const labelList& globalToPatch ) const; - //- Initial test of marking faces using geometric information. - labelList markFacesOnProblemCellsGeometric - ( - const dictionary& motionDict, - const labelList& globalToPatch - ) const; + ////- Initial test of marking faces using geometric information. + //labelList markFacesOnProblemCellsGeometric + //( + // const dictionary& motionDict + //) const; // Baffle merging @@ -578,9 +581,6 @@ public: //- Get points on surfaces with intersection and boundary faces. labelList intersectedPoints() const; - //- Get added patches (inverse of globalToPatch) - static labelList addedPatches(const labelList& globalToPatch); - //- Create patch from set of patches static autoPtr<indirectPrimitivePatch> makePatch ( @@ -688,9 +688,16 @@ public: // Other topo changes - //- Helper function to add patch to mesh + //- Helper:add patch to mesh. Update all registered fields. + // Use addMeshedPatch to add patches originating from surfaces. static label addPatch(fvMesh&, const word& name, const word& type); + //- Add patch originating from meshing. Update meshedPatches_. + label addMeshedPatch(const word& name, const word& type); + + //- Get patchIDs for patches added in addMeshedPatch. + labelList meshedPatches() const; + //- Split mesh. Keep part containing point. autoPtr<mapPolyMesh> splitMeshRegions(const point& keepPoint); @@ -699,7 +706,11 @@ public: //- Update for external change to mesh. changedFaces are in new mesh // face labels. - void updateMesh(const mapPolyMesh&, const labelList& changedFaces); + void updateMesh + ( + const mapPolyMesh&, + const labelList& changedFaces + ); // Restoring : is where other processes delete and reinsert data. diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C index 3904f960737a3e9a84b8e4366ca71b49bfa31f4c..494a20e264286f1e3457cd3c432510f5c8a0722b 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementBaffles.C @@ -1511,11 +1511,7 @@ void Foam::meshRefinement::baffleAndSplitMesh perpendicularAngle, globalToPatch ) - //markFacesOnProblemCellsGeometric - //( - // motionDict, - // globalToPatch - //) + //markFacesOnProblemCellsGeometric(motionDict) ); Info<< "Analyzed problem cells in = " << runTime.cpuTimeIncrement() << " s\n" << nl << endl; @@ -1665,7 +1661,7 @@ void Foam::meshRefinement::baffleAndSplitMesh // Split off (with optional buffer layers) unreachable areas of mesh. -Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh +Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMesh ( const label nBufferLayers, const labelList& globalToPatch, diff --git a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C index ea1e8a083cd24cac69c384129668cf6fecb1a7cf..fb0a7e2121f020576494e848ad8b6116f71fbcdd 100644 --- a/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C +++ b/src/autoMesh/autoHexMesh/meshRefinement/meshRefinementProblemCells.C @@ -136,15 +136,13 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells const labelList& globalToPatch ) const { - labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch)); - - // Construct addressing engine. + // Construct addressing engine from all patches added for meshing. autoPtr<indirectPrimitivePatch> ppPtr ( meshRefinement::makePatch ( mesh_, - adaptPatchIDs + meshedPatches() ) ); const indirectPrimitivePatch& pp = ppPtr(); @@ -386,11 +384,6 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells const labelList& pointLevel = meshCutter_.pointLevel(); const polyBoundaryMesh& patches = mesh_.boundaryMesh(); - // Swap neighbouring cell centres and cell level - labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces()); - pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces()); - calcNeighbourData(neiLevel, neiCc); - // Per internal face (boundary faces not used) the patch that the // baffle should get (or -1) labelList facePatch(mesh_.nFaces(), -1); @@ -403,7 +396,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells // Fill boundary data. All elements on meshed patches get marked. // Get the labels of added patches. - labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch)); + labelList adaptPatchIDs(meshedPatches()); forAll(adaptPatchIDs, i) { @@ -427,6 +420,12 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells } } + // Swap neighbouring cell centres and cell level + labelList neiLevel(mesh_.nFaces()-mesh_.nInternalFaces()); + pointField neiCc(mesh_.nFaces()-mesh_.nInternalFaces()); + calcNeighbourData(neiLevel, neiCc); + + // Count of faces marked for baffling label nBaffleFaces = 0; @@ -961,20 +960,16 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells //// test to find nearest surface and checks which faces would get squashed. //Foam::labelList Foam::meshRefinement::markFacesOnProblemCellsGeometric //( -// const dictionary& motionDict, -// const labelList& globalToPatch +// const dictionary& motionDict //) const //{ -// // Get the labels of added patches. -// labelList adaptPatchIDs(meshRefinement::addedPatches(globalToPatch)); -// // // Construct addressing engine. // autoPtr<indirectPrimitivePatch> ppPtr // ( // meshRefinement::makePatch // ( // mesh_, -// adaptPatchIDs +// meshedPatches() // ) // ); // const indirectPrimitivePatch& pp = ppPtr(); diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H index 71bfdbe92816ee196930ebe8505b4409ceda0608..d986946b578e18a92c3157af25bf131c34200e62 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H @@ -185,8 +185,6 @@ class hexRef8 const bool searchForward, const label wantedLevel ) const; - //- Gets level such that the face has four points <= level. - label getAnchorLevel(const label faceI) const; ////- Print levels of list of points. //void printLevels(Ostream&, const labelList&) const; @@ -370,6 +368,9 @@ public: // Refinement + //- Gets level such that the face has four points <= level. + label getAnchorLevel(const label faceI) const; + //- Given valid mesh and current cell level and proposed // cells to refine calculate any clashes (due to 2:1) and return // ok list of cells to refine. diff --git a/src/finiteVolume/fvMesh/fvMesh.C b/src/finiteVolume/fvMesh/fvMesh.C index 976493b136c58c61aac7e2dd49ef3668e495df21..4b080e4b0a9f77011c96eb7b14a7ffbddf0608dc 100644 --- a/src/finiteVolume/fvMesh/fvMesh.C +++ b/src/finiteVolume/fvMesh/fvMesh.C @@ -44,6 +44,7 @@ License #include "leastSquaresVectors.H" #include "CentredFitData.H" #include "linearFitPolynomial.H" +#include "quadraticFitPolynomial.H" #include "quadraticLinearFitPolynomial.H" #include "skewCorrectionVectors.H" @@ -92,11 +93,12 @@ void Foam::fvMesh::clearGeom() // Things geometry dependent that are not updated. volPointInterpolation::Delete(*this); extendedLeastSquaresVectors::Delete(*this); - extendedLeastSquaresVectors::Delete(*this); leastSquaresVectors::Delete(*this); CentredFitData<linearFitPolynomial>::Delete(*this); + CentredFitData<quadraticFitPolynomial>::Delete(*this); CentredFitData<quadraticLinearFitPolynomial>::Delete(*this); skewCorrectionVectors::Delete(*this); + quadraticFitSnGradData::Delete(*this); } @@ -108,16 +110,18 @@ void Foam::fvMesh::clearAddressing() volPointInterpolation::Delete(*this); extendedLeastSquaresVectors::Delete(*this); - extendedLeastSquaresVectors::Delete(*this); leastSquaresVectors::Delete(*this); CentredFitData<linearFitPolynomial>::Delete(*this); + CentredFitData<quadraticFitPolynomial>::Delete(*this); CentredFitData<quadraticLinearFitPolynomial>::Delete(*this); skewCorrectionVectors::Delete(*this); + quadraticFitSnGradData::Delete(*this); centredCECCellToFaceStencilObject::Delete(*this); centredCFCCellToFaceStencilObject::Delete(*this); centredCPCCellToFaceStencilObject::Delete(*this); centredFECCellToFaceStencilObject::Delete(*this); + // Is this geometry related - cells distorting to upwind direction? upwindCECCellToFaceStencilObject::Delete(*this); upwindCFCCellToFaceStencilObject::Delete(*this); upwindCPCCellToFaceStencilObject::Delete(*this); @@ -597,8 +601,10 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p) MeshObjectMovePoints<extendedLeastSquaresVectors>(*this); MeshObjectMovePoints<leastSquaresVectors>(*this); MeshObjectMovePoints<CentredFitData<linearFitPolynomial> >(*this); + MeshObjectMovePoints<CentredFitData<quadraticFitPolynomial> >(*this); MeshObjectMovePoints<CentredFitData<quadraticLinearFitPolynomial> >(*this); MeshObjectMovePoints<skewCorrectionVectors>(*this); + MeshObjectMovePoints<quadraticFitSnGradData>(*this); return tsweptVols; } diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties index d8bbfe7f595cd351683a08e8f1d8fe5974ea401d..5fc829b87cf5f1b92eaa88fe1ef7e7324601bbc1 100644 --- a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoom/constant/radiationProperties @@ -27,6 +27,9 @@ P1Coeffs { } +// Number of flow iterations per radiation iteration +solverFreq 1; + absorptionEmissionModel constantAbsorptionEmission; constantAbsorptionEmissionCoeffs diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G new file mode 100644 index 0000000000000000000000000000000000000000..cb9783649fe55f5f67032842ed34cefccd958808 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G @@ -0,0 +1,56 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object G; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + + fixedWalls + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + + ceiling + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } + + box + { + type MarshakRadiation; + T T; + emissivity 1; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault new file mode 100644 index 0000000000000000000000000000000000000000..bbb4ec4ca347db87a2f6d153c8a75e30f9abb452 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object IDefault; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 0 -3 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + ".*" + { + type greyDiffusiveRadiation; + T T; + emissivity 0.5; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T new file mode 100644 index 0000000000000000000000000000000000000000..19ee7d9d08e1a184e767104e3384895d5ab2e4c0 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object T; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 1 0 0 0]; + +internalField uniform 300; + +boundaryField +{ + floor + { + type fixedValue; + value uniform 300.0; + } + + ceiling + { + type fixedValue; + value uniform 300.0; + } + + fixedWalls + { + type zeroGradient; + } + + box + { + type fixedValue; + value uniform 500.0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U new file mode 100644 index 0000000000000000000000000000000000000000..9a0eaf66b54cacbc5eed28bb9ed45cf51b8e8ba3 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://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 (0 0 0); + +boundaryField +{ + floor + { + type fixedValue; + value uniform (0 0 0); + } + + ceiling + { + type fixedValue; + value uniform (0 0 0); + } + + fixedWalls + { + type fixedValue; + value uniform (0 0 0); + } + + box + { + type fixedValue; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat new file mode 100644 index 0000000000000000000000000000000000000000..f11126d3f5379f99fbfa6dd2237ce2157f5189a9 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat @@ -0,0 +1,47 @@ +/*--------------------------------*- 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 alphat; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + box + { + type alphatWallFunction; + value uniform 0; + } + floor + { + type alphatWallFunction; + value uniform 0; + } + ceiling + { + type alphatWallFunction; + value uniform 0; + } + fixedWalls + { + type alphatWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon new file mode 100644 index 0000000000000000000000000000000000000000..d5e7b9cd0273d6d3e2024e42e6ec4aaac6be4986 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon @@ -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 epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -3 0 0 0 0 ]; + +internalField uniform 0.01; + +boundaryField +{ + floor + { + type compressible::epsilonWallFunction; + value uniform 0; + } + + ceiling + { + type compressible::epsilonWallFunction; + value uniform 0; + } + + fixedWalls + { + type compressible::epsilonWallFunction; + value uniform 0; + } + + box + { + type compressible::epsilonWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k new file mode 100644 index 0000000000000000000000000000000000000000..5b206f8e4e379cbc9d5a2764071140549649d354 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k @@ -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 k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 0 2 -2 0 0 0 0 ]; + +internalField uniform 0.1; + +boundaryField +{ + floor + { + type compressible::kQRWallFunction; + value uniform 0; + } + + ceiling + { + type compressible::kQRWallFunction; + value uniform 0; + } + + fixedWalls + { + type compressible::kQRWallFunction; + value uniform 0; + } + + box + { + type compressible::kQRWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut new file mode 100644 index 0000000000000000000000000000000000000000..c609cbf3d2c865212d20992980a9b59a349b9c68 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut @@ -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 mut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [ 1 -1 -1 0 0 0 0 ]; + +internalField uniform 0; + +boundaryField +{ + box + { + type mutWallFunction; + value uniform 0; + } + + floor + { + type mutWallFunction; + value uniform 0; + } + + ceiling + { + type mutWallFunction; + value uniform 0; + } + + fixedWalls + { + type mutWallFunction; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p new file mode 100644 index 0000000000000000000000000000000000000000..f200e3eeb0f918f10cf34f5b87e5d04abd76b21d --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 100000; + +boundaryField +{ + floor + { + type calculated; + value uniform 100000; + } + + ceiling + { + type calculated; + value uniform 100000; + } + + fixedWalls + { + type calculated; + value uniform 100000; + } + + box + { + type calculated; + value uniform 100000; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd new file mode 100644 index 0000000000000000000000000000000000000000..1841d7882f5c06e25080901cd800391c09d11868 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object pd; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + floor + { + type fixedFluxBuoyantPressure; + value uniform 0; + } + + ceiling + { + type fixedFluxBuoyantPressure; + value uniform 0; + } + + fixedWalls + { + type fixedFluxBuoyantPressure; + value uniform 0; + } + + box + { + type fixedFluxBuoyantPressure; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..35b5a409f230c180f07469bfe0679cdf00cb419d --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties @@ -0,0 +1,100 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + +laminarCoeffs +{ +} + +kEpsilonCoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 0.85; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +RNGkEpsilonCoeffs +{ + Cmu 0.0845; + C1 1.42; + C2 1.68; + C3 -0.33; + alphah 1; + alphak 1.39; + alphaEps 1.39; + eta0 4.38; + beta 0.012; +} + +LaunderSharmaKECoeffs +{ + Cmu 0.09; + C1 1.44; + C2 1.92; + C3 -0.33; + alphah 1; + alphak 1; + alphaEps 0.76923; +} + +LRRCoeffs +{ + Cmu 0.09; + Clrr1 1.8; + Clrr2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +LaunderGibsonRSTMCoeffs +{ + Cmu 0.09; + Clg1 1.8; + Clg2 0.6; + C1 1.44; + C2 1.92; + alphah 1; + C1Ref 0.5; + C2Ref 0.3; + Cs 0.25; + Ceps 0.15; + alphaR 1; + alphaEps 0.76923; +} + +wallFunctionCoeffs +{ + kappa 0.4187; + E 9; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties new file mode 100644 index 0000000000000000000000000000000000000000..639bd90b066ffdac881dc8722b84c1bf39170e9d --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object environmentalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +g g [ 0 1 -2 0 0 0 0 ] ( 0 0 -9.81 ); + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..e69de20d9d6c7b3b86178f0f7d486dae976931ad --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict @@ -0,0 +1,170 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + ( 0.0 0.0 0.0) + ( 0.5 0.0 0.0) + ( 1.5 0.0 0.0) + (10.0 0.0 0.0) + ( 0.0 0.5 0.0) + ( 0.5 0.5 0.0) + ( 1.5 0.5 0.0) + (10.0 0.5 0.0) + ( 0.0 1.5 0.0) + ( 0.5 1.5 0.0) + ( 1.5 1.5 0.0) + (10.0 1.5 0.0) + ( 0.0 6.0 0.0) + ( 0.5 6.0 0.0) + ( 1.5 6.0 0.0) + (10.0 6.0 0.0) + + ( 0.0 0.0 0.5) + ( 0.5 0.0 0.5) + ( 1.5 0.0 0.5) + (10.0 0.0 0.5) + ( 0.0 0.5 0.5) + ( 0.5 0.5 0.5) + ( 1.5 0.5 0.5) + (10.0 0.5 0.5) + ( 0.0 1.5 0.5) + ( 0.5 1.5 0.5) + ( 1.5 1.5 0.5) + (10.0 1.5 0.5) + ( 0.0 6.0 0.5) + ( 0.5 6.0 0.5) + ( 1.5 6.0 0.5) + (10.0 6.0 0.5) + + ( 0.0 0.0 2.0) + ( 0.5 0.0 2.0) + ( 1.5 0.0 2.0) + (10.0 0.0 2.0) + ( 0.0 0.5 2.0) + ( 0.5 0.5 2.0) + ( 1.5 0.5 2.0) + (10.0 0.5 2.0) + ( 0.0 1.5 2.0) + ( 0.5 1.5 2.0) + ( 1.5 1.5 2.0) + (10.0 1.5 2.0) + ( 0.0 6.0 2.0) + ( 0.5 6.0 2.0) + ( 1.5 6.0 2.0) + (10.0 6.0 2.0) +); + +blocks +( + hex ( 0 1 5 4 16 17 21 20) ( 5 5 5) simpleGrading (1 1 1) + hex ( 1 2 6 5 17 18 22 21) (10 5 5) simpleGrading (1 1 1) + hex ( 2 3 7 6 18 19 23 22) (80 5 5) simpleGrading (1 1 1) + hex ( 4 5 9 8 20 21 25 24) ( 5 10 5) simpleGrading (1 1 1) + hex ( 6 7 11 10 22 23 27 26) (80 10 5) simpleGrading (1 1 1) + hex ( 8 9 13 12 24 25 29 28) ( 5 40 5) simpleGrading (1 1 1) + hex ( 9 10 14 13 25 26 30 29) (10 40 5) simpleGrading (1 1 1) + hex (10 11 15 14 26 27 31 30) (80 40 5) simpleGrading (1 1 1) + + hex (16 17 21 20 32 33 37 36) ( 5 5 15) simpleGrading (1 1 1) + hex (17 18 22 21 33 34 38 37) (10 5 15) simpleGrading (1 1 1) + hex (18 19 23 22 34 35 39 38) (80 5 15) simpleGrading (1 1 1) + hex (20 21 25 24 36 37 41 40) ( 5 10 15) simpleGrading (1 1 1) + + hex (21 22 26 25 37 38 42 41) (10 10 15) simpleGrading (1 1 1) + + hex (22 23 27 26 38 39 43 42) (80 10 15) simpleGrading (1 1 1) + hex (24 25 29 28 40 41 45 44) ( 5 40 15) simpleGrading (1 1 1) + hex (25 26 30 29 41 42 46 45) (10 40 15) simpleGrading (1 1 1) + hex (26 27 31 30 42 43 47 46) (80 40 15) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall box + ( + ( 6 22 21 5) + (10 26 22 6) + ( 9 25 26 10) + ( 5 21 25 9) + (22 26 25 21) + ) + wall floor + ( + ( 1 5 4 0) + ( 2 6 5 1) + ( 3 7 6 2) + ( 5 9 8 4) + ( 7 11 10 6) + ( 9 13 12 8) + (10 14 13 9) + (11 15 14 10) + ) + wall ceiling + ( + (33 37 36 32) + (34 38 37 33) + (35 39 38 34) + (37 41 40 36) + (38 42 41 37) + (39 43 42 38) + (41 45 44 40) + (42 46 45 41) + (43 47 46 42) + ) + wall fixedWalls + ( + ( 1 17 16 0) + ( 2 18 17 1) + ( 3 19 18 2) + (17 33 32 16) + (18 34 33 17) + (19 35 34 18) + + ( 7 23 19 3) + (11 27 23 7) + (15 31 27 11) + (23 39 35 19) + (27 43 39 23) + (31 47 43 27) + + (14 30 31 15) + (13 29 30 14) + (12 28 29 13) + (30 46 47 31) + (29 45 46 30) + (28 44 45 29) + + ( 8 24 28 12) + ( 4 20 24 8) + ( 0 16 20 4) + (24 40 44 28) + (20 36 40 24) + (16 32 36 20) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary new file mode 100644 index 0000000000000000000000000000000000000000..ab64c00e2818ae921e8d7797fd57ddc8e836a70c --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/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 "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +4 +( + box + { + type wall; + nFaces 300; + startFace 303675; + } + floor + { + type wall; + nFaces 5125; + startFace 303975; + } + ceiling + { + type wall; + nFaces 5225; + startFace 309100; + } + fixedWalls + { + type wall; + nFaces 6000; + startFace 314325; + } +) + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties new file mode 100644 index 0000000000000000000000000000000000000000..1521e119a1c03763e3ee05efd9afd3fc4579c46a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object radiationProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +radiation on; + +radiationModel fvDOM; + +noRadiation +{ +} + +P1Coeffs +{ +} + +fvDOMCoeffs +{ + nPhi 3; // azimuthal angles in PI/2 on X-Y.(from Y to X) + nTheta 5; // polar angles in PI (from Z to X-Y plane) + convergence 1e-3; // convergence criteria for radiation iteration + maxIter 10; // maximum number of iterations +} + +// Number of flow iterations per radiation iteration +solverFreq 10; + +absorptionEmissionModel constantAbsorptionEmission; + +constantAbsorptionEmissionCoeffs +{ + a a [ 0 -1 0 0 0 0 0 ] 0.01; + e e [ 0 -1 0 0 0 0 0 ] 0; + E E [ 1 -1 -3 0 0 0 0 ] 0; +} + +scatterModel constantScatter; + +constantScatterCoeffs +{ + sigma sigma [ 0 -1 0 0 0 0 0 ] 0; + C C [ 0 0 0 0 0 0 0 ] 0; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties new file mode 100644 index 0000000000000000000000000000000000000000..f826516c2ebc44480f764103bbcc05c3f2e83efd --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType hThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>; + +mixture air 1 28.9 1000 0 1.8e-05 0.7; + +pRef 100000; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..06eec5ead0b78d157eddd5c952c86b16a369c092 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict @@ -0,0 +1,47 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1000; + +deltaT 1; + +writeControl timeStep; + +writeInterval 100; + +purgeWrite 0; + +writeFormat binary; + +writePrecision 6; + +writeCompression uncompressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..0800e9f9323d8477caa278e74075c327f307206a --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes @@ -0,0 +1,70 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default steadyState; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss upwind; + div(phi,h) Gauss upwind; + div(phi,k) Gauss upwind; + div(phi,epsilon) Gauss upwind; + div(phi,R) Gauss upwind; + div(R) Gauss linear; + div(Ji,Ii_h) Gauss linearUpwind Gauss linear; //Gauss upwind; + div((muEff*dev2(grad(U).T()))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(muEff,U) Gauss linear corrected; + laplacian((rho*(1|A(U))),pd) Gauss linear corrected; + laplacian(alphaEff,h) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(gammaRad,G) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + pd ; +} + + +// ************************************************************************* // diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..a5d6208674369243cbae66f6912c317406ef60d3 --- /dev/null +++ b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution @@ -0,0 +1,92 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.5 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pd + { + solver GAMG; + tolerance 1e-06; + relTol 0.01; + smoother GaussSeidel; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + U + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + h + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + k + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + epsilon + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + Ii + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } +} + +SIMPLE +{ + nNonOrthogonalCorrectors 0; + pdRefCell 0; + pdRefValue 0; +} + +relaxationFactors +{ + rho 1.0; + pd 0.3; + U 0.7; + h 0.7; + k 0.7; + epsilon 0.7; + "ILambda.*" 0.7; +} + + +// ************************************************************************* // diff --git a/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict b/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict index 0c11dad74fd0ca9d40793fcf23a0f5e2205d744f..30da45333116a695a3d463d85d30aa98babc1b38 100644 --- a/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/mesh/snappyHexMesh/iglooWithFridges/system/snappyHexMeshDict @@ -45,6 +45,8 @@ geometry fridgeFreezer { type searchableSurfaceCollection; + + mergeSubRegions true; freezer { @@ -75,6 +77,8 @@ geometry { type searchableSurfaceCollection; + mergeSubRegions true; + seal { surface fridgeFreezer;