From ea2b087db9b8144cdaa5808e650a076f289fc2e3 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 7 Oct 2008 08:28:55 +0100 Subject: [PATCH 01/10] Upgraded to the new improved SVD weighting. --- .../schemes/quadraticFit/quadraticFitData.C | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitData.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitData.C index 0caebcd421..7271bad0ff 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitData.C +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/quadraticFit/quadraticFitData.C @@ -206,7 +206,7 @@ Foam::label Foam::quadraticFitData::calcFit // calculate the matrix of the polynomial components scalarRectangularMatrix B(C.size(), minSize_, scalar(0)); - for(label ip = 0; ip < C.size(); ip++) + for(label ip = 0; ip < C.size(); ip++) { const point& p = C[ip]; @@ -228,9 +228,8 @@ Foam::label Foam::quadraticFitData::calcFit pz /= scale; label is = 0; - B[ip][is++] = wts[ip]; - - B[ip][is++] = wts[ip]*px; + B[ip][is++] = wts[0]*wts[ip]; + B[ip][is++] = wts[0]*wts[ip]*px; B[ip][is++] = wts[ip]*sqr(px); if (dim_ >= 2) @@ -255,14 +254,14 @@ Foam::label Foam::quadraticFitData::calcFit label nSVDzeros = 0; bool goodFit = false; - for(scalar tol = SMALL; tol < 0.1 && !goodFit; tol *= 10) + for(int iIt = 0; iIt < 35 && !goodFit; iIt++) { - SVD svd(B, tol); + SVD svd(B, SMALL); - scalar fit0 = wts[0]*svd.VSinvUt()[0][0]; - scalar fit1 = wts[1]*svd.VSinvUt()[0][1]; + scalar fit0 = wts[0]*wts[0]*svd.VSinvUt()[0][0]; + scalar fit1 = wts[0]*wts[1]*svd.VSinvUt()[0][1]; - goodFit = sign(fit0) == sign(fit1); + goodFit = sign(fit0) == sign(fit1) && fit0 < 1 && fit1 < 1; if (goodFit) { @@ -270,12 +269,27 @@ Foam::label Foam::quadraticFitData::calcFit fit_[faci][1] = fit1; for(label i = 2; i < stencilSize; i++) { - fit_[faci][i] = wts[i]*svd.VSinvUt()[0][i]; + fit_[faci][i] = wts[0]*wts[i]*svd.VSinvUt()[0][i]; } singVals = svd.S(); nSVDzeros = svd.nZeros(); } + else // (not good fit so increase weight in the centre and for linear) + { + wts[0] *= 10; + wts[1] *= 10; + for(label i = 0; i < B.n(); i++) + { + B[i][0] *= 10; + B[i][1] *= 10; + } + for(label j = 0; j < B.m(); j++) + { + B[0][j] *= 10; + B[1][j] *= 10; + } + } } if (!goodFit) { @@ -283,7 +297,7 @@ Foam::label Foam::quadraticFitData::calcFit ( "quadraticFitData::calcFit(const pointField&, const label)" ) << "For face " << faci << endl - << "Fit not good even once tol >= 0.1" + << "Cannot find good fit" << exit(FatalError); } From 81f08283f4d9bf15e5347ba0889d8f5bbeba62b2 Mon Sep 17 00:00:00 2001 From: henry Date: Tue, 7 Oct 2008 10:07:43 +0100 Subject: [PATCH 02/10] Added momentum equation relaxation to allow forcing diagonal-dominance. --- applications/solvers/incompressible/oodles/oodles.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/solvers/incompressible/oodles/oodles.C b/applications/solvers/incompressible/oodles/oodles.C index eb5fa65dcf..8c51065db1 100644 --- a/applications/solvers/incompressible/oodles/oodles.C +++ b/applications/solvers/incompressible/oodles/oodles.C @@ -66,6 +66,9 @@ int main(int argc, char *argv[]) + sgsModel->divDevBeff(U) ); + // Optionally ensure diagonal-dominance of the momentum matrix + UEqn.relax(); + if (momentumPredictor) { solve(UEqn == -fvc::grad(p)); From 3c69749b47d6d2a9ecf08bb21e8034df678f86c6 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 7 Oct 2008 13:10:16 +0100 Subject: [PATCH 03/10] intel compiler from Ayad --- .../fieldAverageItem/fieldAverageItem.H | 32 +++++++++++++------ 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/src/postProcessing/fieldAverage/fieldAverageItem/fieldAverageItem.H b/src/postProcessing/fieldAverage/fieldAverageItem/fieldAverageItem.H index 1bcb5689bb..a8b8830016 100644 --- a/src/postProcessing/fieldAverage/fieldAverageItem/fieldAverageItem.H +++ b/src/postProcessing/fieldAverage/fieldAverageItem/fieldAverageItem.H @@ -102,15 +102,6 @@ private: baseType base_; - // Private Member Functions - - //- Disallow default bitwise copy construct -// fieldAverageItem(const fieldAverageItem&); - - //- Disallow default bitwise assignment -// void operator=(const fieldAverageItem&); - - public: // Constructors @@ -175,6 +166,29 @@ public: void operator=(const fieldAverageItem&); + // Friend Operators + + friend bool operator== + ( + const fieldAverageItem& a, + const fieldAverageItem& b + ) + { + return + a.fieldName_ == b.fieldName_ + && a.mean_ == b.mean_ + && a.prime2Mean_ == b.prime2Mean_ + && a.base_ == b.base_; + } + + friend bool operator!= + ( + const fieldAverageItem& a, + const fieldAverageItem& b + ) + { + return !(a == b); + } // IOstream Operators From 69c567167d218a7b6e5358cf30bd5b6be9f71de0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 7 Oct 2008 18:02:50 +0100 Subject: [PATCH 04/10] intel compiler messages --- .../rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C index 4db4faac50..5a17820680 100644 --- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C +++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C @@ -157,9 +157,8 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs() if(thermalCreep_) { - const GeometricField& vsfT = - this->db().objectRegistry:: - lookupObject >("T"); + const volScalarField& vsfT = + this->db().objectRegistry::lookupObject("T"); label patchi = this->patch().index(); const fvPatchScalarField& pT = vsfT.boundaryField()[patchi]; Field gradpT = fvc::grad(vsfT)().boundaryField()[patchi]; From 0bbc8fd2c42cf6f8abd27671fe6aff431f493d68 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 7 Oct 2008 18:24:56 +0100 Subject: [PATCH 05/10] parallel checkMesh --- .../manipulation/checkMesh/checkGeometry.C | 82 +++++++++++------ .../manipulation/checkMesh/checkTopology.C | 25 +++-- .../manipulation/checkMesh/printMeshStats.C | 91 +++++++++++++------ .../polyBoundaryMesh/polyBoundaryMesh.C | 4 +- 4 files changed, 141 insertions(+), 61 deletions(-) diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C index 6b1a10d90e..8eb1f3f05f 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkGeometry.C @@ -39,10 +39,15 @@ Foam::label Foam::checkGeometry(const polyMesh& mesh, const bool allGeometry) if (mesh.checkEdgeAlignment(true, validDirs, &nonAlignedPoints)) { noFailedChecks++; + label nNonAligned = returnReduce + ( + nonAlignedPoints.size(), + sumOp