From 368e06e611b694824c63a9cf23a7bcda8dc46cee Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 10 Dec 2013 16:58:57 +0000 Subject: [PATCH 01/60] STYLE: Minor code formatting --- .../surfaceInterpolation/schemes/CoBlended/CoBlended.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H index e8ed67a9d8..8d420950b0 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H @@ -170,7 +170,7 @@ public: ( surfaceInterpolationScheme::New(mesh, faceFlux, is) ), - faceFlux_(faceFlux) + faceFlux_(faceFlux) { if (Co1_ < 0 || Co2_ < 0 || Co1_ >= Co2_) { From 83d222ee68792c1e0517169bc0dfc67d2141fdb4 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:38:59 +0000 Subject: [PATCH 02/60] ENH: Added new fvc cellReduce functions with templated op to generate cell data from face data --- .../finiteVolume/fvc/fvcCellReduce.C | 118 ++++++++++++++++++ .../finiteVolume/fvc/fvcCellReduce.H | 82 ++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C create mode 100644 src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H diff --git a/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C new file mode 100644 index 0000000000..63c718375b --- /dev/null +++ b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.C @@ -0,0 +1,118 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "fvcCellReduce.H" +#include "fvMesh.H" +#include "volFields.H" +#include "surfaceFields.H" +#include "zeroGradientFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace fvc +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +tmp > cellReduce +( + const GeometricField& ssf, + const CombineOp& cop +) +{ + typedef GeometricField volFieldType; + + const fvMesh& mesh = ssf.mesh(); + + tmp tresult + ( + new volFieldType + ( + IOobject + ( + "cellReduce(" + ssf.name() + ')', + ssf.instance(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensioned("0", ssf.dimensions(), pTraits::zero), + zeroGradientFvPatchField::typeName + ) + ); + + volFieldType& result = tresult(); + + const labelUList& own = mesh.owner(); + const labelUList& nbr = mesh.neighbour(); + + forAll(own, i) + { + label cellI = own[i]; + cop(result[cellI], ssf[i]); + } + forAll(nbr, i) + { + label cellI = nbr[i]; + cop(result[cellI], ssf[i]); + } + + result.correctBoundaryConditions(); + + return tresult; +} + + +template +tmp > cellReduce +( + const tmp&> tssf, + const CombineOp& cop +) +{ + tmp > + tvf(cellReduce(cop, tssf)); + + tssf.clear(); + return tvf; +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace fvc + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H new file mode 100644 index 0000000000..19bd24135a --- /dev/null +++ b/src/finiteVolume/finiteVolume/fvc/fvcCellReduce.H @@ -0,0 +1,82 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +InNamespace + Foam::fvc + +Description + Construct a volume field from a surface field using a combine operator. + +SourceFiles + fvcCellReduce.C + +\*---------------------------------------------------------------------------*/ + +#ifndef fvcCellReduce_H +#define fvcCellReduce_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Namespace fvc functions Declaration +\*---------------------------------------------------------------------------*/ + +namespace fvc +{ + template + tmp > cellReduce + ( + const GeometricField&, + const CombineOp& cop + ); + + template + tmp > cellReduce + ( + const tmp >&, + const CombineOp& cop + ); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "fvcCellReduce.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From f1d7acffdd976be61d7adc67ea29d59ac3c66f59 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:40:59 +0000 Subject: [PATCH 03/60] ENH: Added new blendingFactor FO to output blending factor used by blended convection schemes --- .../blendingFactor/IOblendingFactor.H | 49 +++++ .../utilities/blendingFactor/blendingFactor.C | 131 +++++++++++++ .../utilities/blendingFactor/blendingFactor.H | 175 ++++++++++++++++++ .../blendingFactorFunctionObject.C | 42 +++++ .../blendingFactorFunctionObject.H | 54 ++++++ .../blendingFactor/blendingFactorTemplates.C | 119 ++++++++++++ 6 files changed, 570 insertions(+) create mode 100644 src/postProcessing/functionObjects/utilities/blendingFactor/IOblendingFactor.H create mode 100644 src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C create mode 100644 src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H create mode 100644 src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.C create mode 100644 src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.H create mode 100644 src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/IOblendingFactor.H b/src/postProcessing/functionObjects/utilities/blendingFactor/IOblendingFactor.H new file mode 100644 index 0000000000..2d1ae3dc1e --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/IOblendingFactor.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +Typedef + Foam::IOblendingFactor + +Description + Instance of the generic IOOutputFilter for blendingFactor. + +\*---------------------------------------------------------------------------*/ + +#ifndef IOblendingFactor_H +#define IOblendingFactor_H + +#include "blendingFactor.H" +#include "IOOutputFilter.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef IOOutputFilter IOblendingFactor; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C new file mode 100644 index 0000000000..351c48bfb4 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.C @@ -0,0 +1,131 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "blendingFactor.H" +#include "dictionary.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(blendingFactor, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::blendingFactor::blendingFactor +( + const word& name, + const objectRegistry& obr, + const dictionary& dict, + const bool loadFromFiles +) +: + name_(name), + obr_(obr), + active_(true), + phiName_("unknown-phiName"), + fieldName_("unknown-fieldName") +{ + // Check if the available mesh is an fvMesh, otherwise deactivate + if (!isA(obr_)) + { + active_ = false; + WarningIn + ( + "blendingFactor::blendingFactor" + "(" + "const word&, " + "const objectRegistry&, " + "const dictionary&, " + "const bool" + ")" + ) << "No fvMesh available, deactivating " << name_ << nl + << endl; + } + + read(dict); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::blendingFactor::~blendingFactor() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::blendingFactor::read(const dictionary& dict) +{ + if (active_) + { + phiName_ = dict.lookupOrDefault("phiName", "phi"); + dict.lookup("fieldName") >> fieldName_; + } +} + + +void Foam::blendingFactor::execute() +{ + if (active_) + { + calc(); + calc(); + } +} + + +void Foam::blendingFactor::end() +{ + // Do nothing +} + +void Foam::blendingFactor::timeSet() +{ + // Do nothing +} + + +void Foam::blendingFactor::write() +{ + if (active_) + { + const word fieldName = "blendingFactor:" + fieldName_; + + const volScalarField& blendingFactor = + obr_.lookupObject(fieldName); + + Info<< type() << " " << name_ << " output:" << nl + << " writing field " << blendingFactor.name() << nl + << endl; + + blendingFactor.write(); + } +} + + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H new file mode 100644 index 0000000000..8b86a25cea --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactor.H @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::blendingFactor + +Group + grpUtilitiesFunctionObjects + +Description + This function object calculates and outputs the blendingFactor as used by + the bended convection schemes. The output is a volume field (cells) whose + value is calculated via the maximum blending factor for any cell face. + + +SourceFiles + blendingFactor.C + IOblendingFactor.H + +\*---------------------------------------------------------------------------*/ + +#ifndef blendingFactor_H +#define blendingFactor_H + +#include "volFieldsFwd.H" +#include "surfaceFieldsFwd.H" +#include "OFstream.H" +#include "Switch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +class objectRegistry; +class dictionary; +class polyMesh; +class mapPolyMesh; + +/*---------------------------------------------------------------------------*\ + Class blendingFactor Declaration +\*---------------------------------------------------------------------------*/ + +class blendingFactor +{ + // Private data + + //- Name of this set of blendingFactor objects + word name_; + + //- Reference to the database + const objectRegistry& obr_; + + //- On/off switch + bool active_; + + //- Name of flux field, default is "phi" + word phiName_; + + //- Field name + word fieldName_; + + + // Private Member Functions + + //- Disallow default bitwise copy construct + blendingFactor(const blendingFactor&); + + //- Disallow default bitwise assignment + void operator=(const blendingFactor&); + + //- Return the blending factor field from the database + template + volScalarField& factor + ( + const GeometricField& field + ); + + //- Calculate the blending factor + template + void calc(); + + +public: + + //- Runtime type information + TypeName("blendingFactor"); + + + // Constructors + + //- Construct for given objectRegistry and dictionary. + // Allow the possibility to load fields from files + blendingFactor + ( + const word& name, + const objectRegistry&, + const dictionary&, + const bool loadFromFiles = false + ); + + + //- Destructor + virtual ~blendingFactor(); + + + // Member Functions + + //- Return name of the set of blendingFactor + virtual const word& name() const + { + return name_; + } + + //- Read the blendingFactor data + virtual void read(const dictionary&); + + //- Execute, currently does nothing + virtual void execute(); + + //- Execute at the final time-loop, currently does nothing + virtual void end(); + + //- Called when time was set at the end of the Time::operator++ + virtual void timeSet(); + + //- Calculate the blendingFactor and write + virtual void write(); + + //- Update for changes of mesh + virtual void updateMesh(const mapPolyMesh&) + {} + + //- Update for changes of mesh + virtual void movePoints(const polyMesh&) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "blendingFactorTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.C b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.C new file mode 100644 index 0000000000..6f32ea9c6f --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.C @@ -0,0 +1,42 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "blendingFactorFunctionObject.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineNamedTemplateTypeNameAndDebug(blendingFactorFunctionObject, 0); + + addToRunTimeSelectionTable + ( + functionObject, + blendingFactorFunctionObject, + dictionary + ); +} + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.H b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.H new file mode 100644 index 0000000000..b2e2369ebe --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorFunctionObject.H @@ -0,0 +1,54 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +Typedef + Foam::blendingFactorFunctionObject + +Description + FunctionObject wrapper around blendingFactor to allow it to be created + via the functions entry within controlDict. + +SourceFiles + blendingFactorFunctionObject.C + +\*---------------------------------------------------------------------------*/ + +#ifndef blendingFactorFunctionObject_H +#define blendingFactorFunctionObject_H + +#include "blendingFactor.H" +#include "OutputFilterFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + typedef OutputFilterFunctionObject + blendingFactorFunctionObject; +} + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C new file mode 100644 index 0000000000..3a284b8c73 --- /dev/null +++ b/src/postProcessing/functionObjects/utilities/blendingFactor/blendingFactorTemplates.C @@ -0,0 +1,119 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "gaussConvectionScheme.H" +#include "blendedSchemeBase.H" +#include "fvcCellReduce.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template +Foam::volScalarField& Foam::blendingFactor::factor +( + const GeometricField& field +) +{ + const word fieldName = "blendingFactor:" + field.name(); + + if (!obr_.foundObject(fieldName)) + { + const fvMesh& mesh = refCast(obr_); + + volScalarField* factorPtr = + new volScalarField + ( + IOobject + ( + fieldName, + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("0", dimless, 0.0), + zeroGradientFvPatchScalarField::typeName + ); + + obr_.store(factorPtr); + } + + return + const_cast + ( + obr_.lookupObject(fieldName) + ); +} + + +template +void Foam::blendingFactor::calc() +{ + typedef GeometricField fieldType; + + if (!obr_.foundObject(fieldName_)) + { + return; + } + + const fvMesh& mesh = refCast(obr_); + + const fieldType& field = mesh.lookupObject(fieldName_); + + const word divScheme("div(" + phiName_ + ',' + fieldName_ + ')'); + ITstream& its = mesh.divScheme(divScheme); + + const surfaceScalarField& phi = + mesh.lookupObject(phiName_); + + tmp > cs = + fv::convectionScheme::New(mesh, phi, its); + + const fv::gaussConvectionScheme& gcs = + refCast >(cs()); + + const surfaceInterpolationScheme& interpScheme = + gcs.interpScheme(); + + if (!isA >(interpScheme)) + { + FatalErrorIn("void Foam::blendingFactor::execute()") + << interpScheme.typeName << " is not a blended scheme" + << exit(FatalError); + } + + // retrieve the face-based blending factor + const blendedSchemeBase& blendedScheme = + refCast >(interpScheme); + const surfaceScalarField factorf(blendedScheme.blendingFactor(field)); + + // convert into vol field whose values represent the local face maxima + volScalarField& factor = this->factor(field); + factor = fvc::cellReduce(factorf, maxEqOp()); + factor.correctBoundaryConditions(); +} + + +// ************************************************************************* // From 3ce683241e66aef18d19b4e2db98bf920fe09f8c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:41:40 +0000 Subject: [PATCH 04/60] ENH: Added base class for blended convection schemes --- .../blendedSchemeBase/blendedSchemeBase.H | 87 +++++++++++++++++++ .../blendedSchemeBase/blendedSchemeBaseName.C | 36 ++++++++ 2 files changed, 123 insertions(+) create mode 100644 src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H create mode 100644 src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBaseName.C diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H b/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H new file mode 100644 index 0000000000..2c485e0147 --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBase.H @@ -0,0 +1,87 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::blendedSchemeBase + +Description + Base class for blended schemes to provide access to the blending factor + surface field + +\*---------------------------------------------------------------------------*/ + +#ifndef blendedSchemeBase_H +#define blendedSchemeBase_H + +#include "className.H" +#include "tmp.H" +#include "surfaceFieldsFwd.H" +#include "volFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +TemplateName(blendedSchemeBase); + +/*---------------------------------------------------------------------------*\ + Class blendedSchemeBase Declaration +\*---------------------------------------------------------------------------*/ + +template +class blendedSchemeBase +: + public blendedSchemeBaseName +{ + +public: + + //- Constructor + blendedSchemeBase() + {} + + //- Destructor + virtual ~blendedSchemeBase() + {} + + + // Memeber Functions + + //- Return the face-based blending factor + virtual tmp blendingFactor + ( + const GeometricField& vf + ) const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBaseName.C b/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBaseName.C new file mode 100644 index 0000000000..0a97d7f617 --- /dev/null +++ b/src/finiteVolume/interpolation/surfaceInterpolation/blendedSchemeBase/blendedSchemeBaseName.C @@ -0,0 +1,36 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "blendedSchemeBase.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(blendedSchemeBaseName, 0); +} + + +// ************************************************************************* // From 9437175bb83c4ceab0112304841d705687191746 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:42:02 +0000 Subject: [PATCH 05/60] STYLE: Updated code comments --- src/postProcessing/functionObjects/utilities/Peclet/Peclet.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C index 07c7e436b5..0c77608b13 100644 --- a/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C +++ b/src/postProcessing/functionObjects/utilities/Peclet/Peclet.C @@ -197,12 +197,12 @@ void Foam::Peclet::execute() void Foam::Peclet::end() { - // Do nothing - only valid on write + // Do nothing } void Foam::Peclet::timeSet() { - // Do nothing - only valid on write + // Do nothing } From 351d0f420c105d1f28e69e1e724e1303460b55e9 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:42:35 +0000 Subject: [PATCH 06/60] ENH: Simplified lookup from database --- .../flowRateInletVelocityFvPatchVectorField.C | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C index c59d8d89ee..e05c34aa20 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C @@ -199,10 +199,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::updateCoeffs() else { // mass flow-rate - if - ( - patch().boundaryMesh().mesh().foundObject(rhoName_) - ) + if (db().foundObject(rhoName_)) { const fvPatchField& rhop = patch().lookupPatchField(rhoName_); From 17b321cbb11e5699616e606694a1b56272e604df Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:43:15 +0000 Subject: [PATCH 07/60] BUG: Added file missed during commit 3ce6832 --- src/finiteVolume/Make/files | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 0bcfcf48a5..d7ea0f0099 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -251,6 +251,8 @@ surfaceInterpolation = interpolation/surfaceInterpolation $(surfaceInterpolation)/surfaceInterpolation/surfaceInterpolation.C $(surfaceInterpolation)/surfaceInterpolationScheme/surfaceInterpolationSchemes.C +$(surfaceInterpolation)/blendedSchemeBase/blendedSchemeBaseName.C + schemes = $(surfaceInterpolation)/schemes $(schemes)/linear/linear.C $(schemes)/pointLinear/pointLinear.C From 93a4ba566fe71f1af088ef638af5e93f0542da42 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:45:13 +0000 Subject: [PATCH 08/60] ENH: Added access to interpolation scheme --- .../gaussConvectionScheme/gaussConvectionScheme.C | 10 +++++++++- .../gaussConvectionScheme/gaussConvectionScheme.H | 4 +++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C index c814f22060..1c68b9cf12 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.C +++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.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 @@ -39,6 +39,14 @@ namespace fv // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +template +const surfaceInterpolationScheme& +gaussConvectionScheme::interpScheme() const +{ + return tinterpScheme_(); +} + + template tmp > gaussConvectionScheme::interpolate diff --git a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H index 61d6c22d37..a3ce0d1ec0 100644 --- a/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.H +++ b/src/finiteVolume/finiteVolume/convectionSchemes/gaussConvectionScheme/gaussConvectionScheme.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 @@ -134,6 +134,8 @@ public: // Member Functions + const surfaceInterpolationScheme& interpScheme() const; + tmp > interpolate ( const surfaceScalarField&, From 30fb36f7e3d74f7e7646c4871a256432b775c5ad Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:46:42 +0000 Subject: [PATCH 09/60] ENH: Refactored blended convection schemes --- .../limitedSchemes/blended/blended.H | 38 ++++++++++++- .../schemes/CoBlended/CoBlended.H | 57 +++++++++++++------ .../schemes/localBlended/localBlended.H | 33 +++++++++-- 3 files changed, 103 insertions(+), 25 deletions(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/blended/blended.H b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/blended/blended.H index 6d207fcdcd..f58b8c2393 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/blended/blended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/blended/blended.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 @@ -36,6 +36,7 @@ SourceFiles #define blended_H #include "limitedSurfaceInterpolationScheme.H" +#include "blendedSchemeBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +50,8 @@ namespace Foam template class blended : - public limitedSurfaceInterpolationScheme + public limitedSurfaceInterpolationScheme, + public blendedSchemeBase { // Private data @@ -111,8 +113,40 @@ public: {} + //- Destructor + virtual ~blended() + {} + + // Member Functions + //- Return the face-based blending factor + virtual tmp blendingFactor + ( + const GeometricField& vf + ) const + { + return tmp + ( + new surfaceScalarField + ( + IOobject + ( + vf.name() + "BlendingFactor", + this->mesh().time().timeName(), + this->mesh() + ), + this->mesh(), + dimensionedScalar + ( + "blendingFactor", + dimless, + blendingFactor_ + ) + ) + ); + } + //- Return the interpolation limiter virtual tmp limiter ( diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H index 8d420950b0..3f15520061 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H @@ -63,6 +63,7 @@ SourceFiles #define CoBlended_H #include "surfaceInterpolationScheme.H" +#include "blendedSchemeBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -76,7 +77,8 @@ namespace Foam template class CoBlended : - public surfaceInterpolationScheme + public surfaceInterpolationScheme, + public blendedSchemeBase { // Private data @@ -135,10 +137,7 @@ public: ), faceFlux_ ( - mesh.lookupObject - ( - word(is) - ) + mesh.lookupObject(word(is)) ) { if (Co1_ < 0 || Co2_ < 0 || Co1_ >= Co2_) @@ -182,17 +181,39 @@ public: } + //- Destructor + virtual ~CoBlended() + {} + + // Member Functions - //- Return the face-based Courant number blending factor - tmp blendingFactor() const + //- Return the face-based blending factor + virtual tmp blendingFactor + ( + const GeometricField& vf + ) const { - const fvMesh& mesh = faceFlux_.mesh(); + const fvMesh& mesh = this->mesh(); - return + tmp tbf ( - scalar(1) - - max + new surfaceScalarField + ( + IOobject + ( + vf.name() + "BlendingFactor", + mesh.time().timeName(), + mesh + ), + mesh, + dimensionedScalar("blendingFactor", dimless, 0.0) + ) + ); + + tbf() = + scalar(1) + - max ( min ( @@ -204,8 +225,9 @@ public: scalar(1) ), scalar(0) - ) - ); + ); + + return tbf; } @@ -216,9 +238,10 @@ public: const GeometricField& vf ) const { - surfaceScalarField bf(blendingFactor()); + surfaceScalarField bf(blendingFactor(vf)); - Info<< "weights " << max(bf) << " " << min(bf) << endl; + Info<< "weights " << max(bf).value() << " " << min(bf).value() + << endl; return bf*tScheme1_().weights(vf) @@ -234,7 +257,7 @@ public: const GeometricField& vf ) const { - surfaceScalarField bf(blendingFactor()); + surfaceScalarField bf(blendingFactor(vf)); return bf*tScheme1_().interpolate(vf) @@ -257,7 +280,7 @@ public: const GeometricField& vf ) const { - surfaceScalarField bf(blendingFactor()); + surfaceScalarField bf(blendingFactor(vf)); if (tScheme1_().corrected()) { diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H index 5f49be98fd..0e85f0ea76 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/localBlended/localBlended.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 @@ -36,6 +36,7 @@ SourceFiles #define localBlended_H #include "surfaceInterpolationScheme.H" +#include "blendedSchemeBase.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,7 +50,8 @@ namespace Foam template class localBlended : - public surfaceInterpolationScheme + public surfaceInterpolationScheme, + public blendedSchemeBase { // Private Member Functions @@ -115,8 +117,27 @@ public: {} + //- Destructor + virtual ~localBlended() + {} + + // Member Functions + //- Return the face-based blending factor + virtual tmp blendingFactor + ( + const GeometricField& vf + ) const + { + return + this->mesh().objectRegistry::template + lookupObject + ( + word(vf.name() + "BlendingFactor") + ); + } + //- Return the interpolation weighting factors tmp weights ( @@ -125,10 +146,10 @@ public: { const surfaceScalarField& blendingFactor = this->mesh().objectRegistry::template - lookupObject - ( - word(vf.name() + "BlendingFactor") - ); + lookupObject + ( + word(vf.name() + "BlendingFactor") + ); return blendingFactor*tScheme1_().weights(vf) From a97070c303b6f24217a9bd636603d5260cc5ed8b Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:57:19 +0000 Subject: [PATCH 10/60] ENH: Added pimpleam pitzDaily test case --- .../incompressible/pimpleFoam/pitzDaily/0/U | 52 ++++++ .../pimpleFoam/pitzDaily/0/epsilon | 50 +++++ .../incompressible/pimpleFoam/pitzDaily/0/k | 50 +++++ .../pimpleFoam/pitzDaily/0/nuTilda | 50 +++++ .../incompressible/pimpleFoam/pitzDaily/0/nut | 51 ++++++ .../incompressible/pimpleFoam/pitzDaily/0/p | 50 +++++ .../pitzDaily/constant/RASProperties | 25 +++ .../pitzDaily/constant/polyMesh/blockMeshDict | 173 ++++++++++++++++++ .../pitzDaily/constant/polyMesh/boundary | 53 ++++++ .../pitzDaily/constant/transportProperties | 39 ++++ .../pitzDaily/constant/turbulenceProperties | 20 ++ .../pimpleFoam/pitzDaily/system/controlDict | 52 ++++++ .../pimpleFoam/pitzDaily/system/fvSchemes | 71 +++++++ .../pimpleFoam/pitzDaily/system/fvSolution | 62 +++++++ 14 files changed, 798 insertions(+) create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/0/U create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/0/epsilon create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/0/k create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/0/nuTilda create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/0/nut create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/0/p create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/constant/RASProperties create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/blockMeshDict create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/boundary create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/constant/transportProperties create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/constant/turbulenceProperties create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/system/controlDict create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSchemes create mode 100644 tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSolution diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/0/U b/tutorials/incompressible/pimpleFoam/pitzDaily/0/U new file mode 100644 index 0000000000..885c5b9de4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/0/U @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + inlet + { + type fixedValue; + value uniform (10 0 0); + } + + outlet + { + type zeroGradient; + } + + upperWall + { + type fixedValue; + value uniform (0 0 0); + } + + lowerWall + { + type fixedValue; + value uniform (0 0 0); + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/0/epsilon b/tutorials/incompressible/pimpleFoam/pitzDaily/0/epsilon new file mode 100644 index 0000000000..d82c45e629 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/0/epsilon @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 14.855; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 14.855; + } + outlet + { + type zeroGradient; + } + upperWall + { + type epsilonWallFunction; + value uniform 14.855; + } + lowerWall + { + type epsilonWallFunction; + value uniform 14.855; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/0/k b/tutorials/incompressible/pimpleFoam/pitzDaily/0/k new file mode 100644 index 0000000000..7de1adf4b5 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/0/k @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.375; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0.375; + } + outlet + { + type zeroGradient; + } + upperWall + { + type kqRWallFunction; + value uniform 0.375; + } + lowerWall + { + type kqRWallFunction; + value uniform 0.375; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/0/nuTilda b/tutorials/incompressible/pimpleFoam/pitzDaily/0/nuTilda new file mode 100644 index 0000000000..cbe04420b9 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/0/nuTilda @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object nuTilda; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type fixedValue; + value uniform 0; + } + + outlet + { + type zeroGradient; + } + + upperWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/0/nut b/tutorials/incompressible/pimpleFoam/pitzDaily/0/nut new file mode 100644 index 0000000000..585d8ec0f4 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/0/nut @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type calculated; + value uniform 0; + } + outlet + { + type calculated; + value uniform 0; + } + upperWall + { + type nutkWallFunction; + value uniform 0; + } + lowerWall + { + type nutkWallFunction; + value uniform 0; + } + frontAndBack + { + type empty; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/0/p b/tutorials/incompressible/pimpleFoam/pitzDaily/0/p new file mode 100644 index 0000000000..0fdd33ec47 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/0/p @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + inlet + { + type zeroGradient; + } + + outlet + { + type fixedValue; + value uniform 0; + } + + upperWall + { + type zeroGradient; + } + + lowerWall + { + type zeroGradient; + } + + frontAndBack + { + type empty; + } +} + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/constant/RASProperties b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/RASProperties new file mode 100644 index 0000000000..a4937b503a --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel kEpsilon; + +turbulence on; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/blockMeshDict b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000..0e0fcf1c98 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/blockMeshDict @@ -0,0 +1,173 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.001; + +vertices +( + (-20.6 0 -0.5) + (-20.6 3 -0.5) + (-20.6 12.7 -0.5) + (-20.6 25.4 -0.5) + (0 -25.4 -0.5) + (0 -5 -0.5) + (0 0 -0.5) + (0 3 -0.5) + (0 12.7 -0.5) + (0 25.4 -0.5) + (206 -25.4 -0.5) + (206 -8.5 -0.5) + (206 0 -0.5) + (206 6.5 -0.5) + (206 17 -0.5) + (206 25.4 -0.5) + (290 -16.6 -0.5) + (290 -6.3 -0.5) + (290 0 -0.5) + (290 4.5 -0.5) + (290 11 -0.5) + (290 16.6 -0.5) + (-20.6 0 0.5) + (-20.6 3 0.5) + (-20.6 12.7 0.5) + (-20.6 25.4 0.5) + (0 -25.4 0.5) + (0 -5 0.5) + (0 0 0.5) + (0 3 0.5) + (0 12.7 0.5) + (0 25.4 0.5) + (206 -25.4 0.5) + (206 -8.5 0.5) + (206 0 0.5) + (206 6.5 0.5) + (206 17 0.5) + (206 25.4 0.5) + (290 -16.6 0.5) + (290 -6.3 0.5) + (290 0 0.5) + (290 4.5 0.5) + (290 11 0.5) + (290 16.6 0.5) +); + +blocks +( + hex (0 6 7 1 22 28 29 23) (18 7 1) simpleGrading (0.5 1.8 1) + hex (1 7 8 2 23 29 30 24) (18 10 1) simpleGrading (0.5 4 1) + hex (2 8 9 3 24 30 31 25) (18 13 1) simpleGrading (0.5 0.25 1) + hex (4 10 11 5 26 32 33 27) (180 18 1) simpleGrading (4 1 1) + hex (5 11 12 6 27 33 34 28) (180 9 1) edgeGrading (4 4 4 4 0.5 1 1 0.5 1 1 1 1) + hex (6 12 13 7 28 34 35 29) (180 7 1) edgeGrading (4 4 4 4 1.8 1 1 1.8 1 1 1 1) + hex (7 13 14 8 29 35 36 30) (180 10 1) edgeGrading (4 4 4 4 4 1 1 4 1 1 1 1) + hex (8 14 15 9 30 36 37 31) (180 13 1) simpleGrading (4 0.25 1) + hex (10 16 17 11 32 38 39 33) (25 18 1) simpleGrading (2.5 1 1) + hex (11 17 18 12 33 39 40 34) (25 9 1) simpleGrading (2.5 1 1) + hex (12 18 19 13 34 40 41 35) (25 7 1) simpleGrading (2.5 1 1) + hex (13 19 20 14 35 41 42 36) (25 10 1) simpleGrading (2.5 1 1) + hex (14 20 21 15 36 42 43 37) (25 13 1) simpleGrading (2.5 0.25 1) +); + +edges +( +); + +boundary +( + inlet + { + type patch; + faces + ( + (0 22 23 1) + (1 23 24 2) + (2 24 25 3) + ); + } + outlet + { + type patch; + faces + ( + (16 17 39 38) + (17 18 40 39) + (18 19 41 40) + (19 20 42 41) + (20 21 43 42) + ); + } + upperWall + { + type wall; + faces + ( + (3 25 31 9) + (9 31 37 15) + (15 37 43 21) + ); + } + lowerWall + { + type wall; + faces + ( + (0 6 28 22) + (6 5 27 28) + (5 4 26 27) + (4 10 32 26) + (10 16 38 32) + ); + } + frontAndBack + { + type empty; + faces + ( + (22 28 29 23) + (23 29 30 24) + (24 30 31 25) + (26 32 33 27) + (27 33 34 28) + (28 34 35 29) + (29 35 36 30) + (30 36 37 31) + (32 38 39 33) + (33 39 40 34) + (34 40 41 35) + (35 41 42 36) + (36 42 43 37) + (0 1 7 6) + (1 2 8 7) + (2 3 9 8) + (4 5 11 10) + (5 6 12 11) + (6 7 13 12) + (7 8 14 13) + (8 9 15 14) + (10 11 17 16) + (11 12 18 17) + (12 13 19 18) + (13 14 20 19) + (14 15 21 20) + ); + } +); + +mergePatchPairs +( +); + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/boundary b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/boundary new file mode 100644 index 0000000000..221823b308 --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/polyMesh/boundary @@ -0,0 +1,53 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 2.2.x | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class polyBoundaryMesh; + location "constant/polyMesh"; + object boundary; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +5 +( + inlet + { + type patch; + nFaces 30; + startFace 24170; + } + outlet + { + type patch; + nFaces 57; + startFace 24200; + } + upperWall + { + type wall; + nFaces 223; + startFace 24257; + } + lowerWall + { + type wall; + nFaces 250; + startFace 24480; + } + frontAndBack + { + type empty; + inGroups 1(empty); + nFaces 24450; + startFace 24730; + } +) + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/constant/transportProperties b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/transportProperties new file mode 100644 index 0000000000..b40b7d66cd --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/transportProperties @@ -0,0 +1,39 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +transportModel Newtonian; + +nu nu [ 0 2 -1 0 0 0 0 ] 1e-05; + +CrossPowerLawCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + m m [ 0 0 1 0 0 0 0 ] 1; + n n [ 0 0 0 0 0 0 0 ] 1; +} + +BirdCarreauCoeffs +{ + nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06; + nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06; + k k [ 0 0 1 0 0 0 0 ] 0; + n n [ 0 0 0 0 0 0 0 ] 1; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/constant/turbulenceProperties b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/turbulenceProperties new file mode 100644 index 0000000000..e7fa28c74a --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/constant/turbulenceProperties @@ -0,0 +1,20 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType RASModel; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/system/controlDict b/tutorials/incompressible/pimpleFoam/pitzDaily/system/controlDict new file mode 100644 index 0000000000..a8ea900b3c --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/system/controlDict @@ -0,0 +1,52 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application pimpleFoam; + +startFrom latestTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.0001; + +writeControl adjustableRunTime; + +writeInterval 0.001; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 5; + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSchemes b/tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSchemes new file mode 100644 index 0000000000..926d489aae --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSchemes @@ -0,0 +1,71 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; + grad(p) Gauss linear; + grad(U) Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) bounded Gauss linearUpwind grad(U); + div(phi,k) bounded Gauss upwind; + div(phi,epsilon) bounded Gauss upwind; + div(phi,R) bounded Gauss upwind; + div(R) Gauss linear; + div(phi,nuTilda) bounded Gauss upwind; + div((nuEff*dev(T(grad(U))))) Gauss linear; +} + +laplacianSchemes +{ + default none; + laplacian(nuEff,U) Gauss linear corrected; + laplacian(rAUf,p) Gauss linear corrected; + laplacian(DkEff,k) Gauss linear corrected; + laplacian(DepsilonEff,epsilon) Gauss linear corrected; + laplacian(DREff,R) Gauss linear corrected; + laplacian(DnuTildaEff,nuTilda) Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; + interpolate(U) linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p ; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSolution b/tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSolution new file mode 100644 index 0000000000..880d7bef7b --- /dev/null +++ b/tutorials/incompressible/pimpleFoam/pitzDaily/system/fvSolution @@ -0,0 +1,62 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + p + { + solver GAMG; + tolerance 1e-7; + relTol 0.01; + + smoother GaussSeidel; + + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + $p; + relTol 0; + } + + "(U|k|epsilon)" + { + solver PBiCG; + preconditioner DILU; + tolerance 1e-05; + relTol 0.1; + } + + "(U|k|epsilon)Final" + { + $U; + relTol 0; + } +} + +PIMPLE +{ + nNonOrthogonalCorrectors 0; + nCorrectors 2; +} + + +// ************************************************************************* // From 2d1ed06aab19be011a364dcbbc2ea69555985e0f Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 12:57:56 +0000 Subject: [PATCH 11/60] ENH: Updated Make/files for utility function objects --- src/postProcessing/functionObjects/utilities/Make/files | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/postProcessing/functionObjects/utilities/Make/files b/src/postProcessing/functionObjects/utilities/Make/files index f711fc0880..6a905f28a1 100644 --- a/src/postProcessing/functionObjects/utilities/Make/files +++ b/src/postProcessing/functionObjects/utilities/Make/files @@ -12,6 +12,9 @@ Peclet/PecletFunctionObject.C Q/Q.C Q/QFunctionObject.C +blendingFactor/blendingFactor.C +blendingFactor/blendingFactorFunctionObject.C + DESModelRegions/DESModelRegions.C DESModelRegions/DESModelRegionsFunctionObject.C From 171d004cb4d8cedec2b803dc79cf0256dfe8acaf Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 12 Dec 2013 13:04:10 +0000 Subject: [PATCH 12/60] BUG: fvIOoptionList - corrected typo in output messaage - mantis #1109 --- src/fvOptions/fvOptions/fvIOoptionList.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fvOptions/fvOptions/fvIOoptionList.C b/src/fvOptions/fvOptions/fvIOoptionList.C index 287e4171be..0a7ab4e6fc 100644 --- a/src/fvOptions/fvOptions/fvIOoptionList.C +++ b/src/fvOptions/fvOptions/fvIOoptionList.C @@ -45,7 +45,7 @@ Foam::IOobject Foam::fv::IOoptionList::createIOobject if (io.headerOk()) { - Info<< "Creating fintite volume options from " << io.name() << nl + Info<< "Creating finite volume options from " << io.name() << nl << endl; io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; From b479c83c179df41d5fac15f5218cc1c84914e1f9 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 13 Dec 2013 13:04:11 +0000 Subject: [PATCH 13/60] ENH: flameSpreadWaterSuppressionPanel: unused patchField entry in p_rgh --- .../fireFoam/les/flameSpreadWaterSuppressionPanel/0/p_rgh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/p_rgh b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/p_rgh index e0461769d0..d95b85f7ba 100755 --- a/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/p_rgh +++ b/tutorials/combustion/fireFoam/les/flameSpreadWaterSuppressionPanel/0/p_rgh @@ -21,12 +21,6 @@ internalField uniform 101325; boundaryField { - wall - { - type fixedFluxPressure; - value $internalField; - } - outlet { type fixedFluxPressure; From 9d2e472a5aab610eb6f83e516f58bf1975e15b4b Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 13 Dec 2013 13:09:31 +0000 Subject: [PATCH 14/60] ENH: angledDuct: renamed wall to walls --- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T | 2 +- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U | 2 +- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat | 2 +- .../compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon | 2 +- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k | 2 +- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut | 2 +- tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p | 2 +- .../angledDuct/constant/polyMesh/blockMeshDict.m4 | 2 +- .../rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary | 6 +++++- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T index 561ca236be..76e54ad382 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/T @@ -29,7 +29,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U index e9b532f373..47440fb13c 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat index dc2104f83c..33ecb425e2 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/alphat @@ -31,7 +31,7 @@ boundaryField type compressible::alphatWallFunction; value uniform 0; } - wall + walls { type compressible::alphatWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon index e4dccfe577..c6f28faeea 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/epsilon @@ -31,7 +31,7 @@ boundaryField type compressible::epsilonWallFunction; value uniform 200; } - wall + walls { type compressible::epsilonWallFunction; value uniform 200; diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k index 655a91bb45..b92ab42afe 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/k @@ -31,7 +31,7 @@ boundaryField type compressible::kqRWallFunction; value uniform 1; } - wall + walls { type compressible::kqRWallFunction; value uniform 1; diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut index 0cea2db2d2..6f779fd416 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/mut @@ -31,7 +31,7 @@ boundaryField type mutkWallFunction; value uniform 0; } - wall + walls { type mutkWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p index 21db04d610..e3bdb75a7e 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 index 79da11e10a..09a4670392 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -126,7 +126,7 @@ patches backQuad(poro1, out1, out2, poro2) ) - wall wall + wall walls ( // inlet block quad2D(in1, join1) diff --git a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary index 0abd1608ab..7a2d7d0e5e 100644 --- a/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary +++ b/tutorials/compressible/rhoLTSPimpleFoam/angledDuct/constant/polyMesh/boundary @@ -20,24 +20,28 @@ FoamFile front { type wall; + inGroups 1(wall); nFaces 700; startFace 63400; } back { type wall; + inGroups 1(wall); nFaces 700; startFace 64100; } - wall + walls { type wall; + inGroups 1(wall); nFaces 1400; startFace 64800; } porosityWall { type wall; + inGroups 1(wall); nFaces 1600; startFace 66200; } From 86233780e33a77e33b4b613bf4c3dd1968145a22 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 13 Dec 2013 14:31:34 +0000 Subject: [PATCH 15/60] ENH: annularThermalMixer: renamed wall to walls --- .../annularThermalMixer/system/snappyHexMeshDict | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/snappyHexMeshDict b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/snappyHexMeshDict index ea372875da..f211a4aebb 100644 --- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/snappyHexMeshDict +++ b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/snappyHexMeshDict @@ -71,7 +71,7 @@ geometry wall.obj { type triSurfaceMesh; - name wall; + name walls; } }; @@ -191,7 +191,7 @@ castellatedMeshControls faceType baffle; } - wall + walls { level (1 1); patchInfo From 5552d5500b5e7b17e96177732db9f0278b55df45 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 13 Dec 2013 14:34:08 +0000 Subject: [PATCH 16/60] ENH: angledDuct: renamed wall to walls --- .../rhoPimpleFoam/ras/angledDuct/0/T | 2 +- .../rhoPimpleFoam/ras/angledDuct/0/U | 2 +- .../rhoPimpleFoam/ras/angledDuct/0/alphat | 2 +- .../rhoPimpleFoam/ras/angledDuct/0/epsilon | 2 +- .../rhoPimpleFoam/ras/angledDuct/0/k | 2 +- .../rhoPimpleFoam/ras/angledDuct/0/mut | 2 +- .../rhoPimpleFoam/ras/angledDuct/0/p | 2 +- .../constant/polyMesh/blockMeshDict.m4 | 2 +- .../rhoPimplecFoam/angledDuct/0/U | 2 +- .../rhoPimplecFoam/angledDuct/0/alphat | 2 +- .../rhoPimplecFoam/angledDuct/0/epsilon | 2 +- .../rhoPimplecFoam/angledDuct/0/k | 2 +- .../rhoPimplecFoam/angledDuct/0/mut | 2 +- .../rhoPimplecFoam/angledDuct/0/p | 2 +- .../constant/polyMesh/blockMeshDict.m4 | 2 +- .../angledDuct/constant/polyMesh/boundary | 58 ---------------- .../angledDuctImplicit/0/T | 2 +- .../angledDuctImplicit/0/U | 2 +- .../angledDuctImplicit/0/alphat | 2 +- .../angledDuctImplicit/0/epsilon | 2 +- .../angledDuctImplicit/0/k | 2 +- .../angledDuctImplicit/0/mut | 2 +- .../angledDuctImplicit/0/p | 2 +- .../constant/polyMesh/blockMeshDict.m4 | 2 +- .../angledDuctExplicitFixedCoeff/0/T | 2 +- .../angledDuctExplicitFixedCoeff/0/U | 2 +- .../angledDuctExplicitFixedCoeff/0/alphat | 2 +- .../angledDuctExplicitFixedCoeff/0/epsilon | 2 +- .../angledDuctExplicitFixedCoeff/0/k | 2 +- .../angledDuctExplicitFixedCoeff/0/mut | 2 +- .../angledDuctExplicitFixedCoeff/0/p | 2 +- .../constant/polyMesh/blockMeshDict.m4 | 2 +- .../constant/polyMesh/boundary | 2 +- .../constant/polyMesh/blockMeshDict | 1 - .../iglooWithFridges/system/snappyHexMeshDict | 2 - .../porousSimpleFoam/angledDuctImplicit/0/T | 2 +- .../porousSimpleFoam/angledDuctImplicit/0/U | 2 +- .../angledDuctImplicit/0/epsilon | 2 +- .../porousSimpleFoam/angledDuctImplicit/0/k | 2 +- .../porousSimpleFoam/angledDuctImplicit/0/nut | 2 +- .../porousSimpleFoam/angledDuctImplicit/0/p | 2 +- .../constant/polyMesh/blockMeshDict.m4 | 2 +- .../constant/polyMesh/boundary | 2 +- .../porousSimpleFoam/straightDuctImplicit/0/T | 2 +- .../porousSimpleFoam/straightDuctImplicit/0/U | 2 +- .../straightDuctImplicit/0/epsilon | 2 +- .../porousSimpleFoam/straightDuctImplicit/0/k | 2 +- .../straightDuctImplicit/0/nut | 2 +- .../porousSimpleFoam/straightDuctImplicit/0/p | 2 +- .../straightDuctImplicit/Allrun.pre | 2 +- .../system/meshDict.geometry | 2 +- .../incompressible/simpleFoam/airFoil2D/0/U | 2 +- .../simpleFoam/airFoil2D/0/nuTilda | 2 +- .../incompressible/simpleFoam/airFoil2D/0/nut | 2 +- .../incompressible/simpleFoam/airFoil2D/0/p | 2 +- .../airFoil2D/constant/polyMesh/boundary | 2 +- .../multiphase/interFoam/les/nozzleFlow2D/0/U | 2 +- .../interFoam/les/nozzleFlow2D/0/alpha.fuel | 2 +- .../multiphase/interFoam/les/nozzleFlow2D/0/k | 2 +- .../interFoam/les/nozzleFlow2D/0/nuSgs | 2 +- .../interFoam/les/nozzleFlow2D/0/nuTilda | 2 +- .../interFoam/les/nozzleFlow2D/0/p_rgh | 2 +- .../constant/polyMesh/blockMeshDict | 2 +- .../nozzleFlow2D/constant/polyMesh/boundary | 68 ------------------- .../constant/polyMesh/boundary.org | 68 ------------------- 65 files changed, 60 insertions(+), 257 deletions(-) delete mode 100644 tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/boundary delete mode 100644 tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary delete mode 100644 tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary.org diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/T b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/T index 561ca236be..76e54ad382 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/T +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/T @@ -29,7 +29,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U index 713bdebe4a..454300ab0e 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/alphat b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/alphat index dc2104f83c..33ecb425e2 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/alphat +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/alphat @@ -31,7 +31,7 @@ boundaryField type compressible::alphatWallFunction; value uniform 0; } - wall + walls { type compressible::alphatWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/epsilon b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/epsilon index e4dccfe577..c6f28faeea 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/epsilon +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/epsilon @@ -31,7 +31,7 @@ boundaryField type compressible::epsilonWallFunction; value uniform 200; } - wall + walls { type compressible::epsilonWallFunction; value uniform 200; diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/k b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/k index 655a91bb45..b92ab42afe 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/k +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/k @@ -31,7 +31,7 @@ boundaryField type compressible::kqRWallFunction; value uniform 1; } - wall + walls { type compressible::kqRWallFunction; value uniform 1; diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/mut b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/mut index 0cea2db2d2..6f779fd416 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/mut +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/mut @@ -31,7 +31,7 @@ boundaryField type mutkWallFunction; value uniform 0; } - wall + walls { type mutkWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/p b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/p index 21db04d610..e3bdb75a7e 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/p +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 index 2e865a7856..ce48c80996 100644 --- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -134,7 +134,7 @@ boundary ); } - wall + walls { type wall; faces diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/U b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/U index 1105ba84b0..590ae2411e 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/U +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat index dc2104f83c..33ecb425e2 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/alphat @@ -31,7 +31,7 @@ boundaryField type compressible::alphatWallFunction; value uniform 0; } - wall + walls { type compressible::alphatWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon index e4dccfe577..c6f28faeea 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/epsilon @@ -31,7 +31,7 @@ boundaryField type compressible::epsilonWallFunction; value uniform 200; } - wall + walls { type compressible::epsilonWallFunction; value uniform 200; diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/k b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/k index 655a91bb45..b92ab42afe 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/k +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/k @@ -31,7 +31,7 @@ boundaryField type compressible::kqRWallFunction; value uniform 1; } - wall + walls { type compressible::kqRWallFunction; value uniform 1; diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/mut b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/mut index 0cea2db2d2..6f779fd416 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/mut +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/mut @@ -31,7 +31,7 @@ boundaryField type mutkWallFunction; value uniform 0; } - wall + walls { type mutkWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/p b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/p index 21db04d610..e3bdb75a7e 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/0/p +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 index 2e865a7856..ce48c80996 100644 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/blockMeshDict.m4 @@ -134,7 +134,7 @@ boundary ); } - wall + walls { type wall; faces diff --git a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/boundary b/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/boundary deleted file mode 100644 index 0abd1608ab..0000000000 --- a/tutorials/compressible/rhoPimplecFoam/angledDuct/constant/polyMesh/boundary +++ /dev/null @@ -1,58 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( - front - { - type wall; - nFaces 700; - startFace 63400; - } - back - { - type wall; - nFaces 700; - startFace 64100; - } - wall - { - type wall; - nFaces 1400; - startFace 64800; - } - porosityWall - { - type wall; - nFaces 1600; - startFace 66200; - } - inlet - { - type patch; - nFaces 400; - startFace 67800; - } - outlet - { - type patch; - nFaces 400; - startFace 68200; - } -) - -// ************************************************************************* // diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/T b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/T index 561ca236be..76e54ad382 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/T +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/T @@ -29,7 +29,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U index 20e25d12a8..e121b9c3c1 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat index dc2104f83c..33ecb425e2 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/alphat @@ -31,7 +31,7 @@ boundaryField type compressible::alphatWallFunction; value uniform 0; } - wall + walls { type compressible::alphatWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon index 7588e13063..12c9b362e3 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/epsilon @@ -33,7 +33,7 @@ boundaryField value uniform 200; } - wall + walls { type compressible::epsilonWallFunction; value uniform 200; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k index 85df9b83c3..3dbe46f030 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/k @@ -33,7 +33,7 @@ boundaryField value uniform 1; } - wall + walls { type compressible::kqRWallFunction; value uniform 1; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut index 2ba718d5b5..a01a5a0eed 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/mut @@ -33,7 +33,7 @@ boundaryField value uniform 0; } - wall + walls { type mutkWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/p b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/p index 21db04d610..e3bdb75a7e 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/p +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 index 79da11e10a..09a4670392 100644 --- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 @@ -126,7 +126,7 @@ patches backQuad(poro1, out1, out2, poro2) ) - wall wall + wall walls ( // inlet block quad2D(in1, join1) diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/T b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/T index 561ca236be..76e54ad382 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/T +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/T @@ -29,7 +29,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U index 20e25d12a8..e121b9c3c1 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/alphat b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/alphat index dc2104f83c..33ecb425e2 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/alphat +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/alphat @@ -31,7 +31,7 @@ boundaryField type compressible::alphatWallFunction; value uniform 0; } - wall + walls { type compressible::alphatWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/epsilon b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/epsilon index 7588e13063..12c9b362e3 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/epsilon +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/epsilon @@ -33,7 +33,7 @@ boundaryField value uniform 200; } - wall + walls { type compressible::epsilonWallFunction; value uniform 200; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/k b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/k index 85df9b83c3..3dbe46f030 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/k +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/k @@ -33,7 +33,7 @@ boundaryField value uniform 1; } - wall + walls { type compressible::kqRWallFunction; value uniform 1; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/mut b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/mut index 2ba718d5b5..a01a5a0eed 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/mut +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/mut @@ -33,7 +33,7 @@ boundaryField value uniform 0; } - wall + walls { type mutkWallFunction; value uniform 0; diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/p b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/p index 21db04d610..e3bdb75a7e 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/p +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/blockMeshDict.m4 b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/blockMeshDict.m4 index 79da11e10a..09a4670392 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/blockMeshDict.m4 @@ -126,7 +126,7 @@ patches backQuad(poro1, out1, out2, poro2) ) - wall wall + wall walls ( // inlet block quad2D(in1, join1) diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/boundary b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/boundary index 0abd1608ab..76e163242f 100644 --- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/boundary +++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/constant/polyMesh/boundary @@ -29,7 +29,7 @@ FoamFile nFaces 700; startFace 64100; } - wall + walls { type wall; nFaces 1400; diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict index c854ce532d..265f408344 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/constant/polyMesh/blockMeshDict @@ -79,7 +79,6 @@ boundary ground { type wall; - inGroups (wall); faces ( (0 3 2 1) diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict index a6e206d525..ff6504711b 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/snappyHexMeshDict @@ -168,7 +168,6 @@ castellatedMeshControls patchInfo { type wall; - inGroups (wall); } } @@ -182,7 +181,6 @@ castellatedMeshControls patchInfo { type wall; - inGroups (wall); } } } diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T index 561ca236be..76e54ad382 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/T @@ -29,7 +29,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U index ad11b09e1e..fe2432b8aa 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon index 6d30851be3..21b1e98ef9 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/epsilon @@ -33,7 +33,7 @@ boundaryField value uniform 200; } - wall + walls { type epsilonWallFunction; value uniform 200; diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k index 673cfc8310..cd7aa31096 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/k @@ -33,7 +33,7 @@ boundaryField value uniform 1; } - wall + walls { type kqRWallFunction; value uniform 1; diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut index 5db002b34b..fcb2bc9b00 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/nut @@ -33,7 +33,7 @@ boundaryField value uniform 0; } - wall + walls { type nutkWallFunction; value uniform 0; diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p index 865e81e29f..dd95d3a8eb 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 index 79da11e10a..09a4670392 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 @@ -126,7 +126,7 @@ patches backQuad(poro1, out1, out2, poro2) ) - wall wall + wall walls ( // inlet block quad2D(in1, join1) diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary index a664893343..1e23642ed6 100644 --- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary +++ b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/boundary @@ -29,7 +29,7 @@ FoamFile nFaces 700; startFace 64100; } - wall + walls { type wall; nFaces 1400; diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/T b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/T index 52286928be..0b87371528 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/T +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/T @@ -29,7 +29,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U index c411935183..155713c25c 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/U @@ -30,7 +30,7 @@ boundaryField type fixedValue; value uniform (0 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/epsilon b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/epsilon index fc7c3ed349..1d7a756c5c 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/epsilon +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/epsilon @@ -33,7 +33,7 @@ boundaryField value uniform 200; } - wall + walls { type epsilonWallFunction; value uniform 200; diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/k b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/k index 13f51bec6b..1626050988 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/k +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/k @@ -33,7 +33,7 @@ boundaryField value uniform 1; } - wall + walls { type kqRWallFunction; value uniform 1; diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/nut b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/nut index 6f819a7891..86f8c11285 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/nut +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/nut @@ -33,7 +33,7 @@ boundaryField value uniform 0; } - wall + walls { type nutkWallFunction; value uniform 0; diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/p b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/p index 682ac792a8..0d408ac631 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/p +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/0/p @@ -28,7 +28,7 @@ boundaryField { type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre index 3a02370217..14f681a614 100755 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/Allrun.pre @@ -22,7 +22,7 @@ runApplication checkMesh -allTopology -allGeometry -latestTime latestTime=`foamInfoExec -latestTime` # Move the mesh into polyMesh -\rm -r constant/polyMesh +\rm -rf constant/polyMesh \mv "${latestTime}"/polyMesh constant # Clean up intermediate meshes diff --git a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/meshDict.geometry b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/meshDict.geometry index b3d5aa6128..83061a7975 100644 --- a/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/meshDict.geometry +++ b/tutorials/incompressible/porousSimpleFoam/straightDuctImplicit/system/meshDict.geometry @@ -23,7 +23,7 @@ straightDuct.stl { wall { - name wall; + name walls; } porosityWall { diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/0/U b/tutorials/incompressible/simpleFoam/airFoil2D/0/U index 0f4b7d581b..3fa0d8ab8b 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/0/U +++ b/tutorials/incompressible/simpleFoam/airFoil2D/0/U @@ -32,7 +32,7 @@ boundaryField freestreamValue uniform (25.75 3.62 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/0/nuTilda b/tutorials/incompressible/simpleFoam/airFoil2D/0/nuTilda index 90565ca85a..42e1dccd97 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/0/nuTilda +++ b/tutorials/incompressible/simpleFoam/airFoil2D/0/nuTilda @@ -32,7 +32,7 @@ boundaryField freestreamValue uniform 0.14; } - wall + walls { type fixedValue; value uniform 0; diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/0/nut b/tutorials/incompressible/simpleFoam/airFoil2D/0/nut index 688ffe90ff..1e2a80af91 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/0/nut +++ b/tutorials/incompressible/simpleFoam/airFoil2D/0/nut @@ -32,7 +32,7 @@ boundaryField freestreamValue uniform 0.14; } - wall + walls { type nutUSpaldingWallFunction; value uniform 0; diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/0/p b/tutorials/incompressible/simpleFoam/airFoil2D/0/p index 76d0d89ff5..5e45181672 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/0/p +++ b/tutorials/incompressible/simpleFoam/airFoil2D/0/p @@ -30,7 +30,7 @@ boundaryField type freestreamPressure; } - wall + walls { type zeroGradient; } diff --git a/tutorials/incompressible/simpleFoam/airFoil2D/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/airFoil2D/constant/polyMesh/boundary index 5bca16c74e..34e79da6d3 100644 --- a/tutorials/incompressible/simpleFoam/airFoil2D/constant/polyMesh/boundary +++ b/tutorials/incompressible/simpleFoam/airFoil2D/constant/polyMesh/boundary @@ -31,7 +31,7 @@ outlet startFace 21388; } -wall +walls { type wall; physicalType wall; diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/U b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/U index 3735619129..8b03633eb9 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/U +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/U @@ -31,7 +31,7 @@ boundaryField value uniform (460 0 0); } - wall + walls { type fixedValue; value uniform (0 0 0); diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/alpha.fuel b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/alpha.fuel index baf41e0bb3..b6b34155c1 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/alpha.fuel +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/alpha.fuel @@ -31,7 +31,7 @@ boundaryField value uniform 1; } - wall + walls { type zeroGradient; } diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/k b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/k index b42409456a..948e99914a 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/k +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/k @@ -31,7 +31,7 @@ boundaryField value uniform 1e-05; } - wall + walls { type fixedValue; value uniform 1e-11; diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuSgs b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuSgs index 202a0d9207..95e02c374e 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuSgs +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuSgs @@ -30,7 +30,7 @@ boundaryField type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuTilda b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuTilda index 56a11e4e71..bbbcc3b281 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuTilda +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/nuTilda @@ -31,7 +31,7 @@ boundaryField value uniform 0; } - wall + walls { type fixedValue; value uniform 0; diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh index 120a41b910..7590b3df5d 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/0/p_rgh @@ -30,7 +30,7 @@ boundaryField type zeroGradient; } - wall + walls { type zeroGradient; } diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/blockMeshDict index 07136745bf..a0f3c09a37 100644 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/blockMeshDict +++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/blockMeshDict @@ -82,7 +82,7 @@ boundary ); } - wall + walls { type wall; faces diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary b/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary deleted file mode 100644 index 0b4b7a6a88..0000000000 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary +++ /dev/null @@ -1,68 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( -axis -{ - type empty; - physicalType empty; - nFaces 0; - startFace 41031; -} - -inlet -{ - type patch; - physicalType inlet; - nFaces 30; - startFace 41031; -} - -wall -{ - type wall; - physicalType wall; - nFaces 70; - startFace 41061; -} - -atmosphere -{ - type patch; - physicalType atmosphere; - nFaces 175; - startFace 41131; -} - -front -{ - type wedge; - physicalType wedge; - nFaces 20603; - startFace 41306; -} - -back -{ - type wedge; - physicalType wedge; - nFaces 20603; - startFace 61909; -} -) - -// ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary.org b/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary.org deleted file mode 100644 index 0b4b7a6a88..0000000000 --- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/constant/polyMesh/boundary.org +++ /dev/null @@ -1,68 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -6 -( -axis -{ - type empty; - physicalType empty; - nFaces 0; - startFace 41031; -} - -inlet -{ - type patch; - physicalType inlet; - nFaces 30; - startFace 41031; -} - -wall -{ - type wall; - physicalType wall; - nFaces 70; - startFace 41061; -} - -atmosphere -{ - type patch; - physicalType atmosphere; - nFaces 175; - startFace 41131; -} - -front -{ - type wedge; - physicalType wedge; - nFaces 20603; - startFace 41306; -} - -back -{ - type wedge; - physicalType wedge; - nFaces 20603; - startFace 61909; -} -) - -// ************************************************************************* // From 541a03f7732b8d70517f5fb7fb524df72b513544 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 13 Dec 2013 15:35:24 +0000 Subject: [PATCH 17/60] sixDoFRigidBodyMotionConstraint: rewritten as direct constraints on the velocity rather than applied as a force correction --- src/sixDoFRigidBodyMotion/Make/files | 4 +- .../fixedAxis/fixedAxis.C | 83 ++------ .../fixedAxis/fixedAxis.H | 21 +- .../fixedLine/fixedLine.C | 74 ++----- .../fixedLine/fixedLine.H | 23 +-- .../fixedOrientation/fixedOrientation.C | 108 ++-------- .../fixedOrientation/fixedOrientation.H | 25 +-- .../fixedPlane/fixedPlane.C | 82 ++------ .../fixedPlane/fixedPlane.H | 25 +-- .../fixedPoint/fixedPoint.C | 78 ++------ .../fixedPoint/fixedPoint.H | 21 +- .../sixDoFRigidBodyMotionConstraint.C | 27 +-- .../sixDoFRigidBodyMotionConstraint.H | 54 ++--- .../sixDoFRigidBodyMotionConstraintNew.C | 14 +- .../linearAxialAngularSpring.C | 3 +- .../linearAxialAngularSpring.H | 1 + .../linearSpring/linearSpring.C | 3 +- .../linearSpring/linearSpring.H | 1 + .../sixDoFRigidBodyMotionRestraint.C | 2 + .../sixDoFRigidBodyMotionRestraint.H | 15 +- .../sixDoFRigidBodyMotionRestraintNew.C | 14 +- .../sphericalAngularSpring.C | 3 +- .../sphericalAngularSpring.H | 1 + .../tabulatedAxialAngularSpring.C | 3 +- .../tabulatedAxialAngularSpring.H | 1 + .../sixDoFRigidBodyMotion.C | 189 ++++-------------- .../sixDoFRigidBodyMotion.H | 31 +-- .../sixDoFRigidBodyMotionI.H | 19 -- .../sixDoFRigidBodyMotionIO.C | 7 +- 29 files changed, 218 insertions(+), 714 deletions(-) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedAxis/fixedAxis.C (60%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedAxis/fixedAxis.H (83%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedLine/fixedLine.C (63%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedLine/fixedLine.H (81%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedOrientation/fixedOrientation.C (51%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedOrientation/fixedOrientation.H (79%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedPlane/fixedPlane.C (56%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedPlane/fixedPlane.H (80%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedPoint/fixedPoint.C (56%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/fixedPoint/fixedPoint.H (83%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C (77%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H (75%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionConstraint => constraints}/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C (89%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/linearAxialAngularSpring/linearAxialAngularSpring.C (98%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/linearAxialAngularSpring/linearAxialAngularSpring.H (99%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/linearSpring/linearSpring.C (98%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/linearSpring/linearSpring.H (99%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C (98%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H (92%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C (89%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/sphericalAngularSpring/sphericalAngularSpring.C (98%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/sphericalAngularSpring/sphericalAngularSpring.H (99%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C (98%) rename src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/{sixDoFRigidBodyMotionRestraint => restraints}/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H (99%) diff --git a/src/sixDoFRigidBodyMotion/Make/files b/src/sixDoFRigidBodyMotion/Make/files index 022baa43df..75435920ea 100644 --- a/src/sixDoFRigidBodyMotion/Make/files +++ b/src/sixDoFRigidBodyMotion/Make/files @@ -3,7 +3,7 @@ sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C sixDoFRigidBodyMotion/sixDoFRigidBodyMotionStateIO.C -restraints = sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint +restraints = sixDoFRigidBodyMotion/restraints $(restraints)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C $(restraints)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C @@ -12,7 +12,7 @@ $(restraints)/linearSpring/linearSpring.C $(restraints)/sphericalAngularSpring/sphericalAngularSpring.C $(restraints)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C -constraints = sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint +constraints = sixDoFRigidBodyMotion/constraints $(constraints)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C $(constraints)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedAxis/fixedAxis.C similarity index 60% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedAxis/fixedAxis.C index 0e27378425..db7b66a6ff 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedAxis/fixedAxis.C @@ -49,10 +49,11 @@ namespace sixDoFRigidBodyMotionConstraints Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::fixedAxis ( + const word& name, const dictionary& sDoFRBMCDict ) : - sixDoFRigidBodyMotionConstraint(sDoFRBMCDict), + sixDoFRigidBodyMotionConstraint(name, sDoFRBMCDict), fixedAxis_() { read(sDoFRBMCDict); @@ -67,79 +68,19 @@ Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::~fixedAxis() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrain +void Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrainTranslation ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement + pointConstraint& pc +) const +{} + + +void Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrainRotation +( + pointConstraint& pc ) const { - constraintMomentIncrement = vector::zero; - - vector predictedDir = motion.predictedOrientation - ( - fixedAxis_, - existingConstraintMoment, - deltaT - ); - - scalar theta = acos(min(predictedDir & fixedAxis_, 1.0)); - - vector rotationAxis = fixedAxis_ ^ predictedDir; - - scalar magRotationAxis = mag(rotationAxis); - - if (magRotationAxis > VSMALL) - { - rotationAxis /= magRotationAxis; - - const tensor& Q = motion.orientation(); - - // Transform rotationAxis to body local system - rotationAxis = Q.T() & rotationAxis; - - constraintMomentIncrement = - -relaxationFactor_ - *(motion.momentOfInertia() & rotationAxis) - *theta/sqr(deltaT); - - // Transform moment increment to global system - constraintMomentIncrement = Q & constraintMomentIncrement; - - // Remove any moment that is around the fixedAxis_ - constraintMomentIncrement -= - (constraintMomentIncrement & fixedAxis_)*fixedAxis_; - } - - constraintPosition = motion.centreOfMass(); - - constraintForceIncrement = vector::zero; - - bool converged(mag(theta) < tolerance_); - - if (sixDoFRigidBodyMotionConstraint::debug) - { - Info<< " angle " << theta - << " force " << constraintForceIncrement - << " moment " << constraintMomentIncrement; - - if (converged) - { - Info<< " converged"; - } - else - { - Info<< " not converged"; - } - - Info<< endl; - } - - return converged; + pc.combine(pointConstraint(Tuple2(2, vector(0,1,0)))); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedAxis/fixedAxis.H similarity index 83% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedAxis/fixedAxis.H index 7772833f4d..e2a2cc26da 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedAxis/fixedAxis.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedAxis/fixedAxis.H @@ -37,8 +37,6 @@ SourceFiles #define fixedAxis_H #include "sixDoFRigidBodyMotionConstraint.H" -#include "point.H" -#include "tensor.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,6 +72,7 @@ public: //- Construct from components fixedAxis ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -93,19 +92,11 @@ public: // Member Functions - //- Calculate the constraint position, force and moment. - // Global reference frame vectors. Returns boolean stating - // whether the constraint been converged to tolerance. - virtual bool constrain - ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement - ) const; + //- Apply and accumulate translational constraints + virtual void constrainTranslation(pointConstraint&) const; + + //- Apply and accumulate rotational constraints + virtual void constrainRotation(pointConstraint&) const; //- Update properties from given dictionary virtual bool read(const dictionary& sDoFRBMCCoeff); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedLine/fixedLine.C similarity index 63% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedLine/fixedLine.C index f77afa2b10..5aa4d669da 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedLine/fixedLine.C @@ -49,11 +49,11 @@ namespace sixDoFRigidBodyMotionConstraints Foam::sixDoFRigidBodyMotionConstraints::fixedLine::fixedLine ( + const word& name, const dictionary& sDoFRBMCDict ) : - sixDoFRigidBodyMotionConstraint(sDoFRBMCDict), - refPt_(), + sixDoFRigidBodyMotionConstraint(name, sDoFRBMCDict), dir_() { read(sDoFRBMCDict); @@ -68,67 +68,22 @@ Foam::sixDoFRigidBodyMotionConstraints::fixedLine::~fixedLine() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrain +void Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrainTranslation ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement + pointConstraint& pc ) const { - point predictedPosition = motion.predictedPosition - ( - refPt_, - existingConstraintForce, - existingConstraintMoment, - deltaT - ); - - constraintPosition = motion.currentPosition(refPt_); - - // Info<< "current position " << constraintPosition << nl - // << "next predictedPosition " << predictedPosition - // << endl; - - // Vector from reference point to predicted point - vector rC = predictedPosition - refPt_; - - vector error = rC - ((rC) & dir_)*dir_; - - // Info<< "error " << error << endl; - - constraintForceIncrement = - -relaxationFactor_*error*motion.mass()/sqr(deltaT); - - constraintMomentIncrement = vector::zero; - - bool converged(mag(error) < tolerance_); - - if (sixDoFRigidBodyMotionConstraint::debug) - { - Info<< " error " << error - << " force " << constraintForceIncrement - << " moment " << constraintMomentIncrement; - - if (converged) - { - Info<< " converged"; - } - else - { - Info<< " not converged"; - } - - Info<< endl; - } - - return converged; + pc.combine(pointConstraint(Tuple2(2, dir_))); } +void Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrainRotation +( + pointConstraint& pc +) const +{} + + bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::read ( const dictionary& sDoFRBMCDict @@ -136,8 +91,6 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::read { sixDoFRigidBodyMotionConstraint::read(sDoFRBMCDict); - sDoFRBMCCoeffs_.lookup("refPoint") >> refPt_; - sDoFRBMCCoeffs_.lookup("direction") >> dir_; scalar magDir(mag(dir_)); @@ -168,9 +121,6 @@ void Foam::sixDoFRigidBodyMotionConstraints::fixedLine::write Ostream& os ) const { - os.writeKeyword("refPoint") - << refPt_ << token::END_STATEMENT << nl; - os.writeKeyword("direction") << dir_ << token::END_STATEMENT << nl; } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedLine/fixedLine.H similarity index 81% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedLine/fixedLine.H index 8d0710e090..2e48f564a7 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedLine/fixedLine.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedLine/fixedLine.H @@ -37,7 +37,6 @@ SourceFiles #define fixedLine_H #include "sixDoFRigidBodyMotionConstraint.H" -#include "point.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,9 +56,6 @@ class fixedLine { // Private data - //- Reference point for the constraining line - point refPt_; - //- Direction of the constraining line vector dir_; @@ -75,6 +71,7 @@ public: //- Construct from components fixedLine ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -94,19 +91,11 @@ public: // Member Functions - //- Calculate the constraint position, force and moment. - // Global reference frame vectors. Returns boolean stating - // whether the constraint been converged to tolerance. - virtual bool constrain - ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement - ) const; + //- Apply and accumulate translational constraints + virtual void constrainTranslation(pointConstraint&) const; + + //- Apply and accumulate rotational constraints + virtual void constrainRotation(pointConstraint&) const; //- Update properties from given dictionary virtual bool read(const dictionary& sDoFRBMCCoeff); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedOrientation/fixedOrientation.C similarity index 51% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedOrientation/fixedOrientation.C index c66bdbb362..5d4cc8cff0 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedOrientation/fixedOrientation.C @@ -49,10 +49,11 @@ namespace sixDoFRigidBodyMotionConstraints Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::fixedOrientation ( + const word& name, const dictionary& sDoFRBMCDict ) : - sixDoFRigidBodyMotionConstraint(sDoFRBMCDict) + sixDoFRigidBodyMotionConstraint(name, sDoFRBMCDict) { read(sDoFRBMCDict); } @@ -66,102 +67,21 @@ Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::~fixedOrientation() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::constrain +void Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation:: +constrainTranslation ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement + pointConstraint& pc +) const +{} + + +void Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation:: +constrainRotation +( + pointConstraint& pc ) const { - constraintMomentIncrement = vector::zero; - - scalar maxTheta = -SMALL; - - for (direction cmpt=0; cmpt VSMALL) - { - predictedDir /= magPredictedDir; - - theta = acos(min(predictedDir & refDir, 1.0)); - - // Recalculating axis to give correct sign to angle - axis = (refDir ^ predictedDir); - - scalar magAxis = mag(axis); - - if (magAxis > VSMALL) - { - axis /= magAxis; - } - else - { - axis = vector::zero; - } - } - - if (theta > maxTheta) - { - maxTheta = theta; - } - - constraintMomentIncrement += - -relaxationFactor_ - *theta*axis - *motion.momentOfInertia()[cmpt]/sqr(deltaT); - } - - constraintPosition = motion.centreOfMass(); - - constraintForceIncrement = vector::zero; - - bool converged(mag(maxTheta) < tolerance_); - - if (sixDoFRigidBodyMotionConstraint::debug) - { - Info<< " max angle " << maxTheta - << " force " << constraintForceIncrement - << " moment " << constraintMomentIncrement; - - if (converged) - { - Info<< " converged"; - } - else - { - Info<< " not converged"; - } - - Info<< endl; - } - - return converged; + pc.combine(pointConstraint(Tuple2(3, vector::zero))); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedOrientation/fixedOrientation.H similarity index 79% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedOrientation/fixedOrientation.H index fcf7a62167..b41945837a 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedOrientation/fixedOrientation.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedOrientation/fixedOrientation.H @@ -25,9 +25,7 @@ Class Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation Description - sixDoFRigidBodyMotionConstraint. Orientation of body fixed global - space. Only valid where the predicted deviation from alignment is - < 90 degrees. + Fix orientation of body in global space. SourceFiles fixedOrientation.C @@ -38,8 +36,6 @@ SourceFiles #define fixedOrientation_H #include "sixDoFRigidBodyMotionConstraint.H" -#include "point.H" -#include "tensor.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,6 +65,7 @@ public: //- Construct from components fixedOrientation ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -88,19 +85,11 @@ public: // Member Functions - //- Calculate the constraint position, force and moment. - // Global reference frame vectors. Returns boolean stating - // whether the constraint been converged to tolerance. - virtual bool constrain - ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement - ) const; + //- Apply and accumulate translational constraints + virtual void constrainTranslation(pointConstraint&) const; + + //- Apply and accumulate rotational constraints + virtual void constrainRotation(pointConstraint&) const; //- Update properties from given dictionary virtual bool read(const dictionary& sDoFRBMCCoeff); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPlane/fixedPlane.C similarity index 56% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPlane/fixedPlane.C index 263694ee3f..edcde4d07c 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPlane/fixedPlane.C @@ -49,11 +49,12 @@ namespace sixDoFRigidBodyMotionConstraints Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::fixedPlane ( + const word& name, const dictionary& sDoFRBMCDict ) : - sixDoFRigidBodyMotionConstraint(sDoFRBMCDict), - fixedPlane_(vector::one) + sixDoFRigidBodyMotionConstraint(name, sDoFRBMCDict), + normal_(vector::zero) { read(sDoFRBMCDict); } @@ -67,68 +68,22 @@ Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::~fixedPlane() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrain +void Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrainTranslation ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement + pointConstraint& pc ) const { - const point& refPt = fixedPlane_.refPoint(); - - const vector& n = fixedPlane_.normal(); - - point predictedPosition = motion.predictedPosition - ( - refPt, - existingConstraintForce, - existingConstraintMoment, - deltaT - ); - - constraintPosition = motion.currentPosition(refPt); - - // Info<< "current position " << constraintPosition << nl - // << "next predictedPosition " << predictedPosition - // << endl; - - vector error = ((predictedPosition - refPt) & n)*n; - - // Info<< "error " << error << endl; - - constraintForceIncrement = - -relaxationFactor_*error*motion.mass()/sqr(deltaT); - - constraintMomentIncrement = vector::zero; - - bool converged(mag(error) < tolerance_); - - if (sixDoFRigidBodyMotionConstraint::debug) - { - Info<< " error " << error - << " force " << constraintForceIncrement - << " moment " << constraintMomentIncrement; - - if (converged) - { - Info<< " converged"; - } - else - { - Info<< " not converged"; - } - - Info<< endl; - } - - return converged; + pc.applyConstraint(normal_); } +void Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrainRotation +( + pointConstraint& pc +) const +{} + + bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::read ( const dictionary& sDoFRBMCDict @@ -136,11 +91,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::read { sixDoFRigidBodyMotionConstraint::read(sDoFRBMCDict); - point refPt = sDoFRBMCCoeffs_.lookup("refPoint"); - - vector normal = sDoFRBMCCoeffs_.lookup("normal"); - - fixedPlane_ = plane(refPt, normal); + normal_ = sDoFRBMCCoeffs_.lookup("normal"); return true; } @@ -151,11 +102,8 @@ void Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::write Ostream& os ) const { - os.writeKeyword("refPoint") - << fixedPlane_.refPoint() << token::END_STATEMENT << nl; - os.writeKeyword("normal") - << fixedPlane_.normal() << token::END_STATEMENT << nl; + << normal_ << token::END_STATEMENT << nl; } // ************************************************************************* // diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPlane/fixedPlane.H similarity index 80% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPlane/fixedPlane.H index b7f100ac5e..82ed9fab9e 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPlane/fixedPlane.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPlane/fixedPlane.H @@ -37,7 +37,6 @@ SourceFiles #define fixedPlane_H #include "sixDoFRigidBodyMotionConstraint.H" -#include "plane.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,9 +56,8 @@ class fixedPlane { // Private data - //- Plane which the transformed reference point is constrained - // to move along - plane fixedPlane_; + //- Normal to plane + vector normal_; public: @@ -73,6 +71,7 @@ public: //- Construct from components fixedPlane ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -92,19 +91,11 @@ public: // Member Functions - //- Calculate the constraint position, force and moment. - // Global reference frame vectors. Returns boolean stating - // whether the constraint been converged to tolerance. - virtual bool constrain - ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement - ) const; + //- Apply and accumulate translational constraints + virtual void constrainTranslation(pointConstraint&) const; + + //- Apply and accumulate rotational constraints + virtual void constrainRotation(pointConstraint&) const; //- Update properties from given dictionary virtual bool read(const dictionary& sDoFRBMCCoeff); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPoint/fixedPoint.C similarity index 56% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPoint/fixedPoint.C index 084334868d..c0f4bbf311 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPoint/fixedPoint.C @@ -49,10 +49,11 @@ namespace sixDoFRigidBodyMotionConstraints Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::fixedPoint ( + const word& name, const dictionary& sDoFRBMCDict ) : - sixDoFRigidBodyMotionConstraint(sDoFRBMCDict), + sixDoFRigidBodyMotionConstraint(name, sDoFRBMCDict), fixedPoint_() { read(sDoFRBMCDict); @@ -67,77 +68,22 @@ Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::~fixedPoint() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrain +void Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrainTranslation ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement + pointConstraint& pc ) const { - point predictedPosition = motion.predictedPosition - ( - fixedPoint_, - existingConstraintForce, - existingConstraintMoment, - deltaT - ); - - constraintPosition = motion.currentPosition(fixedPoint_); - - // Info<< "current position " << constraintPosition << nl - // << "next predictedPosition " << predictedPosition - // << endl; - - vector error = predictedPosition - fixedPoint_; - - // Info<< "error " << error << endl; - - // Correction force derived from Lagrange multiplier: - // G = -lambda*grad(sigma) - // where - // sigma = mag(error) = 0 - // so - // grad(sigma) = error/mag(error) - // Solving for lambda using the SHAKE methodology gives - // lambda = mass*mag(error)/sqr(deltaT) - // This is only strictly applicable (i.e. will converge in one - // iteration) to constraints at the centre of mass. Everything - // else will need to iterate, and may need under-relaxed to be - // stable. - - constraintForceIncrement = - -relaxationFactor_*error*motion.mass()/sqr(deltaT); - - constraintMomentIncrement = vector::zero; - - bool converged(mag(error) < tolerance_); - - if (sixDoFRigidBodyMotionConstraint::debug) - { - Info<< " error " << error - << " force " << constraintForceIncrement - << " moment " << constraintMomentIncrement; - - if (converged) - { - Info<< " converged"; - } - else - { - Info<< " not converged"; - } - - Info<< endl; - } - - return converged; + pc.combine(pointConstraint(Tuple2(3, vector::zero))); } +void Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrainRotation +( + pointConstraint& pc +) const +{} + + bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::read ( const dictionary& sDoFRBMCDict diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPoint/fixedPoint.H similarity index 83% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPoint/fixedPoint.H index c361d3a8b3..4745adc8a9 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/fixedPoint/fixedPoint.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/fixedPoint/fixedPoint.H @@ -25,7 +25,7 @@ Class Foam::sixDoFRigidBodyMotionConstraints::fixedPoint Description - sixDoFRigidBodyMotionConstraint. Point fixed in space. + Point fixed in space. SourceFiles fixedPoint.C @@ -74,6 +74,7 @@ public: //- Construct from components fixedPoint ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -93,19 +94,11 @@ public: // Member Functions - //- Calculate the constraint position, force and moment. - // Global reference frame vectors. Returns boolean stating - // whether the constraint been converged to tolerance. - virtual bool constrain - ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement - ) const; + //- Apply and accumulate translational constraints + virtual void constrainTranslation(pointConstraint&) const; + + //- Apply and accumulate rotational constraints + virtual void constrainRotation(pointConstraint&) const; //- Update properties from given dictionary virtual bool read(const dictionary& sDoFRBMCCoeff); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C similarity index 77% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C index 22299c7f3c..6a497d4de5 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C @@ -29,9 +29,8 @@ License namespace Foam { -defineTypeNameAndDebug(sixDoFRigidBodyMotionConstraint, 0); - -defineRunTimeSelectionTable(sixDoFRigidBodyMotionConstraint, dictionary); + defineTypeNameAndDebug(sixDoFRigidBodyMotionConstraint, 0); + defineRunTimeSelectionTable(sixDoFRigidBodyMotionConstraint, dictionary); } @@ -39,9 +38,11 @@ defineRunTimeSelectionTable(sixDoFRigidBodyMotionConstraint, dictionary); Foam::sixDoFRigidBodyMotionConstraint::sixDoFRigidBodyMotionConstraint ( + const word& name, const dictionary& sDoFRBMCDict ) : + name_(name), sDoFRBMCCoeffs_ ( sDoFRBMCDict.subDict @@ -49,11 +50,6 @@ Foam::sixDoFRigidBodyMotionConstraint::sixDoFRigidBodyMotionConstraint word(sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint")) + "Coeffs" ) - ), - tolerance_(readScalar(sDoFRBMCDict.lookup("tolerance"))), - relaxationFactor_ - ( - sDoFRBMCDict.lookupOrDefault("relaxationFactor", 1) ) {} @@ -71,14 +67,6 @@ bool Foam::sixDoFRigidBodyMotionConstraint::read const dictionary& sDoFRBMCDict ) { - tolerance_ = (readScalar(sDoFRBMCDict.lookup("tolerance"))); - - relaxationFactor_ = sDoFRBMCDict.lookupOrDefault - ( - "relaxationFactor", - 1 - ); - sDoFRBMCCoeffs_ = sDoFRBMCDict.subDict(type() + "Coeffs"); return true; @@ -86,12 +74,7 @@ bool Foam::sixDoFRigidBodyMotionConstraint::read void Foam::sixDoFRigidBodyMotionConstraint::write(Ostream& os) const -{ - os.writeKeyword("tolerance") - << tolerance_ << token::END_STATEMENT << nl; +{} - os.writeKeyword("relaxationFactor") - << relaxationFactor_ << token::END_STATEMENT << nl; -} // ************************************************************************* // diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H similarity index 75% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H index b1f5438948..b4eed214f9 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.H @@ -46,7 +46,7 @@ SourceFiles #include "Time.H" #include "dictionary.H" #include "autoPtr.H" -#include "vector.H" +#include "pointConstraint.H" #include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -69,16 +69,12 @@ protected: // Protected data + //- Name of the constraint + word name_; + //- Constraint model specific coefficient dictionary dictionary sDoFRBMCCoeffs_; - //- Solution tolerance. Meaning depends on model, usually an - // absolute distance or angle. - scalar tolerance_; - - //- Relaxation factor for solution, default to one - scalar relaxationFactor_; - public: @@ -93,8 +89,8 @@ public: autoPtr, sixDoFRigidBodyMotionConstraint, dictionary, - (const dictionary& sDoFRBMCDict), - (sDoFRBMCDict) + (const word& name, const dictionary& sDoFRBMCDict), + (name, sDoFRBMCDict) ); @@ -103,6 +99,7 @@ public: //- Construct from the sDoFRBMCDict dictionary and Time sixDoFRigidBodyMotionConstraint ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -115,6 +112,7 @@ public: //- Select constructed from the sDoFRBMCDict dictionary and Time static autoPtr New ( + const word& name, const dictionary& sDoFRBMCDict ); @@ -125,19 +123,17 @@ public: // Member Functions - //- Calculate the constraint position, force and moment. - // Global reference frame vectors. Returns boolean stating - // whether the constraint been converged to tolerance. - virtual bool constrain - ( - const sixDoFRigidBodyMotion& motion, - const vector& existingConstraintForce, - const vector& existingConstraintMoment, - scalar deltaT, - vector& constraintPosition, - vector& constraintForceIncrement, - vector& constraintMomentIncrement - ) const = 0; + //- Return the name + const word& name() const + { + return name_; + } + + //- Apply and accumulate translational constraints + virtual void constrainTranslation(pointConstraint&) const = 0; + + //- Apply and accumulate rotational constraints + virtual void constrainRotation(pointConstraint&) const = 0; //- Update properties from given dictionary virtual bool read(const dictionary& sDoFRBMCDict); @@ -150,18 +146,6 @@ public: return sDoFRBMCCoeffs_; } - //- Return access to the tolerance - inline scalar tolerance() const - { - return tolerance_; - } - - //- Return access to the relaxationFactor - inline scalar relaxationFactor() const - { - return relaxationFactor_; - } - //- Write virtual void write(Ostream&) const; }; diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C similarity index 89% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C index fa74999aa5..b6f3e8fb1f 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/constraints/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C @@ -28,16 +28,17 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // Foam::autoPtr -Foam::sixDoFRigidBodyMotionConstraint::New(const dictionary& sDoFRBMCDict) +Foam::sixDoFRigidBodyMotionConstraint::New +( + const word& name, + const dictionary& sDoFRBMCDict +) { const word constraintType ( sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint") ); - // Info<< "Selecting sixDoFRigidBodyMotionConstraint function " - // << constraintType << endl; - dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(constraintType); @@ -56,7 +57,10 @@ Foam::sixDoFRigidBodyMotionConstraint::New(const dictionary& sDoFRBMCDict) << exit(FatalError); } - return autoPtr(cstrIter()(sDoFRBMCDict)); + return autoPtr + ( + cstrIter()(name, sDoFRBMCDict) + ); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.C similarity index 98% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.C index 76805d60d4..3701dd8bf9 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.C @@ -51,10 +51,11 @@ namespace sixDoFRigidBodyMotionRestraints Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring:: linearAxialAngularSpring ( + const word& name, const dictionary& sDoFRBMRDict ) : - sixDoFRigidBodyMotionRestraint(sDoFRBMRDict), + sixDoFRigidBodyMotionRestraint(name, sDoFRBMRDict), refQ_(), axis_(), stiffness_(), diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.H similarity index 99% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.H index d7f8c5e280..4a30e30c65 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearAxialAngularSpring/linearAxialAngularSpring.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearAxialAngularSpring/linearAxialAngularSpring.H @@ -81,6 +81,7 @@ public: //- Construct from components linearAxialAngularSpring ( + const word& name, const dictionary& sDoFRBMRDict ); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.C similarity index 98% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.C index c6b1c10ca0..a9ed4ce7a3 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.C @@ -49,10 +49,11 @@ namespace sixDoFRigidBodyMotionRestraints Foam::sixDoFRigidBodyMotionRestraints::linearSpring::linearSpring ( + const word& name, const dictionary& sDoFRBMRDict ) : - sixDoFRigidBodyMotionRestraint(sDoFRBMRDict), + sixDoFRigidBodyMotionRestraint(name, sDoFRBMRDict), anchor_(), refAttachmentPt_(), stiffness_(), diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.H similarity index 99% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.H index c0610d974b..dbd12372c3 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/linearSpring/linearSpring.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/linearSpring/linearSpring.H @@ -84,6 +84,7 @@ public: //- Construct from components linearSpring ( + const word& name, const dictionary& sDoFRBMRDict ); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C similarity index 98% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C index b06c5baf46..31c16f85ac 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C @@ -39,9 +39,11 @@ defineRunTimeSelectionTable(sixDoFRigidBodyMotionRestraint, dictionary); Foam::sixDoFRigidBodyMotionRestraint::sixDoFRigidBodyMotionRestraint ( + const word& name, const dictionary& sDoFRBMRDict ) : + name_(name), sDoFRBMRCoeffs_ ( sDoFRBMRDict.subDict diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H similarity index 92% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H index d8bdf1469a..41216a0c2b 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.H @@ -69,6 +69,9 @@ protected: // Protected data + //- Name of the restraint + word name_; + //- Restraint model specific coefficient dictionary dictionary sDoFRBMRCoeffs_; @@ -86,8 +89,8 @@ public: autoPtr, sixDoFRigidBodyMotionRestraint, dictionary, - (const dictionary& sDoFRBMRDict), - (sDoFRBMRDict) + (const word& name, const dictionary& sDoFRBMRDict), + (name, sDoFRBMRDict) ); @@ -96,6 +99,7 @@ public: //- Construct from the sDoFRBMRDict dictionary and Time sixDoFRigidBodyMotionRestraint ( + const word& name, const dictionary& sDoFRBMRDict ); @@ -108,6 +112,7 @@ public: //- Select constructed from the sDoFRBMRDict dictionary and Time static autoPtr New ( + const word& name, const dictionary& sDoFRBMRDict ); @@ -118,6 +123,12 @@ public: // Member Functions + //- Return the name + const word& name() const + { + return name_; + } + //- Calculate the restraint position, force and moment. // Global reference frame vectors. virtual void restrain diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C similarity index 89% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C index 9361e0ab4d..1bb047a77d 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C @@ -28,16 +28,17 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // Foam::autoPtr -Foam::sixDoFRigidBodyMotionRestraint::New(const dictionary& sDoFRBMRDict) +Foam::sixDoFRigidBodyMotionRestraint::New +( + const word& name, + const dictionary& sDoFRBMRDict +) { const word restraintType ( sDoFRBMRDict.lookup("sixDoFRigidBodyMotionRestraint") ); - // Info<< "Selecting sixDoFRigidBodyMotionRestraint function " - // << restraintType << endl; - dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(restraintType); @@ -56,7 +57,10 @@ Foam::sixDoFRigidBodyMotionRestraint::New(const dictionary& sDoFRBMRDict) << exit(FatalError); } - return autoPtr(cstrIter()(sDoFRBMRDict)); + return autoPtr + ( + cstrIter()(name, sDoFRBMRDict) + ); } diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.C similarity index 98% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.C index dbb480b93a..f3dab425d7 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.C @@ -50,10 +50,11 @@ namespace sixDoFRigidBodyMotionRestraints Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring:: sphericalAngularSpring ( + const word& name, const dictionary& sDoFRBMRDict ) : - sixDoFRigidBodyMotionRestraint(sDoFRBMRDict), + sixDoFRigidBodyMotionRestraint(name, sDoFRBMRDict), refQ_(), stiffness_(), damping_() diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.H similarity index 99% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.H index a36ef5d4ab..f1bfa784d3 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/sphericalAngularSpring/sphericalAngularSpring.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/sphericalAngularSpring/sphericalAngularSpring.H @@ -78,6 +78,7 @@ public: //- Construct from components sphericalAngularSpring ( + const word& name, const dictionary& sDoFRBMRDict ); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C similarity index 98% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C index 252aa471f7..037639dde8 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C @@ -52,10 +52,11 @@ namespace sixDoFRigidBodyMotionRestraints Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring:: tabulatedAxialAngularSpring ( + const word& name, const dictionary& sDoFRBMRDict ) : - sixDoFRigidBodyMotionRestraint(sDoFRBMRDict), + sixDoFRigidBodyMotionRestraint(name, sDoFRBMRDict), refQ_(), axis_(), moment_(), diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H similarity index 99% rename from src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H rename to src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H index bb45f00d51..bcd2c2c5b3 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/restraints/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.H @@ -88,6 +88,7 @@ public: //- Construct from components tabulatedAxialAngularSpring ( + const word& name, const dictionary& sDoFRBMRDict ); diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C index 6f002c5e2f..4ee39646d0 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C @@ -41,7 +41,7 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints() { if (report_) { - Info<< "Restraint " << restraintNames_[rI] << ": "; + Info<< "Restraint " << restraints_[rI].name() << ": "; } // restraint position @@ -65,101 +65,6 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints() } -void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT) -{ - if (constraints_.empty()) - { - return; - } - - if (Pstream::master()) - { - label iteration = 0; - - bool allConverged = true; - - // constraint force accumulator - vector cFA = vector::zero; - - // constraint moment accumulator - vector cMA = vector::zero; - - do - { - allConverged = true; - - forAll(constraints_, cI) - { - if (sixDoFRigidBodyMotionConstraint::debug) - { - Info<< "Constraint " << constraintNames_[cI] << ": "; - } - - // constraint position - point cP = vector::zero; - - // constraint force - vector cF = vector::zero; - - // constraint moment - vector cM = vector::zero; - - bool constraintConverged = constraints_[cI].constrain - ( - *this, - cFA, - cMA, - deltaT, - cP, - cF, - cM - ); - - allConverged = allConverged && constraintConverged; - - // Accumulate constraint force - cFA += cF; - - // Accumulate constraint moment - cMA += cM + ((cP - centreOfMass()) ^ cF); - } - - } while(++iteration < maxConstraintIterations_ && !allConverged); - - if (iteration >= maxConstraintIterations_) - { - FatalErrorIn - ( - "Foam::sixDoFRigidBodyMotion::applyConstraints(scalar)" - ) - << nl << "Maximum number of sixDoFRigidBodyMotion constraint " - << "iterations (" - << maxConstraintIterations_ - << ") exceeded." << nl - << exit(FatalError); - } - - Info<< "sixDoFRigidBodyMotion constraints converged in " - << iteration << " iterations" << endl; - - if (report_) - { - Info<< "Constraint force: " << cFA << nl - << "Constraint moment: " << cMA - << endl; - } - - // Add the constraint forces and moments to the motion state variables - a() += cFA/mass_; - - // The moment of constraint forces has already been added - // during accumulation. Moments are returned in global axes, - // transforming to body local - tau() += Q().T() & cMA; - } -} - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion() @@ -167,17 +72,16 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion() motionState_(), motionState0_(), restraints_(), - restraintNames_(), constraints_(), - constraintNames_(), - maxConstraintIterations_(0), initialCentreOfMass_(vector::zero), initialQ_(I), momentOfInertia_(diagTensor::one*VSMALL), mass_(VSMALL), aRelax_(1.0), aDamp_(1.0), - report_(false) + report_(false), + tConstraints_(tensor::I), + rConstraints_(tensor::I) {} @@ -209,17 +113,16 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion ), motionState0_(motionState_), restraints_(), - restraintNames_(), constraints_(), - constraintNames_(), - maxConstraintIterations_(0), initialCentreOfMass_(initialCentreOfMass), initialQ_(initialQ), momentOfInertia_(momentOfInertia), mass_(mass), aRelax_(aRelax), aDamp_(aDamp), - report_(report) + report_(report), + tConstraints_(tensor::I), + rConstraints_(tensor::I) {} @@ -232,10 +135,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion motionState_(stateDict), motionState0_(motionState_), restraints_(), - restraintNames_(), constraints_(), - constraintNames_(), - maxConstraintIterations_(0), initialCentreOfMass_ ( dict.lookupOrDefault @@ -256,7 +156,9 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion mass_(readScalar(dict.lookup("mass"))), aRelax_(dict.lookupOrDefault("accelerationRelaxation", 1.0)), aDamp_(dict.lookupOrDefault("accelerationDamping", 1.0)), - report_(dict.lookupOrDefault("report", false)) + report_(dict.lookupOrDefault("report", false)), + tConstraints_(tensor::I), + rConstraints_(tensor::I) { addRestraints(dict); addConstraints(dict); @@ -271,10 +173,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion motionState_(sDoFRBM.motionState_), motionState0_(sDoFRBM.motionState0_), restraints_(sDoFRBM.restraints_), - restraintNames_(sDoFRBM.restraintNames_), constraints_(sDoFRBM.constraints_), - constraintNames_(sDoFRBM.constraintNames_), - maxConstraintIterations_(sDoFRBM.maxConstraintIterations_), initialCentreOfMass_(sDoFRBM.initialCentreOfMass_), initialQ_(sDoFRBM.initialQ_), momentOfInertia_(sDoFRBM.momentOfInertia_), @@ -306,29 +205,23 @@ void Foam::sixDoFRigidBodyMotion::addRestraints restraints_.setSize(restraintDict.size()); - restraintNames_.setSize(restraintDict.size()); - forAllConstIter(IDLList, restraintDict, iter) { if (iter().isDict()) { - // Info<< "Adding restraint: " << iter().keyword() << endl; - restraints_.set ( - i, - sixDoFRigidBodyMotionRestraint::New(iter().dict()) + i++, + sixDoFRigidBodyMotionRestraint::New + ( + iter().keyword(), + iter().dict() + ) ); - - restraintNames_[i] = iter().keyword(); - - i++; } } restraints_.setSize(i); - - restraintNames_.setSize(i); } } @@ -346,21 +239,25 @@ void Foam::sixDoFRigidBodyMotion::addConstraints constraints_.setSize(constraintDict.size()); - constraintNames_.setSize(constraintDict.size()); + pointConstraint pct; + pointConstraint pcr; forAllConstIter(IDLList, constraintDict, iter) { if (iter().isDict()) { - // Info<< "Adding constraint: " << iter().keyword() << endl; - constraints_.set ( i, - sixDoFRigidBodyMotionConstraint::New(iter().dict()) + sixDoFRigidBodyMotionConstraint::New + ( + iter().keyword(), + iter().dict() + ) ); - constraintNames_[i] = iter().keyword(); + constraints_[i].constrainTranslation(pct); + constraints_[i].constrainRotation(pcr); i++; } @@ -368,15 +265,11 @@ void Foam::sixDoFRigidBodyMotion::addConstraints constraints_.setSize(i); - constraintNames_.setSize(i); + tConstraints_ = pct.constraintTransformation(); + rConstraints_ = pcr.constraintTransformation(); - if (!constraints_.empty()) - { - maxConstraintIterations_ = readLabel - ( - constraintDict.lookup("maxIterations") - ); - } + Info<< "Translational constraint tensor " << tConstraints_ << nl + << "Rotational constraint tensor " << rConstraints_ << endl; } } @@ -392,8 +285,8 @@ void Foam::sixDoFRigidBodyMotion::updatePosition if (Pstream::master()) { - v() = v0() + aDamp_*0.5*deltaT0*a(); - pi() = pi0() + aDamp_*0.5*deltaT0*tau(); + v() = tConstraints_ & aDamp_*(v0() + 0.5*deltaT0*a()); + pi() = rConstraints_ & aDamp_*(pi0() + 0.5*deltaT0*tau()); // Leapfrog move part centreOfMass() = centreOfMass0() + deltaT*v(); @@ -401,7 +294,7 @@ void Foam::sixDoFRigidBodyMotion::updatePosition // Leapfrog orientation adjustment Tuple2 Qpi = rotate(Q0(), pi(), deltaT); Q() = Qpi.first(); - pi() = Qpi.second(); + pi() = rConstraints_ & Qpi.second(); } Pstream::scatter(motionState_); @@ -439,12 +332,9 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration } first = false; - // Apply constraints after relaxation - applyConstraints(deltaT); - // Correct velocities - v() += aDamp_*0.5*deltaT*a(); - pi() += aDamp_*0.5*deltaT*tau(); + v() += tConstraints_ & aDamp_*0.5*deltaT*a(); + pi() += rConstraints_ & aDamp_*0.5*deltaT*tau(); if (report_) { @@ -463,8 +353,8 @@ void Foam::sixDoFRigidBodyMotion::updateVelocity(scalar deltaT) if (Pstream::master()) { - v() += aDamp_*0.5*deltaT*a(); - pi() += aDamp_*0.5*deltaT*tau(); + v() += tConstraints_ & aDamp_*0.5*deltaT*a(); + pi() += rConstraints_ & aDamp_*0.5*deltaT*tau(); if (report_) { @@ -532,7 +422,10 @@ Foam::vector Foam::sixDoFRigidBodyMotion::predictedOrientation vector piTemp = pi() + deltaT*(tau() + (Q().T() & deltaMoment)); Tuple2 QpiTemp = rotate(Q0(), piTemp, deltaT); - return (QpiTemp.first() & initialQ_.T() & vInitial); + vector o(QpiTemp.first() & initialQ_.T() & vInitial); + o /= mag(o); + + return o; } @@ -564,8 +457,6 @@ Foam::tmp Foam::sixDoFRigidBodyMotion::scaledPosition const scalarField& scale ) const { - Info<< "initialCentreOfMass " << initialCentreOfMass() << endl; - // Calculate the transformation septerion from the initial state septernion s ( diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H index 670004ba69..34e5016e11 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.H @@ -90,22 +90,12 @@ class sixDoFRigidBodyMotion //- Motion state data object for previous time-step sixDoFRigidBodyMotionState motionState0_; - //- Restraints on the motion + //- Motion restraints PtrList restraints_; - //- Names of the restraints - wordList restraintNames_; - - //- Constaints on the motion + //- Motion constaints PtrList constraints_; - //- Names of the constraints - wordList constraintNames_; - - //- Maximum number of iterations allowed to attempt to obey - // constraints - label maxConstraintIterations_; - //- Centre of mass of initial state point initialCentreOfMass_; @@ -128,6 +118,10 @@ class sixDoFRigidBodyMotion //- Switch to turn reporting of motion data on and off Switch report_; + tensor tConstraints_; + + tensor rConstraints_; + // Private Member Functions @@ -155,9 +149,6 @@ class sixDoFRigidBodyMotion //- Apply the restraints to the object void applyRestraints(); - //- Apply the constraints to the object - void applyConstraints(scalar deltaT); - // Access functions retained as private because of the risk of // confusion over what is a body local frame vector and what is global @@ -168,20 +159,10 @@ class sixDoFRigidBodyMotion inline const PtrList& restraints() const; - //- Return access to the restraintNames - inline const wordList& restraintNames() const; - //- Return access to the constraints inline const PtrList& constraints() const; - //- Return access to the constraintNames - inline const wordList& constraintNames() const; - - //- Return access to the maximum allowed number of - // constraint iterations - inline label maxConstraintIterations() const; - //- Return access to the initial centre of mass inline const point& initialCentreOfMass() const; diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionI.H b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionI.H index f70ba68ced..3186ca2fa1 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionI.H +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionI.H @@ -111,12 +111,6 @@ Foam::sixDoFRigidBodyMotion::restraints() const } -inline const Foam::wordList& Foam::sixDoFRigidBodyMotion::restraintNames() const -{ - return restraintNames_; -} - - inline const Foam::PtrList& Foam::sixDoFRigidBodyMotion::constraints() const { @@ -124,19 +118,6 @@ Foam::sixDoFRigidBodyMotion::constraints() const } -inline const Foam::wordList& -Foam::sixDoFRigidBodyMotion::constraintNames() const -{ - return constraintNames_; -} - - -inline Foam::label Foam::sixDoFRigidBodyMotion::maxConstraintIterations() const -{ - return maxConstraintIterations_; -} - - inline const Foam::point& Foam::sixDoFRigidBodyMotion::initialCentreOfMass() const { diff --git a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C index 99bdba3ef0..11670ba623 100644 --- a/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C +++ b/src/sixDoFRigidBodyMotion/sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C @@ -54,7 +54,7 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const { word restraintType = restraints_[rI].type(); - os << indent << restraintNames_[rI] << nl + os << indent << restraints_[rI].name() << nl << indent << token::BEGIN_BLOCK << incrIndent << endl; os.writeKeyword("sixDoFRigidBodyMotionRestraint") @@ -79,14 +79,11 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const os << indent << "constraints" << nl << indent << token::BEGIN_BLOCK << incrIndent << nl; - os.writeKeyword("maxIterations") - << maxConstraintIterations_ << token::END_STATEMENT << nl; - forAll(constraints_, rI) { word constraintType = constraints_[rI].type(); - os << indent << constraintNames_[rI] << nl + os << indent << constraints_[rI].name() << nl << indent << token::BEGIN_BLOCK << incrIndent << endl; os.writeKeyword("sixDoFRigidBodyMotionConstraint") From c32add9e907f12c3b6cf3990bff137de3581e4a4 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 13 Dec 2013 15:35:24 +0000 Subject: [PATCH 18/60] ENH: edgeMesh: added extendedEdgeMesh --- .../extendedFeatureEdgeMesh.C | 0 .../extendedFeatureEdgeMesh.H | 0 .../extendedFeatureEdgeMeshI.H | 0 .../extendedFeatureEdgeMeshTemplates.C | 0 .../constant/polyMesh/boundary | 112 ------------------ 5 files changed, 112 deletions(-) rename src/edgeMesh/{ => extendedEdgeMesh}/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C (100%) rename src/edgeMesh/{ => extendedEdgeMesh}/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H (100%) rename src/edgeMesh/{ => extendedEdgeMesh}/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshI.H (100%) rename src/edgeMesh/{ => extendedEdgeMesh}/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C (100%) delete mode 100644 tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C b/src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C similarity index 100% rename from src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C rename to src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H b/src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H similarity index 100% rename from src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H rename to src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.H diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshI.H b/src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshI.H similarity index 100% rename from src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshI.H rename to src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshI.H diff --git a/src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C b/src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C similarity index 100% rename from src/edgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C rename to src/edgeMesh/extendedEdgeMesh/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshTemplates.C diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary deleted file mode 100644 index 2d2096ddc3..0000000000 --- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/constant/polyMesh/boundary +++ /dev/null @@ -1,112 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class polyBoundaryMesh; - location "constant/polyMesh"; - object boundary; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -12 -( - innerInlet - { - type patch; - inGroups 1(inlet); - nFaces 544; - startFace 245836; - } - outerInlet - { - type patch; - inGroups 1(inlet); - nFaces 1404; - startFace 246380; - } - innerOutlet - { - type patch; - inGroups 1(outlet); - nFaces 544; - startFace 247784; - } - outerOutlet - { - type patch; - inGroups 1(outlet); - nFaces 1404; - startFace 248328; - } - rotorBlades - { - type wall; - inGroups 1(movingWalls); - nFaces 540; - startFace 249732; - } - rotorBlades_slave - { - type wall; - inGroups 1(movingWalls); - nFaces 540; - startFace 250272; - } - shaft - { - type wall; - inGroups 1(movingWalls); - nFaces 1044; - startFace 250812; - } - statorBlades - { - type wall; - inGroups 1(staticWalls); - nFaces 2128; - startFace 251856; - } - statorBlades_slave - { - type wall; - inGroups 1(staticWalls); - nFaces 2128; - startFace 253984; - } - wall - { - type wall; - inGroups 1(staticWalls); - nFaces 6165; - startFace 256112; - } - AMI1 - { - type cyclicAMI; - inGroups 1(cyclicAMI); - nFaces 10944; - startFace 262277; - matchTolerance 0.0001; - transform noOrdering; - neighbourPatch AMI2; - } - AMI2 - { - type cyclicAMI; - inGroups 1(cyclicAMI); - nFaces 10944; - startFace 273221; - matchTolerance 0.0001; - transform noOrdering; - neighbourPatch AMI1; - } -) - -// ************************************************************************* // From 2e7c9a8206bd3142a5cdc41c79fe7120d0df40c5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 13 Dec 2013 15:39:22 +0000 Subject: [PATCH 19/60] ENH: edgeMesh: added extendedEdgeMesh level --- src/edgeMesh/Make/files | 32 +- src/edgeMesh/Make/options | 4 +- src/edgeMesh/edgeMesh.H | 5 +- .../extendedFeatureEdgeMeshFormat.C | 70 + .../extendedFeatureEdgeMeshFormat.H | 106 ++ .../extendedFeatureEdgeMeshFormatRunTime.C | 50 + src/edgeMesh/edgeMeshIO.C | 8 +- src/edgeMesh/edgeMeshNew.C | 5 +- .../extendedEdgeMesh/extendedEdgeMesh.C | 1518 +++++++++++++++++ .../extendedEdgeMesh/extendedEdgeMesh.H | 547 ++++++ .../extendedEdgeMeshFormat.C | 103 ++ .../extendedEdgeMeshFormat.H | 95 ++ .../extendedEdgeMeshFormatRunTime.C | 51 + .../obj/OBJextendedEdgeFormat.C | 66 + .../obj/OBJextendedEdgeFormat.H | 119 ++ .../obj/OBJextendedEdgeFormatRunTime.C | 60 + .../extendedEdgeMesh/extendedEdgeMeshI.H | 293 ++++ .../extendedEdgeMesh/extendedEdgeMeshNew.C | 79 + .../extendedEdgeMeshTemplates.C | 432 +++++ .../extendedFeatureEdgeMesh.C | 1345 ++------------- .../extendedFeatureEdgeMesh.H | 370 +--- 21 files changed, 3736 insertions(+), 1622 deletions(-) create mode 100644 src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.C create mode 100644 src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H create mode 100644 src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormatRunTime.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.H create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.H create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormatRunTime.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.H create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshI.H create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshNew.C create mode 100644 src/edgeMesh/extendedEdgeMesh/extendedEdgeMeshTemplates.C diff --git a/src/edgeMesh/Make/files b/src/edgeMesh/Make/files index 70c5178cbe..ed4cec5d95 100644 --- a/src/edgeMesh/Make/files +++ b/src/edgeMesh/Make/files @@ -1,13 +1,20 @@ -edgeMesh.C -edgeMeshIO.C -edgeMeshNew.C +em = . -edgeMeshFormats = edgeMeshFormats +$(em)/edgeMesh.C +$(em)/edgeMeshIO.C +$(em)/edgeMeshNew.C + + +edgeMeshFormats = $(em)/edgeMeshFormats $(edgeMeshFormats)/edgeMeshFormatsCore.C $(edgeMeshFormats)/edgeMesh/edgeMeshFormat.C $(edgeMeshFormats)/edgeMesh/edgeMeshFormatRunTime.C +$(edgeMeshFormats)/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.C +$(edgeMeshFormats)/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormatRunTime.C + + $(edgeMeshFormats)/nas/NASedgeFormat.C $(edgeMeshFormats)/nas/NASedgeFormatRunTime.C @@ -20,9 +27,22 @@ $(edgeMeshFormats)/starcd/STARCDedgeFormatRunTime.C $(edgeMeshFormats)/vtk/VTKedgeFormat.C $(edgeMeshFormats)/vtk/VTKedgeFormatRunTime.C -extendedFeatureEdgeMesh/extendedFeatureEdgeMesh.C -featureEdgeMesh/featureEdgeMesh.C +$(em)/featureEdgeMesh/featureEdgeMesh.C + +eem = $(em)/extendedEdgeMesh + +$(eem)/extendedEdgeMesh.C +$(eem)/extendedEdgeMeshNew.C + +$(eem)/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormat.C +$(eem)/extendedEdgeMeshFormats/obj/OBJextendedEdgeFormatRunTime.C +$(eem)/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormat.C +$(eem)/extendedEdgeMeshFormats/extendedEdgeMeshFormat/extendedEdgeMeshFormatRunTime.C + +efm = $(eem)/extendedFeatureEdgeMesh + +$(efm)/extendedFeatureEdgeMesh.C diff --git a/src/edgeMesh/Make/options b/src/edgeMesh/Make/options index 3c1b5258d3..61439e40e2 100644 --- a/src/edgeMesh/Make/options +++ b/src/edgeMesh/Make/options @@ -1,9 +1,11 @@ EXE_INC = \ -I$(LIB_SRC)/fileFormats/lnInclude \ + -I$(LIB_SRC)/surfMesh/lnInclude \ -I$(LIB_SRC)/triSurface/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude LIB_LIBS = \ -ltriSurface \ -lmeshTools \ - -lfileFormats + -lfileFormats \ + -lsurfMesh diff --git a/src/edgeMesh/edgeMesh.H b/src/edgeMesh/edgeMesh.H index c8abb55169..d3397a290b 100644 --- a/src/edgeMesh/edgeMesh.H +++ b/src/edgeMesh/edgeMesh.H @@ -27,6 +27,9 @@ Class Description Points connected by edges. + Can be read from fileName based on extension. Uses ::New factory method + to select the reader and transfer the result. + SourceFiles edgeMeshI.H edgeMesh.C @@ -253,7 +256,7 @@ public: // Write - void writeStats(Ostream&) const; + virtual void writeStats(Ostream&) const; //- Generic write routine. Chooses writer based on extension. virtual void write(const fileName& name) const diff --git a/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.C b/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.C new file mode 100644 index 0000000000..5f20b3016b --- /dev/null +++ b/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.C @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "extendedFeatureEdgeMeshFormat.H" +#include "edgeMeshFormat.H" +#include "IFstream.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fileFormats::extendedFeatureEdgeMeshFormat::extendedFeatureEdgeMeshFormat +( + const fileName& filename +) +{ + read(filename); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +bool Foam::fileFormats::extendedFeatureEdgeMeshFormat::read +( + const fileName& filename +) +{ + clear(); + + IFstream is(filename); + if (!is.good()) + { + FatalErrorIn + ( + "fileFormats::extendedFeatureEdgeMeshFormat::read(const fileName&)" + ) + << "Cannot read file " << filename + << exit(FatalError); + } + + return fileFormats::edgeMeshFormat::read + ( + is, + this->storedPoints(), + this->storedEdges() + ); +} + + +// ************************************************************************* // diff --git a/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H b/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H new file mode 100644 index 0000000000..cabc9beec0 --- /dev/null +++ b/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormat.H @@ -0,0 +1,106 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::fileFormats::extendedFeatureEdgeMeshFormat + +Description + Provide a means of reading extendedFeatureEdgeMesh as featureEdgeMesh + +SourceFiles + extendedFeatureEdgeMeshFormat.C + +\*---------------------------------------------------------------------------*/ + +#ifndef extendedFeatureEdgeMeshFormat_H +#define extendedFeatureEdgeMeshFormat_H + +#include "edgeMesh.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fileFormats +{ + +/*---------------------------------------------------------------------------*\ + Class extendedFeatureEdgeMeshFormat Declaration +\*---------------------------------------------------------------------------*/ + +class extendedFeatureEdgeMeshFormat +: + public edgeMesh +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + extendedFeatureEdgeMeshFormat(const extendedFeatureEdgeMeshFormat&); + + //- Disallow default bitwise assignment + void operator=(const extendedFeatureEdgeMeshFormat&); + + +public: + + // Constructors + + //- Construct from file name + extendedFeatureEdgeMeshFormat(const fileName&); + + + // Selectors + + //- Read file and return surface + static autoPtr New(const fileName& name) + { + return autoPtr + ( + new extendedFeatureEdgeMeshFormat(name) + ); + } + + + //- Destructor + virtual ~extendedFeatureEdgeMeshFormat() + {} + + + // Member Functions + + //- Read from file + virtual bool read(const fileName&); + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace fileFormats +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormatRunTime.C b/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormatRunTime.C new file mode 100644 index 0000000000..958f99facb --- /dev/null +++ b/src/edgeMesh/edgeMeshFormats/extendedFeatureEdgeMesh/extendedFeatureEdgeMeshFormatRunTime.C @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "extendedFeatureEdgeMeshFormat.H" + +#include "addToRunTimeSelectionTable.H" +#include "addToMemberFunctionSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fileFormats +{ + +// read extendedEdgeMesh +addNamedToRunTimeSelectionTable +( + edgeMesh, + extendedFeatureEdgeMeshFormat, + fileExtension, + featureEdgeMesh +); + +} +} + +// ************************************************************************* // diff --git a/src/edgeMesh/edgeMeshIO.C b/src/edgeMesh/edgeMeshIO.C index 08e1398a36..3887f9d679 100644 --- a/src/edgeMesh/edgeMeshIO.C +++ b/src/edgeMesh/edgeMeshIO.C @@ -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 @@ -122,9 +122,9 @@ void Foam::edgeMesh::write void Foam::edgeMesh::writeStats(Ostream& os) const { - os << "points : " << points().size() << nl; - os << "edges : " << edges().size() << nl; - os << "boundingBox : " << boundBox(this->points()) << endl; + os << indent << "points : " << points().size() << nl; + os << indent << "edges : " << edges().size() << nl; + os << indent << "boundingBox : " << boundBox(this->points()) << endl; } diff --git a/src/edgeMesh/edgeMeshNew.C b/src/edgeMesh/edgeMeshNew.C index da7091c73a..df52d7cf63 100644 --- a/src/edgeMesh/edgeMeshNew.C +++ b/src/edgeMesh/edgeMeshNew.C @@ -42,8 +42,9 @@ Foam::autoPtr Foam::edgeMesh::New ( "edgeMesh::New(const fileName&, const word&) : " "constructing edgeMesh" - ) << "Unknown file extension " << ext << nl << nl - << "Valid types are :" << nl + ) << "Unknown file extension " << ext + << " for file " << name << nl << nl + << "Valid extensions are :" << nl << fileExtensionConstructorTablePtr_->sortedToc() << exit(FatalError); } diff --git a/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C new file mode 100644 index 0000000000..999d2f0651 --- /dev/null +++ b/src/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C @@ -0,0 +1,1518 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2013 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 "extendedEdgeMesh.H" +#include "surfaceFeatures.H" +#include "triSurface.H" +#include "Random.H" +#include "Time.H" +#include "OBJstream.H" +#include "DynamicField.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(extendedEdgeMesh, 0); + + template<> + const char* Foam::NamedEnum + < + Foam::extendedEdgeMesh::pointStatus, + 4 + >::names[] = + { + "convex", + "concave", + "mixed", + "nonFeature" + }; + + template<> + const char* Foam::NamedEnum + < + Foam::extendedEdgeMesh::edgeStatus, + 6 + >::names[] = + { + "external", + "internal", + "flat", + "open", + "multiple", + "none" + }; + + template<> + const char* Foam::NamedEnum + < + Foam::extendedEdgeMesh::sideVolumeType, + 4 + >::names[] = + { + "inside", + "outside", + "both", + "neither" + }; +} + +const Foam::NamedEnum + Foam::extendedEdgeMesh::pointStatusNames_; + +const Foam::NamedEnum + Foam::extendedEdgeMesh::edgeStatusNames_; + +const Foam::NamedEnum + Foam::extendedEdgeMesh::sideVolumeTypeNames_; + +Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ = + Foam::cos(degToRad(0.1)); + + +Foam::label Foam::extendedEdgeMesh::convexStart_ = 0; + + +Foam::label Foam::extendedEdgeMesh::externalStart_ = 0; + + +Foam::label Foam::extendedEdgeMesh::nPointTypes = 4; + + +Foam::label Foam::extendedEdgeMesh::nEdgeTypes = 5; + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::extendedEdgeMesh::pointStatus +Foam::extendedEdgeMesh::classifyFeaturePoint +( + label ptI +) const +{ + labelList ptEds(pointEdges()[ptI]); + + label nPtEds = ptEds.size(); + label nExternal = 0; + label nInternal = 0; + + if (nPtEds == 0) + { + // There are no edges attached to the point, this is a problem + return NONFEATURE; + } + + forAll(ptEds, i) + { + edgeStatus edStat = getEdgeStatus(ptEds[i]); + + if (edStat == EXTERNAL) + { + nExternal++; + } + else if (edStat == INTERNAL) + { + nInternal++; + } + } + + if (nExternal == nPtEds) + { + return CONVEX; + } + else if (nInternal == nPtEds) + { + return CONCAVE; + } + else + { + return MIXED; + } +} + + +Foam::extendedEdgeMesh::edgeStatus +Foam::extendedEdgeMesh::classifyEdge +( + const List& norms, + const labelList& edNorms, + const vector& fC0tofC1 +) +{ + label nEdNorms = edNorms.size(); + + if (nEdNorms == 1) + { + return OPEN; + } + else if (nEdNorms == 2) + { + const vector& n0(norms[edNorms[0]]); + const vector& n1(norms[edNorms[1]]); + + if ((n0 & n1) > cosNormalAngleTol_) + { + return FLAT; + } + else if ((fC0tofC1 & n0) > 0.0) + { + return INTERNAL; + } + else + { + return EXTERNAL; + } + } + else if (nEdNorms > 2) + { + return MULTIPLE; + } + else + { + // There is a problem - the edge has no normals + return NONE; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::extendedEdgeMesh::extendedEdgeMesh() +: + edgeMesh(pointField(0), edgeList(0)), + concaveStart_(0), + mixedStart_(0), + nonFeatureStart_(0), + internalStart_(0), + flatStart_(0), + openStart_(0), + multipleStart_(0), + normals_(0), + normalVolumeTypes_(0), + edgeDirections_(0), + normalDirections_(0), + edgeNormals_(0), + featurePointNormals_(0), + featurePointEdges_(0), + regionEdges_(0), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{} + + +Foam::extendedEdgeMesh::extendedEdgeMesh +( + const extendedEdgeMesh& fem +) +: + edgeMesh(fem), + concaveStart_(fem.concaveStart()), + mixedStart_(fem.mixedStart()), + nonFeatureStart_(fem.nonFeatureStart()), + internalStart_(fem.internalStart()), + flatStart_(fem.flatStart()), + openStart_(fem.openStart()), + multipleStart_(fem.multipleStart()), + normals_(fem.normals()), + normalVolumeTypes_(fem.normalVolumeTypes()), + edgeDirections_(fem.edgeDirections()), + normalDirections_(fem.normalDirections()), + edgeNormals_(fem.edgeNormals()), + featurePointNormals_(fem.featurePointNormals()), + featurePointEdges_(fem.featurePointEdges()), + regionEdges_(fem.regionEdges()), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{} + + +Foam::extendedEdgeMesh::extendedEdgeMesh(Istream& is) +{ + is >> *this; +} + + +Foam::extendedEdgeMesh::extendedEdgeMesh +( + const Xfer& pointLst, + const Xfer& edgeLst +) +: + edgeMesh(pointLst, edgeLst), + concaveStart_(0), + mixedStart_(0), + nonFeatureStart_(0), + internalStart_(0), + flatStart_(0), + openStart_(0), + multipleStart_(0), + normals_(0), + normalVolumeTypes_(0), + edgeDirections_(0), + normalDirections_(0), + edgeNormals_(0), + featurePointNormals_(0), + featurePointEdges_(0), + regionEdges_(0), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{} + + +Foam::extendedEdgeMesh::extendedEdgeMesh +( + const surfaceFeatures& sFeat, + const boolList& surfBaffleRegions +) +: + edgeMesh(pointField(0), edgeList(0)), + concaveStart_(-1), + mixedStart_(-1), + nonFeatureStart_(-1), + internalStart_(-1), + flatStart_(-1), + openStart_(-1), + multipleStart_(-1), + normals_(0), + normalVolumeTypes_(0), + edgeDirections_(0), + normalDirections_(0), + edgeNormals_(0), + featurePointNormals_(0), + featurePointEdges_(0), + regionEdges_(0), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{ + // Extract and reorder the data from surfaceFeatures + const triSurface& surf = sFeat.surface(); + const labelList& featureEdges = sFeat.featureEdges(); + const labelList& featurePoints = sFeat.featurePoints(); + + // Get a labelList of all the featureEdges that are region edges + const labelList regionFeatureEdges(identity(sFeat.nRegionEdges())); + + sortPointsAndEdges + ( + surf, + featureEdges, + regionFeatureEdges, + featurePoints + ); + + const labelListList& edgeFaces = surf.edgeFaces(); + + normalVolumeTypes_.setSize(normals_.size()); + + // Noting when the normal of a face has been used so not to duplicate + labelList faceMap(surf.size(), -1); + + label nAdded = 0; + + forAll(featureEdges, i) + { + label sFEI = featureEdges[i]; + + // Pick up the faces adjacent to the feature edge + const labelList& eFaces = edgeFaces[sFEI]; + + forAll(eFaces, j) + { + label eFI = eFaces[j]; + + // Check to see if the points have been already used + if (faceMap[eFI] == -1) + { + normalVolumeTypes_[nAdded++] = + ( + surfBaffleRegions[surf[eFI].region()] + ? BOTH + : INSIDE + ); + + faceMap[eFI] = nAdded - 1; + } + } + } +} + + +Foam::extendedEdgeMesh::extendedEdgeMesh +( + const PrimitivePatch& surf, + const labelList& featureEdges, + const labelList& regionFeatureEdges, + const labelList& featurePoints +) +: + edgeMesh(pointField(0), edgeList(0)), + concaveStart_(-1), + mixedStart_(-1), + nonFeatureStart_(-1), + internalStart_(-1), + flatStart_(-1), + openStart_(-1), + multipleStart_(-1), + normals_(0), + normalVolumeTypes_(0), + edgeDirections_(0), + normalDirections_(0), + edgeNormals_(0), + featurePointNormals_(0), + featurePointEdges_(0), + regionEdges_(0), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{ + sortPointsAndEdges + ( + surf, + featureEdges, + regionFeatureEdges, + featurePoints + ); +} + + +Foam::extendedEdgeMesh::extendedEdgeMesh +( + const pointField& pts, + const edgeList& eds, + label concaveStart, + label mixedStart, + label nonFeatureStart, + label internalStart, + label flatStart, + label openStart, + label multipleStart, + const vectorField& normals, + const List& normalVolumeTypes, + const vectorField& edgeDirections, + const labelListList& normalDirections, + const labelListList& edgeNormals, + const labelListList& featurePointNormals, + const labelListList& featurePointEdges, + const labelList& regionEdges +) +: + edgeMesh(pts, eds), + concaveStart_(concaveStart), + mixedStart_(mixedStart), + nonFeatureStart_(nonFeatureStart), + internalStart_(internalStart), + flatStart_(flatStart), + openStart_(openStart), + multipleStart_(multipleStart), + normals_(normals), + normalVolumeTypes_(normalVolumeTypes), + edgeDirections_(edgeDirections), + normalDirections_(normalDirections), + edgeNormals_(edgeNormals), + featurePointNormals_(featurePointNormals), + featurePointEdges_(featurePointEdges), + regionEdges_(regionEdges), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{} + + +Foam::extendedEdgeMesh::extendedEdgeMesh +( + const fileName& name, + const word& ext +) +: + edgeMesh(pointField(0), edgeList(0)), + concaveStart_(0), + mixedStart_(0), + nonFeatureStart_(0), + internalStart_(0), + flatStart_(0), + openStart_(0), + multipleStart_(0), + normals_(0), + normalVolumeTypes_(0), + edgeDirections_(0), + normalDirections_(0), + edgeNormals_(0), + featurePointNormals_(0), + featurePointEdges_(0), + regionEdges_(0), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{ + read(name, ext); +} + + +Foam::extendedEdgeMesh::extendedEdgeMesh(const fileName& name) +: + edgeMesh(pointField(0), edgeList(0)), + concaveStart_(0), + mixedStart_(0), + nonFeatureStart_(0), + internalStart_(0), + flatStart_(0), + openStart_(0), + multipleStart_(0), + normals_(0), + normalVolumeTypes_(0), + edgeDirections_(0), + normalDirections_(0), + edgeNormals_(0), + featurePointNormals_(0), + featurePointEdges_(0), + regionEdges_(0), + pointTree_(), + edgeTree_(), + edgeTreesByType_() +{ + read(name); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::extendedEdgeMesh::~extendedEdgeMesh() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +bool Foam::extendedEdgeMesh::read(const fileName& name) +{ + word ext = name.ext(); + if (ext == "gz") + { + fileName unzipName = name.lessExt(); + return read(unzipName, unzipName.ext()); + } + else + { + return read(name, ext); + } +} + + +// Read from file in given format +bool Foam::extendedEdgeMesh::read +( + const fileName& name, + const word& ext +) +{ + // read via selector mechanism + transfer(New(name, ext)()); + return true; +} + + +void Foam::extendedEdgeMesh::nearestFeaturePoint +( + const point& sample, + scalar searchDistSqr, + pointIndexHit& info +) const +{ + info = pointTree().findNearest + ( + sample, + searchDistSqr + ); +} + + +void Foam::extendedEdgeMesh::nearestFeatureEdge +( + const point& sample, + scalar searchDistSqr, + pointIndexHit& info +) const +{ + info = edgeTree().findNearest + ( + sample, + searchDistSqr + ); +} + + +void Foam::extendedEdgeMesh::nearestFeatureEdge +( + const pointField& samples, + const scalarField& searchDistSqr, + List& info +) const +{ + info.setSize(samples.size()); + + forAll(samples, i) + { + nearestFeatureEdge + ( + samples[i], + searchDistSqr[i], + info[i] + ); + } +} + + +void Foam::extendedEdgeMesh::nearestFeatureEdgeByType +( + const point& sample, + const scalarField& searchDistSqr, + List& info +) const +{ + const PtrList >& edgeTrees = edgeTreesByType(); + + info.setSize(edgeTrees.size()); + + labelList sliceStarts(edgeTrees.size()); + + sliceStarts[0] = externalStart_; + sliceStarts[1] = internalStart_; + sliceStarts[2] = flatStart_; + sliceStarts[3] = openStart_; + sliceStarts[4] = multipleStart_; + + forAll(edgeTrees, i) + { + info[i] = edgeTrees[i].findNearest + ( + sample, + searchDistSqr[i] + ); + + // The index returned by the indexedOctree is local to the slice of + // edges it was supplied with, return the index to the value in the + // complete edge list + + info[i].setIndex(info[i].index() + sliceStarts[i]); + } +} + + +void Foam::extendedEdgeMesh::allNearestFeaturePoints +( + const point& sample, + scalar searchRadiusSqr, + List& info +) const +{ + // Pick up all the feature points that intersect the search sphere + labelList elems = pointTree().findSphere + ( + sample, + searchRadiusSqr + ); + + DynamicList dynPointHit(elems.size()); + + forAll(elems, elemI) + { + label index = elems[elemI]; + label ptI = pointTree().shapes().pointLabels()[index]; + const point& pt = points()[ptI]; + + pointIndexHit nearHit(true, pt, index); + + dynPointHit.append(nearHit); + } + + info.transfer(dynPointHit); +} + + +void Foam::extendedEdgeMesh::allNearestFeatureEdges +( + const point& sample, + const scalar searchRadiusSqr, + List& info +) const +{ + const PtrList >& edgeTrees = edgeTreesByType(); + + info.setSize(edgeTrees.size()); + + labelList sliceStarts(edgeTrees.size()); + + sliceStarts[0] = externalStart_; + sliceStarts[1] = internalStart_; + sliceStarts[2] = flatStart_; + sliceStarts[3] = openStart_; + sliceStarts[4] = multipleStart_; + + DynamicList dynEdgeHit(edgeTrees.size()*3); + + // Loop over all the feature edge types + forAll(edgeTrees, i) + { + // Pick up all the edges that intersect the search sphere + labelList elems = edgeTrees[i].findSphere + ( + sample, + searchRadiusSqr + ); + + forAll(elems, elemI) + { + label index = elems[elemI]; + label edgeI = edgeTrees[i].shapes().edgeLabels()[index]; + const edge& e = edges()[edgeI]; + + pointHit hitPoint = e.line(points()).nearestDist(sample); + + label hitIndex = index + sliceStarts[i]; + + pointIndexHit nearHit + ( + hitPoint.hit(), + hitPoint.rawPoint(), + hitIndex + ); + + dynEdgeHit.append(nearHit); + } + } + + info.transfer(dynEdgeHit); +} + + +const Foam::indexedOctree& +Foam::extendedEdgeMesh::pointTree() const +{ + if (pointTree_.empty()) + { + Random rndGen(17301893); + + // Slightly extended bb. Slightly off-centred just so on symmetric + // geometry there are less face/edge aligned items. + treeBoundBox bb + ( + treeBoundBox(points()).extend(rndGen, 1e-4) + ); + + bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + + const labelList featurePointLabels = identity(nonFeatureStart_); + + pointTree_.reset + ( + new indexedOctree + ( + treeDataPoint + ( + points(), + featurePointLabels + ), + bb, // bb + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ) + ); + } + + return pointTree_(); +} + + +const Foam::indexedOctree& +Foam::extendedEdgeMesh::edgeTree() const +{ + if (edgeTree_.empty()) + { + Random rndGen(17301893); + + // Slightly extended bb. Slightly off-centred just so on symmetric + // geometry there are less face/edge aligned items. + treeBoundBox bb + ( + treeBoundBox(points()).extend(rndGen, 1e-4) + ); + + bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + + labelList allEdges(identity(edges().size())); + + edgeTree_.reset + ( + new indexedOctree + ( + treeDataEdge + ( + false, // cachebb + edges(), // edges + points(), // points + allEdges // selected edges + ), + bb, // bb + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ) + ); + } + + return edgeTree_(); +} + + +const Foam::PtrList >& +Foam::extendedEdgeMesh::edgeTreesByType() const +{ + if (edgeTreesByType_.size() == 0) + { + edgeTreesByType_.setSize(nEdgeTypes); + + Random rndGen(872141); + + // Slightly extended bb. Slightly off-centred just so on symmetric + // geometry there are less face/edge aligned items. + treeBoundBox bb + ( + treeBoundBox(points()).extend(rndGen, 1e-4) + ); + + bb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + bb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL); + + labelListList sliceEdges(nEdgeTypes); + + // External edges + sliceEdges[0] = + identity(internalStart_ - externalStart_) + externalStart_; + + // Internal edges + sliceEdges[1] = identity(flatStart_ - internalStart_) + internalStart_; + + // Flat edges + sliceEdges[2] = identity(openStart_ - flatStart_) + flatStart_; + + // Open edges + sliceEdges[3] = identity(multipleStart_ - openStart_) + openStart_; + + // Multiple edges + sliceEdges[4] = + identity(edges().size() - multipleStart_) + multipleStart_; + + forAll(edgeTreesByType_, i) + { + edgeTreesByType_.set + ( + i, + new indexedOctree + ( + treeDataEdge + ( + false, // cachebb + edges(), // edges + points(), // points + sliceEdges[i] // selected edges + ), + bb, // bb + 8, // maxLevel + 10, // leafsize + 3.0 // duplicity + ) + ); + } + } + + return edgeTreesByType_; +} + + +void Foam::extendedEdgeMesh::transfer(extendedEdgeMesh& mesh) +{ + edgeMesh::transfer(mesh); + + concaveStart_ = mesh.concaveStart_; + mixedStart_ = mesh.mixedStart_; + nonFeatureStart_ = mesh.nonFeatureStart_; + internalStart_ = mesh.internalStart_; + flatStart_ = mesh.flatStart_; + openStart_ = mesh.openStart_; + multipleStart_ = mesh.multipleStart_; + normals_.transfer(mesh.normals_); + normalVolumeTypes_.transfer(mesh.normalVolumeTypes_); + edgeDirections_.transfer(mesh.edgeDirections_); + normalDirections_.transfer(mesh.normalDirections_); + edgeNormals_.transfer(mesh.edgeNormals_); + featurePointNormals_.transfer(mesh.featurePointNormals_); + featurePointEdges_.transfer(mesh.featurePointEdges_); + regionEdges_.transfer(mesh.regionEdges_); + pointTree_ = mesh.pointTree_; + edgeTree_ = mesh.edgeTree_; + edgeTreesByType_.transfer(mesh.edgeTreesByType_); +} + + +Foam::Xfer Foam::extendedEdgeMesh::xfer() +{ + return xferMoveTo(*this); +} + + +void Foam::extendedEdgeMesh::clear() +{ + edgeMesh::clear(); + concaveStart_ = 0; + mixedStart_ = 0; + nonFeatureStart_ = 0; + internalStart_ = 0; + flatStart_ = 0; + openStart_ = 0; + multipleStart_ = 0; + normals_.clear(); + normalVolumeTypes_.clear(); + edgeDirections_.clear(); + normalDirections_.clear(); + edgeNormals_.clear(); + featurePointNormals_.clear(); + featurePointEdges_.clear(); + regionEdges_.clear(); + pointTree_.clear(); + edgeTree_.clear(); + edgeTreesByType_.clear(); +} + + +void Foam::extendedEdgeMesh::add(const extendedEdgeMesh& fem) +{ + // Points + // ~~~~~~ + + // From current points into combined points + labelList reversePointMap(points().size()); + labelList reverseFemPointMap(fem.points().size()); + + label newPointI = 0; + for (label i = 0; i < concaveStart(); i++) + { + reversePointMap[i] = newPointI++; + } + for (label i = 0; i < fem.concaveStart(); i++) + { + reverseFemPointMap[i] = newPointI++; + } + + // Concave + label newConcaveStart = newPointI; + for (label i = concaveStart(); i < mixedStart(); i++) + { + reversePointMap[i] = newPointI++; + } + for (label i = fem.concaveStart(); i < fem.mixedStart(); i++) + { + reverseFemPointMap[i] = newPointI++; + } + + // Mixed + label newMixedStart = newPointI; + for (label i = mixedStart(); i < nonFeatureStart(); i++) + { + reversePointMap[i] = newPointI++; + } + for (label i = fem.mixedStart(); i < fem.nonFeatureStart(); i++) + { + reverseFemPointMap[i] = newPointI++; + } + + // Non-feature + label newNonFeatureStart = newPointI; + for (label i = nonFeatureStart(); i < points().size(); i++) + { + reversePointMap[i] = newPointI++; + } + for (label i = fem.nonFeatureStart(); i < fem.points().size(); i++) + { + reverseFemPointMap[i] = newPointI++; + } + + pointField newPoints(newPointI); + newPoints.rmap(points(), reversePointMap); + newPoints.rmap(fem.points(), reverseFemPointMap); + + + // Edges + // ~~~~~ + + // From current edges into combined edges + labelList reverseEdgeMap(edges().size()); + labelList reverseFemEdgeMap(fem.edges().size()); + + // External + label newEdgeI = 0; + for (label i = 0; i < internalStart(); i++) + { + reverseEdgeMap[i] = newEdgeI++; + } + for (label i = 0; i < fem.internalStart(); i++) + { + reverseFemEdgeMap[i] = newEdgeI++; + } + + // Internal + label newInternalStart = newEdgeI; + for (label i = internalStart(); i < flatStart(); i++) + { + reverseEdgeMap[i] = newEdgeI++; + } + for (label i = fem.internalStart(); i < fem.flatStart(); i++) + { + reverseFemEdgeMap[i] = newEdgeI++; + } + + // Flat + label newFlatStart = newEdgeI; + for (label i = flatStart(); i < openStart(); i++) + { + reverseEdgeMap[i] = newEdgeI++; + } + for (label i = fem.flatStart(); i < fem.openStart(); i++) + { + reverseFemEdgeMap[i] = newEdgeI++; + } + + // Open + label newOpenStart = newEdgeI; + for (label i = openStart(); i < multipleStart(); i++) + { + reverseEdgeMap[i] = newEdgeI++; + } + for (label i = fem.openStart(); i < fem.multipleStart(); i++) + { + reverseFemEdgeMap[i] = newEdgeI++; + } + + // Multiple + label newMultipleStart = newEdgeI; + for (label i = multipleStart(); i < edges().size(); i++) + { + reverseEdgeMap[i] = newEdgeI++; + } + for (label i = fem.multipleStart(); i < fem.edges().size(); i++) + { + reverseFemEdgeMap[i] = newEdgeI++; + } + + edgeList newEdges(newEdgeI); + forAll(edges(), i) + { + const edge& e = edges()[i]; + newEdges[reverseEdgeMap[i]] = edge + ( + reversePointMap[e[0]], + reversePointMap[e[1]] + ); + } + forAll(fem.edges(), i) + { + const edge& e = fem.edges()[i]; + newEdges[reverseFemEdgeMap[i]] = edge + ( + reverseFemPointMap[e[0]], + reverseFemPointMap[e[1]] + ); + } + + pointField newEdgeDirections(newEdgeI); + newEdgeDirections.rmap(edgeDirections(), reverseEdgeMap); + newEdgeDirections.rmap(fem.edgeDirections(), reverseFemEdgeMap); + + + + + // Normals + // ~~~~~~~ + + // Combine normals + DynamicField newNormals(normals().size()+fem.normals().size()); + newNormals.append(normals()); + newNormals.append(fem.normals()); + + + // Combine and re-index into newNormals + labelListList newEdgeNormals(edgeNormals().size()+fem.edgeNormals().size()); + UIndirectList(newEdgeNormals, reverseEdgeMap) = + edgeNormals(); + UIndirectList(newEdgeNormals, reverseFemEdgeMap) = + fem.edgeNormals(); + forAll(reverseFemEdgeMap, i) + { + label mapI = reverseFemEdgeMap[i]; + labelList& en = newEdgeNormals[mapI]; + forAll(en, j) + { + en[j] += normals().size(); + } + } + + + // Combine and re-index into newFeaturePointNormals + labelListList newFeaturePointNormals + ( + featurePointNormals().size() + + fem.featurePointNormals().size() + ); + + // Note: featurePointNormals only go up to nonFeatureStart + UIndirectList + ( + newFeaturePointNormals, + SubList