ENH: New WallInteractionSite class to pass wall data to wall model.

Access and lookup to/of UName.
This commit is contained in:
graham
2010-05-13 18:50:07 +01:00
parent 3d43439072
commit 5924a74108
8 changed files with 430 additions and 5 deletions

View File

@ -287,10 +287,13 @@ public:
wallFaceIndexAndTransformToDistribute() const;
//- Return access to the referred wall faces
const List<referredWallFace>& referredWallFaces() const;
inline const List<referredWallFace>& referredWallFaces() const;
//- Return the name of the velocity field
inline const word& UName() const;
//- Return access to the referred wall data
const List<vector>& referredWallData() const;
inline const List<vector>& referredWallData() const;
//- Return access to the referred particle container
inline const List<IDLList<ParticleType> >&

View File

@ -128,6 +128,13 @@ Foam::InteractionLists<ParticleType>::referredWallFaces() const
}
template<class ParticleType>
const Foam::word& Foam::InteractionLists<ParticleType>::UName() const
{
return UName_;
}
template<class ParticleType>
const Foam::List<Foam::vector>&
Foam::InteractionLists<ParticleType>::referredWallData() const

View File

@ -175,6 +175,10 @@ void Foam::PairCollision<CloudType>::wallInteraction()
const labelListList directWallFaces = il_.dwfil();
const labelList& patchID = mesh.boundaryMesh().patchID();
const volVectorField& U = mesh.lookupObject<volVectorField>(il_.UName());
// Storage for the wall interaction sites
DynamicList<point> flatSites;
DynamicList<scalar> flatSiteExclusionDistancesSqr;
@ -199,7 +203,7 @@ void Foam::PairCollision<CloudType>::wallInteraction()
sharpSiteExclusionDistancesSqr.clear();
typename CloudType::parcelType& p =
*cellOccupancy_[realCellI][cellParticleI];
*cellOccupancy_[realCellI][cellParticleI];
const point& pos = p.position();
@ -269,8 +273,10 @@ void Foam::PairCollision<CloudType>::wallInteraction()
forAll(cellRefWallFaces, rWFI)
{
label refWallFaceI = cellRefWallFaces[rWFI];
const referredWallFace& rwf =
il_.referredWallFaces()[cellRefWallFaces[rWFI]];
il_.referredWallFaces()[refWallFaceI];
const pointField& pts = rwf.points();
@ -502,7 +508,8 @@ Foam::PairCollision<CloudType>::PairCollision
(
owner.mesh(),
readScalar(this->coeffDict().lookup("maxInteractionDistance")),
Switch(this->coeffDict().lookup("writeReferredParticleCloud"))
Switch(this->coeffDict().lookup("writeReferredParticleCloud")),
this->coeffDict().lookupOrDefault("UName", word("U"))
)
{}

View File

@ -36,6 +36,7 @@ SourceFiles
#include "CollisionModel.H"
#include "InteractionLists.H"
#include "WallInteractionSite.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,121 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "WallInteractionSite.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::WallInteractionSite<Type>::WallInteractionSite()
:
patchI_(),
wallData_()
{}
template<class Type>
Foam::WallInteractionSite<Type>::WallInteractionSite
(
label patchI,
const Type& wallData
)
:
patchI_(patchI),
wallData_(wallData)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type>
Foam::WallInteractionSite<Type>::~WallInteractionSite()
{}
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
template<class Type>
bool Foam::WallInteractionSite<Type>::operator==
(
const WallInteractionSite<Type>& rhs
) const
{
return patchI_ == rhs.patch_ && wallData_ == rhs.wallData_;
}
template<class Type>
bool Foam::WallInteractionSite<Type>::operator!=
(
const WallInteractionSite<Type>& rhs
) const
{
return !(*this == rhs);
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Type>
Foam::Istream& Foam::operator>>
(
Istream& is,
WallInteractionSite<Type>& wIS
)
{
is >> wIS.patchI_ >> wIS.wallData_;
// Check state of Istream
is.check
(
"Foam::Istream& Foam::operator>>"
"(Foam::Istream&, Foam::WallInteractionSite<Type>&)"
);
return is;
}
template<class Type>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const WallInteractionSite<Type>& wIS
)
{
os << wIS.patchI_ << token::SPACE << wIS.wallData_;
// Check state of Ostream
os.check
(
"Foam::Ostream& Foam::operator<<"
"(Ostream&, const WallInteractionSite<Type>&)"
);
return os;
}
// ************************************************************************* //

View File

@ -0,0 +1,144 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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 <http://www.gnu.org/licenses/>.
Class
Foam::WallInteractionSite
Description
Stores the patch ID and templated data to represent a collision
with a wall to be passed to the wall model.
SourceFiles
WallInteractionSiteI.H
WallInteractionSite.C
WallInteractionSiteIO.C
\*---------------------------------------------------------------------------*/
#ifndef WallInteractionSite_H
#define WallInteractionSite_H
#include "label.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// Forward declaration of friend functions and operators
template<class Type>
class WallInteractionSite;
template<class Type>
Istream& operator>>(Istream&, WallInteractionSite<Type>&);
template<class Type>
Ostream& operator<<(Ostream&, const WallInteractionSite<Type>&);
/*---------------------------------------------------------------------------*\
Class WallInteractionSite Declaration
\*---------------------------------------------------------------------------*/
template<class Type>
class WallInteractionSite
{
// Private data
//- Index of originating patch
label patchI_;
//- Wall data
Type wallData_;
public:
// Constructors
//- Construct null
WallInteractionSite();
//- Construct from components
WallInteractionSite
(
label patchI,
const Type& wallData
);
//- Destructor
~WallInteractionSite();
// Member Functions
//- Return access to the patch index
inline label patchIndex() const;
//- Return non-const access to the patch index
inline label& patchIndex();
//- Return access to wall data
inline const Type& wallData() const;
//- Return non-const access to wall data
inline Type& wallData();
// Member Operators
bool operator==(const WallInteractionSite<Type>&) const;
bool operator!=(const WallInteractionSite<Type>&) const;
// IOstream Operators
friend Istream& operator>> <Type>
(Istream&, WallInteractionSite<Type>&);
friend Ostream& operator<< <Type>
(Ostream&, const WallInteractionSite<Type>&);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "WallInteractionSiteI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "WallInteractionSite.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
#/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::label Foam::WallInteractionSite<Type>::patchIndex() const
{
return patchI_;
}
template<class Type>
Foam::label& Foam::WallInteractionSite<Type>::patchIndex()
{
return patchI_;
}
template<class Type>
const Type& Foam::WallInteractionSite<Type>::wallData() const
{
return wallData_;
}
template<class Type>
Type& Foam::WallInteractionSite<Type>::wallData()
{
return wallData_;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* //

View File

@ -0,0 +1,82 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "WallInteractionSite.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::WallInteractionSite<Type>::WallInteractionSite(Istream& is)
:
base1(is),
base2(is),
member1(is),
member2(is)
{
// Check state of Istream
is.check("Foam::WallInteractionSite<Type>::WallInteractionSite(Foam::Istream&)");
}
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
template<class Type>
Foam::Istream& Foam::operator>>
(
Istream& is,
WallInteractionSite<Type>&
)
{
// Check state of Istream
is.check
(
"Foam::Istream& Foam::operator>>"
"(Foam::Istream&, Foam::WallInteractionSite<Type>&)"
);
return is;
}
template<class Type>
Foam::Ostream& Foam::operator<<
(
Ostream& os,
const WallInteractionSite<Type>&
)
{
// Check state of Ostream
os.check
(
"Foam::Ostream& Foam::operator<<"
"(Ostream&, const WallInteractionSite<Type>&)"
);
return os;
}
// ************************************************************************* //