From d5f43168c9335fa566a16258201adea802e53b7b Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 3 Apr 2014 12:35:10 +0100 Subject: [PATCH 1/5] ENH: createBafflesDict: added comment --- .../manipulation/createBaffles/createBafflesDict | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict b/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict index 15e099fb..9ce767ea 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict +++ b/applications/utilities/mesh/manipulation/createBaffles/createBafflesDict @@ -19,7 +19,17 @@ FoamFile // - or converting boundary faces into a boundary face // (internalFacesOnly=false)(though should use really createPatch // to do this) -// - specification in one of two modes: +// +// - selection of faces (and orientation) to 'baffle' through: +// faceZone: +// type faceZone; +// zoneName f0; +// searchableSurface: +// type searchableSurface; +// surface triSurfaceMesh; +// name baffle1D.stl; +// +// - specification of patches for baffle sides in one of two modes: // - patchPairs : create two patches of same type, same input // - patches : create patches separately, full control over what // to create on what side From 322f93660cc529ea63bc5b95757f23d6f0ca2736 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 4 Apr 2014 11:07:16 +0100 Subject: [PATCH 2/5] ENH: ptscotchDecomp: handle locally zero cells --- .../decompose/ptscotchDecomp/ptscotchDecomp.C | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C index 8736987c..3791ad53 100644 --- a/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C +++ b/src/parallel/decompose/ptscotchDecomp/ptscotchDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -532,12 +532,23 @@ Foam::label Foam::ptscotchDecomp::decompose if (maxWeights > minWeights) { - // Convert to integers. - velotab.setSize(cWeights.size()); - - forAll(velotab, i) + if (cWeights.size()) { - velotab[i] = int((cWeights[i]/minWeights - 1)*rangeScale) + 1; + // Convert to integers. + velotab.setSize(cWeights.size()); + + forAll(velotab, i) + { + velotab[i] = int((cWeights[i]/minWeights - 1)*rangeScale) + 1; + } + } + else + { + // Locally zero cells but not globally. Make sure we have + // some size so .begin() does not return null pointer. Data + // itself is never used. + velotab.setSize(1); + velotab[0] = 1; } } From 7ac96f1f979f8e158300f54b6561e792ef4033df Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 4 Apr 2014 11:07:50 +0100 Subject: [PATCH 3/5] ENH: polyMesh: handle locally zero cells --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index c20baae3..ce71727d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -1448,6 +1448,15 @@ Foam::label Foam::polyMesh::findCell const cellRepresentation decompMode ) const { + if (Pstream::parRun() && decompMode == FACEDIAGTETS) + { + // Force construction of face-diagonal decomposition before testing + // for zero cells. If parallel running a local domain might have zero + // cells so never construct the face-diagonal decomposition (which + // uses parallel transfers) + (void)tetBasePtIs(); + } + if (nCells() == 0) { return -1; From d2aac18bfca57f91ede075bf0e3d4fb556f76518 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 4 Apr 2014 11:10:46 +0100 Subject: [PATCH 4/5] GIT: damBreak: remove generated file --- .../damBreak/constant/polyMesh/boundary | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary deleted file mode 100644 index 95b2b1c9..00000000 --- a/tutorials/multiphase/interFoam/laminar/damBreak/constant/polyMesh/boundary +++ /dev/null @@ -1,53 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 2.3.0 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -5 -( - leftWall - { - type wall; - nFaces 50; - startFace 4432; - } - rightWall - { - type wall; - nFaces 50; - startFace 4482; - } - lowerWall - { - type wall; - nFaces 62; - startFace 4532; - } - atmosphere - { - type patch; - nFaces 46; - startFace 4594; - } - defaultFaces - { - type empty; - inGroups 1(empty); - nFaces 4536; - startFace 4640; - } -) - -// ************************************************************************* // From 1b3c80476136d0ab0729354769207c650796e605 Mon Sep 17 00:00:00 2001 From: sergio Date: Fri, 4 Apr 2014 11:28:47 +0100 Subject: [PATCH 5/5] BUG: Correcting calculation of Q --- .../externalWallHeatFluxTemperatureFvPatchScalarField.C | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C index 4b51db9f..ea273e25 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -269,7 +269,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() } } } - q = (Ta_ - Tp)*(1.0/h_ + totalSolidRes); + q = (Ta_ - Tp)/(1.0/h_ + totalSolidRes); break; } default: @@ -287,7 +287,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() { if (q[i] > 0) //in { - this->refGrad()[i] = q[i]/KWall[i]; + this->refGrad()[i] = q[i]/KWall[i]; this->refValue()[i] = 0.0; this->valueFraction()[i] = 0.0; }