Infrastructure for CollisionModel created and make...Submodel files

updated an created.

Included interactionLists from molecule library.  Building with
temporary length squared hard coded.

Selecting collision partnersusing DIL and applying test force to each.
This commit is contained in:
graham
2009-08-20 20:06:13 +01:00
parent 05a88e7458
commit 0e8fdf5b9b
43 changed files with 1179 additions and 77448 deletions

View File

@ -19,4 +19,6 @@ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleRASModels \
-lcompressibleLESModels \ -lcompressibleLESModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools -lmeshTools \
-lmolecule \
-lpotential

View File

@ -15,7 +15,8 @@ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \ -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
-I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \ -I$(LIB_SRC)/turbulenceModels/LES/LESdeltas/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude -I$(LIB_SRC)/turbulenceModels/compressible/LES/lnInclude \
-I$(LIB_SRC)/lagrangian/molecularDynamics/molecule/lnInclude
LIB_LIBS = \ LIB_LIBS = \
-lfiniteVolume \ -lfiniteVolume \

View File

@ -31,6 +31,7 @@ License
#include "DispersionModel.H" #include "DispersionModel.H"
#include "DragModel.H" #include "DragModel.H"
#include "InjectionModel.H" #include "InjectionModel.H"
#include "CollisionModel.H"
#include "PatchInteractionModel.H" #include "PatchInteractionModel.H"
#include "PostProcessingModel.H" #include "PostProcessingModel.H"
@ -98,6 +99,14 @@ Foam::InteractingKinematicCloud<ParcelType>::InteractingKinematicCloud
*this *this
) )
), ),
collisionModel_
(
CollisionModel<InteractingKinematicCloud<ParcelType> >::New
(
particleProperties_,
*this
)
),
patchInteractionModel_ patchInteractionModel_
( (
PatchInteractionModel<InteractingKinematicCloud<ParcelType> >::New PatchInteractionModel<InteractingKinematicCloud<ParcelType> >::New
@ -239,6 +248,8 @@ void Foam::InteractingKinematicCloud<ParcelType>::evolve()
resetSourceTerms(); resetSourceTerms();
} }
this->collision().collide();
Cloud<ParcelType>::move(td); Cloud<ParcelType>::move(td);
postEvolve(); postEvolve();

View File

@ -72,6 +72,9 @@ class DragModel;
template<class CloudType> template<class CloudType>
class InjectionModel; class InjectionModel;
template<class CloudType>
class CollisionModel;
template<class CloudType> template<class CloudType>
class PostProcessingModel; class PostProcessingModel;
@ -165,6 +168,10 @@ protected:
autoPtr<InjectionModel<InteractingKinematicCloud<ParcelType> > > autoPtr<InjectionModel<InteractingKinematicCloud<ParcelType> > >
injectionModel_; injectionModel_;
//- Collision model
autoPtr<CollisionModel<InteractingKinematicCloud<ParcelType> > >
collisionModel_;
//- Patch interaction model //- Patch interaction model
autoPtr autoPtr
< <
@ -306,6 +313,15 @@ public:
inline InjectionModel<InteractingKinematicCloud<ParcelType> >& inline InjectionModel<InteractingKinematicCloud<ParcelType> >&
injection(); injection();
//- Return const access to the collision model
inline
const CollisionModel<InteractingKinematicCloud<ParcelType> >&
collision() const;
//- Return reference to the collision model
inline CollisionModel<InteractingKinematicCloud<ParcelType> >&
collision();
//- Return const-access to the patch interaction model //- Return const-access to the patch interaction model
inline inline
const PatchInteractionModel const PatchInteractionModel

View File

@ -174,6 +174,22 @@ Foam::InteractingKinematicCloud<ParcelType>::injection()
} }
template<class ParcelType>
inline const Foam::CollisionModel<Foam::InteractingKinematicCloud<ParcelType> >&
Foam::InteractingKinematicCloud<ParcelType>::collision() const
{
return collisionModel_();
}
template<class ParcelType>
inline Foam::CollisionModel<Foam::InteractingKinematicCloud<ParcelType> >&
Foam::InteractingKinematicCloud<ParcelType>::collision()
{
return collisionModel_();
}
template<class ParcelType> template<class ParcelType>
inline Foam::PostProcessingModel<Foam::InteractingKinematicCloud<ParcelType> >& inline Foam::PostProcessingModel<Foam::InteractingKinematicCloud<ParcelType> >&
Foam::InteractingKinematicCloud<ParcelType>::postProcessing() Foam::InteractingKinematicCloud<ParcelType>::postProcessing()

View File

@ -106,6 +106,7 @@ void Foam::InteractingKinematicParcel<ParcelType>::calc
// Explicit momentum source for particle // Explicit momentum source for particle
vector Su = vector::zero; vector Su = vector::zero;
// Momentum transfer from the particle to the carrier phase // Momentum transfer from the particle to the carrier phase
vector dUTrans = vector::zero; vector dUTrans = vector::zero;
@ -158,14 +159,14 @@ const Foam::vector Foam::InteractingKinematicParcel<ParcelType>::calcVelocity
mass*td.cloud().forces().calcCoupled(cellI, dt, rhoc_, rho, Uc_, U); mass*td.cloud().forces().calcCoupled(cellI, dt, rhoc_, rho, Uc_, U);
const vector FNonCoupled = const vector FNonCoupled =
mass*td.cloud().forces().calcNonCoupled(cellI, dt, rhoc_, rho, Uc_, U); mass*td.cloud().forces().calcNonCoupled(cellI, dt, rhoc_, rho, Uc_, U);
const vector& FCollision = f();
// New particle velocity // New particle velocity
//~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~
// Update velocity - treat as 3-D // Update velocity - treat as 3-D
const scalar As = this->areaS(d); const scalar As = this->areaS(d);
const vector ap = Uc_ + (FCoupled + FNonCoupled + Su)/(utc*As); const vector ap = Uc_ + (FCoupled + FNonCoupled + FCollision + Su)/(utc*As);
const scalar bp = 6.0*utc/(rho*d); const scalar bp = 6.0*utc/(rho*d);
IntegrationScheme<vector>::integrationResult Ures = IntegrationScheme<vector>::integrationResult Ures =
@ -196,6 +197,7 @@ Foam::InteractingKinematicParcel<ParcelType>::InteractingKinematicParcel
nParticle_(p.nParticle_), nParticle_(p.nParticle_),
d_(p.d_), d_(p.d_),
U_(p.U_), U_(p.U_),
f_(p.f_),
rho_(p.rho_), rho_(p.rho_),
tTurb_(p.tTurb_), tTurb_(p.tTurb_),
UTurb_(p.UTurb_), UTurb_(p.UTurb_),

View File

@ -209,6 +209,9 @@ protected:
//- Velocity of Parcel [m/s] //- Velocity of Parcel [m/s]
vector U_; vector U_;
//- Force on particle due to collisions [N]
vector f_;
//- Density [kg/m3] //- Density [kg/m3]
scalar rho_; scalar rho_;
@ -324,6 +327,9 @@ public:
//- Return const access to velocity //- Return const access to velocity
inline const vector& U() const; inline const vector& U() const;
//- Return const access to force
inline const vector& f() const;
//- Return const access to density //- Return const access to density
inline scalar rho() const; inline scalar rho() const;
@ -348,6 +354,9 @@ public:
//- Return access to velocity //- Return access to velocity
inline vector& U(); inline vector& U();
//- Return access to force
inline vector& f();
//- Return access to density //- Return access to density
inline scalar& rho(); inline scalar& rho();

View File

@ -77,6 +77,7 @@ inline Foam::InteractingKinematicParcel<ParcelType>::InteractingKinematicParcel
nParticle_(0), nParticle_(0),
d_(0.0), d_(0.0),
U_(vector::zero), U_(vector::zero),
f_(vector::zero),
rho_(0.0), rho_(0.0),
tTurb_(0.0), tTurb_(0.0),
UTurb_(vector::zero), UTurb_(vector::zero),
@ -104,6 +105,7 @@ inline Foam::InteractingKinematicParcel<ParcelType>::InteractingKinematicParcel
nParticle_(nParticle0), nParticle_(nParticle0),
d_(d0), d_(d0),
U_(U0), U_(U0),
f_(vector::zero),
rho_(constProps.rho0()), rho_(constProps.rho0()),
tTurb_(0.0), tTurb_(0.0),
UTurb_(vector::zero), UTurb_(vector::zero),
@ -231,6 +233,14 @@ Foam::InteractingKinematicParcel<ParcelType>::U() const
} }
template <class ParcelType>
inline const Foam::vector&
Foam::InteractingKinematicParcel<ParcelType>::f() const
{
return f_;
}
template <class ParcelType> template <class ParcelType>
inline Foam::scalar Foam::InteractingKinematicParcel<ParcelType>::rho() const inline Foam::scalar Foam::InteractingKinematicParcel<ParcelType>::rho() const
{ {
@ -281,6 +291,13 @@ inline Foam::vector& Foam::InteractingKinematicParcel<ParcelType>::U()
} }
template <class ParcelType>
inline Foam::vector& Foam::InteractingKinematicParcel<ParcelType>::f()
{
return f_;
}
template <class ParcelType> template <class ParcelType>
inline Foam::scalar& Foam::InteractingKinematicParcel<ParcelType>::rho() inline Foam::scalar& Foam::InteractingKinematicParcel<ParcelType>::rho()
{ {

View File

@ -30,6 +30,7 @@ License
#include "makeReactingParcelDispersionModels.H" #include "makeReactingParcelDispersionModels.H"
#include "makeReactingParcelDragModels.H" #include "makeReactingParcelDragModels.H"
#include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant #include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant
#include "makeReactingParcelCollisionModels.H"
#include "makeReactingParcelPatchInteractionModels.H" #include "makeReactingParcelPatchInteractionModels.H"
#include "makeReactingParcelPostProcessingModels.H" #include "makeReactingParcelPostProcessingModels.H"
@ -52,6 +53,7 @@ namespace Foam
makeReactingDispersionModels(BasicReactingMultiphaseParcel); makeReactingDispersionModels(BasicReactingMultiphaseParcel);
makeReactingDragModels(BasicReactingMultiphaseParcel); makeReactingDragModels(BasicReactingMultiphaseParcel);
makeReactingMultiphaseInjectionModels(BasicReactingMultiphaseParcel); makeReactingMultiphaseInjectionModels(BasicReactingMultiphaseParcel);
makeReactingCollisionModels(BasicReactingMultiphaseParcel);
makeReactingPatchInteractionModels(BasicReactingMultiphaseParcel); makeReactingPatchInteractionModels(BasicReactingMultiphaseParcel);
makeReactingPostProcessingModels(BasicReactingMultiphaseParcel); makeReactingPostProcessingModels(BasicReactingMultiphaseParcel);

View File

@ -30,6 +30,7 @@ License
#include "makeReactingParcelDispersionModels.H" #include "makeReactingParcelDispersionModels.H"
#include "makeReactingParcelDragModels.H" #include "makeReactingParcelDragModels.H"
#include "makeReactingParcelInjectionModels.H" #include "makeReactingParcelInjectionModels.H"
#include "makeReactingParcelCollisionModels.H"
#include "makeReactingParcelPatchInteractionModels.H" #include "makeReactingParcelPatchInteractionModels.H"
#include "makeReactingParcelPostProcessingModels.H" #include "makeReactingParcelPostProcessingModels.H"
@ -48,6 +49,7 @@ namespace Foam
makeReactingDispersionModels(BasicReactingParcel); makeReactingDispersionModels(BasicReactingParcel);
makeReactingDragModels(BasicReactingParcel); makeReactingDragModels(BasicReactingParcel);
makeReactingInjectionModels(BasicReactingParcel); makeReactingInjectionModels(BasicReactingParcel);
makeReactingCollisionModels(BasicReactingParcel);
makeReactingPatchInteractionModels(BasicReactingParcel); makeReactingPatchInteractionModels(BasicReactingParcel);
makeReactingPostProcessingModels(BasicReactingParcel); makeReactingPostProcessingModels(BasicReactingParcel);

View File

@ -26,10 +26,11 @@ License
#include "basicInteractingKinematicParcel.H" #include "basicInteractingKinematicParcel.H"
// InteractingKinematic // Kinematic
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H" #include "makeParcelDragModels.H"
#include "makeParcelInjectionModels.H" #include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H" #include "makeParcelPostProcessingModels.H"
@ -41,6 +42,7 @@ namespace Foam
makeParcelDispersionModels(basicInteractingKinematicParcel); makeParcelDispersionModels(basicInteractingKinematicParcel);
makeParcelDragModels(basicInteractingKinematicParcel); makeParcelDragModels(basicInteractingKinematicParcel);
makeParcelInjectionModels(basicInteractingKinematicParcel); makeParcelInjectionModels(basicInteractingKinematicParcel);
makeParcelCollisionModels(basicInteractingKinematicParcel);
makeParcelPatchInteractionModels(basicInteractingKinematicParcel); makeParcelPatchInteractionModels(basicInteractingKinematicParcel);
makeParcelPostProcessingModels(basicInteractingKinematicParcel); makeParcelPostProcessingModels(basicInteractingKinematicParcel);
}; };

View File

@ -30,6 +30,7 @@ License
#include "makeParcelDispersionModels.H" #include "makeParcelDispersionModels.H"
#include "makeParcelDragModels.H" #include "makeParcelDragModels.H"
#include "makeParcelInjectionModels.H" #include "makeParcelInjectionModels.H"
#include "makeParcelCollisionModels.H"
#include "makeParcelPatchInteractionModels.H" #include "makeParcelPatchInteractionModels.H"
#include "makeParcelPostProcessingModels.H" #include "makeParcelPostProcessingModels.H"
@ -44,6 +45,7 @@ namespace Foam
makeParcelDispersionModels(basicThermoParcel); makeParcelDispersionModels(basicThermoParcel);
makeParcelDragModels(basicThermoParcel); makeParcelDragModels(basicThermoParcel);
makeParcelInjectionModels(basicThermoParcel); makeParcelInjectionModels(basicThermoParcel);
makeParcelCollisionModels(basicThermoParcel);
makeParcelPatchInteractionModels(basicThermoParcel); makeParcelPatchInteractionModels(basicThermoParcel);
makeParcelPostProcessingModels(basicThermoParcel); makeParcelPostProcessingModels(basicThermoParcel);

View File

@ -0,0 +1,62 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#ifndef makeParcelCollisionModels_H
#define makeParcelCollisionModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "InteractingKinematicCloud.H"
#include "NoCollision.H"
#include "DeterministicPairForce.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeParcelCollisionModels(ParcelType) \
\
makeCollisionModel(InteractingKinematicCloud<ParcelType>); \
\
makeCollisionModelType \
( \
NoCollision, \
InteractingKinematicCloud, \
ParcelType \
); \
\
makeCollisionModelType \
( \
DeterministicPairForce, \
InteractingKinematicCloud, \
ParcelType \
); \
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,87 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
\*---------------------------------------------------------------------------*/
#ifndef makeReactingParcelCollisionModels_H
#define makeReactingParcelCollisionModels_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "thermoPhysicsTypes.H"
#include "InteractingKinematicCloud.H"
#include "NoCollision.H"
#include "DeterministicPairForce.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeReactingCollisionModels(ParcelType) \
\
makeReactingCollisionModelThermoType \
( \
ParcelType, \
constGasThermoPhysics \
); \
\
makeReactingCollisionModelThermoType \
( \
ParcelType, \
gasThermoPhysics \
); \
\
makeReactingCollisionModelThermoType \
( \
ParcelType, \
icoPoly8ThermoPhysics \
);
#define makeReactingCollisionModelThermoType(ParcelType, ThermoType) \
\
makeCollisionModel(InteractingKinematicCloud<ParcelType<ThermoType> >); \
\
makeCollisionModelThermoType \
( \
NoCollision, \
InteractingKinematicCloud, \
ParcelType, \
ThermoType \
); \
\
makeCollisionModelThermoType \
( \
DeterministicPairForce, \
InteractingKinematicCloud, \
ParcelType, \
ThermoType \
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -65,7 +65,10 @@ License
\ \
defineNamedTemplateTypeNameAndDebug \ defineNamedTemplateTypeNameAndDebug \
( \ ( \
DispersionRASModel<InteractingKinematicCloud<ParcelType<ThermoType> > >, \ DispersionRASModel \
< \
InteractingKinematicCloud<ParcelType<ThermoType> > \
>, \
0 \ 0 \
); \ ); \
\ \

View File

@ -61,7 +61,10 @@ License
#define makeReactingPatchInteractionModelThermoType(ParcelType, ThermoType) \ #define makeReactingPatchInteractionModelThermoType(ParcelType, ThermoType) \
\ \
makePatchInteractionModel(InteractingKinematicCloud<ParcelType<ThermoType> >); \ makePatchInteractionModel \
( \
InteractingKinematicCloud<ParcelType<ThermoType> > \
); \
\ \
makePatchInteractionModelThermoType \ makePatchInteractionModelThermoType \
( \ ( \

View File

@ -60,7 +60,10 @@ License
#define makeReactingPostProcessingModelThermoType(ParcelType, ThermoType) \ #define makeReactingPostProcessingModelThermoType(ParcelType, ThermoType) \
\ \
makePostProcessingModel(InteractingKinematicCloud<ParcelType<ThermoType> >); \ makePostProcessingModel \
( \
InteractingKinematicCloud<ParcelType<ThermoType> > \
); \
\ \
makePostProcessingModelThermoType \ makePostProcessingModelThermoType \
( \ ( \

View File

@ -188,4 +188,3 @@ Foam::vector Foam::particleForces::calcNonCoupled
// ************************************************************************* // // ************************************************************************* //

View File

@ -0,0 +1,65 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "CollisionModel.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::CollisionModel<CloudType>::CollisionModel(CloudType& owner)
:
dict_(dictionary::null),
owner_(owner),
coeffDict_(dictionary::null)
{}
template<class CloudType>
Foam::CollisionModel<CloudType>::CollisionModel
(
const dictionary& dict,
CloudType& owner,
const word& type
)
:
dict_(dict),
owner_(owner),
coeffDict_(dict.subDict(type + "Coeffs"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::CollisionModel<CloudType>::~CollisionModel()
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "NewCollisionModel.C"
// ************************************************************************* //

View File

@ -0,0 +1,207 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::CollisionModel
Description
Templated collision model class.
SourceFiles
CollisionModel.C
NewCollisionModel.C
\*---------------------------------------------------------------------------*/
#ifndef CollisionModel_H
#define CollisionModel_H
#include "IOdictionary.H"
#include "autoPtr.H"
#include "runTimeSelectionTables.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class CollisionModel Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class CollisionModel
{
// Private data
//- The cloud dictionary
const dictionary& dict_;
//- Reference to the owner cloud class
CloudType& owner_;
//- The coefficients dictionary
const dictionary coeffDict_;
protected:
// Protected data
//- Convenience typedef for parcel type
typedef typename CloudType::parcelType parcelType;
// Protected member functions
//- Calculate the pair force between parcels
virtual void evaluatePair
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const = 0;
public:
//- Runtime type information
TypeName("CollisionModel");
//- Declare runtime constructor selection table
declareRunTimeSelectionTable
(
autoPtr,
CollisionModel,
dictionary,
(
const dictionary& dict,
CloudType& owner
),
(dict, owner)
);
// Constructors
//- Construct null from owner
CollisionModel(CloudType& owner);
//- Construct from dictionary
CollisionModel
(
const dictionary& dict,
CloudType& owner,
const word& type
);
//- Destructor
virtual ~CollisionModel();
//- Selector
static autoPtr<CollisionModel<CloudType> > New
(
const dictionary& dict,
CloudType& owner
);
// Access
//- Return the owner cloud dictionary
inline const dictionary& dict() const;
//- Return const access the owner cloud object
inline const CloudType& owner() const;
//- Return non-const access the owner cloud object for manipulation
inline CloudType& owner();
//- Return the coefficients dictionary
inline const dictionary& coeffDict() const;
// Member Functions
//- Flag to indicate whether model activates injection model
virtual bool active() const = 0;
// Collision function
virtual void collide() = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeCollisionModel(CloudType) \
\
defineNamedTemplateTypeNameAndDebug(CollisionModel<CloudType>, 0); \
\
defineTemplateRunTimeSelectionTable(CollisionModel<CloudType>, dictionary);
#define makeCollisionModelType(SS, CloudType, ParcelType) \
\
defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
\
CollisionModel<CloudType<ParcelType> >:: \
adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
add##SS##CloudType##ParcelType##ConstructorToTable_;
#define makeCollisionModelThermoType(SS, CloudType, ParcelType, ThermoType) \
\
defineNamedTemplateTypeNameAndDebug \
( \
SS<CloudType<ParcelType<ThermoType> > >, \
0 \
); \
\
CollisionModel<CloudType<ParcelType<ThermoType> > >:: \
adddictionaryConstructorToTable \
<SS<CloudType<ParcelType<ThermoType> > > > \
add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "CollisionModelI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "CollisionModel.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,57 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "CollisionModel.H"
template<class CloudType>
const Foam::dictionary& Foam::CollisionModel<CloudType>::dict() const
{
return dict_;
}
template<class CloudType>
const CloudType& Foam::CollisionModel<CloudType>::owner() const
{
return owner_;
}
template<class CloudType>
CloudType& Foam::CollisionModel<CloudType>::owner()
{
return owner_;
}
template<class CloudType>
const Foam::dictionary& Foam::CollisionModel<CloudType>::coeffDict() const
{
return coeffDict_;
}
// ************************************************************************* //

View File

@ -0,0 +1,66 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "CollisionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::autoPtr<Foam::CollisionModel<CloudType> >
Foam::CollisionModel<CloudType>::New
(
const dictionary& dict,
CloudType& owner
)
{
word CollisionModelType(dict.lookup("CollisionModel"));
Info<< "Selecting CollisionModel " << CollisionModelType << endl;
typename dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(CollisionModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn
(
"CollisionModel<CloudType>::New"
"("
"const dictionary&, "
"CloudType&"
")"
) << "Unknown CollisionModelType type "
<< CollisionModelType
<< ", constructor not in hash table" << nl << nl
<< " Valid CollisionModel types are:" << nl
<< dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError);
}
return autoPtr<CollisionModel<CloudType> >(cstrIter()(dict, owner));
}
// ************************************************************************* //

View File

@ -0,0 +1,155 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "DeterministicPairForce.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class CloudType>
void Foam::DeterministicPairForce<CloudType>::buildCellOccupancy()
{
Info<< "Build cell occupancy" << endl;
forAll(cellOccupancy_, cO)
{
cellOccupancy_[cO].clear();
}
forAllIter(typename CloudType, this->owner(), iter)
{
cellOccupancy_[iter().cell()].append(&iter());
}
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class CloudType>
void Foam::DeterministicPairForce<CloudType>::evaluatePair
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const
{
Info<< "PARTICLE FORCES HARD CODED AS TEST" << endl;
pA.f() += -20.0*pB.mass()*pB.U();
pB.f() += -20.0*pA.mass()*pA.U();
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::DeterministicPairForce<CloudType>::DeterministicPairForce
(
const dictionary& dict,
CloudType& owner
)
:
CollisionModel<CloudType>(dict, owner, typeName),
cellOccupancy_(owner.mesh().nCells()),
il_(owner.mesh(), 1e-6, false)
{
Info<< "SEARCH DISTANCE SQR HARD CODED" << endl;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::DeterministicPairForce<CloudType>::~DeterministicPairForce()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::DeterministicPairForce<CloudType>::active() const
{
return true;
}
template<class CloudType>
void Foam::DeterministicPairForce<CloudType>::collide()
{
Info<< "Calculating collisions" << endl;
forAllIter(typename CloudType, this->owner(), iter)
{
typename CloudType::parcelType& p = iter();
p.f() = vector::zero;
}
buildCellOccupancy();
const directInteractionList& dil(il_.dil());
typename CloudType::parcelType* pA_ptr = NULL;
typename CloudType::parcelType* pB_ptr = NULL;
forAll(dil, d)
{
// Loop over all Parcels in cell A (a)
forAll(cellOccupancy_[d], a)
{
pA_ptr = cellOccupancy_[d][a];
forAll(dil[d], interactingCells)
{
List<typename CloudType::parcelType*> cellBParcels =
cellOccupancy_[dil[d][interactingCells]];
// Loop over all Parcels in cell B (b)
forAll(cellBParcels, b)
{
pB_ptr = cellBParcels[b];
evaluatePair(*pA_ptr, *pB_ptr);
}
}
// Loop over the other Parcels in cell A (aO)
forAll(cellOccupancy_[d], aO)
{
pB_ptr = cellOccupancy_[d][aO];
// Do not double-evaluate, compare pointers, arbitrary
// order
if (pB_ptr > pA_ptr)
{
evaluatePair(*pA_ptr, *pB_ptr);
}
}
}
}
Info<< "ADD COLLISIONS WITH WALLS HERE, DOES NOT NEED TO BE A TRACKING"
<< "OPERATION. CALCULATE DISTANCE TO SURFACES OF WALL TYPE AND APPLY"
<< "WALL FORCE MODEL" << endl;
}
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::DeterministicPairForce
Description
SourceFiles
DeterministicPairForce.C
\*---------------------------------------------------------------------------*/
#ifndef DeterministicPairForce_H
#define DeterministicPairForce_H
#include "CollisionModel.H"
#include "interactionLists.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class DeterministicPairForce Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class DeterministicPairForce
:
public CollisionModel<CloudType>
{
// Private data
//- Cell occupancy information for each parcel
List<DynamicList<typename CloudType::parcelType*> > cellOccupancy_;
//- Interactions lists determining which cells are in
// interaction range of each other
interactionLists il_;
// Private member functions
//- Build the cell occupancy information for each parcel
void buildCellOccupancy();
protected:
// Protected member functions
//- Calculate the pair force between parcels
virtual void evaluatePair
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const;
public:
//- Runtime type information
TypeName("DeterministicPairForce");
// Constructors
//- Construct from dictionary
DeterministicPairForce
(
const dictionary& dict,
CloudType& owner
);
//- Destructor
virtual ~DeterministicPairForce();
// Member Functions
//- Flag to indicate whether model activates injection model
virtual bool active() const;
// Collision function
virtual void collide();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "DeterministicPairForce.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,77 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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 "NoCollision.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template<class CloudType>
void Foam::NoCollision<CloudType>::evaluatePair
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const
{
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NoCollision<CloudType>::NoCollision
(
const dictionary& dict,
CloudType& owner
)
:
CollisionModel<CloudType>(dict, owner, typeName)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class CloudType>
Foam::NoCollision<CloudType>::~NoCollision()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class CloudType>
bool Foam::NoCollision<CloudType>::active() const
{
return true;
}
template<class CloudType>
void Foam::NoCollision<CloudType>::collide()
{
}
// ************************************************************************* //

View File

@ -0,0 +1,111 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / 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::NoCollision
Description
SourceFiles
NoCollision.C
\*---------------------------------------------------------------------------*/
#ifndef NoCollision_H
#define NoCollision_H
#include "CollisionModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class NoCollision Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
class NoCollision
:
public CollisionModel<CloudType>
{
protected:
// Protected member functions
//- Calculate the pair force between parcels
virtual void evaluatePair
(
typename CloudType::parcelType& pA,
typename CloudType::parcelType& pB
) const;
public:
//- Runtime type information
TypeName("NoCollision");
// Constructors
//- Construct from dictionary
NoCollision
(
const dictionary& dict,
CloudType& owner
);
//- Destructor
virtual ~NoCollision();
// Member Functions
//- Flag to indicate whether model activates injection model
virtual bool active() const;
// Collision function
virtual void collide();
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "NoCollision.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -24,7 +24,7 @@ boundaryField
{ {
type fixedValue; type fixedValue;
// Field Value // Field Value
value uniform (3 0 0); value uniform (2 0 0);
} }
fixedWalls fixedWalls

View File

@ -23,13 +23,13 @@ boundaryField
{ {
movingWall movingWall
{ {
type compressible::alphatWallFunction; type alphatWallFunction;
Prt 0.85; Prt 0.85;
value uniform 0; value uniform 0;
} }
fixedWalls fixedWalls
{ {
type compressible::alphatWallFunction; type alphatWallFunction;
Prt 0.85; Prt 0.85;
value uniform 0; value uniform 0;
} }

View File

@ -15,6 +15,9 @@ FoamFile
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//CollisionModel NoCollision;
CollisionModel DeterministicPairForce;
InjectionModel ManualInjection; InjectionModel ManualInjection;
DragModel SphereDrag; DragModel SphereDrag;
@ -57,6 +60,10 @@ particleForces
pressureGradient off; pressureGradient off;
} }
NoCollisionCoeffs {}
DeterministicPairForceCoeffs {}
ManualInjectionCoeffs ManualInjectionCoeffs
{ {
massTotal massTotal [ 1 0 0 0 0 ] 0.0002; massTotal massTotal [ 1 0 0 0 0 ] 0.0002;

View File

@ -30,7 +30,7 @@ vertices
blocks blocks
( (
hex (0 1 2 3 4 5 6 7) (80 80 1) simpleGrading (1 1 1) hex (0 1 2 3 4 5 6 7) (20 20 1) simpleGrading (1 1 1)
); );
edges edges

View File

@ -20,20 +20,20 @@ FoamFile
movingWall movingWall
{ {
type wall; type wall;
nFaces 80; nFaces 20;
startFace 12640; startFace 760;
} }
fixedWalls fixedWalls
{ {
type wall; type wall;
nFaces 240; nFaces 60;
startFace 12720; startFace 780;
} }
frontAndBack frontAndBack
{ {
type empty; type empty;
nFaces 12800; nFaces 800;
startFace 12960; startFace 840;
} }
) )

View File

@ -19,17 +19,17 @@ application rhoPisoFoam;
startFrom startTime; startFrom startTime;
startTime 0; startTime 1;
stopAt endTime; stopAt endTime;
endTime 1; endTime 2;
deltaT 0.0008; deltaT 0.0001;
writeControl runTime; writeControl runTime;
writeInterval 1; writeInterval 0.001;
purgeWrite 0; purgeWrite 0;