From 7ea650d4ca1908ec8a59cdeef9097497d8c37c36 Mon Sep 17 00:00:00 2001 From: Henry Date: Sun, 6 Jul 2014 20:20:16 +0100 Subject: [PATCH 1/8] Revert non-orthogonality treatment for non-coupled BCs. --- .../fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C | 9 --------- .../fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H | 3 --- src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C | 4 +++- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C index ddc60991..f5ce1243 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.C @@ -46,15 +46,6 @@ wedgeFvPatch::wedgeFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm) {} -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -Foam::tmp Foam::wedgeFvPatch::delta() const -{ - const vectorField nHat(nf()); - return nHat*(nHat & (Cf() - Cn())); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H index 16fab3e4..25be556b 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/wedge/wedgeFvPatch.H @@ -83,9 +83,6 @@ public: { return wedgePolyPatch_.cellT(); } - - //- Return cell-centre to face normal vector - virtual tmp delta() const; }; diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C index c55ad272..e7dd4120 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.C @@ -140,7 +140,9 @@ const Foam::scalarField& Foam::fvPatch::magSf() const Foam::tmp Foam::fvPatch::delta() const { - return Cf() - Cn(); + // Use patch-normal delta for all non-coupled BCs + const vectorField nHat(nf()); + return nHat*(nHat & (Cf() - Cn())); } From c831c3eaacdc41492d0166182bb615475b5f97ac Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 7 Jul 2014 11:41:43 +0100 Subject: [PATCH 2/8] ENH: polyPatch: split clearing of addressing from clearing of geometry --- .../meshes/polyMesh/polyPatches/polyPatch/polyPatch.C | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C index 643e06a4..d7508c3d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.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 @@ -61,8 +61,8 @@ void Foam::polyPatch::movePoints(PstreamBuffers&, const pointField& p) void Foam::polyPatch::updateMesh(PstreamBuffers&) { + primitivePatch::clearGeom(); clearAddressing(); - primitivePatch::clearOut(); } @@ -348,6 +348,8 @@ const Foam::labelList& Foam::polyPatch::meshEdges() const void Foam::polyPatch::clearAddressing() { + primitivePatch::clearTopology(); + primitivePatch::clearPatchMeshAddr(); deleteDemandDrivenData(faceCellsPtr_); deleteDemandDrivenData(mePtr_); } From 9eb0fb8215ef4220aecb831cb763113492b4cb8d Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 7 Jul 2014 11:43:08 +0100 Subject: [PATCH 3/8] ENH: tensor: stabilise eigenvectors --- src/OpenFOAM/primitives/Tensor/tensor/tensor.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C index d0d3b30b..7e68450a 100644 --- a/src/OpenFOAM/primitives/Tensor/tensor/tensor.C +++ b/src/OpenFOAM/primitives/Tensor/tensor/tensor.C @@ -150,7 +150,7 @@ Foam::vector Foam::eigenValues(const tensor& t) if (R2 < Q3) { scalar sqrtQ = sqrt(Q); - scalar theta = acos(R/(Q*sqrtQ)); + scalar theta = acos(min(1.0, max(-1.0, R/(Q*sqrtQ)))); scalar m2SqrtQ = -2*sqrtQ; scalar aBy3 = a/3; @@ -344,7 +344,7 @@ Foam::vector Foam::eigenValues(const symmTensor& t) if (R2 < Q3) { scalar sqrtQ = sqrt(Q); - scalar theta = acos(R/(Q*sqrtQ)); + scalar theta = acos(min(1.0, max(-1.0, R/(Q*sqrtQ)))); scalar m2SqrtQ = -2*sqrtQ; scalar aBy3 = a/3; From 590b1dd19419ae5a2cc458b817b5eee61b0ad57f Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 9 Jul 2014 14:56:51 +0100 Subject: [PATCH 4/8] BUG: snappyHexMesh: feature refinement in parallel --- .../autoMesh/autoHexMesh/trackedParticle/trackedParticle.C | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C index 61424852..a883c39d 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C @@ -103,8 +103,12 @@ bool Foam::trackedParticle::move scalar tEnd = (1.0 - stepFraction())*trackTime; scalar dtMax = tEnd; - if (tEnd <= SMALL) + if (tEnd <= SMALL && onBoundary()) { + // This is a hack to handle particles reaching their endpoint + // on a processor boundary. If the endpoint is on a processor face + // it currently gets transferred backwards and forwards infinitely. + // Remove the particle td.keepParticle = false; } From 24b8b584b7324aae784580704ed1575042e0ba31 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 Jul 2014 08:55:27 +0100 Subject: [PATCH 5/8] BUG: UPstream: missing closing bracket --- src/Pstream/mpi/UPstream.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Pstream/mpi/UPstream.C b/src/Pstream/mpi/UPstream.C index 72f1e4b0..610c6fa9 100644 --- a/src/Pstream/mpi/UPstream.C +++ b/src/Pstream/mpi/UPstream.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 @@ -286,7 +286,7 @@ void Foam::reduce Pout<< "UPstream::allocateRequest for non-blocking reduce" << " : request:" << requestID << endl; - + } #else // Non-blocking not yet implemented in mpi reduce(Value, bop, tag, communicator); From 144c6db700f29ec092ef16760ef78dbdb1dab009 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 10 Jul 2014 11:00:42 +0100 Subject: [PATCH 6/8] BUG: Correcting molecular weight fot Tritium in thermoData --- etc/thermoData/thermoData | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/thermoData/thermoData b/etc/thermoData/thermoData index 3048d293..057c9557 100644 --- a/etc/thermoData/thermoData +++ b/etc/thermoData/thermoData @@ -18621,7 +18621,7 @@ T_Tritium__(g) specie { nMoles 1; - molWeight 47.9; + molWeight 3.016; } thermodynamics { From 8214d42f1e50faa8ecfb893eec259abe50267871 Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 10 Jul 2014 11:17:45 +0100 Subject: [PATCH 7/8] ENH: Adding Tritium to atomicWeights.C --- .../specie/atomicWeights/atomicWeights.C | 5 +++-- .../specie/atomicWeights/atomicWeights.H | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C index d46ca188..1997f4fa 100644 --- a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C +++ b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -132,7 +132,8 @@ Foam::atomicWeightTable::atomicWeights[atomicWeightTable::nElements] = {"Es", 254.00000}, {"Fm", 253.00000}, {"D", 2.01410}, - {"e", 5.45e-4} + {"e", 5.45e-4}, + {"T", 3.01604}, }; diff --git a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H index fd68aada..58420fb9 100644 --- a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H +++ b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,7 +63,7 @@ public: scalar weight; }; - static const int nElements = 103; + static const int nElements = 104; //- Static table of the weights of all known elements static const atomicWeight atomicWeights[nElements]; From 2e031c1d11fe1413908f80e8290744ab61d6556d Mon Sep 17 00:00:00 2001 From: sergio Date: Thu, 10 Jul 2014 11:20:03 +0100 Subject: [PATCH 8/8] STY: Re-checking Copyright years --- src/thermophysicalModels/specie/atomicWeights/atomicWeights.C | 4 ++-- src/thermophysicalModels/specie/atomicWeights/atomicWeights.H | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C index 1997f4fa..c0e56979 100644 --- a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C +++ b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -133,7 +133,7 @@ Foam::atomicWeightTable::atomicWeights[atomicWeightTable::nElements] = {"Fm", 253.00000}, {"D", 2.01410}, {"e", 5.45e-4}, - {"T", 3.01604}, + {"T", 3.01604} }; diff --git a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H index 58420fb9..768ed3ea 100644 --- a/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H +++ b/src/thermophysicalModels/specie/atomicWeights/atomicWeights.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License