diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 817381be6194ccea96d53281d062c83777b8b642..87ba99409dc1086ba1f911001e0f0f79ead855d1 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 b91061399ee1cebe26a7b6f122b5231e7f7ff7e3..3d695172e2196d69b751fc2ea06f28b92e0a8664 100644 --- a/src/finiteVolume/Make/options +++ b/src/finiteVolume/Make/options @@ -1,6 +1,7 @@ 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 \ 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 0000000000000000000000000000000000000000..2e9319df76cf293645e986113c76348f1378dc2d --- /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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#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<const directMappedVariableThicknessWallPolyPatch> + ( + patch() + ); + + const directMappedPatchBase& mpp = refCast<const directMappedPatchBase> + ( + patch() + ); + + const polyMesh& nbrMesh = mpp.sampleMesh(); + + typedef regionModels::regionModel1D modelType; + + const modelType& region1D = + nbrMesh.objectRegistry::lookupObject<modelType> + ( + "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 0000000000000000000000000000000000000000..0dcdde96c48f024087cfea2caf86769f215794f6 --- /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) 2004-2010 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 <http://www.gnu.org/licenses/>. + +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/meshTools/Make/files b/src/meshTools/Make/files index f52dedbf61fa9272937d1665ff4b95016a77df50..abf52704b1efc54be683d3ab274123b51defad39 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -158,7 +158,10 @@ twoDPointCorrector/twoDPointCorrector.C directMapped/directMappedPolyPatch/directMappedPatchBase.C directMapped/directMappedPolyPatch/directMappedPolyPatch.C directMapped/directMappedPolyPatch/directMappedWallPolyPatch.C +directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.C directMapped/directMappedPointPatch/directMappedPointPatch.C directMapped/directMappedPointPatch/directMappedWallPointPatch.C + + LIB = $(FOAM_LIBBIN)/libmeshTools diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.C new file mode 100644 index 0000000000000000000000000000000000000000..bd5bacbb3701649be7ec8b4bede809ed72fe9306 --- /dev/null +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.C @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2004-2010 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 <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "directMappedVariableThicknessWallPolyPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(directMappedVariableThicknessWallPolyPatch, 0); + + addToRunTimeSelectionTable + ( + polyPatch, + directMappedVariableThicknessWallPolyPatch, + word + ); + + addToRunTimeSelectionTable + ( + polyPatch, + directMappedVariableThicknessWallPolyPatch, + dictionary + ); +} + + +// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm +) +: + directMappedWallPolyPatch(name, size, start, index, bm), + thickness_(size) +{} + + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vectorField& offset, + const polyBoundaryMesh& bm +) +: + directMappedWallPolyPatch(name, size, start, index, bm), + thickness_(size) +{} + + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vector& offset, + const polyBoundaryMesh& bm +) +: + directMappedWallPolyPatch(name, size, start, index, bm), + thickness_(size) +{} + + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const word& name, + const dictionary& dict, + const label index, + const polyBoundaryMesh& bm +) +: + directMappedWallPolyPatch(name, dict, index, bm), + thickness_(scalarField("thickness", dict, this->size())) +{} + + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const directMappedVariableThicknessWallPolyPatch& pp, + const polyBoundaryMesh& bm +) +: + directMappedWallPolyPatch(pp, bm), + thickness_(pp.thickness_) +{} + + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const directMappedVariableThicknessWallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart +) +: + directMappedWallPolyPatch(pp, bm, index, newSize, newStart), + thickness_(newSize) +{} + + +Foam::directMappedVariableThicknessWallPolyPatch:: +directMappedVariableThicknessWallPolyPatch +( + const directMappedVariableThicknessWallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const labelUList& mapAddressing, + const label newStart +) +: + directMappedWallPolyPatch(pp, bm, index, mapAddressing, newStart), + thickness_(pp.size()) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::directMappedVariableThicknessWallPolyPatch:: +~directMappedVariableThicknessWallPolyPatch() +{ +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::directMappedVariableThicknessWallPolyPatch:: +write(Foam::Ostream& os) const +{ + os.writeKeyword("thickness") << thickness_ << token::END_STATEMENT << nl; +} + +// ************************************************************************* // diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.H b/src/meshTools/directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.H new file mode 100644 index 0000000000000000000000000000000000000000..f8f063eb7820f0d6adb34372fdffb5b5511ce5b5 --- /dev/null +++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedVariableThicknessWallPolyPatch.H @@ -0,0 +1,236 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 <http://www.gnu.org/licenses/>. + +Class + Foam::directMappedVariableThicknessWallPolyPatch + +Description + Foam::directMappedVariableThicknessWallPolyPatch + +SourceFiles + directMappedVariableThicknessWallPolyPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedVariableThicknessWallPolyPatch_H +#define directMappedVariableThicknessWallPolyPatch_H + +#include "wallPolyPatch.H" +#include "directMappedWallPolyPatch.H" + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class polyMesh; + +/*---------------------------------------------------------------------------*\ + Class directMappedVariableThicknessWallPolyPatch Declaration +\*---------------------------------------------------------------------------*/ + +class directMappedVariableThicknessWallPolyPatch +: + public directMappedWallPolyPatch +{ + + // Private data + + //- Thickness + scalarList thickness_; + + +public: + + //- Runtime type information + TypeName("directMappedWallVariableThickness"); + + + // Constructors + + //- Construct from components + directMappedVariableThicknessWallPolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm + ); + + //- Construct from components + directMappedVariableThicknessWallPolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vectorField& offset, + const polyBoundaryMesh& bm + ); + + //- Construct from components. Uniform offset. + directMappedVariableThicknessWallPolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const word& sampleRegion, + const directMappedPatchBase::sampleMode mode, + const word& samplePatch, + const vector& offset, + const polyBoundaryMesh& bm + ); + + //- Construct from dictionary + directMappedVariableThicknessWallPolyPatch + ( + const word& name, + const dictionary& dict, + const label index, + const polyBoundaryMesh& bm + ); + + //- Construct as copy, resetting the boundary mesh + directMappedVariableThicknessWallPolyPatch + ( + const directMappedVariableThicknessWallPolyPatch&, + const polyBoundaryMesh& + ); + + //- Construct given the original patch and resetting the + // face list and boundary mesh information + directMappedVariableThicknessWallPolyPatch + ( + const directMappedVariableThicknessWallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart + ); + + //- Construct given the original patch and a map + directMappedVariableThicknessWallPolyPatch + ( + const directMappedVariableThicknessWallPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const labelUList& mapAddressing, + const label newStart + ); + + //- Construct and return a clone, resetting the boundary mesh + virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const + { + return autoPtr<polyPatch> + ( + new directMappedVariableThicknessWallPolyPatch(*this, bm) + ); + } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new directMappedVariableThicknessWallPolyPatch + ( + *this, + bm, + index, + newSize, + newStart + ) + ); + } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr<polyPatch> clone + ( + const polyBoundaryMesh& bm, + const label index, + const labelUList& mapAddressing, + const label newStart + ) const + { + return autoPtr<polyPatch> + ( + new directMappedVariableThicknessWallPolyPatch + ( + *this, + bm, + index, + mapAddressing, + newStart + ) + ); + } + + + //- Destructor + virtual ~directMappedVariableThicknessWallPolyPatch(); + + + // Member functions + + //- Return non const thickness + scalarList& thickness() + { + return thickness_; + } + + + //- Return const thickness + const scalarList& thickness() const + { + return thickness_; + } + + + //- Write the polyPatch data as a dictionary + void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* //