From 3a51a8215cc5f7ed3f157ae8307857137c31ebc4 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 13 May 2011 10:05:38 +0100 Subject: [PATCH 1/9] ENH: Mesh accessor. --- src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H index 240e8ace42..2f4d4adc43 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/hexRef8.H @@ -344,6 +344,11 @@ public: // Access + const polyMesh& mesh() const + { + return mesh_; + } + const labelIOList& cellLevel() const { return cellLevel_; From 54ba194801876b4d38dfc1ac229d5d5688556209 Mon Sep 17 00:00:00 2001 From: graham Date: Wed, 11 May 2011 13:00:56 +0100 Subject: [PATCH 2/9] ENH: Improved bound box obj output. --- .../algorithms/indexedOctree/indexedOctree.C | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C index 6020d24d19..10cb44fa27 100644 --- a/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C +++ b/src/OpenFOAM/algorithms/indexedOctree/indexedOctree.C @@ -2282,7 +2282,7 @@ void Foam::indexedOctree::writeOBJ { subBb = nodes_[getNode(index)].bb_; } - else if (isContent(index)) + else if (isContent(index) || isEmpty(index)) { subBb = nodes_[nodeI].bb_.subBbox(octant); } @@ -2290,17 +2290,21 @@ void Foam::indexedOctree::writeOBJ Pout<< "dumpContentNode : writing node:" << nodeI << " octant:" << octant << " to " << str.name() << endl; - label vertI = 0; - // Dump bounding box pointField bbPoints(subBb.points()); - label pointVertI = vertI; + forAll(bbPoints, i) + { + const point& pt = bbPoints[i]; + + str<< "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; + } + forAll(treeBoundBox::edges, i) { const edge& e = treeBoundBox::edges[i]; - str<< "l " << e[0]+pointVertI+1 << ' ' << e[1]+pointVertI+1 << nl; + str<< "l " << e[0] + 1 << ' ' << e[1] + 1 << nl; } } @@ -2852,6 +2856,11 @@ void Foam::indexedOctree::print { const labelList& indices = contents_[getContent(index)]; + if (debug) + { + writeOBJ(nodeI, octant); + } + os << "octant:" << octant << " content: n:" << indices.size() << " bb:" << subBb; @@ -2868,6 +2877,11 @@ void Foam::indexedOctree::print } else { + if (debug) + { + writeOBJ(nodeI, octant); + } + os << "octant:" << octant << " empty:" << subBb << endl; } } From 1bb786567d50885d50cb010bac450fea285582e8 Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 13 May 2011 16:01:07 +0100 Subject: [PATCH 3/9] BUG: Face centre error, treating all faces as tris. --- src/OpenFOAM/meshes/meshShapes/face/face.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C index 4060404af7..4128afc9a9 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.C +++ b/src/OpenFOAM/meshes/meshShapes/face/face.C @@ -499,7 +499,7 @@ Foam::point Foam::face::centre(const pointField& points) const const label nPoints = size(); // If the face is a triangle, do a direct calculation - if (nPoints) + if (nPoints == 3) { return (1.0/3.0) From 6b81fecadfd7f2e925dc9130cd2702065d1d610e Mon Sep 17 00:00:00 2001 From: mattijs Date: Sun, 15 May 2011 20:52:33 +0100 Subject: [PATCH 4/9] STYLE: refinementHistory: removed printing --- .../polyTopoChange/refinementHistory.C | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C index 9f3911b164..ccd822d499 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/refinementHistory.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 @@ -690,9 +690,9 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map) // Remove unreferenced history. compact(); - Pout<< nl << "--BEFORE:" << endl; - writeDebug(); - Pout<< "---------" << nl << endl; + //Pout<< nl << "--BEFORE:" << endl; + //writeDebug(); + //Pout<< "---------" << nl << endl; // Distribution is only partially functional. @@ -746,18 +746,18 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map) } } -Pout<< "refinementHistory::distribute :" - << " splitCellProc:" << splitCellProc << endl; - -Pout<< "refinementHistory::distribute :" - << " splitCellNum:" << splitCellNum << endl; + //Pout<< "refinementHistory::distribute :" + // << " splitCellProc:" << splitCellProc << endl; + // + //Pout<< "refinementHistory::distribute :" + // << " splitCellNum:" << splitCellNum << endl; // Create subsetted refinement tree consisting of all parents that // move in their whole to other processor. for (label procI = 0; procI < Pstream::nProcs(); procI++) { - Pout<< "-- Subetting for processor " << procI << endl; + //Pout<< "-- Subetting for processor " << procI << endl; // From uncompacted to compacted splitCells. labelList oldToNew(splitCells_.size(), -1); @@ -781,10 +781,10 @@ Pout<< "refinementHistory::distribute :" oldToNew[index] = newSplitCells.size(); newSplitCells.append(splitCells_[index]); - Pout<< "Added oldCell " << index - << " info " << newSplitCells.last() - << " at position " << newSplitCells.size()-1 - << endl; + //Pout<< "Added oldCell " << index + // << " info " << newSplitCells.last() + // << " at position " << newSplitCells.size()-1 + // << endl; } } @@ -797,9 +797,9 @@ Pout<< "refinementHistory::distribute :" { label parent = splitCells_[index].parent_; - Pout<< "Adding refined cell " << cellI - << " since moves to " - << procI << " old parent:" << parent << endl; + //Pout<< "Adding refined cell " << cellI + // << " since moves to " + // << procI << " old parent:" << parent << endl; // Create new splitCell with parent oldToNew[index] = newSplitCells.size(); @@ -891,8 +891,8 @@ Pout<< "refinementHistory::distribute :" // renumbering can be done here. label offset = splitCells_.size(); - Pout<< "**Renumbering data from proc " << procI << " with offset " - << offset << endl; + //Pout<< "**Renumbering data from proc " << procI << " with offset " + // << offset << endl; forAll(newSplitCells, index) { @@ -929,9 +929,9 @@ Pout<< "refinementHistory::distribute :" } splitCells_.shrink(); - Pout<< nl << "--AFTER:" << endl; - writeDebug(); - Pout<< "---------" << nl << endl; + //Pout<< nl << "--AFTER:" << endl; + //writeDebug(); + //Pout<< "---------" << nl << endl; } From 9118e8ea9ddce6df851c6493191eecd043f34a80 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 16 May 2011 10:06:09 +0100 Subject: [PATCH 5/9] porousExplicitSourceReactingParcelFoam: Removed spurious relaxation statement from rhoEqn. --- .../lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H | 2 -- 1 file changed, 2 deletions(-) diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H index b1770a5a9d..33b7943cad 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H @@ -39,8 +39,6 @@ Description + massSource.SuTot() ); - rhoEqn.relax(); - rhoEqn.solve(); } From f0f1e29779248bf00c1a9e8e2888f6a8090a9b78 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 16 May 2011 10:06:41 +0100 Subject: [PATCH 6/9] chtMultiRegionFoam/multiRegionLiquidHeater tutorial: corrected relaxation statement --- .../multiRegionLiquidHeater/system/bottomWater/fvSolution | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSolution b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSolution index 48dae067cb..5004b93012 100644 --- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSolution +++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionLiquidHeater/system/bottomWater/fvSolution @@ -77,7 +77,7 @@ PIMPLE relaxationFactors { - "h.* 1; + "h.*" 1; "U.*" 1; } From 52ce8bae96364f299297bc583a69df71d6511484 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 16 May 2011 10:08:36 +0100 Subject: [PATCH 7/9] HerschelBulkley: Changed the definition of the coefficients and stress to more commonly used forms. This does not change the form of the function but the coefficients must be set appropriately. --- .../HerschelBulkley/HerschelBulkley.C | 24 ++++++++++++++++--- .../viscosityModel/viscosityModel.C | 4 ++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.C b/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.C index 52085f8b69..c1b4132323 100644 --- a/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.C +++ b/src/transportModels/incompressible/viscosityModels/HerschelBulkley/HerschelBulkley.C @@ -52,10 +52,28 @@ Foam::viscosityModels::HerschelBulkley::calcNu() const { dimensionedScalar tone("tone", dimTime, 1.0); dimensionedScalar rtone("rtone", dimless/dimTime, 1.0); + tmp sr(strainRate()); - return (min(nu0_,(tau0_ + k_* rtone *( pow(tone * sr(), n_) - - pow(tone*tau0_/nu0_,n_))) / (max(sr(), dimensionedScalar - ("VSMALL", dimless/dimTime, VSMALL))))); + + // return + // ( + // min + // ( + // nu0_, + // (tau0_ + k_*rtone*(pow(tone*sr(), n_) - pow(tone*tau0_/nu0_, n_))) + // /max(sr(), dimensionedScalar("VSMALL", dimless/dimTime, VSMALL)) + // ) + // ); + + return + ( + min + ( + nu0_, + (tau0_ + k_*rtone*pow(tone*sr(), n_)) + /(max(sr(), dimensionedScalar ("VSMALL", dimless/dimTime, VSMALL))) + ) + ); } diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.C b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.C index 493cb89df6..57be63e30e 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.C +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.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 @@ -57,7 +57,7 @@ Foam::viscosityModel::viscosityModel Foam::tmp Foam::viscosityModel::strainRate() const { - return mag(symm(fvc::grad(U_))); + return sqrt(2.0)*mag(symm(fvc::grad(U_))); } From 50660fcca560ca37fdb9fb0e95dd3a86d2633e81 Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 16 May 2011 10:13:25 +0100 Subject: [PATCH 8/9] snappyHexMesh/flange tutorial: remove the generated "flange" file. --- tutorials/mesh/snappyHexMesh/flange/Allclean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/mesh/snappyHexMesh/flange/Allclean b/tutorials/mesh/snappyHexMesh/flange/Allclean index 884d713e5f..abb949539e 100755 --- a/tutorials/mesh/snappyHexMesh/flange/Allclean +++ b/tutorials/mesh/snappyHexMesh/flange/Allclean @@ -5,7 +5,7 @@ cd ${0%/*} || exit 1 # run from this directory . $WM_PROJECT_DIR/bin/tools/CleanFunctions rm -rf 0 > /dev/null 2>&1 -rm -f ./*.obj > /dev/null 2>&1 +rm -f ./flange ./*.obj > /dev/null 2>&1 rm -rf constant/extendedFeatureEdgeMesh > /dev/null 2>&1 rm -f constant/triSurface/flange.eMesh > /dev/null 2>&1 rm -f constant/polyMesh/boundary From 3868902d80d815d9310a52a179b630d2075e216f Mon Sep 17 00:00:00 2001 From: graham Date: Mon, 16 May 2011 10:26:40 +0100 Subject: [PATCH 9/9] STYLE: Using $internalField for lowerWall as per training notes. --- tutorials/incompressible/simpleFoam/motorBike/0.org/U | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/incompressible/simpleFoam/motorBike/0.org/U b/tutorials/incompressible/simpleFoam/motorBike/0.org/U index 0e62e1551f..c1fb7eec0a 100644 --- a/tutorials/incompressible/simpleFoam/motorBike/0.org/U +++ b/tutorials/incompressible/simpleFoam/motorBike/0.org/U @@ -35,7 +35,7 @@ boundaryField lowerWall { type fixedValue; - value uniform (20 0 0); + value $internalField; } "motorBike_.*"