From 6cd9e92d45e1494dba6792ed65ac601fb40cb613 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 8 Jun 2009 17:59:02 +0100 Subject: [PATCH 1/8] new test app --- .../test/directMappedPatch/Make/files | 4 + .../test/directMappedPatch/Make/options | 6 + .../directMappedPatch/testDirectMappedPatch.C | 127 ++++++++++++++++++ 3 files changed, 137 insertions(+) create mode 100644 applications/test/directMappedPatch/Make/files create mode 100644 applications/test/directMappedPatch/Make/options create mode 100644 applications/test/directMappedPatch/testDirectMappedPatch.C diff --git a/applications/test/directMappedPatch/Make/files b/applications/test/directMappedPatch/Make/files new file mode 100644 index 0000000000..65f39a47b8 --- /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 0000000000..d76bd10c8f --- /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 0000000000..dd27ff6955 --- /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(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 + ( + 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; +} + + +// ************************************************************************* // From a253547154016bcd01d00fa973869006cd482125 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 8 Jun 2009 18:00:04 +0100 Subject: [PATCH 2/8] fvDOM tutorial --- .../hotRadiationRoomFvDOM/0/G | 56 ++++++ .../hotRadiationRoomFvDOM/0/IDefault | 32 ++++ .../hotRadiationRoomFvDOM/0/T | 47 +++++ .../hotRadiationRoomFvDOM/0/U | 48 +++++ .../hotRadiationRoomFvDOM/0/alphat | 47 +++++ .../hotRadiationRoomFvDOM/0/epsilon | 50 ++++++ .../hotRadiationRoomFvDOM/0/k | 50 ++++++ .../hotRadiationRoomFvDOM/0/mut | 50 ++++++ .../hotRadiationRoomFvDOM/0/p | 48 +++++ .../hotRadiationRoomFvDOM/0/pd | 48 +++++ .../constant/RASProperties | 100 +++++++++++ .../constant/environmentalProperties | 21 +++ .../constant/polyMesh/blockMeshDict | 170 ++++++++++++++++++ .../constant/polyMesh/boundary | 46 +++++ .../constant/radiationProperties | 59 ++++++ .../constant/thermophysicalProperties | 25 +++ .../hotRadiationRoomFvDOM/system/controlDict | 47 +++++ .../hotRadiationRoomFvDOM/system/fvSchemes | 70 ++++++++ .../hotRadiationRoomFvDOM/system/fvSolution | 92 ++++++++++ 19 files changed, 1106 insertions(+) create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/IDefault create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/T create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/U create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/alphat create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/epsilon create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/k create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/mut create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/p create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/pd create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/RASProperties create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/environmentalProperties create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/blockMeshDict create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/polyMesh/boundary create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/radiationProperties create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/constant/thermophysicalProperties create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/controlDict create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSchemes create mode 100644 tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/system/fvSolution diff --git a/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G b/tutorials/heatTransfer/buoyantSimpleRadiationFoam/hotRadiationRoomFvDOM/0/G new file mode 100644 index 0000000000..cb9783649f --- /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 0000000000..bbb4ec4ca3 --- /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 0000000000..19ee7d9d08 --- /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 0000000000..9a0eaf66b5 --- /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 0000000000..f11126d3f5 --- /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 0000000000..d5e7b9cd02 --- /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 0000000000..5b206f8e4e --- /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 0000000000..c609cbf3d2 --- /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 0000000000..f200e3eeb0 --- /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 0000000000..1841d7882f --- /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 0000000000..35b5a409f2 --- /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 0000000000..639bd90b06 --- /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 0000000000..e69de20d9d --- /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 0000000000..ab64c00e28 --- /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 0000000000..1521e119a1 --- /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 0000000000..f826516c2e --- /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>>>>; + +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 0000000000..06eec5ead0 --- /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 0000000000..0800e9f932 --- /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 0000000000..a5d6208674 --- /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; +} + + +// ************************************************************************* // From 466b95af86740921b176a168bedebad2f382b443 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 8 Jun 2009 18:03:12 +0100 Subject: [PATCH 3/8] use extrapolated cell-centre for testing;moved added patch information into meshRefinement class --- .../generation/snappyHexMesh/snappyHexMesh.C | 85 +++++++------- .../autoHexMeshDriver/autoHexMeshDriver.C | 77 ++++++------- .../autoHexMeshDriver/autoLayerDriver.C | 11 +- .../autoHexMeshDriver/autoLayerDriver.H | 9 +- .../autoHexMeshDriver/autoRefineDriver.C | 2 +- .../autoHexMeshDriver/autoSnapDriver.C | 31 +---- .../autoHexMeshDriver/autoSnapDriver.H | 3 - .../meshRefinement/meshRefinement.C | 107 ++++++++++++++---- .../meshRefinement/meshRefinement.H | 33 ++++-- .../meshRefinement/meshRefinementBaffles.C | 8 +- .../meshRefinementProblemCells.C | 27 ++--- .../polyTopoChange/polyTopoChange/hexRef8.H | 5 +- 12 files changed, 203 insertions(+), 195 deletions(-) diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMesh.C index 706866bd2a..67b16d75ea 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 5bb4a0ee2d..9081ceb3ee 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 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 01ab952c16..55e35269dd 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 164fd88ce0..1256957006 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 9c4e0a17c5..d9c205bfca 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 011417c29e..f27ccdb9f3 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