From 6b12ccab04398c20e166637afac5a52f89fe7392 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 13 Mar 2012 13:02:58 +0000 Subject: [PATCH 01/15] STYLE: readVTK: comment --- src/triSurface/triSurface/interfaces/VTK/readVTK.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/triSurface/triSurface/interfaces/VTK/readVTK.C b/src/triSurface/triSurface/interfaces/VTK/readVTK.C index 71b3e791aa..a5ffc2e247 100644 --- a/src/triSurface/triSurface/interfaces/VTK/readVTK.C +++ b/src/triSurface/triSurface/interfaces/VTK/readVTK.C @@ -35,7 +35,7 @@ namespace Foam bool Foam::triSurface::readVTK(const fileName& fName) { - // Read (and triagulate) point, faces, zone info + // Read (and triangulate) point, faces, zone info fileFormats::VTKsurfaceFormat surf(fName); List tris(surf.faces().size()); From 806bdec1786946d42cfdf9e5e5af189d50dc3db0 Mon Sep 17 00:00:00 2001 From: mattijs Date: Tue, 13 Mar 2012 13:03:31 +0000 Subject: [PATCH 02/15] BUG: axisRotationMotion: fix angle specification --- .../axisRotationMotion/axisRotationMotion.C | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C index 456441026f..2de3fab7e0 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C @@ -73,8 +73,6 @@ Foam::solidBodyMotionFunctions::axisRotationMotion::transformation() const { scalar t = time_.value(); - // Motion around a centre of gravity - // Rotation around centre of gravity (in radians) vector omega ( @@ -84,10 +82,7 @@ Foam::solidBodyMotionFunctions::axisRotationMotion::transformation() const ); scalar magOmega = mag(omega); - - scalar cosHalfTheta = cos(0.5*magOmega); - - quaternion R(cosHalfTheta, omega/magOmega); + quaternion R(omega/magOmega, magOmega); septernion TR(septernion(CofG_)*R*septernion(-CofG_)); Info<< "solidBodyMotionFunctions::axisRotationMotion::transformation(): " From 2fb7b6cfcce66945a7a299c7efbc8e3e93a58e40 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 14 Mar 2012 09:33:15 +0000 Subject: [PATCH 03/15] ENH: basicThermo: add T from h calculation for cell-set or patch --- .../basic/basicThermo/basicThermo.C | 32 +++++++++++++ .../basic/basicThermo/basicThermo.H | 16 +++++++ .../basic/rhoThermo/hRhoThermo/hRhoThermo.C | 46 ++++++++++++++++++- .../basic/rhoThermo/hRhoThermo/hRhoThermo.H | 18 +++++++- 4 files changed, 110 insertions(+), 2 deletions(-) diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index ad40123d6e..59c0056040 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -350,6 +350,38 @@ Foam::tmp Foam::basicThermo::hc() const } +Foam::tmp Foam::basicThermo::TH +( + const scalarField& h, + const scalarField& T0, // starting temperature + const labelList& cells +) const +{ + notImplemented + ( + "basicThermo::TH" + "(const scalarField&, const scalarField&, const labelList&) const" + ); + return tmp(NULL); +} + + +Foam::tmp Foam::basicThermo::TH +( + const scalarField& h, + const scalarField& T0, // starting temperature + const label patchi +) const +{ + notImplemented + ( + "basicThermo::TH" + "(const scalarField&, const scalarField&, const label) const" + ); + return tmp(NULL); +} + + Foam::volScalarField& Foam::basicThermo::e() { notImplemented("basicThermo::e()"); diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 0bb67f8b49..92c4b01258 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -198,6 +198,22 @@ public: //- Chemical enthalpy [J/kg] virtual tmp hc() const; + //- Temperature from enthalpy for cell-set + virtual tmp TH + ( + const scalarField& h, + const scalarField& T0, // starting temperature + const labelList& cells + ) const; + + //- Temperature from enthalpy for patch + virtual tmp TH + ( + const scalarField& h, + const scalarField& T0, // starting temperature + const label patchi + ) const; + //- Internal energy [J/kg] // Non-const access allowed for transport equations virtual volScalarField& e(); diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C index 9d26c95015..9d3f3c2ba7 100644 --- a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -205,6 +205,50 @@ Foam::tmp Foam::hRhoThermo::h } +template +Foam::tmp Foam::hRhoThermo::TH +( + const scalarField& h, + const scalarField& T0, + const labelList& cells +) const +{ + tmp tT(new scalarField(h.size())); + scalarField& T = tT(); + + forAll(h, celli) + { + T[celli] = this->cellMixture(cells[celli]).TH(h[celli], T0[celli]); + } + + return tT; +} + + +template +Foam::tmp Foam::hRhoThermo::TH +( + const scalarField& h, + const scalarField& T0, + const label patchi +) const +{ + tmp tT(new scalarField(h.size())); + scalarField& T = tT(); + + forAll(h, facei) + { + T[facei] = this->patchFaceMixture + ( + patchi, + facei + ).TH(h[facei], T0[facei]); + } + + return tT; +} + + template Foam::tmp Foam::hRhoThermo::Cp ( diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H index ee3cd4ba7f..1f85793f6b 100644 --- a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -134,6 +134,22 @@ public: const label patchi ) const; + //- Temperature from enthalpy for cell-set + virtual tmp TH + ( + const scalarField& h, + const scalarField& T0, // starting temperature + const labelList& cells + ) const; + + //- Temperature from enthalpy for patch + virtual tmp TH + ( + const scalarField& h, + const scalarField& T0, // starting temperature + const label patchi + ) const; + //- Heat capacity at constant pressure for patch [J/kg/K] virtual tmp Cp ( From 426c1b393de245cac4bba5c049da4ad516200f46 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 14 Mar 2012 09:33:56 +0000 Subject: [PATCH 04/15] ENH: setFields: single warn for internal faces; Updated setFieldsDict --- .../utilities/preProcessing/setFields/setFields.C | 12 +++++++++--- .../utilities/preProcessing/setFields/setFieldsDict | 6 +++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/applications/utilities/preProcessing/setFields/setFields.C b/applications/utilities/preProcessing/setFields/setFields.C index c28df31a2a..7b690d46f2 100644 --- a/applications/utilities/preProcessing/setFields/setFields.C +++ b/applications/utilities/preProcessing/setFields/setFields.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-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -216,14 +216,20 @@ bool setFaceFieldType } // Override + bool hasWarned = false; labelList nChanged(field.boundaryField().size(), 0); forAll(selectedFaces, i) { label facei = selectedFaces[i]; if (mesh.isInternalFace(facei)) { - WarningIn("setFaceFieldType(..)") - << "Ignoring internal face " << facei << endl; + if (!hasWarned) + { + hasWarned = true; + WarningIn("setFaceFieldType(..)") + << "Ignoring internal face " << facei + << ". Suppressing further warnings." << endl; + } } else { diff --git a/applications/utilities/preProcessing/setFields/setFieldsDict b/applications/utilities/preProcessing/setFields/setFieldsDict index 6f4b9cd490..695ab38383 100644 --- a/applications/utilities/preProcessing/setFields/setFieldsDict +++ b/applications/utilities/preProcessing/setFields/setFieldsDict @@ -16,7 +16,7 @@ FoamFile defaultFieldValues ( - volScalarFieldValue gamma 0 + volScalarFieldValue alpha1 0 volVectorFieldValue U (0 0 0) ); @@ -30,7 +30,7 @@ regions fieldValues ( - volScalarFieldValue gamma 1 + volScalarFieldValue alpha1 1 ); } @@ -41,7 +41,7 @@ regions fieldValues ( - volScalarFieldValue gamma 1 + volScalarFieldValue alpha1 1 ); } ); From efb2f886fadc7b74df03a3533f1eca607c3921e7 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 14 Mar 2012 09:35:02 +0000 Subject: [PATCH 05/15] BUG: createPatch: do not remove cyclics since are referred to by opposite side or processorCyclics --- .../mesh/manipulation/createPatch/createPatch.C | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index 50c9f30839..7a969e15d1 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -111,10 +111,18 @@ void filterPatches(polyMesh& mesh, const HashSet& addedPatchNames) // Note: reduce possible since non-proc patches guaranteed in same order if (!isA(pp)) { + + // Add if + // - non zero size + // - or added from the createPatchDict + // - or cyclic (since referred to by other cyclic half or + // proccyclic) + if ( addedPatchNames.found(pp.name()) || returnReduce(pp.size(), sumOp