From 0c8297c8595f469ae897f2bccba3bface737475e Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 13 Oct 2010 14:13:10 +0100 Subject: [PATCH 01/19] Updated tetFem motion tutorial --- .../movingConeMotion/constant/dynamicMeshDict | 5 +- .../constant/polyMesh/blockMeshDict | 42 +++---- .../constant/polyMesh/blockMeshDict-fine | 112 ++++++++++++++++++ .../constant/polyMesh/boundary | 30 ++--- .../constant/transportProperties | 8 +- .../movingConeMotion/system/controlDict | 7 +- .../movingConeMotion/system/decomposeParDict | 50 ++++++++ .../movingConeMotion/system/fvSchemes | 6 - .../movingConeMotion/system/tetFemSolution | 38 +++--- 9 files changed, 227 insertions(+), 71 deletions(-) create mode 100644 tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict-fine create mode 100644 tutorials/incompressible/icoDyMFoam/movingConeMotion/system/decomposeParDict diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/dynamicMeshDict b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/dynamicMeshDict index 02c818b71..8dc88ed85 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/dynamicMeshDict +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/dynamicMeshDict @@ -18,15 +18,16 @@ FoamFile twoDMotion yes; -dynamicFvMesh dynamicMotionSolverFvMesh; +dynamicFvMesh dynamicMotionSolverFvMesh; solver laplaceFaceDecomposition; diffusivity file; +// diffusivity uniform; frozenDiffusion off; -distancePatches +distancePatches ( movingWall farFieldMoving diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict index 9f090b0e6..5b687ed10 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.4 | @@ -10,12 +10,6 @@ FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object blockMeshDict; } @@ -24,7 +18,7 @@ FoamFile convertToMeters 0.001; -vertices +vertices ( (-7.5 0 0) (-7 0 0) @@ -48,52 +42,52 @@ vertices (0 2.5 0.109152) ); -blocks +blocks ( - hex (0 1 5 4 0 1 13 12) (15 15 1) simpleGrading (1 1 1) - hex (2 3 7 6 2 3 15 14) (20 20 1) simpleGrading (2 0.25 1) - hex (4 5 9 8 12 13 17 16) (15 15 1) simpleGrading (1 1 1) - hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1) - hex (6 7 11 10 14 15 19 18) (20 15 1) simpleGrading (2 1 1) + hex (0 1 5 4 0 1 13 12) (5 5 1) simpleGrading (1 1 1) + hex (2 3 7 6 2 3 15 14) (7 7 1) simpleGrading (2 0.25 1) + hex (4 5 9 8 12 13 17 16) (5 5 1) simpleGrading (1 1 1) + hex (5 6 10 9 13 14 18 17) (15 5 1) simpleGrading (1 1 1) + hex (6 7 11 10 14 15 19 18) (7 5 1) simpleGrading (2 1 1) ); -edges +edges ( ); -patches +patches ( - wall movingWall + wall movingWall ( (1 5 13 1) (5 6 14 13) (2 2 14 6) ) - patch farFieldMoving + patch farFieldMoving ( (9 17 18 10) ) - wall fixedWall + wall fixedWall ( (3 7 15 3) (7 11 19 15) ) - empty axis + empty axis ( (0 1 1 0) (2 3 3 2) ) - patch left + patch left ( (0 0 12 4) (4 12 16 8) ) - patch farField + patch farField ( (8 16 17 9) (10 18 19 11) ) - wedge back + wedge back ( (0 4 5 1) (2 6 7 3) @@ -101,7 +95,7 @@ patches (5 9 10 6) (6 10 11 7) ) - wedge front + wedge front ( (0 1 13 12) (2 3 15 14) diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict-fine b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict-fine new file mode 100644 index 000000000..7c71575b3 --- /dev/null +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/blockMeshDict-fine @@ -0,0 +1,112 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.4 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ + +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +vertices +( + (-7.5 0 0) + (-7 0 0) + (-3.5 0 0) + (0 0 0) + (-7.5 0.75 -0.0327457) + (-7 0.75 -0.0327457) + (-3.5 2 -0.0873219) + (0 2 -0.0873219) + (-7.5 2.5 -0.109152) + (-7 2.5 -0.109152) + (-3.5 2.5 -0.109152) + (0 2.5 -0.109152) + (-7.5 0.75 0.0327457) + (-7 0.75 0.0327457) + (-3.5 2 0.0873219) + (0 2 0.0873219) + (-7.5 2.5 0.109152) + (-7 2.5 0.109152) + (-3.5 2.5 0.109152) + (0 2.5 0.109152) +); + +blocks +( + hex (0 1 5 4 0 1 13 12) (15 15 1) simpleGrading (1 1 1) + hex (2 3 7 6 2 3 15 14) (20 20 1) simpleGrading (2 0.25 1) + hex (4 5 9 8 12 13 17 16) (15 15 1) simpleGrading (1 1 1) + hex (5 6 10 9 13 14 18 17) (50 15 1) simpleGrading (1 1 1) + hex (6 7 11 10 14 15 19 18) (20 15 1) simpleGrading (2 1 1) +); + +edges +( +); + +patches +( + wall movingWall + ( + (1 5 13 1) + (5 6 14 13) + (2 2 14 6) + ) + patch farFieldMoving + ( + (9 17 18 10) + ) + wall fixedWall + ( + (3 7 15 3) + (7 11 19 15) + ) + empty axis + ( + (0 1 1 0) + (2 3 3 2) + ) + patch left + ( + (0 0 12 4) + (4 12 16 8) + ) + patch farField + ( + (8 16 17 9) + (10 18 19 11) + ) + wedge back + ( + (0 4 5 1) + (2 6 7 3) + (4 8 9 5) + (5 9 10 6) + (6 10 11 7) + ) + wedge front + ( + (0 1 13 12) + (2 3 15 14) + (12 13 17 16) + (13 14 18 17) + (14 15 19 18) + ) +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/boundary b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/boundary index 635f47626..f2c8bf08c 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/boundary +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/polyMesh/boundary @@ -20,50 +20,50 @@ FoamFile movingWall { type wall; - nFaces 85; - startFace 3665; + nFaces 27; + startFace 374; } farFieldMoving { type patch; - nFaces 50; - startFace 3750; + nFaces 15; + startFace 401; } fixedWall { type wall; - nFaces 35; - startFace 3800; + nFaces 12; + startFace 416; } axis { type empty; nFaces 0; - startFace 3835; + startFace 428; } left { type patch; - nFaces 30; - startFace 3835; + nFaces 10; + startFace 428; } farField { type patch; - nFaces 35; - startFace 3865; + nFaces 12; + startFace 438; } back { type wedge; - nFaces 1900; - startFace 3900; + nFaces 209; + startFace 450; } front { type wedge; - nFaces 1900; - startFace 5800; + nFaces 209; + startFace 659; } ) diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/transportProperties b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/transportProperties index eab1b6e24..71bacf7d1 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/transportProperties +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/constant/transportProperties @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------*\ +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.4 | @@ -10,12 +10,6 @@ FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object transportProperties; } diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict index 7d4f58d31..eeb9f17c4 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict @@ -26,11 +26,11 @@ stopAt endTime; endTime 0.003; -deltaT 5e-06; +deltaT 2e-05; writeControl timeStep; -writeInterval 40; +writeInterval 1; purgeWrite 0; @@ -38,7 +38,7 @@ writeFormat ascii; writePrecision 6; -writeCompression uncompressed; +writeCompression compressed; timeFormat general; @@ -50,4 +50,5 @@ adjustTimeStep no; maxCo 0.2; + // ************************************************************************* // diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/decomposeParDict b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/decomposeParDict new file mode 100644 index 000000000..3ac58130e --- /dev/null +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/decomposeParDict @@ -0,0 +1,50 @@ +/*--------------------------------*- 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 decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 4; + +method simple; + +simpleCoeffs +{ + n (2 2 1); + delta 0.001; +} + +hierarchicalCoeffs +{ + n (1 1 1); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights 4{1}; +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/fvSchemes b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/fvSchemes index f0b66def7..7bf4fd57f 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/fvSchemes +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/fvSchemes @@ -10,12 +10,6 @@ FoamFile { version 2.0; format ascii; - - root ""; - case ""; - instance ""; - local ""; - class dictionary; object fvSchemes; } diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/tetFemSolution b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/tetFemSolution index 0c354c04e..7929d7489 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/tetFemSolution +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/tetFemSolution @@ -20,22 +20,32 @@ solvers { motionU { - solver amgSolver; - cycle W-cycle; - policy AAMG; - nPreSweeps 0; - nPostSweeps 2; - groupSize 4; - minCoarseEqns 30; - nMaxLevels 100; - scale on; - smoother GaussSeidel; + solver PCG; + preconditioner DIC; - minIter 0; - maxIter 500; - tolerance 1e-8; - relTol 0.0; + minIter 0; + maxIter 1000; + tolerance 1e-6; + relTol 0.01; }; +// motionU +// { +// solver amgSolver; +// cycle W-cycle; +// policy AAMG; +// nPreSweeps 0; +// nPostSweeps 2; +// groupSize 4; +// minCoarseEqns 30; +// nMaxLevels 100; +// scale on; +// smoother GaussSeidel; + +// minIter 0; +// maxIter 500; +// tolerance 1e-8; +// relTol 0.0; +// }; } From 2e50d95944466cadff6a0d3fa72c04713d6b8239 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 13 Oct 2010 23:25:34 +0100 Subject: [PATCH 02/19] Reinstated: removed in error --- .../viscoelastic/viscoelasticFluidFoam/Allrun | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tutorials/viscoelastic/viscoelasticFluidFoam/Allrun diff --git a/tutorials/viscoelastic/viscoelasticFluidFoam/Allrun b/tutorials/viscoelastic/viscoelasticFluidFoam/Allrun new file mode 100755 index 000000000..e0c6db010 --- /dev/null +++ b/tutorials/viscoelastic/viscoelasticFluidFoam/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh + +(cd PTT-Exponential; ./Allrun) +(cd DCPP; ./Allrun) +(cd Giesekus; ./Allrun) +(cd FENE-CR; ./Allrun) +(cd FENE-P; ./Allrun) +(cd Feta-PTT; ./Allrun) +(cd Leonov; ./Allrun) +(cd Oldroyd-B; ./Allrun) +(cd S-MDCPP; ./Allrun) +(cd PTT-Linear; ./Allrun) +(cd WhiteMetzner/CarreauYasuda; ./Allrun) +(cd XPP_DE; ./Allrun) +(cd XPP_SE; ./Allrun) From 5ede7aa36edd577395bd37ad30e5e8a5ad4b7c54 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 14 Oct 2010 10:25:59 +0100 Subject: [PATCH 03/19] Permissions on tutorial scripts --- tutorials/combustion/XiFoam/les/pitzDaily/Allrun | 0 .../combustion/XiFoam/les/pitzDaily3D/Allrun | 0 .../viscoelastic/viscoelasticFluidFoam/Allrun | 15 --------------- 3 files changed, 15 deletions(-) mode change 100644 => 100755 tutorials/combustion/XiFoam/les/pitzDaily/Allrun mode change 100644 => 100755 tutorials/combustion/XiFoam/les/pitzDaily3D/Allrun delete mode 100755 tutorials/viscoelastic/viscoelasticFluidFoam/Allrun diff --git a/tutorials/combustion/XiFoam/les/pitzDaily/Allrun b/tutorials/combustion/XiFoam/les/pitzDaily/Allrun old mode 100644 new mode 100755 diff --git a/tutorials/combustion/XiFoam/les/pitzDaily3D/Allrun b/tutorials/combustion/XiFoam/les/pitzDaily3D/Allrun old mode 100644 new mode 100755 diff --git a/tutorials/viscoelastic/viscoelasticFluidFoam/Allrun b/tutorials/viscoelastic/viscoelasticFluidFoam/Allrun deleted file mode 100755 index e0c6db010..000000000 --- a/tutorials/viscoelastic/viscoelasticFluidFoam/Allrun +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -(cd PTT-Exponential; ./Allrun) -(cd DCPP; ./Allrun) -(cd Giesekus; ./Allrun) -(cd FENE-CR; ./Allrun) -(cd FENE-P; ./Allrun) -(cd Feta-PTT; ./Allrun) -(cd Leonov; ./Allrun) -(cd Oldroyd-B; ./Allrun) -(cd S-MDCPP; ./Allrun) -(cd PTT-Linear; ./Allrun) -(cd WhiteMetzner/CarreauYasuda; ./Allrun) -(cd XPP_DE; ./Allrun) -(cd XPP_SE; ./Allrun) From e2baa212429fcf8442a47bcad4b469eb8e3ea603 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 14 Oct 2010 15:31:08 +0100 Subject: [PATCH 04/19] Block matrix update: VectorSpace capability --- .../primitives/VectorSpace/VectorSpaceM.H | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceM.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceM.H index 20703c349..44578134b 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpaceM.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpaceM.H @@ -48,6 +48,20 @@ public: vs.v_[I] = o(vs1.v_[I], vs2.v_[I]); VectorSpaceOps::op(vs, vs1, vs2, o); } + + template + static inline void opVV(V& vs, const V1& vs1, const V2& vs2, Op o) + { + vs.v_[I] = o(vs1.v_[I], vs2.v_[I]); + VectorSpaceOps::opVV(vs, vs1, vs2, o); + } + + template + static inline void SopEqOpVV(S& s, const V1& vs1, const V2& vs2, EqOp eo, Op o) + { + eo(s, o(vs1.v_[I], vs2.v_[I])); + VectorSpaceOps::SopEqOpVV(s, vs1, vs2, eo, o); + } }; @@ -80,4 +94,13 @@ public: template static inline void op(V& vs, const V1&, const V1&, Op) {} + + template + static inline void opVV(V& vs, const V1& vs1, const V2& vs2, Op o) + {} + + template + static inline void SopEqOpVV(S& s, const V1& vs1, const V2& vs2, EqOp eo, Op o) + {} }; + From af259832fa3d4130a317057bcd1cfc9f18460aae Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 14 Oct 2010 15:31:25 +0100 Subject: [PATCH 05/19] OverlapGGI merge: Oliver Borm --- .../constraint/overlapGgi/overlapGgiInterpolation.H | 2 +- .../overlapGgi/overlapGgiPolyPatchTemplates.C | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiInterpolation.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiInterpolation.H index c4c43de47..730026c6d 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiInterpolation.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiInterpolation.H @@ -27,7 +27,7 @@ Class Author Hrvoje Jasak, Wikki Ltd. All rights reserved - Fethi Tekin, All rights reserved, + Fethi Tekin, All rights reserved Description Mass-conservative face interpolation: typedef for stand-alone patch to diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C index cb39c323d..16bec4db1 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C @@ -24,7 +24,7 @@ License Author Hrvoje Jasak, Wikki Ltd. All rights reserved. - Fethi Tekin, All rights reserved. + Fethi Tekin, All rights reserved. fethitekin@gmail.com \*---------------------------------------------------------------------------*/ @@ -43,6 +43,7 @@ Foam::overlapGgiPolyPatch::expandSlaveData(const Field& spf) const const label ncp = shadow().nCopies(); tmp > tef(new Field(ncp*spf.size())); + Field& ef = tef(); label nFaces = 0; @@ -67,11 +68,12 @@ template Foam::tmp > Foam::overlapGgiPolyPatch::expandMasterData(const Field& spf) const { - const scalar masterAngle = angle(); + const scalar masterAngle = shadow().angle(); - const label ncpm = nCopies(); + const label ncpm = shadow().nCopies(); tmp > tef(new Field(ncpm*spf.size())); + Field& ef = tef(); label nFaces = 0; @@ -91,8 +93,6 @@ Foam::overlapGgiPolyPatch::expandMasterData(const Field& spf) const return tef; } - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template @@ -155,5 +155,4 @@ Foam::overlapGgiPolyPatch::interpolate(const tmp >& tpf) const } } - // ************************************************************************* // From 5a13234f1c47a50019d18cbe020647537b516313 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Thu, 14 Oct 2010 22:44:49 +0100 Subject: [PATCH 06/19] Turbo mesh bug fix: assuming constant deltaT --- src/dynamicFvMesh/turboFvMesh/turboFvMesh.C | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/dynamicFvMesh/turboFvMesh/turboFvMesh.C b/src/dynamicFvMesh/turboFvMesh/turboFvMesh.C index dc40662c1..9c7e76b29 100644 --- a/src/dynamicFvMesh/turboFvMesh/turboFvMesh.C +++ b/src/dynamicFvMesh/turboFvMesh/turboFvMesh.C @@ -131,11 +131,14 @@ void Foam::turboFvMesh::calcMovingPoints() const forAll (curFace, pointI) { - //The rotation data is saved within the cell data. For - //non-rotating regions rpm is zero,so mesh movement is - //also zero. The conversion of rotational speed + // The rotation data is saved within the cell data. For + // non-rotating regions rpm is zero, so mesh movement is + // also zero. The conversion of rotational speed + + // Note: deltaT changes during the run: moved to + // turboFvMesh::update(). HJ, 14/Oct/2010 movingPoints[curFace[pointI]] = - vector(0,rpm_*360.0*time().deltaT().value()/60.0, 0); + vector(0, rpm_/60.0*360.0, 0); } } } @@ -213,7 +216,8 @@ bool Foam::turboFvMesh::update() ( csPtr_->globalPosition ( - csPtr_->localPosition(allPoints()) + movingPoints() + csPtr_->localPosition(allPoints()) + + movingPoints()*time().deltaT().value() ) ); From ac79391b25e290f41ea2d32663f1d85562a6703e Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:29:17 +0100 Subject: [PATCH 07/19] Formatting --- .../constraint/overlapGgi/overlapGgiPolyPatchTemplates.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C index cb39c323d..927f29615 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchTemplates.C @@ -37,7 +37,6 @@ template Foam::tmp > Foam::overlapGgiPolyPatch::expandSlaveData(const Field& spf) const { - const scalar slaveAngle = shadow().angle(); const label ncp = shadow().nCopies(); @@ -63,6 +62,7 @@ Foam::overlapGgiPolyPatch::expandSlaveData(const Field& spf) const return tef; } + template Foam::tmp > Foam::overlapGgiPolyPatch::expandMasterData(const Field& spf) const From 0a263adf4b1c3f4b9a021637be207488b6757bb7 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:55:32 +0100 Subject: [PATCH 08/19] Incorporating Swig interface: library changes. Origin: VulaSHAKA project --- .../HashTables/HashPtrTable/HashPtrTable.H | 18 +- .../polyPatches/polyPatch/polyPatch.H | 2 + .../sphericalTensor/sphericalTensor.H | 9 +- .../primitives/VectorSpace/VectorSpace.H | 2 + src/OpenFOAM/primitives/ops/ops.H | 346 +++++++++++++----- .../dynamicFvMesh/dynamicFvMesh.H | 2 + .../fvPatchFields/fvPatchField/fvPatchField.H | 5 +- .../fvsPatchField/fvsPatchField.H | 11 +- .../fvMatrices/fvMatrix/fvMatrix.H | 2 + .../fvMesh/fvPatches/fvPatch/fvPatch.H | 2 + .../psiThermo/basicPsiThermo/basicPsiThermo.H | 4 + .../radiationModel/radiationModel.H | 3 +- .../twoPhaseMixture.C | 10 +- .../viscosityModel/viscosityModel.H | 2 + .../compressible/LES/LESModel/LESModel.H | 2 +- .../compressible/RAS/RASModel/RASModel.H | 8 +- .../turbulenceModel/turbulenceModel.H | 4 +- .../incompressible/LES/LESModel/LESModel.H | 2 +- .../incompressible/RAS/RASModel/RASModel.H | 2 +- 19 files changed, 318 insertions(+), 118 deletions(-) diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H index d8d6b324d..09d906651 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H @@ -65,10 +65,10 @@ template Ostream& operator<< /*---------------------------------------------------------------------------*\ - Class HashPtrTable Declaration + Class HashPtrTable Declaration \*---------------------------------------------------------------------------*/ -template +template class HashPtrTable : public HashTable @@ -89,7 +89,7 @@ public: // Constructors //- Construct given initial table size - HashPtrTable(label size = 100); + HashPtrTable(const label size = 128); //- Construct from Istream using given Istream constructor class template @@ -128,23 +128,19 @@ public: // IOstream Operators - friend Istream& operator>> - #ifndef __CINT__ - - #endif +#ifndef SWIG + friend Istream& operator>> ( Istream&, HashPtrTable& ); - friend Ostream& operator<< - #ifndef __CINT__ - - #endif + friend Ostream& operator<< ( Ostream&, const HashPtrTable& ); +#endif }; diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index 2ebf7aac9..98b43c005 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -228,6 +228,7 @@ public: // Declare run-time constructor selection tables +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -256,6 +257,7 @@ public: ), (name, dict, index, bm) ); +#endif // Constructors diff --git a/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.H b/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.H index 1710a7e40..2cb62a151 100644 --- a/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.H +++ b/src/OpenFOAM/primitives/SphericalTensor/sphericalTensor/sphericalTensor.H @@ -48,11 +48,12 @@ namespace Foam typedef SphericalTensor sphericalTensor; -// Identity tensor -static const sphericalTensor I(1); -static const sphericalTensor oneThirdI(1.0/3.0); -static const sphericalTensor twoThirdsI(2.0/3.0); +// Identity tensor +static const sphericalTensor I; + +static const sphericalTensor oneThirdI; +static const sphericalTensor twoThirdsI; //- Specify data associated with sphericalTensor type are contiguous diff --git a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H index 07272207c..560c8f502 100644 --- a/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H +++ b/src/OpenFOAM/primitives/VectorSpace/VectorSpace.H @@ -136,6 +136,7 @@ public: // IOstream Operators +#ifndef SWIG friend Istream& operator>> ( Istream&, @@ -147,6 +148,7 @@ public: Ostream&, const VectorSpace& ); +#endif }; diff --git a/src/OpenFOAM/primitives/ops/ops.H b/src/OpenFOAM/primitives/ops/ops.H index a1375e296..4bbedc525 100644 --- a/src/OpenFOAM/primitives/ops/ops.H +++ b/src/OpenFOAM/primitives/ops/ops.H @@ -32,6 +32,11 @@ Description combined using the given combination function and the result is broadcast to all nodes +Note: + Format of this file has considerably changed to remove cpp pre-processor + definition in order to help Swig with parsing in. Implemented by + Alexey Petrov; merged by HJ, 14/Oct/2010 + \*---------------------------------------------------------------------------*/ #ifndef ops_H @@ -42,103 +47,272 @@ Description namespace Foam { -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template +class eqOp2 +{ public: void operator()(T1& x, const T2& y) const { x = y; } }; -#define EqOp(opName, op) \ - \ -template \ -class opName##Op2 \ -{ \ -public: \ - \ - void operator()(T1& x, const T2& y) const \ - { \ - op; \ - } \ -}; \ - \ -template \ -class opName##Op \ -{ \ -public: \ - \ - void operator()(T& x, const T& y) const \ - { \ - op; \ - } \ -}; +template +class eqOp +{ public: void operator()(T& x, const T& y) const { x = y; } }; -EqOp(eq, x = y) -EqOp(plusEq, x += y) -EqOp(minusEq, x -= y) -EqOp(multiplyEq, x *= y) -EqOp(divideEq, x /= y) -EqOp(eqMag, x = mag(y)) -EqOp(plusEqMagSqr, x += magSqr(y)) -EqOp(maxEq, x = max(x, y)) -EqOp(minEq, x = min(x, y)) -EqOp(andEq, x = (x && y)) -EqOp(orEq, x = (x || y)) +template +class plusEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x += y; } }; -EqOp(eqMinus, x = -y) +template + class plusEqOp +{ public: void operator()(T& x, const T& y) const { x += y; } }; -#undef EqOp +template + class minusEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x -= y; } }; + +template +class minusEqOp +{ public: void operator()(T& x, const T& y) const { x -= y; } }; + +template +class multiplyEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x *= y; } }; + +template +class multiplyEqOp +{ public: void operator()(T& x, const T& y) const { x *= y; } }; + +template +class divideEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x /= y; } }; + +template +class divideEqOp +{ public: void operator()(T& x, const T& y) const { x /= y; } }; + +template +class eqMagOp2 +{ public: void operator()(T1& x, const T2& y) const { x = mag(y); } }; + +template +class eqMagOp +{ public: void operator()(T& x, const T& y) const { x = mag(y); } }; + +template +class plusEqMagSqrOp2 +{ public: void operator()(T1& x, const T2& y) const { x += magSqr(y); } }; + +template +class plusEqMagSqrOp +{ public: void operator()(T& x, const T& y) const { x += magSqr(y); } }; + +template +class maxEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x = max(x, y); } }; + +template +class maxEqOp +{ public: void operator()(T& x, const T& y) const { x = max(x, y); } }; + +template +class minEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x = min(x, y); } }; + +template +class minEqOp +{ public: void operator()(T& x, const T& y) const { x = min(x, y); } }; + +template +class andEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x = (x && y); } }; + +template +class andEqOp +{ public: void operator()(T& x, const T& y) const { x = (x && y); } }; + +template +class orEqOp2 +{ public: void operator()(T1& x, const T2& y) const { x = (x || y); } }; + +template +class orEqOp +{ public: void operator()(T& x, const T& y) const { x = (x || y); } }; + +template +class eqMinusOp2 +{ public: void operator()(T1& x, const T2& y) const { x = -y; } }; + +template +class eqMinusOp +{ public: void operator()(T& x, const T& y) const { x = -y; } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define Op(opName, op) \ - \ -template \ -class opName##Op3 \ -{ \ -public: \ - \ - T operator()(const T1& x, const T2& y) const \ - { \ - return op; \ - } \ -}; \ - \ -template \ -class opName##Op2 \ -{ \ -public: \ - \ - T1 operator()(const T1& x, const T2& y) const \ - { \ - return op; \ - } \ -}; \ - \ -template \ -class opName##Op \ -{ \ -public: \ - \ - T operator()(const T& x, const T& y) const \ - { \ - return op; \ - } \ -}; +template +class sumOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x + y; } }; -Op(sum, x + y) +template +class sumOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x + y; } }; -Op(plus, x + y) -Op(minus, x - y) -Op(multiply, x * y) -Op(divide, x / y) -Op(cmptMultiply, cmptMultiply(x, y)) -Op(cmptDivide, cmptDivide(x, y)) -Op(stabilise, stabilise(x, y)) -Op(max, max(x, y)) -Op(min, min(x, y)) -Op(minMod, minMod(x, y)) -Op(and, x && y) -Op(or, x || y) -Op(eqEq, x == y) +template +class sumOp +{ public: T operator()(const T& x, const T& y) const { return x + y; } }; -#undef Op +template +class plusOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x + y; } }; + +template +class plusOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x + y; } }; + +template +class plusOp +{ public: T operator()(const T& x, const T& y) const { return x + y; } }; + +template +class minusOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x - y; } }; + +template +class minusOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x - y; } }; + +template +class minusOp +{ public: T operator()(const T& x, const T& y) const { return x - y; } }; + +template +class multiplyOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x * y; } }; + +template +class multiplyOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x * y; } }; + +template +class multiplyOp +{ public: T operator()(const T& x, const T& y) const { return x * y; } }; + +template +class divideOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x / y; } }; + +template +class divideOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x / y; } }; + +template +class divideOp +{ public: T operator()(const T& x, const T& y) const { return x / y; } }; + +template +class cmptMultiplyOp3 +{ public: T operator()(const T1& x, const T2& y) const { return cmptMultiply(x, y); } }; + +template +class cmptMultiplyOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return cmptMultiply(x, y); } }; + +template +class cmptMultiplyOp +{ public: T operator()(const T& x, const T& y) const { return cmptMultiply(x, y); } }; + +template +class cmptDivideOp3 +{ public: T operator()(const T1& x, const T2& y) const { return cmptDivide(x, y); } }; + +template +class cmptDivideOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return cmptDivide(x, y); } }; + +template +class cmptDivideOp +{ public: T operator()(const T& x, const T& y) const { return cmptDivide(x, y); } }; + +template +class stabiliseOp3 +{ public: T operator()(const T1& x, const T2& y) const { return stabilise(x, y); } }; + +template +class stabiliseOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return stabilise(x, y); } }; + +template +class stabiliseOp +{ public: T operator()(const T& x, const T& y) const { return stabilise(x, y); } }; + +template +class maxOp3 +{ public: T operator()(const T1& x, const T2& y) const { return max(x, y); } }; + +template +class maxOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return max(x, y); } }; + +template +class maxOp +{ public: T operator()(const T& x, const T& y) const { return max(x, y); } }; + +template +class minOp3 +{ public: T operator()(const T1& x, const T2& y) const { return min(x, y); } }; + +template +class minOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return min(x, y); } }; + +template +class minOp +{ public: T operator()(const T& x, const T& y) const { return min(x, y); } }; + +template +class minModOp3 +{ public: T operator()(const T1& x, const T2& y) const { return minMod(x, y); } }; + +template +class minModOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return minMod(x, y); } }; + +template +class minModOp +{ public: T operator()(const T& x, const T& y) const { return minMod(x, y); } }; + +template +class andOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x && y; } }; + +template +class andOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x && y; } }; + +template +class andOp +{ public: T operator()(const T& x, const T& y) const { return x && y; } }; + +template +class orOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x || y; } }; + +template +class orOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x || y; } }; + +template +class orOp +{ public: T operator()(const T& x, const T& y) const { return x || y; } }; + +template +class eqEqOp3 +{ public: T operator()(const T1& x, const T2& y) const { return x == y; } }; + +template +class eqEqOp2 +{ public: T1 operator()(const T1& x, const T2& y) const { return x == y; } }; + +template +class eqEqOp +{ public: T operator()(const T& x, const T& y) const { return x == y; } }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H index cdcde49c5..b6a607922 100644 --- a/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H +++ b/src/dynamicFvMesh/dynamicFvMesh/dynamicFvMesh.H @@ -71,6 +71,7 @@ public: // Declare run-time constructor selection table +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -79,6 +80,7 @@ public: (const IOobject& io), (io) ); +#endif // Constructors diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index e9f8d27e9..8563e00f4 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -114,6 +114,7 @@ public: // Declare run-time constructor selection tables +#ifndef SWIG declareRunTimeSelectionTable ( tmp, @@ -152,7 +153,7 @@ public: ), (p, iF, dict) ); - +#endif // Constructors @@ -469,7 +470,9 @@ public: // Ostream operator +#ifndef SWIG friend Ostream& operator<< (Ostream&, const fvPatchField&); +#endif }; diff --git a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H index e3f6f7e97..cbe1ac818 100644 --- a/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H +++ b/src/finiteVolume/fields/fvsPatchFields/fvsPatchField/fvsPatchField.H @@ -102,6 +102,7 @@ public: // Declare run-time constructor selection tables +#ifndef SWIG declareRunTimeSelectionTable ( tmp, @@ -140,7 +141,7 @@ public: ), (p, iF, dict) ); - +#endif // Constructors @@ -354,7 +355,13 @@ public: // Ostream operator - friend Ostream& operator<< (Ostream&, const fvsPatchField&); +#ifndef SWIG + friend Ostream& operator<< + ( + Ostream&, + const fvsPatchField& + ); +#endif }; diff --git a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H index c960e479c..5f9cda21f 100644 --- a/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H +++ b/src/finiteVolume/fvMatrices/fvMatrix/fvMatrix.H @@ -447,6 +447,7 @@ public: // Friend operators +#ifndef SWIG friend tmp > operator& ( @@ -483,6 +484,7 @@ public: Ostream&, const fvMatrix& ); +#endif }; diff --git a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H index 1bd35d5f2..16ed58608 100644 --- a/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/fvPatch/fvPatch.H @@ -113,6 +113,7 @@ public: // Declare run-time constructor selection tables +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -121,6 +122,7 @@ public: (const polyPatch& patch, const fvBoundaryMesh& bm), (patch, bm) ); +#endif // Constructors diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H index e085cfcf8..f779ef58e 100644 --- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/basicPsiThermo.H @@ -69,6 +69,8 @@ public: //- Declare run-time constructor selection table + +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -77,6 +79,8 @@ public: (const fvMesh& mesh), (mesh) ); +#endif + // Constructors diff --git a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H index 806880810..e884a8123 100644 --- a/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiation/radiationModel/radiationModel/radiationModel.H @@ -121,6 +121,7 @@ public: // Declare runtime constructor selection table +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -131,7 +132,7 @@ public: ), (T) ); - +#endif // Constructors diff --git a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C index cb6e25b70..2773c6970 100644 --- a/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C +++ b/src/transportModels/incompressible/incompressibleTwoPhaseMixture/twoPhaseMixture.C @@ -131,11 +131,11 @@ tmp twoPhaseMixture::rho() const { volScalarField limitedAlpha1 = min(max(alpha1_, scalar(0)), scalar(1)); - return tmp + return tmp ( new volScalarField ( - "rho", + "rho_twoPhaseMixture", limitedAlpha1*rho1_ + (scalar(1) - limitedAlpha1)*rho2_ ) @@ -151,7 +151,7 @@ tmp twoPhaseMixture::mu() const ( new volScalarField ( - "mu", + "mu_twoPhaseMixture", limitedAlpha1*rho1_*nuModel1_->nu() + (scalar(1) - limitedAlpha1)*rho2_*nuModel2_->nu() ) @@ -168,7 +168,7 @@ tmp twoPhaseMixture::muf() const ( new surfaceScalarField ( - "muf", + "muf_twoPhaseMixture", alpha1f*rho1_*fvc::interpolate(nuModel1_->nu()) + (scalar(1) - alpha1f)*rho2_*fvc::interpolate(nuModel2_->nu()) ) @@ -185,7 +185,7 @@ tmp twoPhaseMixture::nuf() const ( new surfaceScalarField ( - "nuf", + "nuf_twoPhaseMixture", ( alpha1f*rho1_*fvc::interpolate(nuModel1_->nu()) + (scalar(1) - alpha1f)*rho2_*fvc::interpolate(nuModel2_->nu()) diff --git a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.H b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.H index 6f5fcbce8..58a2dce00 100644 --- a/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.H +++ b/src/transportModels/incompressible/viscosityModels/viscosityModel/viscosityModel.H @@ -92,6 +92,7 @@ public: // Declare run-time constructor selection table +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -105,6 +106,7 @@ public: ), (name, viscosityProperties, U, phi) ); +#endif // Selectors diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index b0d4f4ee3..a7d2b963a 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -144,7 +144,7 @@ public: // Selectors //- Return a reference to the selected LES model - static autoPtr New + static autoPtr New ( const volScalarField& rho, const volVectorField& U, diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index 341406ab1..f00a8f808 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -136,6 +136,7 @@ public: // Declare run-time constructor selection table +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -149,7 +150,7 @@ public: ), (rho, U, phi, thermoPhysicalModel) ); - +#endif // Constructors @@ -167,7 +168,7 @@ public: // Selectors //- Return a reference to the selected turbulence model - static autoPtr New + static autoPtr New ( const volScalarField& rho, const volVectorField& U, @@ -176,8 +177,7 @@ public: ); - // Destructor - + //- Destructor virtual ~RASModel() {} diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H index d843a55bc..4f90bf391 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H @@ -104,6 +104,7 @@ public: // Declare run-time constructor selection table +#ifndef SWIG declareRunTimeNewSelectionTable ( autoPtr, @@ -117,6 +118,7 @@ public: ), (rho, U, phi, thermoPhysicalModel) ); +#endif // Constructors @@ -134,7 +136,7 @@ public: // Selectors //- Return a reference to the selected turbulence model - static autoPtr New + static autoPtr New ( const volScalarField& rho, const volVectorField& U, diff --git a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H index 1f22db2dc..4682a9cc2 100644 --- a/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/incompressible/LES/LESModel/LESModel.H @@ -142,7 +142,7 @@ public: // Selectors //- Return a reference to the selected LES model - static autoPtr New + static autoPtr New ( const volVectorField& U, const surfaceScalarField& phi, diff --git a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H index 37ab64e76..d1a196327 100644 --- a/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/incompressible/RAS/RASModel/RASModel.H @@ -159,7 +159,7 @@ public: // Selectors //- Return a reference to the selected RAS model - static autoPtr New + static autoPtr New ( const volVectorField& U, const surfaceScalarField& phi, From f9f34b6985c6bc8e7eb059d8b61a18ad86a63c9f Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:55:43 +0100 Subject: [PATCH 09/19] Incorporating Swig interface: library changes. Origin: VulaSHAKA project --- .../containers/HashTables/HashTable/HashTable.H | 2 ++ .../containers/Lists/DynamicList/DynamicList.H | 2 ++ .../containers/Lists/FixedList/FixedList.H | 6 ++++++ src/OpenFOAM/containers/Lists/List/List.H | 5 +++-- src/OpenFOAM/containers/Lists/PtrList/PtrList.H | 2 ++ src/OpenFOAM/containers/Lists/UList/UList.H | 3 +++ src/OpenFOAM/containers/NamedEnum/NamedEnum.H | 3 +++ src/OpenFOAM/db/IOobjectList/IOobjectList.H | 4 ++++ src/OpenFOAM/db/IOstreams/token/token.H | 4 +++- src/OpenFOAM/db/objectRegistry/objectRegistry.H | 4 ++++ .../dimensionedType/dimensionedType.H | 2 ++ .../DimensionedField/DimensionedField.H | 7 +++++++ .../fields/FieldFields/FieldField/FieldField.H | 2 ++ src/OpenFOAM/fields/Fields/Field/Field.H | 2 ++ .../GeometricField/GeometricField.H | 16 +++++++++++----- 15 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 51c916e9b..649e7cf91 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -417,6 +417,7 @@ public: // IOstream Operator +#ifndef SWIG friend Istream& operator>> ( Istream&, @@ -428,6 +429,7 @@ public: Ostream&, const HashTable& ); +#endif private: diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H index 81598a269..5076a6dad 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H @@ -208,6 +208,7 @@ public: // IOstream operators +#ifndef SWIG // Write DynamicList to Ostream. friend Ostream& operator<< ( @@ -221,6 +222,7 @@ public: Istream&, DynamicList& ); +#endif }; diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H index 111593561..27d0af294 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H @@ -71,8 +71,11 @@ template class SLList; template class FixedList { +#ifndef SWIG //- Size must be positive (non-zero) and also fit as a signed value StaticAssert(Size && Size <= INT_MAX); +#endif + // Private data @@ -331,6 +334,8 @@ public: // IOstream operators //- Read List from Istream, discarding contents of existing List. + +#ifndef SWIG friend Istream& operator>> (Istream&, FixedList&); @@ -340,6 +345,7 @@ public: Ostream&, const FixedList& ); +#endif }; diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H index 61d999bf0..e4452ef9c 100644 --- a/src/OpenFOAM/containers/Lists/List/List.H +++ b/src/OpenFOAM/containers/Lists/List/List.H @@ -232,9 +232,10 @@ public: // Istream operator +#ifndef SWIG //- Read List from Istream, discarding contents of existing List. - friend Istream& operator>> - (Istream&, List&); + friend Istream& operator>> (Istream&, List&); +#endif }; diff --git a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H index 49fd177af..cebb0f495 100644 --- a/src/OpenFOAM/containers/Lists/PtrList/PtrList.H +++ b/src/OpenFOAM/containers/Lists/PtrList/PtrList.H @@ -295,11 +295,13 @@ public: // IOstream operator +#ifndef SWIG //- Read List from Istream, discarding contents of existing List. friend Istream& operator>> (Istream&, PtrList&); // Write List to Ostream. friend Ostream& operator<< (Ostream&, const PtrList&); +#endif }; diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index b15cd71a8..184cee2df 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -321,13 +321,16 @@ public: // Ostream operator // Write UList to Ostream. +#ifndef SWIG friend Ostream& operator<< ( Ostream&, const UList& ); +#endif }; + template void sort(UList&); diff --git a/src/OpenFOAM/containers/NamedEnum/NamedEnum.H b/src/OpenFOAM/containers/NamedEnum/NamedEnum.H index b113a5a40..6a92823bd 100644 --- a/src/OpenFOAM/containers/NamedEnum/NamedEnum.H +++ b/src/OpenFOAM/containers/NamedEnum/NamedEnum.H @@ -53,8 +53,11 @@ class NamedEnum : public HashTable { +#ifndef SWIG //- nEnum must be positive (non-zero) StaticAssert(nEnum > 0); +#endif + // Private Member Functions diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.H b/src/OpenFOAM/db/IOobjectList/IOobjectList.H index ff1cc3994..ef142b217 100644 --- a/src/OpenFOAM/db/IOobjectList/IOobjectList.H +++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.H @@ -50,7 +50,11 @@ namespace Foam class IOobjectList : +#ifndef SWIG public HashPtrTable +#else + public HashPtrTable +#endif { // Private Member Functions diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index 999459112..39cd176e2 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -209,6 +209,8 @@ public: //- A templated class for holding compound tokens + +#ifndef SWIG template class Compound : @@ -235,7 +237,7 @@ public: operator<<(os, static_cast(*this)); } }; - +#endif //- Static undefined token static token undefinedToken; diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.H b/src/OpenFOAM/db/objectRegistry/objectRegistry.H index 3dd8573f4..d11d0c429 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.H +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.H @@ -51,7 +51,11 @@ namespace Foam class objectRegistry : public regIOobject, +#ifndef SWIG public HashTable +#else + public HashTable +#endif { // Private Data diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H index 3cb95b603..ca48aa08c 100644 --- a/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H +++ b/src/OpenFOAM/dimensionedTypes/dimensionedType/dimensionedType.H @@ -174,11 +174,13 @@ public: // IOstream operators +#ifndef SWIG friend Istream& operator>> (Istream&, dimensioned&); friend Ostream& operator<< (Ostream&, const dimensioned&); +#endif }; diff --git a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H index d65e876a0..19e4ae5ef 100644 --- a/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H +++ b/src/OpenFOAM/fields/DimensionedFields/DimensionedField/DimensionedField.H @@ -162,10 +162,13 @@ public: ); //- Construct by transferring the DimensionedField + +#ifndef SWIG DimensionedField ( const Xfer >& ); +#endif //- Construct as copy of tmp deleting argument # ifdef ConstructFromTmp @@ -198,11 +201,13 @@ public: ); //- Construct by transferring the DimensionedField with a new name +#ifndef SWIG DimensionedField ( const word& newName, const Xfer >& ); +#endif //- Construct as copy resetting name # ifdef ConstructFromTmp @@ -309,6 +314,7 @@ public: // Ostream Operators +#ifndef SWIG friend Ostream& operator<< ( Ostream&, @@ -320,6 +326,7 @@ public: Ostream&, const tmp >& ); +#endif }; diff --git a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.H b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.H index e8bbbf06f..56bc4fe74 100644 --- a/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.H +++ b/src/OpenFOAM/fields/FieldFields/FieldField/FieldField.H @@ -189,6 +189,7 @@ public: // IOstream operators +#ifndef SWIG friend Ostream& operator<< ( Ostream&, @@ -200,6 +201,7 @@ public: Ostream&, const tmp >& ); +#endif }; diff --git a/src/OpenFOAM/fields/Fields/Field/Field.H b/src/OpenFOAM/fields/Fields/Field/Field.H index dba91805f..9224a99db 100644 --- a/src/OpenFOAM/fields/Fields/Field/Field.H +++ b/src/OpenFOAM/fields/Fields/Field/Field.H @@ -339,11 +339,13 @@ public: // IOstream operators +#ifndef SWIG friend Ostream& operator<< (Ostream&, const Field&); friend Ostream& operator<< (Ostream&, const tmp >&); +#endif }; diff --git a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H index e66d5b99e..4ab3a31fc 100644 --- a/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H +++ b/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H @@ -296,7 +296,8 @@ public: const word& patchFieldType=PatchField::calculatedType() ); - //- Constructor given IOobject, mesh, dimensioned and patch types. + //- Constructor given IOobject, mesh, dimensioned + // and patch types. GeometricField ( const IOobject&, @@ -306,6 +307,8 @@ public: ); //- Constructor from components + +#if ( !defined(SWIG) || (SWIG_VERSION > 0x010340) ) GeometricField ( const IOobject&, @@ -314,6 +317,7 @@ public: const Field&, const PtrList >& ); +#endif //- Construct and read given IOobject GeometricField @@ -345,12 +349,12 @@ public: ); //- Construct as copy of tmp deleting argument - #ifdef ConstructFromTmp +# ifdef ConstructFromTmp GeometricField ( const tmp >& ); - #endif +# endif //- Construct as copy resetting IO parameters GeometricField @@ -367,13 +371,13 @@ public: ); //- Construct as copy resetting name - #ifdef ConstructFromTmp +# ifdef ConstructFromTmp GeometricField ( const word& newName, const tmp >& ); - #endif +# endif //- Construct as copy resetting IO parameters and patch type GeometricField @@ -547,6 +551,7 @@ public: // Ostream operators +#ifndef SWIG friend Ostream& operator<< ( Ostream&, @@ -558,6 +563,7 @@ public: Ostream&, const tmp >& ); +#endif }; From 291ffd4eeddcf72d2f9c4847633316945f4675a7 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:55:56 +0100 Subject: [PATCH 10/19] Incorporating Swig interface: library changes. Origin: VulaSHAKA project --- .../coordinateRotation/coordinateRotation.H | 7 +++++++ src/OpenFOAM/coordinateSystems/coordinateSystem.H | 5 +++++ .../interpolatePointToCell/interpolatePointToCell.H | 2 +- .../incompressible/turbulenceModel/turbulenceModel.H | 4 +++- 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H b/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H index 2e95a146c..d2c653665 100644 --- a/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H +++ b/src/OpenFOAM/coordinateSystems/coordinateRotation/coordinateRotation.H @@ -139,9 +139,15 @@ public: //- Construct from dictionary coordinateRotation(const dictionary&); + //- Return clone + autoPtr clone() const + { + return autoPtr(new coordinateRotation(*this)); + } // Declare run-time constructor selection table +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -152,6 +158,7 @@ public: ), (dict) ); +#endif // Selectors diff --git a/src/OpenFOAM/coordinateSystems/coordinateSystem.H b/src/OpenFOAM/coordinateSystems/coordinateSystem.H index 51dd75b1c..4f852e038 100644 --- a/src/OpenFOAM/coordinateSystems/coordinateSystem.H +++ b/src/OpenFOAM/coordinateSystems/coordinateSystem.H @@ -166,6 +166,7 @@ class coordinateSystem //- Global-to-Local transformation tensor tensor Rtr_; + protected: // Protected Member Functions @@ -249,8 +250,10 @@ public: return autoPtr(new coordinateSystem(*this)); } + // Declare run-time constructor selection table +#ifndef SWIG declareRunTimeSelectionTable ( autoPtr, @@ -275,6 +278,8 @@ public: ), (name, origin, cr) ); +#endif + // Selectors diff --git a/src/OpenFOAM/interpolations/interpolatePointToCell/interpolatePointToCell.H b/src/OpenFOAM/interpolations/interpolatePointToCell/interpolatePointToCell.H index abb569f09..90958ad4b 100644 --- a/src/OpenFOAM/interpolations/interpolatePointToCell/interpolatePointToCell.H +++ b/src/OpenFOAM/interpolations/interpolatePointToCell/interpolatePointToCell.H @@ -47,7 +47,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Interpolate field to cell center. +// Interpolate field to cell center template Type interpolatePointToCell ( diff --git a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H index 6ca9028a5..3d9966d7f 100644 --- a/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/incompressible/turbulenceModel/turbulenceModel.H @@ -102,6 +102,7 @@ public: // Declare run-time New selection table +#ifndef SWIG declareRunTimeNewSelectionTable ( autoPtr, @@ -114,6 +115,7 @@ public: ), (U, phi, lamTransportModel) ); +#endif // Constructors @@ -130,7 +132,7 @@ public: // Selectors //- Return a reference to the selected turbulence model - static autoPtr New + static autoPtr New ( const volVectorField& U, const surfaceScalarField& phi, From e15c8da28cad552dade9feb409a27ae762b9fb58 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:56:02 +0100 Subject: [PATCH 11/19] Updated format of rotation for consistency with coordinate systems --- src/OpenFOAM/algorithms/rotation/RodriguesRotation.C | 11 +++++++++-- src/OpenFOAM/algorithms/rotation/RodriguesRotation.H | 3 ++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/OpenFOAM/algorithms/rotation/RodriguesRotation.C b/src/OpenFOAM/algorithms/rotation/RodriguesRotation.C index 935b8ceae..67af64925 100644 --- a/src/OpenFOAM/algorithms/rotation/RodriguesRotation.C +++ b/src/OpenFOAM/algorithms/rotation/RodriguesRotation.C @@ -32,11 +32,18 @@ License Foam::tensor Foam::RodriguesRotation ( const vector& rotationAxis, - const scalar& rotationAngle + const scalar& rotationAngle, + const bool inDegrees ) { tensor rotTensor; - scalar theta = rotationAngle*mathematicalConstant::pi/180.0; + scalar theta = rotationAngle; + + if (inDegrees) + { + theta *= mathematicalConstant::pi/180.0; + } + scalar sinTheta = sin(theta); scalar cosTheta = cos(theta); scalar oneMinusCosTheta = 1.0 - cosTheta; diff --git a/src/OpenFOAM/algorithms/rotation/RodriguesRotation.H b/src/OpenFOAM/algorithms/rotation/RodriguesRotation.H index 50fb04695..cbd598741 100644 --- a/src/OpenFOAM/algorithms/rotation/RodriguesRotation.H +++ b/src/OpenFOAM/algorithms/rotation/RodriguesRotation.H @@ -53,7 +53,8 @@ namespace Foam tensor RodriguesRotation ( const vector& rotationAxis, - const scalar& rotationAngle + const scalar& rotationAngle, + const bool inDegrees = true ); From 4c38814d3f66e2a3727a40b92aa7a5b2349c5b00 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:56:19 +0100 Subject: [PATCH 12/19] Messaging active only on debug --- .../GGIInterpolationWeights.C | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationWeights.C b/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationWeights.C index d2cefbc8b..8967adc08 100644 --- a/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationWeights.C +++ b/src/OpenFOAM/interpolations/GGIInterpolation/GGIInterpolationWeights.C @@ -85,7 +85,10 @@ void GGIInterpolation::calcAddressing() const << abort(FatalError); } - Info << "Evaluation of GGI weighting factors:" << endl; + if (debug) + { + Info << "Evaluation of GGI weighting factors:" << endl; + } // Create the dynamic lists to hold the addressing @@ -475,8 +478,6 @@ void GGIInterpolation::calcAddressing() const { rescaleWeightingFactors(); } - - Info << endl; } @@ -569,12 +570,17 @@ void GGIInterpolation::rescaleWeightingFactors() const } } - if (saW.size() > 0 && maW.size() > 0) + if (debug) { - Info<< " Largest slave weighting factor correction : " << largestSWC - << " average: " << sumSWC/saW.size() << nl - << " Largest master weighting factor correction: " << largestMWC - << " average: " << sumMWC/maW.size() << endl; + if (saW.size() > 0 && maW.size() > 0) + { + Info<< " Largest slave weighting factor correction : " + << largestSWC + << " average: " << sumSWC/saW.size() << nl + << " Largest master weighting factor correction: " + << largestMWC + << " average: " << sumMWC/maW.size() << endl; + } } } From 1d67c3b2bd14c6926d5c71e81bd6641b8625a69f Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:56:26 +0100 Subject: [PATCH 13/19] Bug fix: update surface normal velocity on a moving mesh: normal may be changing --- .../surfaceNormalFixedValueFvPatchVectorField.C | 12 ++++++++++++ .../surfaceNormalFixedValueFvPatchVectorField.H | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C index 3b0efb703..86248accb 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C @@ -129,6 +129,18 @@ void surfaceNormalFixedValueFvPatchVectorField::rmap } +void surfaceNormalFixedValueFvPatchVectorField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Bug fix: update for moving mesh. HJ, 15/Oct/2010 + operator==(refValue_*patch().nf()); +} + + void surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const { fvPatchVectorField::write(os); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H index 0de2d9602..890aa1fbc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.H @@ -151,6 +151,11 @@ public: ); + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + //- Write virtual void write(Ostream&) const; }; From 972dadc41c95d9c25407ae8e56375471cf0203fa Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:56:34 +0100 Subject: [PATCH 14/19] Clean-up and update: overlap GGI --- .../constraint/overlapGgi/overlapGgiPolyPatchGeometry.C | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchGeometry.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchGeometry.C index a3355c798..b9ae5915e 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchGeometry.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/overlapGgi/overlapGgiPolyPatchGeometry.C @@ -54,8 +54,6 @@ void Foam::overlapGgiPolyPatch::calcExpandedMaster() const // Create expanded master patch const label ncpm = nCopies(); - Info << "Number of master copies: " << ncpm << endl; - // Create expanded master points and faces const polyPatch& master = boundaryMesh()[index()]; const pointField& masterLocalPoints = master.localPoints(); @@ -64,8 +62,6 @@ void Foam::overlapGgiPolyPatch::calcExpandedMaster() const const scalar masterAngle = angle(); - Info << "Master Angle is: " << masterAngle << endl; - // Transform points label nPoints_master = 0; @@ -156,8 +152,6 @@ void Foam::overlapGgiPolyPatch::calcExpandedSlave() const // Create expanded patch const label ncp = shadow().nCopies(); - Info << "Number of slave copies: " << ncp << endl; - // Create expanded points and faces const polyPatch& slave = boundaryMesh()[shadowIndex()]; const pointField& slaveLocalPoints = slave.localPoints(); From fb740f2251877d2004e28df44bcae27bdb0005fa Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:57:05 +0100 Subject: [PATCH 15/19] Added further instructions --- testHarness/README.txt | 69 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/testHarness/README.txt b/testHarness/README.txt index ded40bade..21eb3e02c 100644 --- a/testHarness/README.txt +++ b/testHarness/README.txt @@ -14,3 +14,72 @@ OSIG/TurboMachinery : Test harness for the TurboMachinery OSIG. See the file OSI Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved. + + +1: Select your git branch of choice: ie: + + git checkout master # For Hrv master branch + + +2: Make sure your OpenFOAM environment is properly configured to run OpenFOAM. + + +3: The minimal cmake version number for running the test loop is 2.8.0. Make sure you are there. + + +4: Make sure you have the test harness scripts available under your git branch; + otherwise, you will need to fetch this from Hrv's master branch, and merge it into yours + + ls $WM_PROJECT_DIR/testHarness # Checking availability of testHarness under this branch + + +5: move to the runDir directory for the OpenFOAM test harness + + cd $WM_PROJECT_DIR/testHarness/OpenFOAM/1.6-ext/runDir + + +6: Normally, if using the master branch, everything should already be setup for you to run the test harness. + Still, I recommand always checking that these two important files are up-to-date: + + cp ../CMakeFiles/CMakeLists.txt $WM_PROJECT_DIR + cp ../CMakeFiles/CTestConfig.cmake.openfoam-extend_of-1.6-ext-testing $WM_PROJECT_DIR/CTestConfig.cmake + + +7: Next, running the test loop is pretty simple: + + cd $WM_PROJECT_DIR/testHarness/OpenFOAM/1.6-ext/runDir # you should already be there... + ./Allclean + ./Allrun_Experimental + + +8: The results will be published on the CDash dashboard on openfoam-extend. + + To see your results: + URL : http://openfoam-extend.sourceforge.net/CDash/index.php?project=OpenFOAM-1.6-ext_testing + Username : of-1.6-ext@of-extend.cdash + Password : onepasswd4all + + +9: You can customize your system identifier on the dashboard using the environment variable $CDASH_SUBMIT_LOCAL_HOST_ID. + Otherwise, the fully qualified name of your system will be used. + + A good customization idea would be to add the name of your git branch in your system ID. + I will probably modify my scripts to add this information automagically. + + NB: Please no "forward slash" or "/" in the system ID; it looks like CDash will choke on this. + + +10: In general, see the file $WM_PROJECT_DIR/testHarness/OpenFOAM/1.6-ext/README.txt for the necessary information about running the + test loop. + (NB: I just found out a couple of mistakes in that file, so please use this message for now as per instructions for running the test loop. + I will fix this shortly. Sorry.) + + +11: As more people will start using these basic steps, I will supply more information about some other features that are available with + the test loop. + + But I need to see those baby steps first... :) + + +12: Please do not hesitate to report any problems, comments, suggestions about the test loop. + This stuff runs great on my systems, but it needs to run even better on yours. From 05f2682821ac12cf91d7dd14b391b3f178a508c1 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:57:30 +0100 Subject: [PATCH 16/19] Tutorial update --- .../icoDyMFoam/movingConeMotion/system/controlDict | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict index eeb9f17c4..d9f9f3a04 100644 --- a/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict +++ b/tutorials/incompressible/icoDyMFoam/movingConeMotion/system/controlDict @@ -30,7 +30,7 @@ deltaT 2e-05; writeControl timeStep; -writeInterval 1; +writeInterval 10; purgeWrite 0; From 727aea2c9bbffd3eaf8aaced5435944f88c7d9cd Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 19:57:53 +0100 Subject: [PATCH 17/19] Tutorial update --- .../XiFoam/les/pitzDaily/constant/polyMesh/boundary | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tutorials/combustion/XiFoam/les/pitzDaily/constant/polyMesh/boundary b/tutorials/combustion/XiFoam/les/pitzDaily/constant/polyMesh/boundary index 9bc9b451f..caa524867 100644 --- a/tutorials/combustion/XiFoam/les/pitzDaily/constant/polyMesh/boundary +++ b/tutorials/combustion/XiFoam/les/pitzDaily/constant/polyMesh/boundary @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6.x | -| \\ / A nd | Web: www.OpenFOAM.org | +| \\ / F ield | OpenFOAM Extend Project: Open source CFD | +| \\ / O peration | Version: 1.6-ext | +| \\ / A nd | Web: www.extend-project.de | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile From cabe00e1778eaff52d036ef51ba26e46f6ed2404 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 22:24:50 +0100 Subject: [PATCH 18/19] Changes from Martin Beaudoin: test loop --- CMakeLists.txt | 47 ++++++++++++------- .../1.6-ext/CMakeFiles/CMakeLists.txt | 47 ++++++++++++------- 2 files changed, 58 insertions(+), 36 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f7ea6858d..bd8595535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,10 @@ -# /*---------------------------------------------------------------------------*\ +# /*-------------------------------------------------------------------------*\ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -# ------------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # License # This file is part of OpenFOAM. # @@ -23,17 +23,17 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Description -# CMakeLists.txt file for implementing a test harness for the compilation -# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash +# CMakeLists.txt file for implementing a test harness for the compilation +# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash # -# The results will be submitted to the CDash server identified by the file -# CTestConfig.cmake +# The results will be submitted to the CDash server identified by the file +# CTestConfig.cmake # # Author -# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved +# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved # # -# \*---------------------------------------------------------------------------*/ +# \*-------------------------------------------------------------------------*/ cmake_minimum_required (VERSION 2.8) @@ -82,14 +82,12 @@ SET( # Find out the version of the compiler being used. # Add this information to the buildname -# This is for gcc -IF(CMAKE_COMPILER_IS_GNUCC) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS -dumpversion - OUTPUT_VARIABLE COMPILER_VERSION - ) - SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +# This is for gcc or icc because they both support the -dumpversion option +EXEC_PROGRAM($ENV{WM_CC} + ARGS -dumpversion + OUTPUT_VARIABLE COMPILER_VERSION +) +SET(BUILDNAME "${BUILDNAME}-$ENV{WM_CC}${COMPILER_VERSION}") # # We will support more compilers eventually. # @@ -99,7 +97,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) # DART_TESTING_TIMEOUT 14400 # CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test." #) -# Timeout for running all this: 10 minutes : 600 secondes +# Timeout for running all this: 10 minutes : 600 seconds SET( DART_TESTING_TIMEOUT 600 CACHE STRING "Maximum time allowed (10 minutes) before CTest will kill the test." @@ -119,9 +117,22 @@ set (UPDATE_TYPE git) # find_package(Git) if(GIT_FOUND) - message("Git was found: ${GIT_EXECUTABLE}") + message("Git was found: ${GIT_EXECUTABLE}") + + # Adding the name of the git branch to the build name + EXEC_PROGRAM(git + ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' + OUTPUT_VARIABLE GIT_BRANCH_NAME + ) + message("Git branch: ${GIT_BRANCH_NAME}") + SET(BUILDNAME "${BUILDNAME}-git-branch:${GIT_BRANCH_NAME}") endif() +# Some last minute cleanup +# Seems like no '/' are allowed in the BUILDNAME or in the SITE name +string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) +string(REPLACE "/" "_" SITE ${SITE}) + # Build section #----------------------------------------------------------------------------- diff --git a/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt b/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt index f7ea6858d..bd8595535 100644 --- a/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt +++ b/testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt @@ -1,10 +1,10 @@ -# /*---------------------------------------------------------------------------*\ +# /*-------------------------------------------------------------------------*\ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright held by original author # \\/ M anipulation | -# ------------------------------------------------------------------------------- +# ----------------------------------------------------------------------------- # License # This file is part of OpenFOAM. # @@ -23,17 +23,17 @@ # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # # Description -# CMakeLists.txt file for implementing a test harness for the compilation -# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash +# CMakeLists.txt file for implementing a test harness for the compilation +# and test of OpenFOAM-1.5-dev using Kitware CTest./CMake/CDash # -# The results will be submitted to the CDash server identified by the file -# CTestConfig.cmake +# The results will be submitted to the CDash server identified by the file +# CTestConfig.cmake # # Author -# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved +# Martin Beaudoin, Hydro-Quebec, 2010. All rights reserved # # -# \*---------------------------------------------------------------------------*/ +# \*-------------------------------------------------------------------------*/ cmake_minimum_required (VERSION 2.8) @@ -82,14 +82,12 @@ SET( # Find out the version of the compiler being used. # Add this information to the buildname -# This is for gcc -IF(CMAKE_COMPILER_IS_GNUCC) - EXEC_PROGRAM(${CMAKE_CXX_COMPILER} - ARGS -dumpversion - OUTPUT_VARIABLE COMPILER_VERSION - ) - SET(BUILDNAME "${BUILDNAME}-gcc${COMPILER_VERSION}") -ENDIF(CMAKE_COMPILER_IS_GNUCC) +# This is for gcc or icc because they both support the -dumpversion option +EXEC_PROGRAM($ENV{WM_CC} + ARGS -dumpversion + OUTPUT_VARIABLE COMPILER_VERSION +) +SET(BUILDNAME "${BUILDNAME}-$ENV{WM_CC}${COMPILER_VERSION}") # # We will support more compilers eventually. # @@ -99,7 +97,7 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC) # DART_TESTING_TIMEOUT 14400 # CACHE STRING "Maximum time allowed (4 hours) before CTest will kill the test." #) -# Timeout for running all this: 10 minutes : 600 secondes +# Timeout for running all this: 10 minutes : 600 seconds SET( DART_TESTING_TIMEOUT 600 CACHE STRING "Maximum time allowed (10 minutes) before CTest will kill the test." @@ -119,9 +117,22 @@ set (UPDATE_TYPE git) # find_package(Git) if(GIT_FOUND) - message("Git was found: ${GIT_EXECUTABLE}") + message("Git was found: ${GIT_EXECUTABLE}") + + # Adding the name of the git branch to the build name + EXEC_PROGRAM(git + ARGS branch --no-color 2> /dev/null | grep '*'| awk '{print $2}' + OUTPUT_VARIABLE GIT_BRANCH_NAME + ) + message("Git branch: ${GIT_BRANCH_NAME}") + SET(BUILDNAME "${BUILDNAME}-git-branch:${GIT_BRANCH_NAME}") endif() +# Some last minute cleanup +# Seems like no '/' are allowed in the BUILDNAME or in the SITE name +string(REPLACE "/" "_" BUILDNAME ${BUILDNAME}) +string(REPLACE "/" "_" SITE ${SITE}) + # Build section #----------------------------------------------------------------------------- From 0700e50f9f91ddaa008662fc3a03352dbc213d66 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Fri, 15 Oct 2010 22:27:05 +0100 Subject: [PATCH 19/19] Updates for easier external scripting. Philippose Rajan --- etc/bashrc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/etc/bashrc b/etc/bashrc index 965a08265..684aba392 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -71,13 +71,12 @@ fi # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ export WM_PROJECT_INST_DIR=$FOAM_INST_DIR export WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION -export WM_PROJECT_USER_DIR=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION +: ${WM_PROJECT_USER_DIR:=$HOME/$WM_PROJECT/$USER-$WM_PROJECT_VERSION}; export WM_PROJECT_USER_DIR # Location of third-party software # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -export WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION - +: ${WM_THIRD_PARTY_DIR=$WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION}; export WM_THIRD_PARTY_DIR # Operating System/Platform # ~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -95,7 +94,7 @@ export WM_COMPILER_LIB_ARCH= # Compilation options (architecture, precision, optimised, debug or profiling) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -export WM_NCOMPPROCS=2 +: ${WM_NCOMPPROCS:=2}; export WM_NCOMPPROCS # WM_ARCH_OPTION = 32 | 64 : ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION