From 968f865db5764cdfb6b09972adcbaebf21bce866 Mon Sep 17 00:00:00 2001 From: william Date: Mon, 7 Apr 2014 10:23:02 +0100 Subject: [PATCH 1/8] ENH: twoPhaseEulerFoam: added new interfacial models --- .../interfacialModels/Make/files | 2 + .../TomiyamaAspectRatio/TomiyamaAspectRatio.C | 81 ++++++++++++ .../TomiyamaAspectRatio/TomiyamaAspectRatio.H | 108 ++++++++++++++++ .../TomiyamaWallLubrication.C | 97 ++++++++++++++ .../TomiyamaWallLubrication.H | 118 ++++++++++++++++++ 5 files changed, 406 insertions(+) create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C create mode 100644 applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files index 7e028175..81bccf25 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/Make/files @@ -40,6 +40,7 @@ wallLubricationModels/wallLubricationModel/newWallLubricationModel.C wallLubricationModels/noWallLubrication/noWallLubrication.C wallLubricationModels/Antal/Antal.C wallLubricationModels/Frank/Frank.C +wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C turbulentDispersionModels/turbulentDispersionModel/turbulentDispersionModel.C turbulentDispersionModels/turbulentDispersionModel/newTurbulentDispersionModel.C @@ -51,6 +52,7 @@ turbulentDispersionModels/Gosman/Gosman.C aspectRatioModels/aspectRatioModel/aspectRatioModel.C aspectRatioModels/aspectRatioModel/newAspectRatioModel.C aspectRatioModels/constantAspectRatio/constantAspectRatio.C +aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C aspectRatioModels/VakhrushevEfremov/VakhrushevEfremov.C aspectRatioModels/Wellek/Wellek.C diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C new file mode 100644 index 00000000..6e741014 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "TomiyamaAspectRatio.H" +#include "orderedPhasePair.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + defineTypeNameAndDebug(TomiyamaAspectRatio, 0); + addToRunTimeSelectionTable + ( + aspectRatioModel, + TomiyamaAspectRatio, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::TomiyamaAspectRatio::TomiyamaAspectRatio +( + const dictionary& dict, + const orderedPhasePair& pair +) +: + aspectRatioModel(dict, pair), + yWall_(pair.phase1().mesh().lookupObject("yWall")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::aspectRatioModels::TomiyamaAspectRatio::~TomiyamaAspectRatio() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::tmp +Foam::aspectRatioModels::TomiyamaAspectRatio::E() const +{ + return + pair_.Eo() + *max + ( + scalar(1) - 0.35*yWall_/pair_.dispersed().d(), + scalar(0.65) + ); +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H new file mode 100644 index 00000000..ba32d21c --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/aspectRatioModels/TomiyamaAspectRatio/TomiyamaAspectRatio.H @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::aspectRatioModels::TomiyamaAspectRatio + +Description + Aspect ratio model of Tomiyama. + + Reference: + \verbatim + "Implementation and Comparison of Correlations for interfacial Forces + in a Gas-Liquid System within an Euler-Euler Framework" + M Otromke + PhD Thesis + April 2013 + \endverbatim + +SourceFiles + TomiyamaAspectRatio.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaAspectRatio_H +#define TomiyamaAspectRatio_H + +#include "aspectRatioModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace aspectRatioModels +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaAspectRatio Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaAspectRatio +: + public aspectRatioModel +{ +private: + + // Private data + + //- Wall distance + const volScalarField& yWall_; + + +public: + + //- Runtime type information + TypeName("Tomiyama"); + + + // Constructors + + //- Construct from a dictionary and an ordered phase pair + TomiyamaAspectRatio + ( + const dictionary& dict, + const orderedPhasePair& pair + ); + + + //- Destructor + virtual ~TomiyamaAspectRatio(); + + + // Member Functions + + //- Aspect ratio + virtual tmp E() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace aspectRatioModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C new file mode 100644 index 00000000..09e45c32 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "TomiyamaWallLubrication.H" +#include "phasePair.H" +#include "fvc.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace wallLubricationModels +{ + defineTypeNameAndDebug(TomiyamaWallLubrication, 0); + addToRunTimeSelectionTable + ( + wallLubricationModel, + TomiyamaWallLubrication, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::wallLubricationModels::TomiyamaWallLubrication::TomiyamaWallLubrication +( + const dictionary& dict, + const phasePair& pair +) +: + wallLubricationModel(dict, pair), + D_("Cwd", dimLength, dict.lookup("D")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::wallLubricationModels::TomiyamaWallLubrication::~TomiyamaWallLubrication() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::tmp +Foam::wallLubricationModels::TomiyamaWallLubrication::F() const +{ + volVectorField Ur(pair_.Ur()); + volVectorField nWall(- fvc::grad(yWall_)); + nWall /= mag(nWall) + SMALL; + + volScalarField Eo(pair_.Eo()); + + return + ( + pos(Eo - 1.0)*neg(Eo - 5.0)*exp(-0.933*Eo + 0.179) + + pos(Eo - 5.0)*neg(Eo - 33.0)*(0.00599*Eo - 0.0187) + + pos(Eo - 33.0)*0.179 + ) + *0.5 + *pair_.dispersed().d() + *( + 1/sqr(yWall_) + - 1/sqr(D_ - yWall_) + ) + *pair_.dispersed() + *pair_.continuous().rho() + *magSqr(Ur - (Ur & nWall)*nWall) + *nWall; +} + + +// ************************************************************************* // diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H new file mode 100644 index 00000000..24377af8 --- /dev/null +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/wallLubricationModels/TomiyamaWallLubrication/TomiyamaWallLubrication.H @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2014 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::wallLubricationModels::TomiyamaWallLubrication + +Description + Wall lubrication model of Tomiyama. + + References: + \verbatim + "Implementation and Comparison of Correlations for interfacial Forces + in a Gas-Liquid System within an Euler-Euler Framework" + M Otromke + PhD Thesis + April 2013 + \endverbatim + + \verbatim + "Struggle with Computational Bubble Dynamics" + A Tomiyama + Multiphase Science and Technology + Volume 10, Issue 4, Pages 369-405, 1998 + \endverbatim + +SourceFiles + TomiyamaWallLubrication.C + +\*---------------------------------------------------------------------------*/ + +#ifndef TomiyamaWallLubrication_H +#define TomiyamaWallLubrication_H + +#include "wallLubricationModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +class phasePair; + +namespace wallLubricationModels +{ + +/*---------------------------------------------------------------------------*\ + Class TomiyamaWallLubrication Declaration +\*---------------------------------------------------------------------------*/ + +class TomiyamaWallLubrication +: + public wallLubricationModel +{ +private: + + // Private data + + //- Characteristic channel dimension + const dimensionedScalar D_; + + +public: + + //- Runtime type information + TypeName("Tomiyama"); + + + // Constructors + + //- Construct from components + TomiyamaWallLubrication + ( + const dictionary& dict, + const phasePair& pair + ); + + + //- Destructor + virtual ~TomiyamaWallLubrication(); + + + // Member Functions + + //- Wall lubrication force + tmp F() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace wallLubricationModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From f3f82ffc08e9a8551c73a78196f4b18bd164abae Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Apr 2014 11:54:49 +0100 Subject: [PATCH 2/8] ENH: solidBodMotionFvMesh - add support for specifying cells by cellSet --- .../solidBodyMotionFvMesh.C | 58 ++++++++++++++----- .../solidBodyMotionFvMesh.H | 8 +-- 2 files changed, 49 insertions(+), 17 deletions(-) diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C index 44a1a2c4..184cbe60 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C @@ -28,6 +28,7 @@ License #include "volFields.H" #include "transformField.H" #include "cellZoneMesh.H" +#include "cellSet.H" #include "boolList.H" #include "syncTools.H" @@ -74,8 +75,8 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) false ) ), - zoneID_(-1), - pointIDs_() + pointIDs_(), + UName_(dynamicMeshCoeffs_.lookupOrDefault("UName", "U")) { if (undisplacedPoints_.size() != nPoints()) { @@ -92,14 +93,31 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) word cellZoneName = dynamicMeshCoeffs_.lookupOrDefault("cellZone", "none"); + word cellSetName = + dynamicMeshCoeffs_.lookupOrDefault("cellSet", "none"); + + if ((cellZoneName != "none") && (cellSetName != "none")) + { + FatalIOErrorIn + ( + "solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject&)", + dynamicMeshCoeffs_ + ) + << "Either cellZone OR cellSet can be supplied, but not both. " + << "If neither is supplied, all cells will be included" + << exit(FatalIOError); + } + + + labelList cellIDs; if (cellZoneName != "none") { Info<< "Applying solid body motion to cellZone " << cellZoneName << endl; - zoneID_ = cellZones().findZoneID(cellZoneName); + label zoneID = cellZones().findZoneID(cellZoneName); - if (zoneID_ == -1) + if (zoneID == -1) { FatalErrorIn ( @@ -111,16 +129,28 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) << exit(FatalError); } - const cellZone& cz = cellZones()[zoneID_]; + cellIDs = cellZones()[zoneID]; + } + if (cellSetName != "none") + { + Info<< "Applying solid body motion to cellSet " << cellSetName + << endl; + cellSet set(*this, cellSetName); + + cellIDs = set.toc(); + } + + if (cellIDs.size()) + { // collect point IDs of points in cell zone boolList movePts(nPoints(), false); - forAll(cz, i) + forAll(cellIDs, i) { - label cellI = cz[i]; + label cellI = cellIDs[i]; const cell& c = cells()[cellI]; forAll(c, j) { @@ -165,7 +195,7 @@ bool Foam::solidBodyMotionFvMesh::update() { static bool hasWarned = false; - if (zoneID_ != -1) + if (pointIDs_.size()) { pointField transformedPts(undisplacedPoints_); @@ -191,18 +221,20 @@ bool Foam::solidBodyMotionFvMesh::update() } - if (foundObject("U")) + if (foundObject(UName_)) { - const_cast(lookupObject("U")) - .correctBoundaryConditions(); + const volVectorField& U = lookupObject(UName_); + + const_cast(U).correctBoundaryConditions(); } else if (!hasWarned) { hasWarned = true; WarningIn("solidBodyMotionFvMesh::update()") - << "Did not find volVectorField U." - << " Not updating U boundary conditions." << endl; + << "Did not find volVectorField " << UName_ + << " Not updating " << UName_ << "boundary conditions." + << endl; } return true; diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H index f6b9725f..3f691381 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,12 +65,12 @@ class solidBodyMotionFvMesh //- The reference points which are transformed pointIOField undisplacedPoints_; - //- Specified cellZone or -1 for whole-body - label zoneID_; - //- Points to move when cell zone is supplied labelList pointIDs_; + //- Name of velocity field + word UName_; + // Private Member Functions From 0a52f10febc121f044e8150729cdf39c02b36055 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Apr 2014 11:57:27 +0100 Subject: [PATCH 3/8] ENH: polyMesh - add functions to set regIOobject up-to-date with mesh points for topology change --- src/OpenFOAM/meshes/polyMesh/polyMesh.C | 14 +++++++++++++- src/OpenFOAM/meshes/polyMesh/polyMesh.H | 8 +++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.C b/src/OpenFOAM/meshes/polyMesh/polyMesh.C index ce71727d..cd70eb39 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.C @@ -1047,6 +1047,18 @@ const Foam::pointField& Foam::polyMesh::points() const } +bool Foam::polyMesh::upToDatePoints(const regIOobject& io) const +{ + return io.upToDate(points_); +} + + +void Foam::polyMesh::setUpToDatePoints(regIOobject& io) const +{ + io.eventNo() = points_.eventNo(); +} + + const Foam::faceList& Foam::polyMesh::faces() const { if (clearedPrimitives_) @@ -1132,7 +1144,7 @@ Foam::tmp Foam::polyMesh::movePoints points_.writeOpt() = IOobject::AUTO_WRITE; points_.instance() = time().timeName(); - + points_.eventNo() = getEvent(); tmp sweptVols = primitiveMesh::movePoints ( diff --git a/src/OpenFOAM/meshes/polyMesh/polyMesh.H b/src/OpenFOAM/meshes/polyMesh/polyMesh.H index 5d95d9cf..ffabc4c7 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMesh.H +++ b/src/OpenFOAM/meshes/polyMesh/polyMesh.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -394,6 +394,12 @@ public: //- Return raw points virtual const pointField& points() const; + //- Return true if io is up-to-date with points + virtual bool upToDatePoints(const regIOobject& io) const; + + //- Set io to be up-to-date with points + virtual void setUpToDatePoints(regIOobject& io) const; + //- Return raw faces virtual const faceList& faces() const; From 5e5cdc252b658fdc1ad81f67b74b5508de884b4d Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Apr 2014 11:59:41 +0100 Subject: [PATCH 4/8] ENH: forces FO - porosity calc updated for mesh changes --- src/postProcessing/functionObjects/forces/forces/forces.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/postProcessing/functionObjects/forces/forces/forces.C b/src/postProcessing/functionObjects/forces/forces/forces.C index 488a71a8..539e14b3 100644 --- a/src/postProcessing/functionObjects/forces/forces/forces.C +++ b/src/postProcessing/functionObjects/forces/forces/forces.C @@ -922,7 +922,8 @@ void Foam::forces::calcForcesMoment() forAllConstIter(HashTable, models, iter) { - const porosityModel& pm = *iter(); + // non-const access required if mesh is changing + porosityModel& pm = const_cast(*iter()); vectorField fPTot(pm.force(U, rho, mu)); From 0d1ba8b51e046ff03b9c97ad7d69804c991c3c9c Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Apr 2014 12:32:59 +0100 Subject: [PATCH 5/8] ENH: porosity model updates for moving meshes --- .../DarcyForchheimer/DarcyForchheimer.C | 53 +++++++++--------- .../DarcyForchheimer/DarcyForchheimer.H | 14 ++++- .../porosityModel/fixedCoeff/fixedCoeff.C | 55 ++++++++++--------- .../porosityModel/fixedCoeff/fixedCoeff.H | 15 ++++- .../porosityModel/porosityModel.C | 44 ++++++++------- .../porosityModel/porosityModel.H | 26 ++++----- .../porosityModel/porosityModelList.C | 8 +-- .../porosityModel/porosityModelList.H | 6 +- .../general/porosityModel/powerLaw/powerLaw.C | 8 ++- .../general/porosityModel/powerLaw/powerLaw.H | 5 +- 10 files changed, 134 insertions(+), 100 deletions(-) diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C index 619ce5f1..3036baff 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.C @@ -52,19 +52,31 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer ) : porosityModel(name, modelType, mesh, dict, cellZoneName), + dXYZ_(coeffs_.lookup("d")), + fXYZ_(coeffs_.lookup("f")), D_(cellZoneIDs_.size()), F_(cellZoneIDs_.size()), rhoName_(coeffs_.lookupOrDefault("rho", "rho")), muName_(coeffs_.lookupOrDefault("mu", "thermo:mu")), nuName_(coeffs_.lookupOrDefault("nu", "nu")) { + adjustNegativeResistance(dXYZ_); + adjustNegativeResistance(fXYZ_); - dimensionedVector d(coeffs_.lookup("d")); - dimensionedVector f(coeffs_.lookup("f")); + calcTranformModelData(); +} - adjustNegativeResistance(d); - adjustNegativeResistance(f); +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::porosityModels::DarcyForchheimer::~DarcyForchheimer() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::porosityModels::DarcyForchheimer::calcTranformModelData() +{ if (coordSys_.R().uniform()) { forAll (cellZoneIDs_, zoneI) @@ -72,20 +84,19 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer D_[zoneI].setSize(1, tensor::zero); F_[zoneI].setSize(1, tensor::zero); - D_[zoneI][0].xx() = d.value().x(); - D_[zoneI][0].yy() = d.value().y(); - D_[zoneI][0].zz() = d.value().z(); + D_[zoneI][0].xx() = dXYZ_.value().x(); + D_[zoneI][0].yy() = dXYZ_.value().y(); + D_[zoneI][0].zz() = dXYZ_.value().z(); D_[zoneI][0] = coordSys_.R().transformTensor(D_[zoneI][0]); // leading 0.5 is from 1/2*rho - F_[zoneI][0].xx() = 0.5*f.value().x(); - F_[zoneI][0].yy() = 0.5*f.value().y(); - F_[zoneI][0].zz() = 0.5*f.value().z(); + F_[zoneI][0].xx() = 0.5*fXYZ_.value().x(); + F_[zoneI][0].yy() = 0.5*fXYZ_.value().y(); + F_[zoneI][0].zz() = 0.5*fXYZ_.value().z(); F_[zoneI][0] = coordSys_.R().transformTensor(F_[zoneI][0]); } - } else { @@ -98,14 +109,14 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer forAll(cells, i) { - D_[zoneI][i].xx() = d.value().x(); - D_[zoneI][i].yy() = d.value().y(); - D_[zoneI][i].zz() = d.value().z(); + D_[zoneI][i].xx() = dXYZ_.value().x(); + D_[zoneI][i].yy() = dXYZ_.value().y(); + D_[zoneI][i].zz() = dXYZ_.value().z(); // leading 0.5 is from 1/2*rho - F_[zoneI][i].xx() = 0.5*f.value().x(); - F_[zoneI][i].yy() = 0.5*f.value().y(); - F_[zoneI][i].zz() = 0.5*f.value().z(); + F_[zoneI][i].xx() = 0.5*fXYZ_.value().x(); + F_[zoneI][i].yy() = 0.5*fXYZ_.value().y(); + F_[zoneI][i].zz() = 0.5*fXYZ_.value().z(); } D_[zoneI] = coordSys_.R().transformTensor(D_[zoneI], cells); @@ -115,14 +126,6 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::porosityModels::DarcyForchheimer::~DarcyForchheimer() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - void Foam::porosityModels::DarcyForchheimer::calcForce ( const volVectorField& U, diff --git a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H index 7b6ea1dd..119cb9df 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/DarcyForchheimer/DarcyForchheimer.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,11 +74,16 @@ private: // Private data + //- Darcy coeffient XYZ components (user-supplied) [1/m2] + dimensionedVector dXYZ_; - //- Darcy coefficient [1/m2] + //- Forchheimer coeffient XYZ components (user-supplied) [1/m] + dimensionedVector fXYZ_; + + //- Darcy coefficient - converted from dXYZ [1/m2] List D_; - //- Forchheimer coefficient [1/m] + //- Forchheimer coefficient - converted from fXYZ [1/m] List F_; //- Name of density field @@ -143,6 +148,9 @@ public: // Member Functions + //- Transform the model data wrt mesh changes + virtual void calcTranformModelData(); + //- Calculate the porosity force virtual void calcForce ( diff --git a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C index bb7c3c9d..c3ef2826 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,15 +111,28 @@ Foam::porosityModels::fixedCoeff::fixedCoeff ) : porosityModel(name, modelType, mesh, dict, cellZoneName), + alphaXYZ_(coeffs_.lookup("alpha")), + betaXYZ_(coeffs_.lookup("beta")), alpha_(cellZoneIDs_.size()), beta_(cellZoneIDs_.size()) { - dimensionedVector alpha(coeffs_.lookup("alpha")); - dimensionedVector beta(coeffs_.lookup("beta")); + adjustNegativeResistance(alphaXYZ_); + adjustNegativeResistance(betaXYZ_); - adjustNegativeResistance(alpha); - adjustNegativeResistance(beta); + calcTranformModelData(); +} + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::porosityModels::fixedCoeff::~fixedCoeff() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::porosityModels::fixedCoeff::calcTranformModelData() +{ if (coordSys_.R().uniform()) { forAll (cellZoneIDs_, zoneI) @@ -127,14 +140,14 @@ Foam::porosityModels::fixedCoeff::fixedCoeff alpha_[zoneI].setSize(1, tensor::zero); beta_[zoneI].setSize(1, tensor::zero); - alpha_[zoneI][0].xx() = alpha.value().x(); - alpha_[zoneI][0].yy() = alpha.value().y(); - alpha_[zoneI][0].zz() = alpha.value().z(); + alpha_[zoneI][0].xx() = alphaXYZ_.value().x(); + alpha_[zoneI][0].yy() = alphaXYZ_.value().y(); + alpha_[zoneI][0].zz() = alphaXYZ_.value().z(); alpha_[zoneI][0] = coordSys_.R().transformTensor(alpha_[zoneI][0]); - beta_[zoneI][0].xx() = beta.value().x(); - beta_[zoneI][0].yy() = beta.value().y(); - beta_[zoneI][0].zz() = beta.value().z(); + beta_[zoneI][0].xx() = betaXYZ_.value().x(); + beta_[zoneI][0].yy() = betaXYZ_.value().y(); + beta_[zoneI][0].zz() = betaXYZ_.value().z(); beta_[zoneI][0] = coordSys_.R().transformTensor(beta_[zoneI][0]); } } @@ -149,13 +162,13 @@ Foam::porosityModels::fixedCoeff::fixedCoeff forAll(cells, i) { - alpha_[zoneI][i].xx() = alpha.value().x(); - alpha_[zoneI][i].yy() = alpha.value().y(); - alpha_[zoneI][i].zz() = alpha.value().z(); + alpha_[zoneI][i].xx() = alphaXYZ_.value().x(); + alpha_[zoneI][i].yy() = alphaXYZ_.value().y(); + alpha_[zoneI][i].zz() = alphaXYZ_.value().z(); - beta_[zoneI][i].xx() = beta.value().x(); - beta_[zoneI][i].yy() = beta.value().y(); - beta_[zoneI][i].zz() = beta.value().z(); + beta_[zoneI][i].xx() = betaXYZ_.value().x(); + beta_[zoneI][i].yy() = betaXYZ_.value().y(); + beta_[zoneI][i].zz() = betaXYZ_.value().z(); } alpha_[zoneI] = @@ -167,14 +180,6 @@ Foam::porosityModels::fixedCoeff::fixedCoeff } -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::porosityModels::fixedCoeff::~fixedCoeff() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - void Foam::porosityModels::fixedCoeff::calcForce ( const volVectorField& U, diff --git a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H index 7154cdf2..ad441f3a 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/fixedCoeff/fixedCoeff.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -64,10 +64,16 @@ private: // Private data - //- Model alpha coefficient [1/s] + //- alpha coefficient XYZ components (user-supplied) [1/s] + dimensionedVector alphaXYZ_; + + //- beta coefficient XYZ components (user-supplied) [1/m] + dimensionedVector betaXYZ_; + + //- Model alpha coefficient - converted from alphaXYZ [1/s] List alpha_; - //- Model beta coefficient [1/m] + //- Model beta coefficient - converted from betaXYZ [1/m] List beta_; @@ -119,6 +125,9 @@ public: // Member Functions + //- Transform the model data wrt mesh changes + virtual void calcTranformModelData(); + //- Calculate the porosity force virtual void calcForce ( diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C index 81d722a5..613248b0 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -147,13 +147,27 @@ Foam::porosityModel::~porosityModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::porosityModel::transformModelData() +{ + if (!mesh_.upToDatePoints(*this)) + { + calcTranformModelData(); + + // set model up-to-date wrt points + mesh_.setUpToDatePoints(*this); + } +} + + Foam::tmp Foam::porosityModel::porosityModel::force ( const volVectorField& U, const volScalarField& rho, const volScalarField& mu -) const +) { + transformModelData(); + tmp tforce(new vectorField(U.size(), vector::zero)); if (!cellZoneIDs_.empty()) @@ -165,16 +179,14 @@ Foam::tmp Foam::porosityModel::porosityModel::force } -void Foam::porosityModel::addResistance -( - fvVectorMatrix& UEqn -) const +void Foam::porosityModel::addResistance(fvVectorMatrix& UEqn) { if (cellZoneIDs_.empty()) { return; } + transformModelData(); this->correct(UEqn); } @@ -184,13 +196,14 @@ void Foam::porosityModel::addResistance fvVectorMatrix& UEqn, const volScalarField& rho, const volScalarField& mu -) const +) { if (cellZoneIDs_.empty()) { return; } + transformModelData(); this->correct(UEqn, rho, mu); } @@ -200,13 +213,14 @@ void Foam::porosityModel::addResistance const fvVectorMatrix& UEqn, volTensorField& AU, bool correctAUprocBC -) const +) { if (cellZoneIDs_.empty()) { return; } + transformModelData(); this->correct(UEqn, AU); if (correctAUprocBC) @@ -219,24 +233,12 @@ void Foam::porosityModel::addResistance } -bool Foam::porosityModel::movePoints() -{ - // no updates necessary; all member data independent of mesh - return true; -} - - -void Foam::porosityModel::updateMesh(const mapPolyMesh& mpm) -{ - // no updates necessary; all member data independent of mesh -} - - bool Foam::porosityModel::writeData(Ostream& os) const { return true; } + bool Foam::porosityModel::read(const dictionary& dict) { active_ = readBool(dict.lookup("active")); diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H index 06df0bfd..a3b4b0f0 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,6 +99,10 @@ protected: // Protected Member Functions + + //- Transform the model data wrt mesh changes + virtual void calcTranformModelData() = 0; + //- Adjust negative resistance values to be multiplier of max value void adjustNegativeResistance(dimensionedVector& resist); @@ -221,16 +225,19 @@ public: //- Return const access to the cell zone IDs inline const labelList& cellZoneIDs() const; + //- Transform the model data wrt mesh changes + virtual void transformModelData(); + //- Return the force over the cell zone(s) virtual tmp force ( const volVectorField& U, const volScalarField& rho, const volScalarField& mu - ) const; + ); //- Add resistance - virtual void addResistance(fvVectorMatrix& UEqn) const; + virtual void addResistance(fvVectorMatrix& UEqn); //- Add resistance virtual void addResistance @@ -238,7 +245,7 @@ public: fvVectorMatrix& UEqn, const volScalarField& rho, const volScalarField& mu - ) const; + ); //- Add resistance virtual void addResistance @@ -246,16 +253,7 @@ public: const fvVectorMatrix& UEqn, volTensorField& AU, bool correctAUprocBC - ) const; - - - // Topology change - - //- Move points - virtual bool movePoints(); - - //- Update on meshUpdate - virtual void updateMesh(const mapPolyMesh& mpm); + ); // I-O diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C index df302854..339ea07b 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.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-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -126,7 +126,7 @@ bool Foam::porosityModelList::writeData(Ostream& os) const void Foam::porosityModelList::addResistance ( fvVectorMatrix& UEqn -) const +) { forAll(*this, i) { @@ -140,7 +140,7 @@ void Foam::porosityModelList::addResistance fvVectorMatrix& UEqn, const volScalarField& rho, const volScalarField& mu -) const +) { forAll(*this, i) { @@ -154,7 +154,7 @@ void Foam::porosityModelList::addResistance const fvVectorMatrix& UEqn, volTensorField& AU, bool correctAUprocBC -) const +) { forAll(*this, i) { diff --git a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H index 8b79095b..3e953c30 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/porosityModel/porosityModelList.H @@ -94,7 +94,7 @@ public: void reset(const dictionary& dict); //- Add resistance - void addResistance(fvVectorMatrix& UEqn) const; + void addResistance(fvVectorMatrix& UEqn); //- Add resistance void addResistance @@ -102,7 +102,7 @@ public: fvVectorMatrix& UEqn, const volScalarField& rho, const volScalarField& mu - ) const; + ); //- Add resistance void addResistance @@ -110,7 +110,7 @@ public: const fvVectorMatrix& UEqn, volTensorField& AU, bool correctAUprocBC = true - ) const; + ); // I-O diff --git a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C index ae9d5641..8a8361db 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C +++ b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -66,6 +66,12 @@ Foam::porosityModels::powerLaw::~powerLaw() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +void Foam::porosityModels::powerLaw::calcTranformModelData() +{ + // nothing to be transformed +} + + void Foam::porosityModels::powerLaw::calcForce ( const volVectorField& U, diff --git a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H index 299335b7..0bd9be2a 100644 --- a/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H +++ b/src/finiteVolume/cfdTools/general/porosityModel/powerLaw/powerLaw.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,6 +127,9 @@ public: // Member Functions + //- Transform the model data wrt mesh changes + virtual void calcTranformModelData(); + //- Calculate the porosity force virtual void calcForce ( From 37e2c516770d2ea7e608178e71a31fcab0c46dba Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 8 Apr 2014 12:33:55 +0100 Subject: [PATCH 6/8] ENH: removed unused code --- src/parallel/decompose/metisDecomp/metisDecomp.C | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/parallel/decompose/metisDecomp/metisDecomp.C b/src/parallel/decompose/metisDecomp/metisDecomp.C index 2dac90ae..33d9e4db 100644 --- a/src/parallel/decompose/metisDecomp/metisDecomp.C +++ b/src/parallel/decompose/metisDecomp/metisDecomp.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -203,20 +203,6 @@ Foam::label Foam::metisDecomp::decompose // output: number of cut edges int edgeCut = 0; - // Vertex weight info - int* vwgtPtr = NULL; - int* adjwgtPtr = NULL; - - if (cellWeights.size()) - { - vwgtPtr = cellWeights.begin(); - } - if (faceWeights.size()) - { - adjwgtPtr = faceWeights.begin(); - } - - if (method == "recursive") { METIS_PartGraphRecursive From 6cd3c738b189968bed66c3cc6369a1d739360c7f Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 9 Apr 2014 09:12:46 +0100 Subject: [PATCH 7/8] BUG: solidBodyMotionFvMesh - correct parallel running after commit f3f82ff --- .../solidBodyMotionFvMesh.C | 38 ++++++++++--------- .../solidBodyMotionFvMesh.H | 3 ++ 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C index 184cbe60..030fdea8 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C @@ -76,6 +76,7 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) ) ), pointIDs_(), + moveAllCells_(false), UName_(dynamicMeshCoeffs_.lookupOrDefault("UName", "U")) { if (undisplacedPoints_.size() != nPoints()) @@ -142,7 +143,14 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io) cellIDs = set.toc(); } - if (cellIDs.size()) + label nCells = returnReduce(cellIDs.size(), sumOp