diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt index fc0ff4880f..814dfe0850 100644 --- a/doc/changes/splitCyclic.txt +++ b/doc/changes/splitCyclic.txt @@ -104,6 +104,14 @@ type 'processorCyclic'. - processor patches use overlapping communication using a different message tag. This maps straight through into the MPI message tag. +See processorCyclicPolyPatch::tag(). This needs to be calculated the +same on both sides so is calculated as + Pstream::nProcs()*max(myProcNo, neighbProcNo) + + min(myProcNo, neighbProcNo) +which is +- unique +- commutative +- does not interfere with the default tag (= 1) - when constructing a GeometricField from a dictionary it will explicitly diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 30defe5104..0318aa7e39 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -341,6 +341,7 @@ $(constraintPolyPatches)/empty/emptyPolyPatch.C $(constraintPolyPatches)/symmetry/symmetryPolyPatch.C $(constraintPolyPatches)/wedge/wedgePolyPatch.C $(constraintPolyPatches)/cyclic/cyclicPolyPatch.C +$(constraintPolyPatches)/cyclicSlip/cyclicSlipPolyPatch.C $(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C $(constraintPolyPatches)/processor/processorPolyPatch.C @@ -452,6 +453,7 @@ $(constraintPointPatches)/empty/emptyPointPatch.C $(constraintPointPatches)/symmetry/symmetryPointPatch.C $(constraintPointPatches)/wedge/wedgePointPatch.C $(constraintPointPatches)/cyclic/cyclicPointPatch.C +$(constraintPointPatches)/cyclicSlip/cyclicSlipPointPatch.C $(constraintPointPatches)/processor/processorPointPatch.C $(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C index e0ef1bf8eb..fbe7575763 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.C @@ -219,30 +219,6 @@ Foam::List Foam::UPstream::procIDs_(1, 0); // Standard transfer message type int Foam::UPstream::msgType_(1); -// New message type -int Foam::UPstream::freeTag_(msgType()+1); - -// Free'd message types -Foam::LIFOStack Foam::UPstream::freedTags_; - -int Foam::UPstream::allocateTag() -{ - if (freedTags_.empty()) - { - return freeTag_++; - } - else - { - return freedTags_.pop(); - } -} - -void Foam::UPstream::freeTag(const int tag) -{ - freedTags_.push(tag); -} - - // Linear communication schedule Foam::List Foam::UPstream::linearCommunication_(0); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index 57f6c263bc..a0b0e44b87 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -45,7 +45,6 @@ SourceFiles #include "HashTable.H" #include "string.H" #include "NamedEnum.H" -#include "LIFOStack.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -191,12 +190,6 @@ private: static List treeCommunication_; - //- Current free tag - static int freeTag_; - - //- Freed tags - static LIFOStack freedTags_; - // Private Member Functions //- Set data for parallel running @@ -346,11 +339,6 @@ public: { return msgType_; } - //- Allocate new tag - static int allocateTag(); - - //- Release allocated tag - static void freeTag(const int tag); //- Get the communications type of the stream diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C index 7db347c5a6..612e8dc5e3 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.C @@ -8,10 +8,10 @@ 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 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 2 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 @@ -19,12 +19,12 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ #include "cyclicSlipPointPatchField.H" -#include "pointConstraint.H" #include "transformField.H" #include "symmTransformField.H" @@ -104,17 +104,6 @@ void cyclicSlipPointPatchField::evaluate(const Pstream::commsTypes) } -template -void cyclicSlipPointPatchField::applyConstraint -( - const label pointi, - pointConstraint& pc -) const -{ - pc.applyConstraint(this->patch().pointNormals()[pointi]); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H index 52c59ab1b6..45d9cd2264 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchField.H @@ -8,10 +8,10 @@ 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 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 2 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 @@ -19,13 +19,14 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class Foam::cyclicSlipPointPatchField Description - Specialisation of cyclic that constrains to the patch + Cyclic + slip constraints SourceFiles cyclicSlipPointPatchField.C @@ -36,6 +37,7 @@ SourceFiles #define cyclicSlipPointPatchField_H #include "cyclicPointPatchField.H" +#include "cyclicSlipPointPatch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -55,7 +57,7 @@ class cyclicSlipPointPatchField public: //- Runtime type information - TypeName("cyclicSlip"); + TypeName(cyclicSlipPointPatch::typeName_()); // Constructors @@ -121,18 +123,13 @@ public: // Member functions - //- Update the patch field - virtual void evaluate - ( - const Pstream::commsTypes commsType=Pstream::blocking - ); + // Evaluation functions - //- Accumulate the effect of constraint direction of this patch - virtual void applyConstraint - ( - const label pointi, - pointConstraint& - ) const; + //- Evaluate the patch field + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); }; diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.C b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.C index 71e09f575f..e6cac8cdea 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.C +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.C @@ -8,10 +8,10 @@ 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 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 2 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 @@ -19,7 +19,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.H b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.H index da2196d9be..729fcbc2a0 100644 --- a/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.H +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/cyclicSlip/cyclicSlipPointPatchFields.H @@ -8,10 +8,10 @@ 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 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 2 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 @@ -19,7 +19,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA \*---------------------------------------------------------------------------*/ diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C new file mode 100644 index 0000000000..0afb9d4e6b --- /dev/null +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.C @@ -0,0 +1,75 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipPointPatch.H" +#include "pointConstraint.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(cyclicSlipPointPatch, 0); + +// Add the patch constructor functions to the hash tables +addToRunTimeSelectionTable +( + facePointPatch, + cyclicSlipPointPatch, + polyPatch +); + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const vectorField& cyclicSlipPointPatch::pointNormals() const +{ + // Use underlying patch normals + return refCast + ( + *this + ).facePointPatch::pointNormals(); +} + + +void cyclicSlipPointPatch::applyConstraint +( + const label pointi, + pointConstraint& pc +) const +{ + pc.applyConstraint(pointNormals()[pointi]); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.H new file mode 100644 index 0000000000..deb4dd236e --- /dev/null +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/cyclicSlip/cyclicSlipPointPatch.H @@ -0,0 +1,103 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::cyclicSlipPointPatch + +Description + Cyclic patch with slip constraint + +SourceFiles + cyclicSlipPointPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipPointPatch_H +#define cyclicSlipPointPatch_H + +#include "cyclicPointPatch.H" +#include "cyclicSlipPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cyclicSlipPointPatch Declaration +\*---------------------------------------------------------------------------*/ + +class cyclicSlipPointPatch +: + public cyclicPointPatch +{ + +public: + + //- Runtime type information + TypeName(cyclicSlipPolyPatch::typeName_()); + + + // Constructors + + //- Construct from components + cyclicSlipPointPatch + ( + const polyPatch& patch, + const pointBoundaryMesh& bm + ) + : + cyclicPointPatch(patch, bm) + {} + + + // Destructor + + virtual ~cyclicSlipPointPatch() + {} + + + // Member Functions + + //- Return point unit normals. + virtual const vectorField& pointNormals() const; + + //- Accumulate the effect of constraint direction of this patch + virtual void applyConstraint + ( + const label pointi, + pointConstraint& + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.C new file mode 100644 index 0000000000..21fbf574d5 --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.C @@ -0,0 +1,41 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipPolyPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(cyclicSlipPolyPatch, 0); + + addToRunTimeSelectionTable(polyPatch, cyclicSlipPolyPatch, word); + addToRunTimeSelectionTable(polyPatch, cyclicSlipPolyPatch, dictionary); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H new file mode 100644 index 0000000000..50f0ae55c6 --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/cyclicSlip/cyclicSlipPolyPatch.H @@ -0,0 +1,200 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::cyclicSlipPolyPatch + +Description + Copy of cyclicSlip - used to be able to instantiate cyclicSlip pointPatch + which is cyclicSlip with slip constraints + +SourceFiles + cyclicSlipPolyPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipPolyPatch_H +#define cyclicSlipPolyPatch_H + +#include "cyclicPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cyclicSlipPolyPatch Declaration +\*---------------------------------------------------------------------------*/ + +class cyclicSlipPolyPatch +: + public cyclicPolyPatch +{ + +public: + + //- Runtime type information + TypeName("cyclicSlip"); + + + // Constructors + + //- Construct from components + cyclicSlipPolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm + ) + : + cyclicPolyPatch(name, size, start, index, bm) + {} + + //- Construct from dictionary + cyclicSlipPolyPatch + ( + const word& name, + const dictionary& dict, + const label index, + const polyBoundaryMesh& bm + ) + : + cyclicPolyPatch(name, dict, index, bm) + {} + + //- Construct as copy, resetting the boundary mesh + cyclicSlipPolyPatch + ( + const cyclicSlipPolyPatch& pp, + const polyBoundaryMesh& bm + ) + : + cyclicPolyPatch(pp, bm) + {} + + //- Construct given the original patch and resetting the + // face list and boundary mesh information + cyclicSlipPolyPatch + ( + const cyclicSlipPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart, + const word& neighbPatchName + ) + : + cyclicPolyPatch(pp, bm, index, newSize, newStart, neighbPatchName) + {} + + + //- Construct given the original patch and a map + cyclicSlipPolyPatch + ( + const cyclicPolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) + : + cyclicPolyPatch(pp, bm, index, mapAddressing, newStart) + {} + + + //- Construct and return a clone, resetting the boundary mesh + virtual autoPtr clone(const polyBoundaryMesh& bm) const + { + return autoPtr(new cyclicSlipPolyPatch(*this, bm)); + } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr clone + ( + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart + ) const + { + return autoPtr + ( + new cyclicSlipPolyPatch + ( + *this, + bm, + index, + newSize, + newStart, + neighbPatchName() + ) + ); + } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr clone + ( + const polyBoundaryMesh& bm, + const label index, + const unallocLabelList& mapAddressing, + const label newStart + ) const + { + return autoPtr + ( + new cyclicSlipPolyPatch + ( + *this, + bm, + index, + mapAddressing, + newStart + ) + ); + } + + + // Destructor + + virtual ~cyclicSlipPolyPatch() + {} + + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C index df93919fd2..cc2a6ddb95 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/processorCyclic/processorCyclicPolyPatch.C @@ -55,10 +55,20 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch ) : processorPolyPatch(name, size, start, index, bm, myProcNo, neighbProcNo), - tag_(UPstream::allocateTag()), + tag_ + ( + Pstream::nProcs()*max(myProcNo, neighbProcNo) + + min(myProcNo, neighbProcNo) + ), referPatchName_(referPatchName), referPatchID_(-1) -{} +{ + if (debug) + { + Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_ + << endl; + } +} Foam::processorCyclicPolyPatch::processorCyclicPolyPatch @@ -70,10 +80,20 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch ) : processorPolyPatch(name, dict, index, bm), - tag_(UPstream::allocateTag()), + tag_ + ( + Pstream::nProcs()*max(myProcNo(), neighbProcNo()) + + min(myProcNo(), neighbProcNo()) + ), referPatchName_(dict.lookup("referPatch")), referPatchID_(-1) -{} +{ + if (debug) + { + Pout<< "processorCyclicPolyPatch " << name << " uses tag " << tag_ + << endl; + } +} Foam::processorCyclicPolyPatch::processorCyclicPolyPatch @@ -125,9 +145,7 @@ Foam::processorCyclicPolyPatch::processorCyclicPolyPatch // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::processorCyclicPolyPatch::~processorCyclicPolyPatch() -{ - UPstream::freeTag(tag_); -} +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index cdb0a70337..3fa33b7e20 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -20,6 +20,7 @@ $(constraintFvPatches)/empty/emptyFvPatch.C $(constraintFvPatches)/symmetry/symmetryFvPatch.C $(constraintFvPatches)/wedge/wedgeFvPatch.C $(constraintFvPatches)/cyclic/cyclicFvPatch.C +$(constraintFvPatches)/cyclicSlip/cyclicSlipFvPatch.C $(constraintFvPatches)/processor/processorFvPatch.C $(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C @@ -96,6 +97,7 @@ $(basicFvPatchFields)/zeroGradient/zeroGradientFvPatchFields.C constraintFvPatchFields = $(fvPatchFields)/constraint $(constraintFvPatchFields)/cyclic/cyclicFvPatchFields.C +$(constraintFvPatchFields)/cyclicSlip/cyclicSlipFvPatchFields.C $(constraintFvPatchFields)/empty/emptyFvPatchFields.C $(constraintFvPatchFields)/jumpCyclic/jumpCyclicFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchFields.C @@ -167,6 +169,7 @@ $(basicFvsPatchFields)/sliced/slicedFvsPatchFields.C constraintFvsPatchFields = $(fvsPatchFields)/constraint $(constraintFvsPatchFields)/cyclic/cyclicFvsPatchFields.C +$(constraintFvsPatchFields)/cyclicSlip/cyclicSlipFvsPatchFields.C $(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C $(constraintFvsPatchFields)/processor/processorFvsPatchFields.C $(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C new file mode 100644 index 0000000000..de5b7a7985 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipFvPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +cyclicSlipFvPatchField::cyclicSlipFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + cyclicFvPatchField(p, iF) +{} + + +template +cyclicSlipFvPatchField::cyclicSlipFvPatchField +( + const cyclicSlipFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + cyclicFvPatchField(ptf, p, iF, mapper) +{} + + +template +cyclicSlipFvPatchField::cyclicSlipFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + cyclicFvPatchField(p, iF, dict) +{} + + +template +cyclicSlipFvPatchField::cyclicSlipFvPatchField +( + const cyclicSlipFvPatchField& ptf +) +: + cyclicFvPatchField(ptf) +{} + + +template +cyclicSlipFvPatchField::cyclicSlipFvPatchField +( + const cyclicSlipFvPatchField& ptf, + const DimensionedField& iF +) +: + cyclicFvPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H new file mode 100644 index 0000000000..11f0cfb798 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchField.H @@ -0,0 +1,141 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::cyclicSlipFvPatchField + +Description + Foam::cyclicSlipFvPatchField + +SourceFiles + cyclicSlipFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvPatchField_H +#define cyclicSlipFvPatchField_H + +#include "cyclicFvPatchField.H" +#include "cyclicSlipFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cyclicSlipFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +template +class cyclicSlipFvPatchField +: + public cyclicFvPatchField +{ + // Private data + +public: + + //- Runtime type information + TypeName(cyclicSlipFvPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + cyclicSlipFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + cyclicSlipFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given cyclicSlipFvPatchField onto a new patch + cyclicSlipFvPatchField + ( + const cyclicSlipFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + cyclicSlipFvPatchField + ( + const cyclicSlipFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new cyclicSlipFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + cyclicSlipFvPatchField + ( + const cyclicSlipFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new cyclicSlipFvPatchField(*this, iF) + ); + } + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "cyclicSlipFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.C new file mode 100644 index 0000000000..a84b5539f7 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(cyclicSlip); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H new file mode 100644 index 0000000000..421c22bcd5 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvPatchFields_H +#define cyclicSlipFvPatchFields_H + +#include "cyclicSlipFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(cyclicSlip) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H new file mode 100644 index 0000000000..38a89ea43f --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicSlip/cyclicSlipFvPatchFieldsFwd.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvPatchFieldsFwd_H +#define cyclicSlipFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class cyclicSlipFvPatchField; + +makePatchTypeFieldTypedefs(cyclicSlip) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.C new file mode 100644 index 0000000000..ec0b62727a --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.C @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipFvsPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +cyclicSlipFvsPatchField::cyclicSlipFvsPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + cyclicFvsPatchField(p, iF) +{} + + +template +cyclicSlipFvsPatchField::cyclicSlipFvsPatchField +( + const cyclicSlipFvsPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + cyclicFvsPatchField(ptf, p, iF, mapper) +{} + + +template +cyclicSlipFvsPatchField::cyclicSlipFvsPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + cyclicFvsPatchField(p, iF, dict) +{} + + +template +cyclicSlipFvsPatchField::cyclicSlipFvsPatchField +( + const cyclicSlipFvsPatchField& ptf +) +: + cyclicFvsPatchField(ptf) +{} + + +template +cyclicSlipFvsPatchField::cyclicSlipFvsPatchField +( + const cyclicSlipFvsPatchField& ptf, + const DimensionedField& iF +) +: + cyclicFvsPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H new file mode 100644 index 0000000000..77819901b0 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchField.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::cyclicSlipFvsPatchField + +Description + Foam::cyclicSlipFvsPatchField + +SourceFiles + cyclicSlipFvsPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvsPatchField_H +#define cyclicSlipFvsPatchField_H + +#include "cyclicFvsPatchField.H" +#include "cyclicSlipFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cyclicSlipFvsPatch Declaration +\*---------------------------------------------------------------------------*/ + +template +class cyclicSlipFvsPatchField +: + public cyclicFvsPatchField +{ + +public: + + //- Runtime type information + TypeName(cyclicSlipFvPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + cyclicSlipFvsPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + cyclicSlipFvsPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given cyclicSlipFvsPatchField onto a new patch + cyclicSlipFvsPatchField + ( + const cyclicSlipFvsPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + cyclicSlipFvsPatchField + ( + const cyclicSlipFvsPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new cyclicSlipFvsPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + cyclicSlipFvsPatchField + ( + const cyclicSlipFvsPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new cyclicSlipFvsPatchField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "cyclicSlipFvsPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.C b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.C new file mode 100644 index 0000000000..dfdac930f1 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.C @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipFvsPatchFields.H" +#include "fvsPatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFvsPatchFields(cyclicSlip); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H new file mode 100644 index 0000000000..bfadab012d --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFields.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvsPatchFields_H +#define cyclicSlipFvsPatchFields_H + +#include "cyclicSlipFvsPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFvsPatchTypeFieldTypedefs(cyclicSlip) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H new file mode 100644 index 0000000000..a782121974 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicSlip/cyclicSlipFvsPatchFieldsFwd.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvsPatchFieldsFwd_H +#define cyclicSlipFvsPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class cyclicSlipFvsPatchField; + +makeFvsPatchTypeFieldTypedefs(cyclicSlip) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicSlip/cyclicSlipFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicSlip/cyclicSlipFvPatch.C new file mode 100644 index 0000000000..58ccc83590 --- /dev/null +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicSlip/cyclicSlipFvPatch.C @@ -0,0 +1,45 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "cyclicSlipFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(cyclicSlipFvPatch, 0); +addToRunTimeSelectionTable(fvPatch, cyclicSlipFvPatch, polyPatch); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicSlip/cyclicSlipFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicSlip/cyclicSlipFvPatch.H new file mode 100644 index 0000000000..35964ee81c --- /dev/null +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicSlip/cyclicSlipFvPatch.H @@ -0,0 +1,80 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::cyclicSlipFvPatch + +Description + Cyclic-plane patch. + +SourceFiles + cyclicSlipFvPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cyclicSlipFvPatch_H +#define cyclicSlipFvPatch_H + +#include "cyclicFvPatch.H" +#include "cyclicSlipPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cyclicSlipFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class cyclicSlipFvPatch +: + public cyclicFvPatch +{ + +public: + + //- Runtime type information + TypeName(cyclicSlipPolyPatch::typeName_()); + + + // Constructors + + //- Construct from polyPatch + cyclicSlipFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm) + : + cyclicFvPatch(patch, bm) + {} +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C index 0d9e84533d..455ee7936d 100644 --- a/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C +++ b/src/lagrangian/dsmc/clouds/Templates/DsmcCloud/DsmcCloud.C @@ -291,7 +291,10 @@ void Foam::DsmcCloud::initialise template void Foam::DsmcCloud::collisions() { - buildCellOccupancy(); + if (!binaryCollision().active()) + { + return; + } // Temporary storage for subCells List > subCells(8); @@ -1057,6 +1060,9 @@ void Foam::DsmcCloud::evolve() // Move the particles ballistically with their current velocities Cloud::move(td); + // Update cell occupancy + buildCellOccupancy(); + // Calculate new velocities via stochastic collisions collisions(); diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C index b07fd0cb2d..1e8356ef5f 100644 --- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C +++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C @@ -25,6 +25,7 @@ License #include "dsmcParcel.H" #include "DsmcCloud.H" +#include "NoBinaryCollision.H" #include "VariableHardSphere.H" #include "LarsenBorgnakkeVariableHardSphere.H" @@ -34,6 +35,12 @@ namespace Foam // Add instances of collision model to the table makeBinaryCollisionModelType + ( + NoBinaryCollision, + DsmcCloud, + dsmcParcel + ); + makeBinaryCollisionModelType ( VariableHardSphere, DsmcCloud, diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C index 274b9ff79c..f35eee7d98 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.C @@ -27,6 +27,15 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template +Foam::BinaryCollisionModel::BinaryCollisionModel(CloudType& owner) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null) +{} + + template Foam::BinaryCollisionModel::BinaryCollisionModel ( @@ -87,4 +96,3 @@ Foam::BinaryCollisionModel::coeffDict() const #include "BinaryCollisionModelNew.C" // ************************************************************************* // - diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H index 8550762aaf..0136cd5f6a 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/BinaryCollisionModel/BinaryCollisionModel.H @@ -85,6 +85,9 @@ public: // Constructors + //- Construct null from owner + BinaryCollisionModel(CloudType& owner); + //- Construct from components BinaryCollisionModel ( @@ -123,6 +126,9 @@ public: // Member Functions + //- Flag to indicate whether model activates collision model + virtual bool active() const = 0; + //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C index c7bf6a00ab..e5112d5c66 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C @@ -117,6 +117,12 @@ Foam::LarsenBorgnakkeVariableHardSphere:: // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +bool Foam::LarsenBorgnakkeVariableHardSphere::active() const +{ + return true; +} + template Foam::scalar Foam::LarsenBorgnakkeVariableHardSphere::sigmaTcR diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H index f01f625e3f..3f742a78ae 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.H @@ -89,6 +89,9 @@ public: // Member Functions + //- Flag to indicate whether model activates collision model + virtual bool active() const; + //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C new file mode 100644 index 0000000000..5ff9889638 --- /dev/null +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 "NoBinaryCollision.H" +#include "constants.H" + +using namespace Foam::constant::mathematical; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::NoBinaryCollision::NoBinaryCollision +( + const dictionary& dict, + CloudType& cloud +) +: + BinaryCollisionModel(cloud) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::NoBinaryCollision::~NoBinaryCollision() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +bool Foam::NoBinaryCollision::active() const +{ + return false; +} + + +template +Foam::scalar Foam::NoBinaryCollision::sigmaTcR +( + label typeIdP, + label typeIdQ, + const vector& UP, + const vector& UQ +) const +{ + FatalErrorIn + ( + "Foam::scalar Foam::NoBinaryCollision::sigmaTcR" + "(" + "label typeIdP," + "label typeIdQ," + "const vector& UP," + "const vector& UQ" + ") const" + ) + << "sigmaTcR called on NoBinaryCollision model, this should " + << "not happen, this is not an actual model." << nl + << "Enclose calls to sigmaTcR within a if(binaryCollision().active()) " + << " check." + << abort(FatalError); + + return 0.0; +} + + +template +void Foam::NoBinaryCollision::collide +( + label typeIdP, + label typeIdQ, + vector& UP, + vector& UQ, + scalar& EiP, + scalar& EiQ +) +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H new file mode 100644 index 0000000000..b48cedb316 --- /dev/null +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/NoBinaryCollision/NoBinaryCollision.H @@ -0,0 +1,110 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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::NoBinaryCollision + +Description + No collison BinaryCollision Model + +\*---------------------------------------------------------------------------*/ + +#ifndef NoBinaryCollision_H +#define NoBinaryCollision_H + +#include "BinaryCollisionModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class NoBinaryCollision Declaration +\*---------------------------------------------------------------------------*/ + +template +class NoBinaryCollision +: + public BinaryCollisionModel +{ +public: + + //- Runtime type information + TypeName("none"); + + + // Constructors + + //- Construct from dictionary + NoBinaryCollision + ( + const dictionary& dict, + CloudType& cloud + ); + + + //- Destructor + virtual ~NoBinaryCollision(); + + + // Member Functions + + //- Flag to indicate whether model activates collision model + virtual bool active() const; + + //- Return the collision cross section * relative velocity product + virtual scalar sigmaTcR + ( + label typeIdP, + label typeIdQ, + const vector& UP, + const vector& UQ + ) const; + + //- Apply collision + virtual void collide + ( + label typeIdP, + label typeIdQ, + vector& UP, + vector& UQ, + scalar& EiP, + scalar& EiQ + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "NoBinaryCollision.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C index e248d01161..8f7d13dd7d 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.C @@ -51,6 +51,12 @@ Foam::VariableHardSphere::~VariableHardSphere() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template +bool Foam::VariableHardSphere::active() const +{ + return true; +} + template Foam::scalar Foam::VariableHardSphere::sigmaTcR diff --git a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H index 17e1684ee9..bf986189c0 100644 --- a/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H +++ b/src/lagrangian/dsmc/submodels/BinaryCollisionModel/VariableHardSphere/VariableHardSphere.H @@ -74,6 +74,9 @@ public: // Member Functions + //- Flag to indicate whether model activates collision model + virtual bool active() const; + //- Return the collision cross section * relative velocity product virtual scalar sigmaTcR ( diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C index 6f5fe48f45..1f1f8c6254 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.C @@ -27,6 +27,15 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template +Foam::InflowBoundaryModel::InflowBoundaryModel(CloudType& owner) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null) +{} + + template Foam::InflowBoundaryModel::InflowBoundaryModel ( diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H index 764cde1141..e58fb30a6d 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/InflowBoundaryModel/InflowBoundaryModel.H @@ -86,6 +86,9 @@ public: // Constructors + //- Construct null from owner + InflowBoundaryModel(CloudType& owner); + //- Construct from dictionary InflowBoundaryModel ( diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C index b8a9a88b15..682ca7d530 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.C @@ -34,7 +34,7 @@ Foam::NoInflow::NoInflow CloudType& cloud ) : - InflowBoundaryModel(dict, cloud, typeName) + InflowBoundaryModel(cloud) {} diff --git a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H index e969da048c..1ed042ae79 100644 --- a/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H +++ b/src/lagrangian/dsmc/submodels/InflowBoundaryModel/NoInflow/NoInflow.H @@ -50,7 +50,7 @@ class NoInflow public: //- Runtime type information - TypeName("NoInflow"); + TypeName("none"); // Constructors diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C index 947eddda07..467e5fad4f 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/MaxwellianThermal/MaxwellianThermal.C @@ -37,7 +37,7 @@ Foam::MaxwellianThermal::MaxwellianThermal CloudType& cloud ) : - WallInteractionModel(dict, cloud, typeName) + WallInteractionModel(cloud) {} diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C index 979030938d..b690a0f87e 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/SpecularReflection/SpecularReflection.C @@ -36,7 +36,7 @@ Foam::SpecularReflection::SpecularReflection CloudType& cloud ) : - WallInteractionModel(dict, cloud, typeName) + WallInteractionModel(cloud) {} diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C index 8d6d983690..f9bcb86278 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.C @@ -27,6 +27,15 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +template +Foam::WallInteractionModel::WallInteractionModel(CloudType& owner) +: + dict_(dictionary::null), + owner_(owner), + coeffDict_(dictionary::null) +{} + + template Foam::WallInteractionModel::WallInteractionModel ( diff --git a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H index f28a6cec0f..dfed430ff7 100644 --- a/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H +++ b/src/lagrangian/dsmc/submodels/WallInteractionModel/WallInteractionModel/WallInteractionModel.H @@ -85,6 +85,9 @@ public: // Constructors + //- Construct null from owner + WallInteractionModel(CloudType& owner); + //- Construct from components WallInteractionModel ( diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.C index f0b4804cf5..4fd7453f3e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.C @@ -28,37 +28,41 @@ License // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::CollisionRecordList::CollisionRecordList() +template +Foam::CollisionRecordList::CollisionRecordList() : - DynamicList >() + pairRecords_(), + wallRecords_() {} -template -Foam::CollisionRecordList::CollisionRecordList(Istream& is) +template +Foam::CollisionRecordList::CollisionRecordList(Istream& is) : - DynamicList >(is) + pairRecords_(is), + wallRecords_(is) { // Check state of Istream is.check ( - "Foam::CollisionRecordList::CollisionRecordList(Foam::Istream&)" + "Foam::CollisionRecordList::" + "CollisionRecordList(Foam::Istream&)" ); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * / -template -Foam::CollisionRecordList::~CollisionRecordList() +template +Foam::CollisionRecordList::~CollisionRecordList() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -template -Foam::CollisionRecord& Foam::CollisionRecordList::matchRecord +template +Foam::PairCollisionRecord& +Foam::CollisionRecordList::matchPairRecord ( label origProcOfOther, label origIdOfOther @@ -68,15 +72,15 @@ Foam::CollisionRecord& Foam::CollisionRecordList::matchRecord // identifiers. Two records with the same identification is not // supported. - forAll(*this, i) + forAll(pairRecords_, i) { - CollisionRecord& cR = (*this)[i]; + PairCollisionRecord& pCR = pairRecords_[i]; - if (cR.match(origProcOfOther, origIdOfOther)) + if (pCR.match(origProcOfOther, origIdOfOther)) { - cR.setAccessed(); + pCR.setAccessed(); - return cR; + return pCR; } } @@ -84,28 +88,179 @@ Foam::CollisionRecord& Foam::CollisionRecordList::matchRecord // member of the list. The status of the record will be accessed // by construction. - append(CollisionRecord(origProcOfOther, origIdOfOther)); + pairRecords_.append + ( + PairCollisionRecord(origProcOfOther, origIdOfOther) + ); - return (*this)[this->size() - 1]; + return pairRecords_.last(); } -template -void Foam::CollisionRecordList::update() +template +Foam::WallCollisionRecord& +Foam::CollisionRecordList::matchWallRecord +( + const vector& pRel, + scalar radius +) { - DynamicList > updatedRecords; + // Returning the first record that matches the relative position. + // Two records with the same relative position is not supported. - forAll(*this, i) + forAll(wallRecords_, i) { - if ((*this)[i].accessed()) - { - (*this)[i].setUnaccessed(); + WallCollisionRecord& wCR = wallRecords_[i]; - updatedRecords.append((*this)[i]); + if (wCR.match(pRel, radius)) + { + wCR.setAccessed(); + + return wCR; } } - DynamicList >::operator=(updatedRecords); + // Record not found, create a new one and return it as the last + // member of the list. The status of the record will be accessed + // by construction. + + wallRecords_.append(WallCollisionRecord(pRel)); + + return wallRecords_.last(); } + + +template +void Foam::CollisionRecordList::update() +{ + { + DynamicList > updatedRecords; + + forAll(pairRecords_, i) + { + if (pairRecords_[i].accessed()) + { + pairRecords_[i].setUnaccessed(); + + updatedRecords.append(pairRecords_[i]); + } + } + + pairRecords_ = updatedRecords; + } + + { + DynamicList > updatedRecords; + + forAll(wallRecords_, i) + { + if (wallRecords_[i].accessed()) + { + wallRecords_[i].setUnaccessed(); + + updatedRecords.append(wallRecords_[i]); + } + } + + wallRecords_ = updatedRecords; + } +} + + +// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // + +template +void Foam::CollisionRecordList::operator= +( + const CollisionRecordList& rhs +) +{ + // Check for assignment to self + if (this == &rhs) + { + FatalErrorIn + ( + "Foam::CollisionRecordList::operator=" + "(const Foam::CollisionRecordList&)" + ) + << "Attempted assignment to self" + << abort(FatalError); + } + + pairRecords_ = rhs.pairRecords_; + wallRecords_ = rhs.wallRecords_; +} + + +// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // + +template +inline bool Foam::operator== +( + const CollisionRecordList& a, + const CollisionRecordList& b +) +{ + return + ( + a.pairRecords_ == b.pairRecords_ + && a.wallRecords_ == b.wallRecords_ + ); +} + + +template +inline bool Foam::operator!= +( + const CollisionRecordList& a, + const CollisionRecordList& b +) +{ + return !(a == b); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Istream& Foam::operator>> +( + Istream& is, + CollisionRecordList& cRL +) +{ + is >> cRL.pairRecords_ >> cRL.wallRecords_; + + // Check state of Istream + is.check + ( + "Foam::Istream& Foam::operator>>" + "(Foam::Istream&, Foam::CollisionRecordList&)" + ); + + return is; +} + + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const CollisionRecordList& cRL +) +{ + os << cRL.pairRecords_ << cRL.wallRecords_; + + // Check state of Ostream + os.check + ( + "Foam::Ostream& Foam::operator<<(Foam::Ostream&, " + "const Foam::CollisionRecordList&)" + ); + + return os; +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.H index 32c7eef6c6..2993b9df30 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecordList.H @@ -37,22 +37,53 @@ SourceFiles #define CollisionRecordList_H #include "DynamicList.H" -#include "CollisionRecord.H" +#include "PairCollisionRecord.H" +#include "WallCollisionRecord.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { +// Forward declaration of friend functions and operators +template +class CollisionRecordList; + +template +inline bool operator== +( + const CollisionRecordList&, + const CollisionRecordList& +); + +template +inline bool operator!= +( + const CollisionRecordList&, + const CollisionRecordList& +); + +template +Istream& operator>>(Istream&, CollisionRecordList&); + +template +Ostream& operator<<(Ostream&, const CollisionRecordList&); + + /*---------------------------------------------------------------------------*\ Class CollisionRecordList Declaration \*---------------------------------------------------------------------------*/ -template +template class CollisionRecordList -: - public DynamicList > { + // Private data + + //- List of active pair collisions + DynamicList > pairRecords_; + + //- List of active wall collisions + DynamicList > wallRecords_; public: @@ -72,19 +103,66 @@ public: // Member Functions //- Enquires if the proc and id pair of the other particle are - // present in the records. If so, return access to the - // collisionData and mark the CollisionRecord as accessed this - // step, if not, create the record and return access to it. - CollisionRecord& matchRecord + // present in the records. If so, return non-const access to + // the PairCollisionRecord (hence the data) and mark the + // PairCollisionRecord as accessed this step, if not, create + // the record and return access to it. + PairCollisionRecord& matchPairRecord ( label origProcOfOther, label origIdOfOther ); + //- Enquires if the position of wall impact relative to the + // particle centre is present in the records. If so, return + // access to the WallCollisionRecord (hence the data) and + // mark the WallCollisionRecord as accesses this step, if + // not, create the record and return access to it. + WallCollisionRecord& matchWallRecord + ( + const vector& pRel, + scalar radius + ); + //- Update the collision records, deleting any records not // marked as having been accessed, then mark all records as // not accessed ready for the next evaluation void update(); + + + // Member Operators + + void operator=(const CollisionRecordList&); + + + // Friend Operators + + friend bool operator== + ( + const CollisionRecordList&, + const CollisionRecordList& + ); + + friend bool operator!= + ( + const CollisionRecordList&, + const CollisionRecordList& + ); + + + // IOstream Operators + + friend Istream& operator>> + ( + Istream&, + CollisionRecordList& + ); + + friend Ostream& operator<< + ( + Ostream&, + const CollisionRecordList& + ); }; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecord.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecord.C similarity index 77% rename from src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecord.C rename to src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecord.C index 8ccc725054..0357d15c5d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecord.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecord.C @@ -23,12 +23,12 @@ License \*---------------------------------------------------------------------------*/ -#include "CollisionRecord.H" +#include "PairCollisionRecord.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::CollisionRecord::CollisionRecord() +Foam::PairCollisionRecord::PairCollisionRecord() : origProcOfOther_(-VGREAT), origIdOfOther_(-VGREAT), @@ -37,7 +37,7 @@ Foam::CollisionRecord::CollisionRecord() template -Foam::CollisionRecord::CollisionRecord +Foam::PairCollisionRecord::PairCollisionRecord ( label origProcOfOther, label origIdOfOther, @@ -51,33 +51,39 @@ Foam::CollisionRecord::CollisionRecord template -Foam::CollisionRecord::CollisionRecord(const CollisionRecord& cR) +Foam::PairCollisionRecord::PairCollisionRecord +( + const PairCollisionRecord& pCR +) : - origProcOfOther_(cR.origProcOfOther() + 1), - origIdOfOther_(cR.origIdOfOther_), - data_(cR.data_) + origProcOfOther_(pCR.origProcOfOther() + 1), + origIdOfOther_(pCR.origIdOfOther_), + data_(pCR.data_) {} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // template -Foam::CollisionRecord::~CollisionRecord() +Foam::PairCollisionRecord::~PairCollisionRecord() {} // * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // template -void Foam::CollisionRecord::operator=(const CollisionRecord& rhs) +void Foam::PairCollisionRecord::operator= +( + const PairCollisionRecord& rhs +) { // Check for assignment to self if (this == &rhs) { FatalErrorIn ( - "Foam::CollisionRecord::operator=" - "(const Foam::CollisionRecord&)" + "Foam::PairCollisionRecord::operator=" + "(const Foam::PairCollisionRecord&)" ) << "Attempted assignment to self" << abort(FatalError); @@ -91,7 +97,7 @@ void Foam::CollisionRecord::operator=(const CollisionRecord& rhs) // * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // -#include "CollisionRecordIO.C" +#include "PairCollisionRecordIO.C" // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecord.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecord.H similarity index 80% rename from src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecord.H rename to src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecord.H index de226c88e6..a14b645fb4 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecord.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecord.H @@ -22,7 +22,7 @@ License along with OpenFOAM. If not, see . Class - Foam::CollisionRecord + Foam::PairCollisionRecord Description @@ -35,14 +35,14 @@ Description positive means that it has. SourceFiles - CollisionRecordI.H - CollisionRecord.C - CollisionRecordIO.C + PairCollisionRecordI.H + PairCollisionRecord.C + PairCollisionRecordIO.C \*---------------------------------------------------------------------------*/ -#ifndef CollisionRecord_H -#define CollisionRecord_H +#ifndef PairCollisionRecord_H +#define PairCollisionRecord_H #include "label.H" #include "vector.H" @@ -54,35 +54,35 @@ namespace Foam // Forward declaration of friend functions and operators template -class CollisionRecord; +class PairCollisionRecord; template inline bool operator== ( - const CollisionRecord&, - const CollisionRecord& + const PairCollisionRecord&, + const PairCollisionRecord& ); template inline bool operator!= ( - const CollisionRecord&, - const CollisionRecord& + const PairCollisionRecord&, + const PairCollisionRecord& ); template -Istream& operator>>(Istream&, CollisionRecord&); +Istream& operator>>(Istream&, PairCollisionRecord&); template -Ostream& operator<<(Ostream&, const CollisionRecord&); +Ostream& operator<<(Ostream&, const PairCollisionRecord&); /*---------------------------------------------------------------------------*\ - Class CollisionRecord Declaration + Class PairCollisionRecord Declaration \*---------------------------------------------------------------------------*/ template -class CollisionRecord +class PairCollisionRecord { // Private data @@ -103,10 +103,10 @@ public: // Constructors //- Construct null - CollisionRecord(); + PairCollisionRecord(); //- Construct from components - CollisionRecord + PairCollisionRecord ( label origProcOfOther, label origIdOfOther, @@ -114,14 +114,14 @@ public: ); //- Construct from Istream - CollisionRecord(Istream&); + PairCollisionRecord(Istream&); //- Construct as copy - CollisionRecord(const CollisionRecord&); + PairCollisionRecord(const PairCollisionRecord&); //- Destructor - ~CollisionRecord(); + ~PairCollisionRecord(); // Member Functions @@ -165,21 +165,21 @@ public: // Member Operators - void operator=(const CollisionRecord&); + void operator=(const PairCollisionRecord&); // Friend Operators friend bool operator== ( - const CollisionRecord&, - const CollisionRecord& + const PairCollisionRecord&, + const PairCollisionRecord& ); friend bool operator!= ( - const CollisionRecord&, - const CollisionRecord& + const PairCollisionRecord&, + const PairCollisionRecord& ); @@ -188,13 +188,13 @@ public: friend Istream& operator>> ( Istream&, - CollisionRecord& + PairCollisionRecord& ); friend Ostream& operator<< ( Ostream&, - const CollisionRecord& + const PairCollisionRecord& ); }; @@ -205,12 +205,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "CollisionRecordI.H" +#include "PairCollisionRecordI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository -# include "CollisionRecord.C" +# include "PairCollisionRecord.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecordI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecordI.H similarity index 77% rename from src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecordI.H rename to src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecordI.H index 33d60305ce..4c0d3abc87 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecordI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecordI.H @@ -26,7 +26,7 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline bool Foam::CollisionRecord::match +inline bool Foam::PairCollisionRecord::match ( label queryOrigProcOfOther, label queryOrigIdOfOther @@ -41,14 +41,14 @@ inline bool Foam::CollisionRecord::match template -inline Foam::label Foam::CollisionRecord::origProcOfOther() const +inline Foam::label Foam::PairCollisionRecord::origProcOfOther() const { return mag(origProcOfOther_) - 1; } template -inline Foam::label Foam::CollisionRecord::origIdOfOther() const +inline Foam::label Foam::PairCollisionRecord::origIdOfOther() const { return origIdOfOther_; } @@ -56,35 +56,35 @@ inline Foam::label Foam::CollisionRecord::origIdOfOther() const template inline const Type& -Foam::CollisionRecord::collisionData() const +Foam::PairCollisionRecord::collisionData() const { return data_; } template -inline Type& Foam::CollisionRecord::collisionData() +inline Type& Foam::PairCollisionRecord::collisionData() { return data_; } template -inline bool Foam::CollisionRecord::accessed() const +inline bool Foam::PairCollisionRecord::accessed() const { return pos(origProcOfOther_); } template -inline void Foam::CollisionRecord::setAccessed() +inline void Foam::PairCollisionRecord::setAccessed() { origProcOfOther_ = origProcOfOther() + 1; } template -inline void Foam::CollisionRecord::setUnaccessed() +inline void Foam::PairCollisionRecord::setUnaccessed() { origProcOfOther_ = -(origProcOfOther() + 1); } @@ -95,8 +95,8 @@ inline void Foam::CollisionRecord::setUnaccessed() template inline bool Foam::operator== ( - const CollisionRecord& a, - const CollisionRecord& b + const PairCollisionRecord& a, + const PairCollisionRecord& b ) { return @@ -107,11 +107,12 @@ inline bool Foam::operator== ); } + template inline bool Foam::operator!= ( - const CollisionRecord& a, - const CollisionRecord& b + const PairCollisionRecord& a, + const PairCollisionRecord& b ) { return !(a == b); diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecordIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecordIO.C similarity index 72% rename from src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecordIO.C rename to src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecordIO.C index e90611318b..4c1de522f7 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/CollisionRecord/CollisionRecordIO.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/PairCollisionRecord/PairCollisionRecordIO.C @@ -23,35 +23,38 @@ License \*---------------------------------------------------------------------------*/ -#include "CollisionRecord.H" +#include "PairCollisionRecord.H" #include "IOstreams.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::CollisionRecord::CollisionRecord(Istream& is) +Foam::PairCollisionRecord::PairCollisionRecord(Istream& is) : origProcOfOther_(readLabel(is)), origIdOfOther_(readLabel(is)), data_(is) { // Check state of Istream - is.check("Foam::CollisionRecord::CollisionRecord(Foam::Istream&)"); + is.check + ( + "Foam::PairCollisionRecord::PairCollisionRecord(Foam::Istream&)" + ); } // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // template -Foam::Istream& Foam::operator>>(Istream& is, CollisionRecord& cR) +Foam::Istream& Foam::operator>>(Istream& is, PairCollisionRecord& pCR) { - is >> cR.origProcOfOther_ >> cR.origIdOfOther_ >> cR.data_; + is >> pCR.origProcOfOther_ >> pCR.origIdOfOther_ >> pCR.data_; // Check state of Istream is.check ( "Foam::Istream&" - "Foam::operator>>(Foam::Istream&, Foam::CollisionRecord&)" + "Foam::operator>>(Foam::Istream&, Foam::PairCollisionRecord&)" ); return is; @@ -59,17 +62,21 @@ Foam::Istream& Foam::operator>>(Istream& is, CollisionRecord& cR) template -Foam::Ostream& Foam::operator<<(Ostream& os, const CollisionRecord& cR) +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const PairCollisionRecord& pCR +) { - os << cR.origProcOfOther_ - << token::SPACE << cR.origIdOfOther_ - << token::SPACE << cR.data_; + os << pCR.origProcOfOther_ + << token::SPACE << pCR.origIdOfOther_ + << token::SPACE << pCR.data_; // Check state of Ostream os.check ( "Foam::Ostream& Foam::operator<<(Foam::Ostream&, " - "const Foam::CollisionRecord&)" + "const Foam::PairCollisionRecord&)" ); return os; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecord.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecord.C new file mode 100644 index 0000000000..d3141e660d --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecord.C @@ -0,0 +1,102 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 "WallCollisionRecord.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::WallCollisionRecord::WallCollisionRecord() +: + accessed_(false), + pRel_(), + data_(pTraits::zero) +{} + + +template +Foam::WallCollisionRecord::WallCollisionRecord +( + const vector& pRel, + const Type& data +) +: + accessed_(true), + pRel_(pRel), + data_(data) +{} + + +template +Foam::WallCollisionRecord::WallCollisionRecord +( + const WallCollisionRecord& wCR +) +: + accessed_(wCR.accessed_), + pRel_(wCR.pRel_), + data_(wCR.data_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::WallCollisionRecord::~WallCollisionRecord() +{} + + +// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * // + +template +void Foam::WallCollisionRecord::operator= +( + const WallCollisionRecord& rhs +) +{ + // Check for assignment to self + if (this == &rhs) + { + FatalErrorIn + ( + "Foam::WallCollisionRecord::operator=" + "(const Foam::WallCollisionRecord&)" + ) + << "Attempted assignment to self" + << abort(FatalError); + } + + accessed_ = rhs.accessed_; + pRel_ = rhs.pRel_; + data_ = rhs.data_; +} + + +// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * // + +#include "WallCollisionRecordIO.C" + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecord.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecord.H new file mode 100644 index 0000000000..33f021fc7c --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecord.H @@ -0,0 +1,204 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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::WallCollisionRecord + +Description + Record of a collision between the particle holding the record and + a wall face at the position relative to the centre of the particle. + +SourceFiles + WallCollisionRecordI.H + WallCollisionRecord.C + WallCollisionRecordIO.C + +\*---------------------------------------------------------------------------*/ + +#ifndef WallCollisionRecord_H +#define WallCollisionRecord_H + +#include "vector.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of friend functions and operators +template +class WallCollisionRecord; + +template +inline bool operator== +( + const WallCollisionRecord&, + const WallCollisionRecord& +); + +template +inline bool operator!= +( + const WallCollisionRecord&, + const WallCollisionRecord& +); + +template +Istream& operator>>(Istream&, WallCollisionRecord&); + +template +Ostream& operator<<(Ostream&, const WallCollisionRecord&); + + +/*---------------------------------------------------------------------------*\ + Class WallCollisionRecord Declaration +\*---------------------------------------------------------------------------*/ + +template +class WallCollisionRecord +{ + // Private data + + // //- Recording whether or not this record has been accessed + bool accessed_; + + //- The position of wall impact relative to the cell centre + vector pRel_; + + //- Collision data, stored as if the storing particle was the + // first particle (particle A) in the collision. + Type data_; + + +public: + + // Constructors + + //- Construct null + WallCollisionRecord(); + + //- Construct from components + WallCollisionRecord + ( + const vector& pRel, + const Type& data = pTraits::zero + ); + + //- Construct from Istream + WallCollisionRecord(Istream&); + + //- Construct as copy + WallCollisionRecord(const WallCollisionRecord&); + + + //- Destructor + ~WallCollisionRecord(); + + + // Member Functions + + + // Access + + //- Return the pRel data + inline const vector& pRel() const; + + //- Return access to the collision data + inline const Type& collisionData() const; + + //- Return access to the collision data + inline Type& collisionData(); + + + // Check + + inline bool match(const vector& pRel, scalar radius); + + //- Return the accessed status of the record + inline bool accessed() const; + + + // Edit + + //- Set the accessed property of the record to accessed + inline void setAccessed(); + + //- Set the accessed property of the record to unaccessed + inline void setUnaccessed(); + + + // Member Operators + + void operator=(const WallCollisionRecord&); + + + // Friend Operators + + friend bool operator== + ( + const WallCollisionRecord&, + const WallCollisionRecord& + ); + + friend bool operator!= + ( + const WallCollisionRecord&, + const WallCollisionRecord& + ); + + + // IOstream Operators + + friend Istream& operator>> + ( + Istream&, + WallCollisionRecord& + ); + + friend Ostream& operator<< + ( + Ostream&, + const WallCollisionRecord& + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "WallCollisionRecordI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "WallCollisionRecord.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecordI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecordI.H new file mode 100644 index 0000000000..1a9a9feb0b --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecordI.H @@ -0,0 +1,143 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline bool Foam::WallCollisionRecord::match +( + const vector& pRel, + scalar radius +) +{ + scalar magpRel_= mag(pRel_); + + scalar magpRel = mag(pRel); + + // Using the new data as the acceptance criterion + scalar cosAcceptanceAngle = magpRel/radius; + + if (cosAcceptanceAngle > 1.0) + { + Info<< "pRel_ " << pRel_ << " " << magpRel_ << nl + << "pRel " << pRel << " " << magpRel << nl + << "unit vector dot product " << (pRel & pRel_)/(magpRel_*magpRel) + << nl << "cosAcceptanceAngle " << cosAcceptanceAngle + << endl; + + FatalErrorIn + ( + "inline bool Foam::WallCollisionRecord::match" + "(" + "const vector& pRel," + "scalar radius" + ") const" + ) + << "Problem with matching WallCollisionRecord." << nl + << "The given radius, " << radius << ", is smaller than distance " + << "to the relative position of the WallInteractionSite, " + << magpRel << nl + << abort(FatalError); + } + + // Are the test and recorded pRel (relative position vectors) + // aligned to within the calculated tolerance? + bool matched = (pRel & pRel_)/(magpRel_*magpRel) > cosAcceptanceAngle; + + if (matched) + { + pRel_ = pRel; + } + + return matched; +} + + +template +inline const Type& +Foam::WallCollisionRecord::collisionData() const +{ + return data_; +} + + +template +inline Type& Foam::WallCollisionRecord::collisionData() +{ + return data_; +} + + +template +inline bool Foam::WallCollisionRecord::accessed() const +{ + return accessed_; +} + + +template +inline void Foam::WallCollisionRecord::setAccessed() +{ + accessed_ = true; +} + + +template +inline void Foam::WallCollisionRecord::setUnaccessed() +{ + accessed_ = false; +} + + +// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * // + +template +inline bool Foam::operator== +( + const WallCollisionRecord& a, + const WallCollisionRecord& b +) +{ + return + ( + a.accessed_ == b.accessed_ + && a.pRel_ == b.pRel_ + && a.data_ == b.data_ + ); +} + + +template +inline bool Foam::operator!= +( + const WallCollisionRecord& a, + const WallCollisionRecord& b +) +{ + return !(a == b); +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecordIO.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecordIO.C new file mode 100644 index 0000000000..afc35b5b09 --- /dev/null +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/CollisionRecordList/WallCollisionRecord/WallCollisionRecordIO.C @@ -0,0 +1,86 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 "WallCollisionRecord.H" +#include "IOstreams.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::WallCollisionRecord::WallCollisionRecord(Istream& is) +: + accessed_(is), + pRel_(is), + data_(is) +{ + // Check state of Istream + is.check + ( + "Foam::WallCollisionRecord::WallCollisionRecord(Foam::Istream&)" + ); +} + + +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // + +template +Foam::Istream& Foam::operator>>(Istream& is, WallCollisionRecord& wCR) +{ + is >> wCR.accessed_ >> wCR.pRel_ >> wCR.data_; + + // Check state of Istream + is.check + ( + "Foam::Istream&" + "Foam::operator>>(Foam::Istream&, Foam::WallCollisionRecord&)" + ); + + return is; +} + + +template +Foam::Ostream& Foam::operator<< +( + Ostream& os, + const WallCollisionRecord& wCR +) +{ + os << wCR.accessed_ + << token::SPACE << wCR.pRel_ + << token::SPACE << wCR.data_; + + // Check state of Ostream + os.check + ( + "Foam::Ostream& Foam::operator<<(Foam::Ostream&, " + "const Foam::WallCollisionRecord&)" + ); + + return os; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 84123c89f4..9b8691c534 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -268,7 +268,7 @@ protected: vector UTurb_; //- Particle collision records - CollisionRecordList collisionRecords_; + CollisionRecordList collisionRecords_; // Cell-based quantities @@ -400,7 +400,8 @@ public: inline const vector& UTurb() const; //- Return const access to the collision records - inline const CollisionRecordList& collisionRecords() const; + inline const CollisionRecordList& + collisionRecords() const; // Edit @@ -439,7 +440,7 @@ public: inline vector& UTurb(); //- Return access to collision records - inline CollisionRecordList& collisionRecords(); + inline CollisionRecordList& collisionRecords(); // Helper functions diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index ceef9ca8b2..e551c38b9e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -348,7 +348,7 @@ inline bool& Foam::KinematicParcel::active() template -inline const Foam::CollisionRecordList& +inline const Foam::CollisionRecordList& Foam::KinematicParcel::collisionRecords() const { return collisionRecords_; @@ -426,7 +426,7 @@ inline Foam::vector& Foam::KinematicParcel::UTurb() template -inline Foam::CollisionRecordList& +inline Foam::CollisionRecordList& Foam::KinematicParcel::collisionRecords() { return collisionRecords_; diff --git a/src/lagrangian/intermediate/particleForces/particleForces.C b/src/lagrangian/intermediate/particleForces/particleForces.C index 31db9460f1..6591d2b8d4 100644 --- a/src/lagrangian/intermediate/particleForces/particleForces.C +++ b/src/lagrangian/intermediate/particleForces/particleForces.C @@ -61,6 +61,7 @@ Foam::particleForces::particleForces dict_(dict.subDict("particleForces")), g_(g), gradUPtr_(NULL), + HdotGradHInterPtr_(NULL), gravity_(dict_.lookup("gravity")), virtualMass_(dict_.lookup("virtualMass")), Cvm_(0.0), @@ -88,6 +89,7 @@ Foam::particleForces::particleForces(const particleForces& f) dict_(f.dict_), g_(f.g_), gradUPtr_(f.gradUPtr_), + HdotGradHInterPtr_(f.HdotGradHInterPtr_), gravity_(f.gravity_), virtualMass_(f.virtualMass_), Cvm_(f.Cvm_), diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.C index 6c10eff509..54bf3ab659 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.C @@ -198,20 +198,20 @@ void Foam::PairSpringSliderDashpot::evaluatePair scalar deltaT = this->owner().mesh().time().deltaTValue(); vector& tangentialOverlap_AB = - pA.collisionRecords().matchRecord + pA.collisionRecords().matchPairRecord ( pB.origProc(), pB.origId() ).collisionData(); vector& tangentialOverlap_BA = - pB.collisionRecords().matchRecord + pB.collisionRecords().matchPairRecord ( pA.origProc(), pA.origId() ).collisionData(); - vector deltaTangentialOverlap_AB = USlip_AB * deltaT; + vector deltaTangentialOverlap_AB = USlip_AB*deltaT; tangentialOverlap_AB += deltaTangentialOverlap_AB; tangentialOverlap_BA += -deltaTangentialOverlap_AB; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.H index 18b3075337..58cd385012 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairSpringSliderDashpot/PairSpringSliderDashpot.H @@ -33,7 +33,7 @@ Description #define PairSpringSliderDashpot_H #include "PairModel.H" -#include "CollisionRecord.H" +#include "CollisionRecordList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C index 60c4218a75..4bf524e387 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallSpringSliderDashpot/WallSpringSliderDashpot.C @@ -100,11 +100,10 @@ void Foam::WallSpringSliderDashpot::evaluateWall scalar deltaT = this->owner().mesh().time().deltaTValue(); - // For remembering previous overlap - // vector deltaTangentialOverlap_PW = USlip_PW * deltaT; - // tangentialOverlap_PW += deltaTangentialOverlap_PW; + vector& tangentialOverlap_PW = + p.collisionRecords().matchWallRecord(-r_PW, pREff).collisionData(); - vector tangentialOverlap_PW = USlip_PW * deltaT; + tangentialOverlap_PW += USlip_PW*deltaT; scalar tangentialOverlapMag = mag(tangentialOverlap_PW); @@ -124,7 +123,7 @@ void Foam::WallSpringSliderDashpot::evaluateWall fT_PW = -mu_*mag(fN_PW)*USlip_PW/mag(USlip_PW); - // tangentialOverlap_PW = vector::zero; + tangentialOverlap_PW = vector::zero; } else { diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C index ae719eb968..381b24ae0c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C @@ -330,11 +330,11 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::updateCoeffs() Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' - << this->dimensionedInternalField().name() << " -> " + << this->dimensionedInternalField().name() << " <- " << nbrMesh.name() << ':' << nbrPatch.name() << ':' << this->dimensionedInternalField().name() << " :" - << " heatFlux:" << Q + << " heat[W]:" << Q << " walltemperature " << " min:" << gMin(*this) << " max:" << gMax(*this) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C index c58c5f162a..278320f253 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C @@ -198,7 +198,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() // Get the coupling information from the directMappedPatchBase const directMappedPatchBase& mpp = refCast ( - this->patch().patch() + patch().patch() ); const polyMesh& nbrMesh = mpp.sampleMesh(); const fvPatch& nbrPatch = refCast @@ -285,11 +285,11 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::updateCoeffs() Info<< patch().boundaryMesh().mesh().name() << ':' << patch().name() << ':' - << this->dimensionedInternalField().name() << " -> " + << this->dimensionedInternalField().name() << " <- " << nbrMesh.name() << ':' << nbrPatch.name() << ':' << this->dimensionedInternalField().name() << " :" - << " heatFlux:" << Q + << " heat[W]:" << Q << " walltemperature " << " min:" << gMin(*this) << " max:" << gMax(*this) diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryT b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryT index fa809fdc24..ece1ab678b 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryT +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryT @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object boundaryT; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 0 0 1 0 0 0]; +dimensions [ 0 0 0 1 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryU b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryU index 8c8a5f2f33..c75e5506a6 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryU +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/boundaryU @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volVectorField; + location "0"; object boundaryU; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 1 -1 0 0 0 0]; +dimensions [ 0 1 -1 0 0 0 0 ]; -internalField uniform (0 0 0); +internalField uniform ( 0 0 0 ); boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/dsmcRhoN b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/dsmcRhoN index f87f04f57d..2494f1643f 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/dsmcRhoN +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/dsmcRhoN @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object dsmcRhoN; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 -3 0 0 0 0 0]; +dimensions [ 0 -3 0 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/fD b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/fD index 19e3bf764e..bcc188d7b5 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/fD +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/fD @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volVectorField; + location "0"; object fD; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; +dimensions [ 1 -1 -2 0 0 0 0 ]; -internalField uniform (0 0 0); +internalField uniform ( 0 0 0 ); boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/iDof b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/iDof index 0e6a8bddd6..1dd93605f1 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/iDof +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/iDof @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object iDof; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 -3 0 0 0 0 0]; +dimensions [ 0 -3 0 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/internalE b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/internalE index d9dc59d3b1..b5e11bb738 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/internalE +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/internalE @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object internalE; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; +dimensions [ 1 -1 -2 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/linearKE b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/linearKE index 609d964a68..4edb0c49dc 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/linearKE +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/linearKE @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object linearKE; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -1 -2 0 0 0 0]; +dimensions [ 1 -1 -2 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/momentum b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/momentum index d615c80816..1b17cb300b 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/momentum +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/momentum @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volVectorField; + location "0"; object momentum; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -2 -1 0 0 0 0]; +dimensions [ 1 -2 -1 0 0 0 0 ]; -internalField uniform (0 0 0); +internalField uniform ( 0 0 0 ); boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/q b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/q index 0839663c53..e4cb992d82 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/q +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/q @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object q; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 0 -3 0 0 0 0]; +dimensions [ 1 0 -3 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoM b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoM index d8e5cdc513..2eb277f9c6 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoM +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoM @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object rhoM; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [1 -3 0 0 0 0 0]; +dimensions [ 1 -3 0 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoN b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoN index 1ff11802e5..7d6a699198 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoN +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/0/rhoN @@ -1,8 +1,8 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile @@ -10,30 +10,42 @@ FoamFile version 2.0; format ascii; class volScalarField; + location "0"; object rhoN; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -dimensions [0 -3 0 0 0 0 0]; +dimensions [ 0 -3 0 0 0 0 0 ]; internalField uniform 0; boundaryField { - xPeriodic + xPeriodic_half0 { type cyclic; } - - yPeriodic + yPeriodic_half0 { type cyclic; } - - zPeriodic + zPeriodic_half0 + { + type cyclic; + } + yPeriodic_half1 + { + type cyclic; + } + zPeriodic_half1 + { + type cyclic; + } + xPeriodic_half1 { type cyclic; } } + // ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties index 71f793e9de..33fa043381 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/dsmcProperties @@ -27,7 +27,6 @@ nEquivalentParticles 1e12; WallInteractionModel SpecularReflection; -SpecularReflectionCoeffs {} // Binary Collision Model // ~~~~~~~~~~~~~~~~~~~~~~ @@ -43,9 +42,8 @@ LarsenBorgnakkeVariableHardSphereCoeffs // Inflow Boundary Model // ~~~~~~~~~~~~~~~~~~~~~ -InflowBoundaryModel NoInflow; +InflowBoundaryModel none; -NoInflowCoeffs {} // Molecular species // ~~~~~~~~~~~~~~~~~ diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/polyMesh/boundary b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/polyMesh/boundary index 3b2f641ec2..7be12b0361 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/polyMesh/boundary +++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -15,28 +15,49 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -3 +6 ( - xPeriodic + xPeriodic_half0 { type cyclic; - nFaces 512; + nFaces 256; startFace 14464; - featureCos 0.9; + neighbourPatch xPeriodic_half1; } - yPeriodic + xPeriodic_half1 { type cyclic; - nFaces 640; + nFaces 256; + startFace 14720; + neighbourPatch xPeriodic_half0; + } + yPeriodic_half0 + { + type cyclic; + nFaces 320; startFace 14976; - featureCos 0.9; + neighbourPatch yPeriodic_half1; } - zPeriodic + yPeriodic_half1 { type cyclic; - nFaces 640; + nFaces 320; + startFace 15296; + neighbourPatch yPeriodic_half0; + } + zPeriodic_half0 + { + type cyclic; + nFaces 320; startFace 15616; - featureCos 0.9; + neighbourPatch zPeriodic_half1; + } + zPeriodic_half1 + { + type cyclic; + nFaces 320; + startFace 15936; + neighbourPatch zPeriodic_half0; } ) diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/0/interpolaterhoN b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/0/interpolaterhoN deleted file mode 100644 index 73a629252d..0000000000 --- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/0/interpolaterhoN +++ /dev/null @@ -1,42 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class surfaceScalarField; - location "0"; - object interpolaterhoN; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -dimensions [0 -3 0 0 0 0 0]; - -internalField uniform 0; - -boundaryField -{ - outlet - { - type calculated; - value uniform 0; - } - inlet - { - type calculated; - value uniform 0; - } - sides - { - type calculated; - value uniform 0; - } -} - - -// ************************************************************************* // diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties index 273e2b2cbe..154582ddcd 100644 --- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/constant/dsmcProperties @@ -27,8 +27,6 @@ nEquivalentParticles 1e12; WallInteractionModel MaxwellianThermal; -MaxwellianThermalCoeffs {} - // Binary Collision Model // ~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties index 6fd38ae2e6..bf85f1abe7 100644 --- a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/constant/dsmcProperties @@ -25,39 +25,24 @@ nEquivalentParticles 1.2e12; // Wall Interaction Model // ~~~~~~~~~~~~~~~~~~~~~~ -//WallInteractionModel SpecularReflection; WallInteractionModel MaxwellianThermal; -SpecularReflectionCoeffs {} - -MaxwellianThermalCoeffs {} - // Binary Collision Model // ~~~~~~~~~~~~~~~~~~~~~~ -//BinaryCollisionModel VariableHardSphere; -BinaryCollisionModel LarsenBorgnakkeVariableHardSphere; +BinaryCollisionModel VariableHardSphere; VariableHardSphereCoeffs { Tref 273; } -LarsenBorgnakkeVariableHardSphereCoeffs -{ - Tref 273; - relaxationCollisionNumber 5.0; -} - // Inflow Boundary Model // ~~~~~~~~~~~~~~~~~~~~~ InflowBoundaryModel FreeStream; -//InflowBoundaryModel NoInflow; - -NoInflowCoeffs {} FreeStreamCoeffs { diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryT b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryT index db6966ac23..f587cd7380 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryT +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryT @@ -32,9 +32,9 @@ boundaryField value uniform 550; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryU b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryU index 942b5145e2..415380b989 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryU +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/boundaryU @@ -32,9 +32,9 @@ boundaryField value uniform (0 0 0); } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/dsmcRhoN b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/dsmcRhoN index 0690dd175c..07c6a1b456 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/dsmcRhoN +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/dsmcRhoN @@ -30,9 +30,9 @@ boundaryField type zeroGradient; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/fD b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/fD index 8fede74a75..646849b96e 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/fD +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/fD @@ -31,9 +31,9 @@ boundaryField value uniform (0 0 0); } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/iDof b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/iDof index b31b782ef0..1ce7e3b052 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/iDof +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/iDof @@ -31,9 +31,9 @@ boundaryField value uniform 0; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/internalE b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/internalE index 61e30470b9..b13d432e3a 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/internalE +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/internalE @@ -31,9 +31,9 @@ boundaryField value uniform 0; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/linearKE b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/linearKE index b3f5a50d70..189311cb1d 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/linearKE +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/linearKE @@ -31,9 +31,9 @@ boundaryField value uniform 0; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/momentum b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/momentum index 424e0310cc..979ab3893a 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/momentum +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/momentum @@ -31,9 +31,9 @@ boundaryField value uniform (0 0 0); } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/q b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/q index ecceff2ae5..5de7659935 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/q +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/q @@ -31,9 +31,9 @@ boundaryField value uniform 0; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoM b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoM index 224aae627a..3f9855fdb9 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoM +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoM @@ -31,9 +31,9 @@ boundaryField value uniform 0; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoN b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoN index 275417c995..f4305a74a9 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoN +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/0/rhoN @@ -31,9 +31,9 @@ boundaryField value uniform 0; } - periodic + frontAndBack { - type cyclic; + type empty; } } diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties index d338013dcc..032885b138 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/dsmcProperties @@ -27,8 +27,6 @@ nEquivalentParticles 5e12; WallInteractionModel MaxwellianThermal; -MaxwellianThermalCoeffs {} - // Binary Collision Model // ~~~~~~~~~~~~~~~~~~~~~~ @@ -47,8 +45,6 @@ LarsenBorgnakkeVariableHardSphereCoeffs InflowBoundaryModel FreeStream; -NoInflowCoeffs {} - FreeStreamCoeffs { numberDensities diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/blockMeshDict b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/blockMeshDict index 7906adbe08..5ef67b3d58 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/blockMeshDict +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/blockMeshDict @@ -18,26 +18,26 @@ convertToMeters 1; vertices ( - (-0.15242 0 -0.05) - ( 0 0 -0.05) - ( 0.3048 0.081670913853 -0.05) - (-0.15242 0.3 -0.05) - ( 0 0.3 -0.05) - ( 0.3048 0.3 -0.05) + (-0.15242 0 -0.0042) + ( 0 0 -0.0042) + ( 0.3048 0.081670913853 -0.0042) + (-0.15242 0.3 -0.0042) + ( 0 0.3 -0.0042) + ( 0.3048 0.3 -0.0042) - (-0.15242 0 0.05) - ( 0 0 0.05) - ( 0.3048 0.081670913853 0.05) - (-0.15242 0.3 0.05) - ( 0 0.3 0.05) - ( 0.3048 0.3 0.05) + (-0.15242 0 0.0042) + ( 0 0 0.0042) + ( 0.3048 0.081670913853 0.0042) + (-0.15242 0.3 0.0042) + ( 0 0.3 0.0042) + ( 0.3048 0.3 0.0042) ); blocks ( - hex (0 1 4 3 6 7 10 9 ) (20 40 12) simpleGrading (1 1 1) - hex (1 2 5 4 7 8 11 10) (40 40 12) simpleGrading (1 1 1) + hex (0 1 4 3 6 7 10 9 ) (20 40 1) simpleGrading (1 1 1) + hex (1 2 5 4 7 8 11 10) (40 40 1) simpleGrading (1 1 1) ); edges @@ -58,7 +58,7 @@ patches ( (1 2 8 7) ) - cyclic periodic + empty frontAndBack ( (0 3 4 1) (1 4 5 2) diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/boundary b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/boundary index 3c32e9b0e4..0ea523348c 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/boundary +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -20,21 +20,20 @@ FoamFile flow { type patch; - nFaces 1920; - startFace 82800; + nFaces 160; + startFace 4700; } obstacle { type wall; - nFaces 480; - startFace 84720; + nFaces 40; + startFace 4860; } - periodic + frontAndBack { - type cyclic; + type empty; nFaces 4800; - startFace 85200; - featureCos 0.9; + startFace 4900; } ) diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/controlDict b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/controlDict index 31f6cf1b8d..2c4749bb06 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/controlDict +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/controlDict @@ -23,14 +23,13 @@ startTime 0; stopAt endTime; -endTime 0.00125; -// endTime 0.01; +endTime 0.02; deltaT 2e-6; writeControl runTime; -writeInterval 1e-4; +writeInterval 1e-3; purgeWrite 0; diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/decomposeParDict b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/decomposeParDict index eb1bea1fce..f1482468d4 100644 --- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/decomposeParDict +++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/decomposeParDict @@ -21,7 +21,7 @@ method simple; simpleCoeffs { - n ( 1 1 4 ); + n ( 2 2 1 ); delta 0.001; } diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/constant/polyMesh/boundary b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/constant/polyMesh/boundary index 850c9baa1e..27b419834d 100644 --- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/constant/polyMesh/boundary +++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/constant/polyMesh/boundary @@ -15,28 +15,49 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -3 +6 ( - periodicX + periodicX_half0 { type cyclic; - nFaces 288; + nFaces 144; startFace 4752; - featureCos 0.9; + neighbourPatch periodicX_half1; } - periodicY + periodicX_half1 { type cyclic; - nFaces 288; + nFaces 144; + startFace 4896; + neighbourPatch periodicX_half0; + } + periodicY_half0 + { + type cyclic; + nFaces 144; startFace 5040; - featureCos 0.9; + neighbourPatch periodicY_half1; } - periodicZ + periodicY_half1 { type cyclic; - nFaces 288; + nFaces 144; + startFace 5184; + neighbourPatch periodicY_half0; + } + periodicZ_half0 + { + type cyclic; + nFaces 144; startFace 5328; - featureCos 0.9; + neighbourPatch periodicZ_half1; + } + periodicZ_half1 + { + type cyclic; + nFaces 144; + startFace 5472; + neighbourPatch periodicZ_half0; } ) diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/constant/polyMesh/boundary b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/constant/polyMesh/boundary index 435792380c..d5b72fc728 100644 --- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/constant/polyMesh/boundary +++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/constant/polyMesh/boundary @@ -1,7 +1,7 @@ /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | +| \\ / O peration | Version: dev | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ @@ -15,28 +15,49 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -3 +6 ( - periodicX + periodicX_half0 { type cyclic; - nFaces 264; + nFaces 132; startFace 4344; - featureCos 0.9; + neighbourPatch periodicX_half1; } - periodicY + periodicX_half1 { type cyclic; - nFaces 264; + nFaces 132; + startFace 4476; + neighbourPatch periodicX_half0; + } + periodicY_half0 + { + type cyclic; + nFaces 132; startFace 4608; - featureCos 0.9; + neighbourPatch periodicY_half1; } - periodicZ + periodicY_half1 { type cyclic; - nFaces 288; + nFaces 132; + startFace 4740; + neighbourPatch periodicY_half0; + } + periodicZ_half0 + { + type cyclic; + nFaces 144; startFace 4872; - featureCos 0.9; + neighbourPatch periodicZ_half1; + } + periodicZ_half1 + { + type cyclic; + nFaces 144; + startFace 5016; + neighbourPatch periodicZ_half0; } )