diff --git a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C index 46c0171e5a..459eaa0cef 100644 --- a/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrude/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -132,6 +132,7 @@ Usage #include "surfaceFields.H" #include "syncTools.H" #include "cyclicPolyPatch.H" +#include "wedgePolyPatch.H" #include "nonuniformTransformCyclicPolyPatch.H" #include "extrudeModel.H" @@ -951,6 +952,12 @@ int main(int argc, char *argv[]) // Region const word shellRegionName(dict.lookup("region")); const wordList zoneNames(dict.lookup("faceZones")); + wordList zoneShadowNames(0); + if (dict.found("faceZonesShadow")) + { + dict.lookup("faceZonesShadow") >> zoneShadowNames; + } + const Switch oneD(dict.lookup("oneD")); const Switch adaptMesh(dict.lookup("adaptMesh")); @@ -1007,6 +1014,47 @@ int main(int argc, char *argv[]) } } + labelList zoneShadowIDs; + if (zoneShadowNames.size()) + { + zoneShadowIDs.setSize(zoneShadowNames.size()); + forAll(zoneShadowNames, i) + { + zoneShadowIDs[i] = faceZones.findZoneID(zoneShadowNames[i]); + if (zoneShadowIDs[i] == -1) + { + FatalErrorIn(args.executable()) + << "Cannot find zone " << zoneShadowNames[i] << endl + << "Valid zones are " << faceZones.names() + << exit(FatalError); + } + } + } + + label nShadowFaces = 0; + forAll(zoneShadowIDs, i) + { + nShadowFaces += faceZones[zoneShadowIDs[i]].size(); + } + + labelList extrudeMeshShadowFaces(nShadowFaces); + boolList zoneShadowFlipMap(nShadowFaces); + labelList zoneShadowID(nShadowFaces); + + nShadowFaces = 0; + forAll(zoneShadowIDs, i) + { + const faceZone& fz = faceZones[zoneShadowIDs[i]]; + forAll(fz, j) + { + extrudeMeshShadowFaces[nShadowFaces] = fz[j]; + zoneShadowFlipMap[nShadowFaces] = fz.flipMap()[j]; + zoneShadowID[nShadowFaces] = zoneShadowIDs[i]; + nShadowFaces++; + } + } + + // Collect faces to extrude and per-face information // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1047,6 +1095,19 @@ int main(int argc, char *argv[]) << nl << endl; + // Check nExtrudeFaces = nShadowFaces + if (zoneShadowNames.size()) + { + if (nExtrudeFaces != nShadowFaces) + { + FatalErrorIn(args.executable()) + << "Extruded faces " << nExtrudeFaces << endl + << "is different from shadow faces. " << nShadowFaces + << "This is not permitted " << endl + << exit(FatalError); + } + } + // Determine corresponding mesh edges const labelList extrudeMeshEdges @@ -1135,7 +1196,7 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionBottomPatch[i]].type() << nl; } - else + else if (zoneShadowNames.size() == 0) { interRegionTopPatch[i] = addPatch ( @@ -1159,6 +1220,31 @@ int main(int argc, char *argv[]) << '\t' << patches[interRegionBottomPatch[i]].type() << nl; } + else if (zoneShadowNames.size() > 0) //patch using shadow face zones. + { + interRegionTopPatch[i] = addPatch + ( + mesh, + zoneShadowNames[i] + "_top" + ); + nCoupled++; + Info<< interRegionTopPatch[i] + << '\t' << patches[interRegionTopPatch[i]].name() + << '\t' << patches[interRegionTopPatch[i]].type() + << nl; + + interRegionBottomPatch[i] = addPatch + ( + mesh, + interName + ); + nCoupled++; + Info<< interRegionBottomPatch[i] + << '\t' << patches[interRegionBottomPatch[i]].name() + << '\t' << patches[interRegionBottomPatch[i]].type() + << nl; + } + } Info<< "Added " << nCoupled << " inter-region patches." << nl << endl; @@ -1216,9 +1302,9 @@ int main(int argc, char *argv[]) if (oneD) { // Reuse single empty patch. - word patchName = "oneDEmptPatch"; + word patchName = "oneDWedgePatch"; - zoneSidePatch[zoneI] = addPatch + zoneSidePatch[zoneI] = addPatch ( mesh, patchName @@ -1335,7 +1421,7 @@ int main(int argc, char *argv[]) if (oneD) { - nonManifoldEdge[edgeI] = 1; + //nonManifoldEdge[edgeI] = 1; //To fill the space ePatches.setSize(eFaces.size()); forAll(eFaces, i) { @@ -1754,48 +1840,91 @@ int main(int argc, char *argv[]) } } - // Add faces (using same points) to be in top patch - forAll(extrudeMeshFaces, zoneFaceI) + if (zoneShadowNames.size() > 0) //if there is a top faceZone specified { - label meshFaceI = extrudeMeshFaces[zoneFaceI]; - bool flip = zoneFlipMap[zoneFaceI]; - const face& f = mesh.faces()[meshFaceI]; - - if (!flip) + forAll(extrudeMeshFaces, zoneFaceI) { - if (mesh.isInternalFace(meshFaceI)) + label meshFaceI = extrudeMeshShadowFaces[zoneFaceI]; + label zoneI = zoneShadowID[zoneFaceI]; + bool flip = zoneShadowFlipMap[zoneFaceI]; + const face& f = mesh.faces()[meshFaceI]; + + if (!flip) + { + meshMod.modifyFace + ( + f, // modified face + meshFaceI, // face being modified + mesh.faceOwner()[meshFaceI],// owner + -1, // neighbour + false, // face flip + extrudeTopPatchID[zoneFaceI],// patch for face + zoneI, // zone for face + flip // face flip in zone + ); + } + else if (mesh.isInternalFace(meshFaceI)) + { + meshMod.modifyFace + ( + f.reverseFace(), // modified face + meshFaceI, // label modified face + mesh.faceNeighbour()[meshFaceI],// owner + -1, // neighbour + true, // face flip + extrudeTopPatchID[zoneFaceI], // patch for face + zoneI, // zone for face + !flip // face flip in zone + ); + } + } + + } + else + { + // Add faces (using same points) to be in top patch + forAll(extrudeMeshFaces, zoneFaceI) + { + label meshFaceI = extrudeMeshFaces[zoneFaceI]; + bool flip = zoneFlipMap[zoneFaceI]; + const face& f = mesh.faces()[meshFaceI]; + + if (!flip) + { + if (mesh.isInternalFace(meshFaceI)) + { + meshMod.addFace + ( + f.reverseFace(), // modified face + mesh.faceNeighbour()[meshFaceI],// owner + -1, // neighbour + -1, // master point + -1, // master edge + meshFaceI, // master face + true, // flip flux + extrudeTopPatchID[zoneFaceI], // patch for face + -1, // zone for face + false //face flip in zone + ); + } + } + else { meshMod.addFace ( - f.reverseFace(), // modified face - mesh.faceNeighbour()[meshFaceI],// owner + f, // face + mesh.faceOwner()[meshFaceI], // owner -1, // neighbour -1, // master point -1, // master edge meshFaceI, // master face - true, // flip flux + false, // flip flux extrudeTopPatchID[zoneFaceI], // patch for face -1, // zone for face - false // face flip in zone + false // zone flip ); } } - else - { - meshMod.addFace - ( - f, // face - mesh.faceOwner()[meshFaceI], // owner - -1, // neighbour - -1, // master point - -1, // master edge - meshFaceI, // master face - false, // flip flux - extrudeTopPatchID[zoneFaceI], // patch for face - -1, // zone for face - false // zone flip - ); - } } // Change the mesh. Change points directly (no inflation). diff --git a/applications/utilities/parallelProcessing/decomposePar/Make/files b/applications/utilities/parallelProcessing/decomposePar/Make/files index 076ecd41bf..125f6b81e7 100644 --- a/applications/utilities/parallelProcessing/decomposePar/Make/files +++ b/applications/utilities/parallelProcessing/decomposePar/Make/files @@ -2,6 +2,7 @@ decomposePar.C domainDecomposition.C domainDecompositionMesh.C domainDecompositionDistribute.C +dimFieldDecomposer.C fvFieldDecomposer.C pointFieldDecomposer.C lagrangianFieldDecomposer.C diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 8c8b1dfc88..ea306917e5 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -81,6 +81,7 @@ Usage #include "pointFields.H" #include "readFields.H" +#include "dimFieldDecomposer.H" #include "fvFieldDecomposer.H" #include "pointFieldDecomposer.H" #include "lagrangianFieldDecomposer.H" @@ -354,6 +355,25 @@ int main(int argc, char *argv[]) readFields(mesh, objects, volTensorFields); + // Construct the dimensioned fields + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + PtrList > dimScalarFields; + readFields(mesh, objects, dimScalarFields); + + PtrList > dimVectorFields; + readFields(mesh, objects, dimVectorFields); + + PtrList > + dimSphericalTensorFields; + readFields(mesh, objects, dimSphericalTensorFields); + + PtrList > dimSymmTensorFields; + readFields(mesh, objects, dimSymmTensorFields); + + PtrList > dimTensorFields; + readFields(mesh, objects, dimTensorFields); + + // Construct the surface fields // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PtrList surfaceScalarFields; @@ -727,19 +747,6 @@ int main(int argc, char *argv[]) ); // FV fields - if - ( - volScalarFields.size() - || volVectorFields.size() - || volSphericalTensorFields.size() - || volSymmTensorFields.size() - || volTensorFields.size() - || surfaceScalarFields.size() - || surfaceVectorFields.size() - || surfaceSphericalTensorFields.size() - || surfaceSymmTensorFields.size() - || surfaceTensorFields.size() - ) { fvFieldDecomposer fieldDecomposer ( @@ -763,16 +770,25 @@ int main(int argc, char *argv[]) fieldDecomposer.decomposeFields(surfaceTensorFields); } + // Dimensioned fields + { + dimFieldDecomposer fieldDecomposer + ( + mesh, + procMesh, + faceProcAddressing, + cellProcAddressing + ); + + fieldDecomposer.decomposeFields(dimScalarFields); + fieldDecomposer.decomposeFields(dimVectorFields); + fieldDecomposer.decomposeFields(dimSphericalTensorFields); + fieldDecomposer.decomposeFields(dimSymmTensorFields); + fieldDecomposer.decomposeFields(dimTensorFields); + } + // Point fields - if - ( - pointScalarFields.size() - || pointVectorFields.size() - || pointSphericalTensorFields.size() - || pointSymmTensorFields.size() - || pointTensorFields.size() - ) { labelIOList pointProcAddressing ( @@ -822,21 +838,6 @@ int main(int argc, char *argv[]) ); // Lagrangian fields - if - ( - lagrangianLabelFields[cloudI].size() - || lagrangianLabelFieldFields[cloudI].size() - || lagrangianScalarFields[cloudI].size() - || lagrangianScalarFieldFields[cloudI].size() - || lagrangianVectorFields[cloudI].size() - || lagrangianVectorFieldFields[cloudI].size() - || lagrangianSphericalTensorFields[cloudI].size() - || lagrangianSphericalTensorFieldFields[cloudI].size() - || lagrangianSymmTensorFields[cloudI].size() - || lagrangianSymmTensorFieldFields[cloudI].size() - || lagrangianTensorFields[cloudI].size() - || lagrangianTensorFieldFields[cloudI].size() - ) { fieldDecomposer.decomposeFields ( diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.C new file mode 100644 index 0000000000..8c61e0920c --- /dev/null +++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.C @@ -0,0 +1,52 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 3 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, see . + +\*---------------------------------------------------------------------------*/ + +#include "dimFieldDecomposer.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::dimFieldDecomposer::dimFieldDecomposer +( + const fvMesh& completeMesh, + const fvMesh& procMesh, + const labelList& faceAddressing, + const labelList& cellAddressing +) +: + completeMesh_(completeMesh), + procMesh_(procMesh), + faceAddressing_(faceAddressing), + cellAddressing_(cellAddressing) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::dimFieldDecomposer::~dimFieldDecomposer() +{} + + +// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.H new file mode 100644 index 0000000000..ba88e85c8d --- /dev/null +++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposer.H @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 3 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, see . + +Class + Foam::dimFieldDecomposer + +Description + Dimensioned field decomposer. + +SourceFiles + dimFieldDecomposer.C + dimFieldDecomposerDecomposeFields.C + +\*---------------------------------------------------------------------------*/ + +#ifndef dimFieldDecomposer_H +#define dimFieldDecomposer_H + +#include "fvMesh.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class IOobjectList; + +/*---------------------------------------------------------------------------*\ + Class fvFieldDecomposer Declaration +\*---------------------------------------------------------------------------*/ + +class dimFieldDecomposer +{ +private: + + // Private data + + //- Reference to complete mesh + const fvMesh& completeMesh_; + + //- Reference to processor mesh + const fvMesh& procMesh_; + + //- Reference to face addressing + const labelList& faceAddressing_; + + //- Reference to cell addressing + const labelList& cellAddressing_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + dimFieldDecomposer(const dimFieldDecomposer&); + + //- Disallow default bitwise assignment + void operator=(const dimFieldDecomposer&); + + +public: + + // Constructors + + //- Construct from components + dimFieldDecomposer + ( + const fvMesh& completeMesh, + const fvMesh& procMesh, + const labelList& faceAddressing, + const labelList& cellAddressing + ); + + + //- Destructor + ~dimFieldDecomposer(); + + + // Member Functions + + //- Decompose field + template + tmp > decomposeField + ( + const DimensionedField& field + ) const; + + + //- Decompose llist of fields + template + void decomposeFields(const PtrList& fields) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "dimFieldDecomposerDecomposeFields.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C new file mode 100644 index 0000000000..2ca8088103 --- /dev/null +++ b/applications/utilities/parallelProcessing/decomposePar/dimFieldDecomposerDecomposeFields.C @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 3 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, see . + +\*---------------------------------------------------------------------------*/ + +#include "dimFieldDecomposer.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::dimFieldDecomposer::decomposeField +( + const DimensionedField& field +) const +{ + // Create and map the internal field values + Field mappedField(field, cellAddressing_); + + // Create the field for the processor + return tmp > + ( + new DimensionedField + ( + IOobject + ( + field.name(), + procMesh_.time().timeName(), + procMesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + procMesh_, + field.dimensions(), + mappedField + ) + ); +} + + +template +void Foam::dimFieldDecomposer::decomposeFields +( + const PtrList& fields +) const +{ + forAll(fields, fieldI) + { + decomposeField(fields[fieldI])().write(); + } +} + + +// ************************************************************************* // diff --git a/applications/utilities/parallelProcessing/decomposePar/readFields.C b/applications/utilities/parallelProcessing/decomposePar/readFields.C index f72d0a6ac5..5de523e3c2 100644 --- a/applications/utilities/parallelProcessing/decomposePar/readFields.C +++ b/applications/utilities/parallelProcessing/decomposePar/readFields.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -35,7 +35,7 @@ void Foam::readFields PtrList& fields ) { - // Search list of objects for volScalarFields + // Search list of objects for fields of type GeomField IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName)); // Remove the cellDist field @@ -45,7 +45,7 @@ void Foam::readFields fieldObjects.erase(celDistIter); } - // Construct the vol scalar fields + // Construct the fields fields.setSize(fieldObjects.size()); label fieldI = 0; diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 817381be61..87ba99409d 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -29,6 +29,7 @@ derivedFvPatches = $(fvPatches)/derived $(derivedFvPatches)/wall/wallFvPatch.C $(derivedFvPatches)/directMapped/directMappedFvPatch.C $(derivedFvPatches)/directMapped/directMappedWallFvPatch.C +$(derivedFvPatches)/directMapped/directMappedVariableThicknessWallFvPatch.C wallDist = fvMesh/wallDist $(wallDist)/wallPointYPlus/wallPointYPlus.C diff --git a/src/finiteVolume/Make/options b/src/finiteVolume/Make/options index b91061399e..afa13b620e 100644 --- a/src/finiteVolume/Make/options +++ b/src/finiteVolume/Make/options @@ -1,8 +1,10 @@ EXE_INC = \ -I$(LIB_SRC)/triSurface/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude LIB_LIBS = \ -lOpenFOAM \ -ltriSurface \ - -lmeshTools + -lmeshTools \ + -lregionModels diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedVariableThicknessWallFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedVariableThicknessWallFvPatch.C new file mode 100644 index 0000000000..2e9319df76 --- /dev/null +++ b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedVariableThicknessWallFvPatch.C @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 3 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, see . + +\*---------------------------------------------------------------------------*/ + +#include "directMappedVariableThicknessWallFvPatch.H" +#include "addToRunTimeSelectionTable.H" +#include "regionModel1D.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(directMappedVariableThicknessWallFvPatch, 0); + addToRunTimeSelectionTable + ( + fvPatch, + directMappedVariableThicknessWallFvPatch, + polyPatch + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::directMappedVariableThicknessWallFvPatch:: +makeDeltaCoeffs(scalarField& dc) const +{ + const directMappedVariableThicknessWallPolyPatch& pp = + refCast + ( + patch() + ); + + const directMappedPatchBase& mpp = refCast + ( + patch() + ); + + const polyMesh& nbrMesh = mpp.sampleMesh(); + + typedef regionModels::regionModel1D modelType; + + const modelType& region1D = + nbrMesh.objectRegistry::lookupObject + ( + "thermoBaffleProperties" + ); + + dc = 2.0/(pp.thickness()/region1D.nLayers()); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedVariableThicknessWallFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedVariableThicknessWallFvPatch.H new file mode 100644 index 0000000000..69e8ad06a1 --- /dev/null +++ b/src/finiteVolume/fvMesh/fvPatches/derived/directMapped/directMappedVariableThicknessWallFvPatch.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2011 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 3 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, see . + +Class + Foam::directMappedVariableThicknessWallFvPatch + +Description + Take thickness field and number of layers and returns deltaCoeffs + as 2.0/thickness/nLayers. + To be used with 1D thermo baffle. + +SourceFiles + directMappedVariableThicknessWallFvPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedWallFvPatch_H +#define directMappedWallFvPatch_H + +#include "wallFvPatch.H" +#include "directMappedVariableThicknessWallPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class directMappedVariableThicknessWallFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class directMappedVariableThicknessWallFvPatch +: + public wallFvPatch +{ + +protected: + + // Protected Member Functions + + //- Read neighbour cell distances from dictionary + void makeDeltaCoeffs(scalarField& dc) const; + + +public: + + //- Runtime type information + TypeName(directMappedVariableThicknessWallPolyPatch::typeName_()); + + + // Constructors + + //- Construct from components + directMappedVariableThicknessWallFvPatch + ( + const polyPatch& patch, + const fvBoundaryMesh& bm + ) + : + wallFvPatch(patch, bm) + {} + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C index cbdf299df7..cfbd376d9a 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C @@ -76,14 +76,16 @@ void Foam::FacePostProcessing::makeLogFile if (Pstream::master()) { + const fileName logDir = outputDir_/this->owner().time().timeName(); + // Create directory if does not exist - mkDir(outputDir_); + mkDir(logDir); // Open new file at start up outputFilePtr_.set ( zoneI, - new OFstream(outputDir_/(type() + '_' + zoneName + ".dat")) + new OFstream(logDir/(type() + '_' + zoneName + ".dat")) ); outputFilePtr_[zoneI] @@ -164,21 +166,6 @@ void Foam::FacePostProcessing::write() if (surfaceFormat_ != "none") { - fileName outputDir = mesh.time().path(); - - if (Pstream::parRun()) - { - // Put in undecomposed case (Note: gives problems for - // distributed data running) - outputDir = - outputDir/".."/"postProcessing"/cloud::prefix/time.timeName(); - } - else - { - outputDir = - outputDir/"postProcessing"/cloud::prefix/time.timeName(); - } - forAll(faceZoneIDs_, zoneI) { const faceZone& fZone = fzm[faceZoneIDs_[zoneI]]; @@ -233,7 +220,7 @@ void Foam::FacePostProcessing::write() writer->write ( - outputDir, + outputDir_/time.timeName(), fZone.name(), allPoints, allFaces, @@ -244,7 +231,7 @@ void Foam::FacePostProcessing::write() writer->write ( - outputDir, + outputDir_/time.timeName(), fZone.name(), allPoints, allFaces, @@ -308,14 +295,12 @@ Foam::FacePostProcessing::FacePostProcessing // Put in undecomposed case (Note: gives problems for // distributed data running) outputDir_ = - outputDir_/".."/"postProcessing"/cloud::prefix/ - owner.name()/owner.mesh().time().timeName(); + outputDir_/".."/"postProcessing"/cloud::prefix/owner.name(); } else { outputDir_ = - outputDir_/"postProcessing"/cloud::prefix/ - owner.name()/owner.mesh().time().timeName(); + outputDir_/"postProcessing"/cloud::prefix/owner.name(); } DynamicList