From 0a6b9a36d66e831ccd9e70b99d6d259bd6091bba Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 10 May 2013 16:17:24 +0100 Subject: [PATCH 1/7] ENH: OBJstream: add line with normals --- src/surfMesh/surfaceFormats/obj/OBJstream.C | 16 +++++++++++++++- src/surfMesh/surfaceFormats/obj/OBJstream.H | 12 ++++++++++-- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/surfMesh/surfaceFormats/obj/OBJstream.C b/src/surfMesh/surfaceFormats/obj/OBJstream.C index ce0eb2721b..46a6b7e0c0 100644 --- a/src/surfMesh/surfaceFormats/obj/OBJstream.C +++ b/src/surfMesh/surfaceFormats/obj/OBJstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -241,6 +241,20 @@ Foam::Ostream& Foam::OBJstream::write(const linePointRef& ln) } +Foam::Ostream& Foam::OBJstream::write +( + const linePointRef& ln, + const vector& n0, + const vector& n1 +) +{ + write(ln.start(), n0); + write(ln.end(), n1); + write("l ") << nVertices_-1 << ' ' << nVertices_ << nl; + return *this; +} + + Foam::Ostream& Foam::OBJstream::write ( const triPointRef& f, diff --git a/src/surfMesh/surfaceFormats/obj/OBJstream.H b/src/surfMesh/surfaceFormats/obj/OBJstream.H index ec7e93d24e..ee6ae58143 100644 --- a/src/surfMesh/surfaceFormats/obj/OBJstream.H +++ b/src/surfMesh/surfaceFormats/obj/OBJstream.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -92,7 +92,7 @@ public: // Access - //- Return the name of the stream + //- Return the number of vertices written label nVertices() const { return nVertices_; @@ -135,6 +135,14 @@ public: //- Write line Ostream& write(const linePointRef&); + //- Write line with points and vector normals ('vn') + Ostream& write + ( + const linePointRef&, + const vector& n0, + const vector& n1 + ); + //- Write triangle as points with lines or filled polygon Ostream& write(const triPointRef&, const bool lines = true); From 5fda35882efe9c7f330b95a3301dc3ca001b8212 Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 11 May 2013 11:56:42 +0100 Subject: [PATCH 2/7] fvcSup: Change field argument to const --- src/finiteVolume/finiteVolume/fvc/fvcSup.C | 16 ++++++++-------- src/finiteVolume/finiteVolume/fvc/fvcSup.H | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/finiteVolume/finiteVolume/fvc/fvcSup.C b/src/finiteVolume/finiteVolume/fvc/fvcSup.C index d1af6ad007..67b0e11df7 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcSup.C +++ b/src/finiteVolume/finiteVolume/fvc/fvcSup.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) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -43,7 +43,7 @@ tmp > Su ( const GeometricField& su, - GeometricField& vf + const GeometricField& vf ) { return su; @@ -54,7 +54,7 @@ tmp > Su ( const tmp >& tsu, - GeometricField& vf + const GeometricField& vf ) { return tsu; @@ -66,7 +66,7 @@ tmp > Sp ( const volScalarField& sp, - GeometricField& vf + const GeometricField& vf ) { return sp*vf; @@ -77,7 +77,7 @@ tmp > Sp ( const tmp& tsp, - GeometricField& vf + const GeometricField& vf ) { return tsp*vf; @@ -89,7 +89,7 @@ tmp > Sp ( const dimensionedScalar& sp, - GeometricField& vf + const GeometricField& vf ) { return sp*vf; @@ -101,7 +101,7 @@ tmp > SuSp ( const volScalarField& sp, - GeometricField& vf + const GeometricField& vf ) { return sp*vf; @@ -112,7 +112,7 @@ tmp > SuSp ( const tmp& tsp, - GeometricField& vf + const GeometricField& vf ) { return tsp*vf; diff --git a/src/finiteVolume/finiteVolume/fvc/fvcSup.H b/src/finiteVolume/finiteVolume/fvc/fvcSup.H index 8ac75a2150..2958d676b9 100644 --- a/src/finiteVolume/finiteVolume/fvc/fvcSup.H +++ b/src/finiteVolume/finiteVolume/fvc/fvcSup.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) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,14 +55,14 @@ namespace fvc tmp > Su ( const GeometricField&, - GeometricField& + const GeometricField& ); template tmp > Su ( const tmp >&, - GeometricField& + const GeometricField& ); @@ -72,14 +72,14 @@ namespace fvc tmp > Sp ( const volScalarField&, - GeometricField& + const GeometricField& ); template tmp > Sp ( const tmp&, - GeometricField& + const GeometricField& ); @@ -87,7 +87,7 @@ namespace fvc tmp > Sp ( const dimensionedScalar&, - GeometricField& + const GeometricField& ); @@ -97,14 +97,14 @@ namespace fvc tmp > SuSp ( const volScalarField&, - GeometricField& + const GeometricField& ); template tmp > SuSp ( const tmp&, - GeometricField& + const GeometricField& ); } From f18c1c53b23d71795292191611daa620cd171b7c Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 11 May 2013 11:56:57 +0100 Subject: [PATCH 3/7] phaseChangeTwoPhaseMixtures: Correct docs for mDotP function --- .../phaseChangeTwoPhaseMixtures/Kunz/Kunz.H | 7 +++---- .../phaseChangeTwoPhaseMixtures/Merkle/Merkle.H | 9 ++++----- .../SchnerrSauer/SchnerrSauer.H | 7 +++---- .../phaseChangeTwoPhaseMixture.H | 10 ++++------ 4 files changed, 14 insertions(+), 19 deletions(-) diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H index 74f8f2b931..39ccad5382 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Kunz/Kunz.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) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -108,9 +108,8 @@ public: // and a coefficient to multiply alphal for the vaporisation rate virtual Pair > mDotAlphal() const; - //- Return the mass condensation and vaporisation rates as an - // explicit term for the condensation rate and a coefficient to - // multiply (p - pSat) for the vaporisation rate + //- Return the mass condensation and vaporisation rates as coefficients + // to multiply (p - pSat) virtual Pair > mDotP() const; //- Correct the Kunz phaseChange model diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H index 9351afd2de..7dd8e841c8 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/Merkle/Merkle.H @@ -1,8 +1,8 @@ /*---------------------------------------------------------------------------*\ - ========Merkle= | + ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,9 +102,8 @@ public: // and a coefficient to multiply alphal for the vaporisation rate virtual Pair > mDotAlphal() const; - //- Return the mass condensation and vaporisation rates as an - // explicit term for the condensation rate and a coefficient to - // multiply (p - pSat) for the vaporisation rate + //- Return the mass condensation and vaporisation rates as coefficients + // to multiply (p - pSat) virtual Pair > mDotP() const; //- Correct the Merkle phaseChange model diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H index dd676b8fd0..beef7fc7fc 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/SchnerrSauer/SchnerrSauer.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) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -115,9 +115,8 @@ public: // and a coefficient to multiply alphal for the vaporisation rate virtual Pair > mDotAlphal() const; - //- Return the mass condensation and vaporisation rates as an - // explicit term for the condensation rate and a coefficient to - // multiply (p - pSat) for the vaporisation rate + //- Return the mass condensation and vaporisation rates as coefficients + // to multiply (p - pSat) virtual Pair > mDotP() const; //- Correct the SchnerrSauer phaseChange model diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H index fc81d080d3..e05476390b 100644 --- a/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H +++ b/applications/solvers/multiphase/interPhaseChangeFoam/phaseChangeTwoPhaseMixtures/phaseChangeTwoPhaseMixture/phaseChangeTwoPhaseMixture.H @@ -139,9 +139,8 @@ public: // and a coefficient to multiply alphal for the vaporisation rate virtual Pair > mDotAlphal() const = 0; - //- Return the mass condensation and vaporisation rates as an - // explicit term for the condensation rate and a coefficient to - // multiply (p - pSat) for the vaporisation rate + //- Return the mass condensation and vaporisation rates as coefficients + // to multiply (p - pSat) virtual Pair > mDotP() const = 0; //- Return the volumetric condensation and vaporisation rates as a @@ -149,9 +148,8 @@ public: // and a coefficient to multiply alphal for the vaporisation rate Pair > vDotAlphal() const; - //- Return the volumetric condensation and vaporisation rates as an - // explicit term for the condensation rate and a coefficient to - // multiply (p - pSat) for the vaporisation rate + //- Return the volumetric condensation and vaporisation rates as + // coefficients to multiply (p - pSat) Pair > vDotP() const; //- Correct the phaseChange model From 1c0b73055d37a315e6d9338becc7c27ab8aff75e Mon Sep 17 00:00:00 2001 From: Henry Date: Sat, 11 May 2013 11:57:10 +0100 Subject: [PATCH 4/7] multiphaseMixture: Remove alphaTable which is no longer used --- .../multiphaseMixture/multiphaseMixture.C | 5 ----- .../multiphaseMixture/multiphaseMixture.H | 6 +----- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C index 76b4dab8dd..a154565747 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.C @@ -111,11 +111,6 @@ Foam::multiphaseMixture::multiphaseMixture { calcAlphas(); alphas_.write(); - - forAllIter(PtrDictionary, phases_, iter) - { - alphaTable_.add(iter()); - } } diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H index 19b436ef2a..ce97221eea 100644 --- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.H +++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/multiphaseMixture.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) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,6 @@ SourceFiles #include "PtrDictionary.H" #include "volFields.H" #include "surfaceFields.H" -#include "multivariateSurfaceInterpolationScheme.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -156,9 +155,6 @@ private: //- Conversion factor for degrees into radians static const scalar convertToRad; - //- Phase-fraction field table for multivariate discretisation - multivariateSurfaceInterpolationScheme::fieldTable alphaTable_; - // Private member functions From 4afaa1626db1fa2583e4cfe318d532fbf6ede7bc Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 13 May 2013 11:54:29 +0100 Subject: [PATCH 5/7] ENH: noDecomp: constant decomposition --- .../decompositionMethods/noDecomp/noDecomp.H | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/parallel/decompose/decompositionMethods/noDecomp/noDecomp.H b/src/parallel/decompose/decompositionMethods/noDecomp/noDecomp.H index 13368c9970..154838d35c 100644 --- a/src/parallel/decompose/decompositionMethods/noDecomp/noDecomp.H +++ b/src/parallel/decompose/decompositionMethods/noDecomp/noDecomp.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ public: // up to the user. virtual bool parallelAware() const { - return false; + return true; } //- Return for every coordinate the wanted processor number. Use the @@ -90,12 +90,7 @@ public: const scalarField& cWeights ) { - notImplemented - ( - "decompose(const polyMesh&, const pointField&" - ", const scalarField&)" - ); - return labelList(0); + return labelList(cc.size(), Pstream::myProcNo()); } //- Return for every coordinate the wanted processor number. Explicitly @@ -112,12 +107,7 @@ public: const scalarField& cWeights ) { - notImplemented - ( - "decompose(const labelListList&, const pointField&" - ", const scalarField&)" - ); - return labelList(0); + return labelList(globalCellCells.size(), Pstream::myProcNo()); } }; From caa74eee6f4fc2a5319c2e6daa909466a88759ad Mon Sep 17 00:00:00 2001 From: Henry Date: Mon, 13 May 2013 15:23:16 +0100 Subject: [PATCH 6/7] wmake: Change default behaviour to check the Make/files file for a LIB entry and compile libso if appropriate --- wmake/wmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wmake/wmake b/wmake/wmake index ced70188cc..ebcd38cb6e 100755 --- a/wmake/wmake +++ b/wmake/wmake @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -202,9 +202,9 @@ fi exit 1 } -# transform "all" option to "libso" if that looks appropriate or remove it +# transform "all" or no option to "libso" if that looks appropriate or remove it # so that the call to make builds the application -if [ "$makeType" = all ] +if [ "$makeType" = all -o "$makeType" = "" ] then unset makeType if grep -e '^ *LIB *=' "$MakeDir/files" >/dev/null 2>&1 From e0e369d8889b1a78d877d25ca9754811da705a9e Mon Sep 17 00:00:00 2001 From: Sergio Ferraris Date: Tue, 14 May 2013 09:57:32 +0100 Subject: [PATCH 7/7] BUG:Correcting expression for the inertial contribution to the pressure drop in the bafflePressureDrop --- .../porousBafflePressure/porousBafflePressureFvPatchField.H | 4 ++-- .../porousBafflePressure/porousBafflePressureFvPatchFields.C | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H index a52e8e5b34..ed22575785 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,7 +34,7 @@ Description The porous baffle introduces a pressure jump defined by: \f[ - \Delta p = -(I \mu U + 0.5 D \rho |U|^2 L) + \Delta p = -(I \mu U + 0.5 D \rho |U|^2 )L \f] where diff --git a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C index 08855fa7fb..32317c0ad1 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchFields.C @@ -78,7 +78,7 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() const scalarField nuEffw = turbModel.nuEff()().boundaryField()[patchI]; - jump_ = -sign(Un)*(I_*nuEffw + D_*0.5*magUn*length_)*magUn; + jump_ = -sign(Un)*(I_*nuEffw + D_*0.5*magUn)*magUn*length_; } else { @@ -95,7 +95,7 @@ void Foam::porousBafflePressureFvPatchField::updateCoeffs() Un /= rhow; - jump_ = -sign(Un)*(I_*muEffw + D_*0.5*rhow*magUn*length_)*magUn; + jump_ = -sign(Un)*(I_*muEffw + D_*0.5*rhow*magUn)*magUn*length_; } if (debug)