diff --git a/applications/solvers/lagrangian/interactingKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/interactingKinematicParcelFoam/Make/options index 9f6029be6e..83ef9251c5 100644 --- a/applications/solvers/lagrangian/interactingKinematicParcelFoam/Make/options +++ b/applications/solvers/lagrangian/interactingKinematicParcelFoam/Make/options @@ -19,6 +19,4 @@ EXE_LIBS = \ -lcompressibleRASModels \ -lcompressibleLESModels \ -lfiniteVolume \ - -lmeshTools \ - -lmolecule \ - -lpotential + -lmeshTools diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index d3974a9cdd..25d039c072 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -84,4 +84,9 @@ phaseProperties/phaseProperties/phasePropertiesIO.C phaseProperties/phasePropertiesList/phasePropertiesList.C +// /* interation lists */ +referralLists = interactionLists/referralLists +$(referralLists)/sendingReferralList.C +$(referralLists)/receivingReferralList.C + LIB = $(FOAM_LIBBIN)/liblagrangianIntermediate diff --git a/src/lagrangian/intermediate/Make/options b/src/lagrangian/intermediate/Make/options index 7019e85194..f352597282 100644 --- a/src/lagrangian/intermediate/Make/options +++ b/src/lagrangian/intermediate/Make/options @@ -15,8 +15,7 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ - -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \ - -I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude + -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude LIB_LIBS = \ -lfiniteVolume \ diff --git a/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionList.C b/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionList.C new file mode 100644 index 0000000000..8ddb077f6b --- /dev/null +++ b/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionList.C @@ -0,0 +1,351 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "directInteractionList.H" +#include "interactionLists.H" + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::directInteractionList::buildDirectInteractionList +( + bool pointPointListBuild +) +{ + Info<< nl << "Building list of direct interaction neighbours" << endl; + + const polyMesh& mesh(il_.mesh()); + + List > directInteractionList(mesh.nCells()); + + if (pointPointListBuild) + { + Info<< tab << "Point-Point direct interaction list build." << endl; + + label pointJIndex; + + forAll (mesh.points(), pointIIndex) + { + for + ( + pointJIndex = pointIIndex; + pointJIndex != mesh.points().size(); + ++pointJIndex + ) + { + if (il_.testPointPointDistance(pointIIndex, pointJIndex)) + { + const labelList& ptICells + ( + mesh.pointCells()[pointIIndex] + ); + + const labelList& ptJCells + ( + mesh.pointCells()[pointJIndex] + ); + + forAll(ptICells, pIC) + { + const label cellI(ptICells[pIC]); + + forAll(ptJCells, pJC) + { + const label cellJ(ptJCells[pJC]); + + if (cellJ > cellI) + { + if + ( + findIndex + ( + directInteractionList[cellI], + cellJ + ) + == -1 + ) + { + directInteractionList[cellI].append(cellJ); + } + } + + if (cellI > cellJ) + { + if + ( + findIndex + ( + directInteractionList[cellJ], + cellI + ) + == + -1 + ) + { + directInteractionList[cellJ].append(cellI); + } + } + } + } + } + } + } + } + else + { + Info<< tab << "Point-Face, Edge-Edge direct interaction list build." + << endl; + + forAll(mesh.points(), p) + { + forAll(mesh.faces(), f) + { + if (il_.testPointFaceDistance(p, f)) + { + const labelList& pCells(mesh.pointCells()[p]); + + const label cellO(mesh.faceOwner()[f]); + + forAll(pCells, pC) + { + const label cellI(pCells[pC]); + + // cells are not added to their own DIL + + if (cellO > cellI) + { + if + ( + findIndex + ( + directInteractionList[cellI], + cellO + ) + == + -1 + ) + { + directInteractionList[cellI].append(cellO); + } + } + + if (cellI > cellO) + { + if + ( + findIndex + ( + directInteractionList[cellO], + cellI + ) + == + -1 + ) + { + directInteractionList[cellO].append(cellI); + } + } + + if (mesh.isInternalFace(f)) + { + // boundary faces will not have neighbour + // information + + const label cellN(mesh.faceNeighbour()[f]); + + if (cellN > cellI) + { + if + ( + findIndex + ( + directInteractionList[cellI], + cellN + ) + == + -1 + ) + { + directInteractionList[cellI].append(cellN); + } + } + + if (cellI > cellN) + { + if + ( + findIndex + ( + directInteractionList[cellN], + cellI + ) + == + -1 + ) + { + directInteractionList[cellN].append(cellI); + } + } + } + } + } + } + } + + label edgeJIndex; + + forAll(mesh.edges(), edgeIIndex) + { + const edge& eI(mesh.edges()[edgeIIndex]); + + for + ( + edgeJIndex = edgeIIndex + 1; + edgeJIndex != mesh.edges().size(); + ++edgeJIndex + ) + { + const edge& eJ(mesh.edges()[edgeJIndex]); + + if (il_.testEdgeEdgeDistance(eI, eJ)) + { + const labelList& eICells(mesh.edgeCells()[edgeIIndex]); + + const labelList& eJCells(mesh.edgeCells()[edgeJIndex]); + + forAll(eICells, eIC) + { + const label cellI(eICells[eIC]); + + forAll(eJCells, eJC) + { + const label cellJ(eJCells[eJC]); + + if (cellJ > cellI) + { + if + ( + findIndex + ( + directInteractionList[cellI], + cellJ + ) + == + -1 + ) + { + directInteractionList[cellI].append(cellJ); + } + } + + if (cellI > cellJ) + { + if + ( + findIndex + ( + directInteractionList[cellJ], + cellI + ) + == + -1 + ) + { + directInteractionList[cellJ].append(cellI); + } + } + } + } + } + } + } + } + + forAll(directInteractionList, transDIL) + { + (*this)[transDIL].transfer + ( + directInteractionList[transDIL].shrink() + ); + } + + // sorting DILs + + forAll((*this), dIL) + { + sort((*this)[dIL]); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::directInteractionList::directInteractionList +( + const interactionLists& il, + bool pointPointListBuild +) +: + labelListList(il.mesh().nCells()), + il_(il) +{ + if ((*this).size() > 1) + { + buildDirectInteractionList(pointPointListBuild); + } + else if ((*this).size() == 1) + { + Info<< nl + << "Single cell mesh, no direct interaction lists required." + << endl; + + (*this)[0].setSize(0); + } +} + + +template +Foam::directInteractionList::directInteractionList +( + const interactionLists& il +) +: + labelListList(il.mesh().nCells()), + il_(il) +{ + Info<< "Read directInteractionList from disk not implemented" << endl; +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::directInteractionList::~directInteractionList() +{} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionList.H b/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionList.H new file mode 100644 index 0000000000..451b348e4a --- /dev/null +++ b/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionList.H @@ -0,0 +1,128 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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::directInteractionList + +Description + +SourceFiles + directInteractionListI.H + directInteractionList.C + +\*---------------------------------------------------------------------------*/ + +#ifndef directInteractionList_H +#define directInteractionList_H + +#include "polyMesh.H" +#include "List.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// Forward declaration of classes +template +class interactionLists; + +/*---------------------------------------------------------------------------*\ + Class directInteractionList Declaration +\*---------------------------------------------------------------------------*/ + +template +class directInteractionList +: + public labelListList +{ + // Private data + + const interactionLists& il_; + + + // Private Member Functions + + void buildDirectInteractionList + ( + bool pointPointListBuild + ); + + //- Disallow default bitwise copy construct + directInteractionList(const directInteractionList&); + + //- Disallow default bitwise assignment + void operator=(const directInteractionList&); + + +public: + + // Constructors + + //- Construct lists by searching the mesh + directInteractionList + ( + const interactionLists& il, + bool pointPointListBuild + ); + + //- Construct from file + directInteractionList + ( + const interactionLists& il + ); + + + // Destructor + + ~directInteractionList(); + + + // Member Functions + + // Access + + inline const interactionLists& il() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "directInteractionListI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "directInteractionList.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionListI.H b/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionListI.H new file mode 100644 index 0000000000..89f51e0f2d --- /dev/null +++ b/src/lagrangian/intermediate/interactionLists/directInteractionList/directInteractionListI.H @@ -0,0 +1,37 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 + +\*---------------------------------------------------------------------------*/ + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +inline const Foam::interactionLists& +Foam::directInteractionList::il() const +{ + return il_; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/interactionLists/interactionLists.C b/src/lagrangian/intermediate/interactionLists/interactionLists.C new file mode 100644 index 0000000000..3bbf905a4f --- /dev/null +++ b/src/lagrangian/intermediate/interactionLists/interactionLists.C @@ -0,0 +1,700 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-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 "interactionLists.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template +Foam::scalar Foam::interactionLists::transTol = 1e-12; + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +template +void Foam::interactionLists::buildCellReferralLists() +{ + Info<< nl << "Determining particle referring schedule" << endl; + + const referredCellList& refIntL(ril()); + + DynamicList