mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -257,24 +257,21 @@ void Foam::fileMonitor::checkFiles() const
|
||||
// << "watchFd:" << inotifyEvent.wd << nl
|
||||
// << "watchName:" << watchFile_[inotifyEvent.wd] << endl;
|
||||
|
||||
switch (inotifyEvent.mask)
|
||||
if (inotifyEvent.mask % IN_DELETE_SELF)
|
||||
{
|
||||
case IN_DELETE_SELF:
|
||||
{
|
||||
Map<fileState>::iterator iter =
|
||||
state_.find(label(inotifyEvent.wd));
|
||||
iter() = DELETED;
|
||||
}
|
||||
break;
|
||||
|
||||
case IN_MODIFY:
|
||||
case IN_CLOSE_WRITE:
|
||||
{
|
||||
Map<fileState>::iterator iter =
|
||||
state_.find(label(inotifyEvent.wd));
|
||||
iter() = MODIFIED;
|
||||
}
|
||||
break;
|
||||
Map<fileState>::iterator iter =
|
||||
state_.find(label(inotifyEvent.wd));
|
||||
iter() = DELETED;
|
||||
}
|
||||
else if
|
||||
(
|
||||
(inotifyEvent.mask % IN_MODIFY)
|
||||
|| (inotifyEvent.mask % IN_CLOSE_WRITE)
|
||||
)
|
||||
{
|
||||
Map<fileState>::iterator iter =
|
||||
state_.find(label(inotifyEvent.wd));
|
||||
iter() = MODIFIED;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -25,6 +25,12 @@ License
|
||||
|
||||
#include "ListOps.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::labelList Foam::emptyLabelList = Foam::labelList(0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::labelList Foam::invert
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -43,6 +43,16 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
extern const labelList emptyLabelList;
|
||||
|
||||
//- Return reference to zero-sized list. Compare to List::null() which returns
|
||||
// null pointer cast as list reference.
|
||||
template<class Type>
|
||||
static const List<Type>& emptyList()
|
||||
{
|
||||
return *reinterpret_cast<const List<Type>* >(&emptyLabelList);
|
||||
}
|
||||
|
||||
//- Renumber the values (not the indices) of a list.
|
||||
// Negative ListType elements are left as is.
|
||||
template<class ListType>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -42,59 +42,62 @@ namespace Foam
|
||||
|
||||
void Foam::wedgePolyPatch::initTransforms()
|
||||
{
|
||||
const pointField& points = this->points();
|
||||
|
||||
patchNormal_ = operator[](0).normal(points);
|
||||
patchNormal_ /= mag(patchNormal_);
|
||||
|
||||
centreNormal_ =
|
||||
vector
|
||||
(
|
||||
sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5),
|
||||
sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5),
|
||||
sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5)
|
||||
);
|
||||
centreNormal_ /= mag(centreNormal_);
|
||||
|
||||
if
|
||||
(
|
||||
mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
|
||||
< (1 - SMALL)
|
||||
)
|
||||
if (size() > 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
const pointField& points = this->points();
|
||||
|
||||
patchNormal_ = operator[](0).normal(points);
|
||||
patchNormal_ /= mag(patchNormal_);
|
||||
|
||||
centreNormal_ =
|
||||
vector
|
||||
(
|
||||
sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5),
|
||||
sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5),
|
||||
sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5)
|
||||
);
|
||||
centreNormal_ /= mag(centreNormal_);
|
||||
|
||||
if
|
||||
(
|
||||
"wedgePolyPatch::wedgePolyPatch(const polyPatch&, "
|
||||
"const fvBoundaryMesh&)"
|
||||
) << "wedge " << name()
|
||||
<< " centre plane does not align with a coordinate plane by "
|
||||
<< 1
|
||||
- mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
|
||||
<< exit(FatalError);
|
||||
mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
|
||||
< (1 - SMALL)
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"wedgePolyPatch::wedgePolyPatch(const polyPatch&, "
|
||||
"const fvBoundaryMesh&)"
|
||||
) << "wedge " << name()
|
||||
<< " centre plane does not align with a coordinate plane by "
|
||||
<< 1
|
||||
- mag(centreNormal_.x()+centreNormal_.y()+centreNormal_.z())
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
axis_ = centreNormal_ ^ patchNormal_;
|
||||
scalar magAxis = mag(axis_);
|
||||
axis_ /= magAxis;
|
||||
|
||||
if (magAxis < SMALL)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"wedgePolyPatch::initTransforms()"
|
||||
) << "wedge " << name()
|
||||
<< " plane aligns with a coordinate plane." << nl
|
||||
<< " The wedge plane should make a small angle (~2.5deg)"
|
||||
" with the coordinate plane" << nl
|
||||
<< " and the the pair of wedge planes should be symmetric"
|
||||
<< " about the coordinate plane." << nl
|
||||
<< " Normal of face " << 0 << " is " << patchNormal_
|
||||
<< " , implied coordinate plane direction is " << centreNormal_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
faceT_ = rotationTensor(centreNormal_, patchNormal_);
|
||||
cellT_ = faceT_ & faceT_;
|
||||
}
|
||||
|
||||
axis_ = centreNormal_ ^ patchNormal_;
|
||||
scalar magAxis = mag(axis_);
|
||||
axis_ /= magAxis;
|
||||
|
||||
if (magAxis < SMALL)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"wedgePolyPatch::initTransforms()"
|
||||
) << "wedge " << name()
|
||||
<< " plane aligns with a coordinate plane." << nl
|
||||
<< " The wedge plane should make a small angle (~2.5deg)"
|
||||
" with the coordinate plane" << nl
|
||||
<< " and the the pair of wedge planes should be symmetric"
|
||||
<< " about the coordinate plane." << nl
|
||||
<< " Normal of face " << 0 << " is " << patchNormal_
|
||||
<< " , implied coordinate plane direction is " << centreNormal_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
faceT_ = rotationTensor(centreNormal_, patchNormal_);
|
||||
cellT_ = faceT_ & faceT_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -440,6 +440,19 @@ Foam::point Foam::plane::planePlaneIntersect
|
||||
}
|
||||
|
||||
|
||||
void Foam::plane::writeDict(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("planeType") << "pointAndNormal"
|
||||
<< token::END_STATEMENT << nl;
|
||||
os << indent << "pointAndNormalDict" << nl
|
||||
<< indent << token::BEGIN_BLOCK << incrIndent << nl;
|
||||
os.writeKeyword("basePoint") << basePoint_ << token::END_STATEMENT << nl;
|
||||
os.writeKeyword("normalVector") << unitVector_ << token::END_STATEMENT
|
||||
<< nl;
|
||||
os << decrIndent << indent << token::END_BLOCK << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
bool Foam::operator==(const plane& a, const plane& b)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -182,6 +182,9 @@ public:
|
||||
//- Return the cutting point between this plane and two other planes
|
||||
point planePlaneIntersect(const plane&, const plane&) const;
|
||||
|
||||
//- Write to dictionary
|
||||
void writeDict(Ostream&) const;
|
||||
|
||||
|
||||
// friend Operators
|
||||
|
||||
|
||||
46
src/dummyThirdParty/metisDecomp/metis.h
vendored
Normal file
46
src/dummyThirdParty/metisDecomp/metis.h
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
#ifndef METIS_H
|
||||
#define METIS_H 1
|
||||
|
||||
/* *** DUMMY VERSION of metis.h - this file should not be included if you have metis
|
||||
* installed in the correct position in $WM_THIRD_PARTY_DIR - see
|
||||
* decompositionMethods/metisDecomp/Make/options
|
||||
*/
|
||||
|
||||
#warning "Dummy metis.h - gets included since it cannot find metis installation."
|
||||
|
||||
#define IDXTYPEWIDTH 32
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
* Undefine the following #define in order to use short idxtype as the idxtype
|
||||
*-------------------------------------------------------------------------*/
|
||||
#if IDXTYPEWIDTH == 32
|
||||
#define SCNIDX SCNd32
|
||||
#define PRIIDX PRId32
|
||||
|
||||
typedef int32_t idxtype;
|
||||
#elif IDXTYPEWIDTH == 64
|
||||
#define SCNIDX SCNd64
|
||||
#define PRIIDX PRId64
|
||||
|
||||
typedef int64_t idxtype;
|
||||
#else
|
||||
#error "Incorrect user-supplied value fo IDXTYPEWIDTH"
|
||||
#endif
|
||||
|
||||
|
||||
void METIS_WPartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
|
||||
idxtype *options, idxtype *edgecut, idxtype *part);
|
||||
void METIS_PartGraphRecursive(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
|
||||
idxtype *edgecut, idxtype *part);
|
||||
void METIS_WPartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, float *tpwgts,
|
||||
idxtype *options, idxtype *edgecut, idxtype *part);
|
||||
void METIS_PartGraphKway(idxtype *nvtxs, idxtype *xadj, idxtype *adjncy, idxtype *vwgt,
|
||||
idxtype *adjwgt, idxtype *wgtflag, idxtype *numflag, idxtype *nparts, idxtype *options,
|
||||
idxtype *edgecut, idxtype *part);
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,6 +27,7 @@ License
|
||||
#include "fvMesh.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "geometricOneField.H"
|
||||
#include "stringListOps.H"
|
||||
|
||||
// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -62,15 +63,15 @@ void Foam::porousZone::adjustNegativeResistance(dimensionedVector& resist)
|
||||
|
||||
Foam::porousZone::porousZone
|
||||
(
|
||||
const word& name,
|
||||
const keyType& key,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
name_(name),
|
||||
key_(key),
|
||||
mesh_(mesh),
|
||||
dict_(dict),
|
||||
cellZoneID_(mesh_.cellZones().findZoneID(name)),
|
||||
cellZoneIds_(0),
|
||||
coordSys_(dict, mesh),
|
||||
porosity_(1),
|
||||
intensity_(0),
|
||||
@ -80,9 +81,27 @@ Foam::porousZone::porousZone
|
||||
D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
|
||||
F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
|
||||
{
|
||||
Info<< "Creating porous zone: " << name_ << endl;
|
||||
Info<< "Creating porous zone: " << key_ << endl;
|
||||
|
||||
bool foundZone = (cellZoneID_ != -1);
|
||||
if (key_.isPattern())
|
||||
{
|
||||
cellZoneIds_ = findStrings
|
||||
(
|
||||
key_,
|
||||
mesh_.cellZones().names()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
const label zoneId = mesh_.cellZones().findZoneID(key_);
|
||||
if (zoneId != -1)
|
||||
{
|
||||
cellZoneIds_.setSize(1);
|
||||
cellZoneIds_[0] = zoneId;
|
||||
}
|
||||
}
|
||||
|
||||
bool foundZone = !cellZoneIds_.empty();
|
||||
reduce(foundZone, orOp<bool>());
|
||||
|
||||
if (!foundZone && Pstream::master())
|
||||
@ -90,8 +109,8 @@ Foam::porousZone::porousZone
|
||||
FatalErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)"
|
||||
) << "cannot find porous cellZone " << name_
|
||||
"(const keyType&, const fvMesh&, const dictionary&)"
|
||||
) << "cannot find porous cellZone " << key_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -106,7 +125,7 @@ Foam::porousZone::porousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
dict_
|
||||
)
|
||||
<< "out-of-range porosity value " << porosity_
|
||||
@ -123,7 +142,7 @@ Foam::porousZone::porousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
dict_
|
||||
)
|
||||
<< "out-of-range turbulent intensity value " << intensity_
|
||||
@ -140,7 +159,7 @@ Foam::porousZone::porousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
dict_
|
||||
)
|
||||
<< "out-of-range turbulent length scale " << mixingLength_
|
||||
@ -169,7 +188,7 @@ Foam::porousZone::porousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
dict_
|
||||
) << "incorrect dimensions for d: " << d.dimensions()
|
||||
<< " should be " << D_.dimensions()
|
||||
@ -192,7 +211,7 @@ Foam::porousZone::porousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
dict_
|
||||
) << "incorrect dimensions for f: " << f.dimensions()
|
||||
<< " should be " << F_.dimensions()
|
||||
@ -220,7 +239,7 @@ Foam::porousZone::porousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"Foam::porousZone::porousZone"
|
||||
"(const fvMesh&, const word&, const dictionary&)",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
dict_
|
||||
) << "neither powerLaw (C0/C1) "
|
||||
"nor Darcy-Forchheimer law (d/f) specified"
|
||||
@ -239,7 +258,7 @@ Foam::porousZone::porousZone
|
||||
|
||||
void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
{
|
||||
if (cellZoneID_ == -1)
|
||||
if (cellZoneIds_.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -250,7 +269,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
compressible = true;
|
||||
}
|
||||
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneID_];
|
||||
const scalarField& V = mesh_.V();
|
||||
scalarField& Udiag = UEqn.diag();
|
||||
vectorField& Usource = UEqn.source();
|
||||
@ -263,7 +281,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
addPowerLawResistance
|
||||
(
|
||||
Udiag,
|
||||
cells,
|
||||
V,
|
||||
mesh_.lookupObject<volScalarField>("rho"),
|
||||
U
|
||||
@ -274,7 +291,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
addPowerLawResistance
|
||||
(
|
||||
Udiag,
|
||||
cells,
|
||||
V,
|
||||
geometricOneField(),
|
||||
U
|
||||
@ -293,7 +309,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
(
|
||||
Udiag,
|
||||
Usource,
|
||||
cells,
|
||||
V,
|
||||
mesh_.lookupObject<volScalarField>("rho"),
|
||||
mesh_.lookupObject<volScalarField>("mu"),
|
||||
@ -306,7 +321,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
|
||||
(
|
||||
Udiag,
|
||||
Usource,
|
||||
cells,
|
||||
V,
|
||||
geometricOneField(),
|
||||
mesh_.lookupObject<volScalarField>("nu"),
|
||||
@ -324,7 +338,7 @@ void Foam::porousZone::addResistance
|
||||
bool correctAUprocBC
|
||||
) const
|
||||
{
|
||||
if (cellZoneID_ == -1)
|
||||
if (cellZoneIds_.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -335,7 +349,6 @@ void Foam::porousZone::addResistance
|
||||
compressible = true;
|
||||
}
|
||||
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneID_];
|
||||
const vectorField& U = UEqn.psi();
|
||||
|
||||
if (C0_ > VSMALL)
|
||||
@ -345,7 +358,6 @@ void Foam::porousZone::addResistance
|
||||
addPowerLawResistance
|
||||
(
|
||||
AU,
|
||||
cells,
|
||||
mesh_.lookupObject<volScalarField>("rho"),
|
||||
U
|
||||
);
|
||||
@ -355,7 +367,6 @@ void Foam::porousZone::addResistance
|
||||
addPowerLawResistance
|
||||
(
|
||||
AU,
|
||||
cells,
|
||||
geometricOneField(),
|
||||
U
|
||||
);
|
||||
@ -372,7 +383,6 @@ void Foam::porousZone::addResistance
|
||||
addViscousInertialResistance
|
||||
(
|
||||
AU,
|
||||
cells,
|
||||
mesh_.lookupObject<volScalarField>("rho"),
|
||||
mesh_.lookupObject<volScalarField>("mu"),
|
||||
U
|
||||
@ -383,7 +393,6 @@ void Foam::porousZone::addResistance
|
||||
addViscousInertialResistance
|
||||
(
|
||||
AU,
|
||||
cells,
|
||||
geometricOneField(),
|
||||
mesh_.lookupObject<volScalarField>("nu"),
|
||||
U
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -110,8 +110,8 @@ class porousZone
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of this zone
|
||||
word name_;
|
||||
//- Name of this zone, or a regular expression
|
||||
keyType key_;
|
||||
|
||||
//- Reference to the finite volume mesh this zone is part of
|
||||
const fvMesh& mesh_;
|
||||
@ -119,8 +119,8 @@ class porousZone
|
||||
//- Dictionary containing the parameters
|
||||
dictionary dict_;
|
||||
|
||||
//- Cell zone ID
|
||||
label cellZoneID_;
|
||||
//- Cell zone Ids
|
||||
labelList cellZoneIds_;
|
||||
|
||||
//- Coordinate system used for the zone (Cartesian)
|
||||
coordinateSystem coordSys_;
|
||||
@ -159,7 +159,6 @@ class porousZone
|
||||
void addPowerLawResistance
|
||||
(
|
||||
scalarField& Udiag,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
@ -171,7 +170,6 @@ class porousZone
|
||||
(
|
||||
scalarField& Udiag,
|
||||
vectorField& Usource,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const scalarField& mu,
|
||||
@ -184,7 +182,6 @@ class porousZone
|
||||
void addPowerLawResistance
|
||||
(
|
||||
tensorField& AU,
|
||||
const labelList& cells,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
) const;
|
||||
@ -194,7 +191,6 @@ class porousZone
|
||||
void addViscousInertialResistance
|
||||
(
|
||||
tensorField& AU,
|
||||
const labelList& cells,
|
||||
const RhoFieldType& rho,
|
||||
const scalarField& mu,
|
||||
const vectorField& U
|
||||
@ -213,7 +209,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
porousZone(const word& name, const fvMesh&, const dictionary&);
|
||||
porousZone(const keyType& key, const fvMesh&, const dictionary&);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<porousZone> clone() const
|
||||
@ -237,10 +233,10 @@ public:
|
||||
|
||||
autoPtr<porousZone> operator()(Istream& is) const
|
||||
{
|
||||
word name(is);
|
||||
keyType key(is);
|
||||
dictionary dict(is);
|
||||
|
||||
return autoPtr<porousZone>(new porousZone(name, mesh_, dict));
|
||||
return autoPtr<porousZone>(new porousZone(key, mesh_, dict));
|
||||
}
|
||||
};
|
||||
|
||||
@ -255,9 +251,9 @@ public:
|
||||
// Access
|
||||
|
||||
//- cellZone name
|
||||
const word& zoneName() const
|
||||
const keyType& zoneName() const
|
||||
{
|
||||
return name_;
|
||||
return key_;
|
||||
}
|
||||
|
||||
//- Return mesh
|
||||
@ -266,10 +262,10 @@ public:
|
||||
return mesh_;
|
||||
}
|
||||
|
||||
//- cellZone number
|
||||
label zoneId() const
|
||||
//- cellZone numbers
|
||||
const labelList& zoneIds() const
|
||||
{
|
||||
return cellZoneID_;
|
||||
return cellZoneIds_;
|
||||
}
|
||||
|
||||
//- dictionary values used for the porousZone
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,12 +33,15 @@ void Foam::porousZone::modifyDdt(fvMatrix<Type>& m) const
|
||||
{
|
||||
if (porosity_ < 1)
|
||||
{
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneID_];
|
||||
|
||||
forAll(cells, i)
|
||||
forAll(cellZoneIds_, zoneI)
|
||||
{
|
||||
m.diag()[cells[i]] *= porosity_;
|
||||
m.source()[cells[i]] *= porosity_;
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
m.diag()[cells[i]] *= porosity_;
|
||||
m.source()[cells[i]] *= porosity_;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -48,7 +51,6 @@ template<class RhoFieldType>
|
||||
void Foam::porousZone::addPowerLawResistance
|
||||
(
|
||||
scalarField& Udiag,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
@ -57,10 +59,15 @@ void Foam::porousZone::addPowerLawResistance
|
||||
const scalar C0 = C0_;
|
||||
const scalar C1m1b2 = (C1_ - 1.0)/2.0;
|
||||
|
||||
forAll(cells, i)
|
||||
forAll(cellZoneIds_, zoneI)
|
||||
{
|
||||
Udiag[cells[i]] +=
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
Udiag[cells[i]] +=
|
||||
V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -70,7 +77,6 @@ void Foam::porousZone::addViscousInertialResistance
|
||||
(
|
||||
scalarField& Udiag,
|
||||
vectorField& Usource,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const scalarField& mu,
|
||||
@ -80,14 +86,21 @@ void Foam::porousZone::addViscousInertialResistance
|
||||
const tensor& D = D_.value();
|
||||
const tensor& F = F_.value();
|
||||
|
||||
forAll(cells, i)
|
||||
forAll(cellZoneIds_, zoneI)
|
||||
{
|
||||
tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
|
||||
scalar isoDragCoeff = tr(dragCoeff);
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
|
||||
|
||||
Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
|
||||
Usource[cells[i]] -=
|
||||
V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
|
||||
forAll(cells, i)
|
||||
{
|
||||
const tensor dragCoeff = mu[cells[i]]*D
|
||||
+ (rho[cells[i]]*mag(U[cells[i]]))*F;
|
||||
|
||||
const scalar isoDragCoeff = tr(dragCoeff);
|
||||
|
||||
Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
|
||||
Usource[cells[i]] -=
|
||||
V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -96,7 +109,6 @@ template<class RhoFieldType>
|
||||
void Foam::porousZone::addPowerLawResistance
|
||||
(
|
||||
tensorField& AU,
|
||||
const labelList& cells,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
) const
|
||||
@ -104,10 +116,15 @@ void Foam::porousZone::addPowerLawResistance
|
||||
const scalar C0 = C0_;
|
||||
const scalar C1m1b2 = (C1_ - 1.0)/2.0;
|
||||
|
||||
forAll(cells, i)
|
||||
forAll(cellZoneIds_, zoneI)
|
||||
{
|
||||
AU[cells[i]] = AU[cells[i]]
|
||||
+ I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2));
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
AU[cells[i]] = AU[cells[i]]
|
||||
+ I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +133,6 @@ template<class RhoFieldType>
|
||||
void Foam::porousZone::addViscousInertialResistance
|
||||
(
|
||||
tensorField& AU,
|
||||
const labelList& cells,
|
||||
const RhoFieldType& rho,
|
||||
const scalarField& mu,
|
||||
const vectorField& U
|
||||
@ -125,9 +141,14 @@ void Foam::porousZone::addViscousInertialResistance
|
||||
const tensor& D = D_.value();
|
||||
const tensor& F = F_.value();
|
||||
|
||||
forAll(cells, i)
|
||||
forAll(cellZoneIds_, zoneI)
|
||||
{
|
||||
AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
|
||||
const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,74 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-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 "error.H"
|
||||
#include "atomizationModel.H"
|
||||
#include "LISA.H"
|
||||
#include "noAtomization.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
autoPtr<atomizationModel> atomizationModel::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
spray& sm
|
||||
)
|
||||
{
|
||||
word atomizationModelType
|
||||
(
|
||||
dict.lookup("atomizationModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting atomizationModel "
|
||||
<< atomizationModelType << endl;
|
||||
|
||||
dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(atomizationModelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalError
|
||||
<< "atomizationModel::New(const dictionary&, const spray&) : " << endl
|
||||
<< " unknown atomizationModelType type "
|
||||
<< atomizationModelType
|
||||
<< ", constructor not in hash table" << endl << endl
|
||||
<< " Valid atomizationModel types are :" << endl;
|
||||
Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<atomizationModel>(cstrIter()(dict, sm));
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -59,6 +59,6 @@ Foam::CollisionModel<CloudType>::~CollisionModel()
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "NewCollisionModel.C"
|
||||
#include "CollisionModelNew.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,7 +29,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
CollisionModel.C
|
||||
NewCollisionModel.C
|
||||
CollisionModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -75,6 +75,6 @@ Foam::PairModel<CloudType>::coeffDict() const
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "NewPairModel.C"
|
||||
#include "PairModelNew.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,7 +29,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
PairModel.C
|
||||
NewPairModel.C
|
||||
PairModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -83,6 +83,6 @@ Foam::WallModel<CloudType>::coeffDict() const
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "NewWallModel.C"
|
||||
#include "WallModelNew.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,7 +29,7 @@ Description
|
||||
|
||||
SourceFiles
|
||||
WallModel.C
|
||||
NewWallModel.C
|
||||
WallModelNew.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -208,6 +208,13 @@ bool Foam::blockMesh::readBoundary
|
||||
{
|
||||
const entry& patchInfo = patchesInfo[patchI];
|
||||
|
||||
if (!patchInfo.isDict())
|
||||
{
|
||||
FatalIOErrorIn("blockMesh::readBoundary(..)", meshDescription)
|
||||
<< "Entry " << patchInfo << " in boundary section is not a"
|
||||
<< " valid dictionary." << exit(FatalIOError);
|
||||
}
|
||||
|
||||
// Construct dictionary and add name
|
||||
patchDicts.set(patchI, new dictionary(patchInfo.dict()));
|
||||
patchDicts[patchI].set("name", patchInfo.keyword());
|
||||
|
||||
@ -125,7 +125,7 @@ class PointEdgeWave
|
||||
label nChangedEdges_;
|
||||
|
||||
//- Number of cyclic patches
|
||||
bool nCyclicPatches_;
|
||||
label nCyclicPatches_;
|
||||
|
||||
//- For every cyclic patch two primitivePatches
|
||||
PtrList<primitivePatch> cycHalves_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,6 +33,8 @@ License
|
||||
#include "MeshWave.H"
|
||||
#include "ListOps.H"
|
||||
#include "meshTools.H"
|
||||
#include "cpuTime.H"
|
||||
#include "globalMeshData.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -136,37 +136,36 @@ Foam::coordinateSystem::coordinateSystem
|
||||
{
|
||||
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
|
||||
|
||||
// a simple entry is a lookup into global coordinateSystems
|
||||
// non-dictionary entry is a lookup into global coordinateSystems
|
||||
if (entryPtr && !entryPtr->isDict())
|
||||
{
|
||||
word csName;
|
||||
entryPtr->stream() >> csName;
|
||||
keyType key(entryPtr->stream());
|
||||
|
||||
const coordinateSystems& csLst = coordinateSystems::New(obr);
|
||||
const coordinateSystems& lst = coordinateSystems::New(obr);
|
||||
const label id = lst.find(key);
|
||||
|
||||
label csId = csLst.find(csName);
|
||||
if (debug)
|
||||
{
|
||||
Info<< "coordinateSystem::coordinateSystem"
|
||||
"(const dictionary&, const objectRegistry&):"
|
||||
<< nl << "using global coordinate system: "
|
||||
<< csName << "=" << csId << endl;
|
||||
<< key << "=" << id << endl;
|
||||
}
|
||||
|
||||
if (csId < 0)
|
||||
if (id < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"coordinateSystem::coordinateSystem"
|
||||
"(const dictionary&, const objectRegistry&)"
|
||||
) << "could not find coordinate system: " << csName << nl
|
||||
<< "available coordinate systems: " << csLst.toc() << nl << nl
|
||||
) << "could not find coordinate system: " << key << nl
|
||||
<< "available coordinate systems: " << lst.toc() << nl << nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// copy coordinateSystem, but assign the name as the typeName
|
||||
// to avoid strange things in writeDict()
|
||||
operator=(csLst[csId]);
|
||||
operator=(lst[id]);
|
||||
name_ = typeName_();
|
||||
}
|
||||
else
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "coordinateSystems.H"
|
||||
#include "IOPtrList.H"
|
||||
#include "Time.H"
|
||||
#include "stringListOps.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -97,13 +98,25 @@ const Foam::coordinateSystems& Foam::coordinateSystems::New
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::coordinateSystems::find(const word& keyword) const
|
||||
Foam::label Foam::coordinateSystems::find(const keyType& key) const
|
||||
{
|
||||
forAll(*this, i)
|
||||
if (key.isPattern())
|
||||
{
|
||||
if (keyword == operator[](i).name())
|
||||
labelList allFound = findAll(key);
|
||||
// return first element
|
||||
if (!allFound.empty())
|
||||
{
|
||||
return i;
|
||||
return allFound[0];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(*this, i)
|
||||
{
|
||||
if (key == operator[](i).name())
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,9 +124,34 @@ Foam::label Foam::coordinateSystems::find(const word& keyword) const
|
||||
}
|
||||
|
||||
|
||||
bool Foam::coordinateSystems::found(const word& keyword) const
|
||||
Foam::labelList Foam::coordinateSystems::findAll(const keyType& key) const
|
||||
{
|
||||
return find(keyword) >= 0;
|
||||
labelList allFound;
|
||||
if (key.isPattern())
|
||||
{
|
||||
allFound = findStrings(key, toc());
|
||||
}
|
||||
else
|
||||
{
|
||||
allFound.setSize(size());
|
||||
label nFound = 0;
|
||||
forAll(*this, i)
|
||||
{
|
||||
if (key == operator[](i).name())
|
||||
{
|
||||
allFound[nFound++] = i;
|
||||
}
|
||||
}
|
||||
allFound.setSize(nFound);
|
||||
}
|
||||
|
||||
return allFound;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::coordinateSystems::found(const keyType& key) const
|
||||
{
|
||||
return find(key) >= 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -97,11 +97,14 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Find and return index for a given keyword, returns -1 if not found
|
||||
label find(const word& key) const;
|
||||
//- Find and return index for the first match, returns -1 if not found
|
||||
label find(const keyType& key) const;
|
||||
|
||||
//- Search for given keyword
|
||||
bool found(const word& keyword) const;
|
||||
//- Find and return indices for all matches
|
||||
labelList findAll(const keyType& key) const;
|
||||
|
||||
//- Search for given key
|
||||
bool found(const keyType& key) const;
|
||||
|
||||
//- Return the table of contents (list of all keywords)
|
||||
wordList toc() const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,6 +32,9 @@ License
|
||||
#include "Random.H"
|
||||
#include "treeDataFace.H"
|
||||
#include "indexedOctree.H"
|
||||
#include "polyMesh.H"
|
||||
#include "polyPatch.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -362,7 +365,7 @@ void Foam::directMappedPatchBase::findSamples
|
||||
"(const pointField&, labelList&"
|
||||
", labelList&, pointField&)"
|
||||
) << "Did not find sample " << samples[sampleI]
|
||||
<< " on any processor of region" << sampleRegion_
|
||||
<< " on any processor of region " << sampleRegion_
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -1046,7 +1046,8 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
|
||||
}
|
||||
|
||||
|
||||
//// Takes a bb and a point on the outside of the bb. Checks if on multiple faces
|
||||
//// Takes a bb and a point on the outside of the bb. Checks if on multiple
|
||||
// faces
|
||||
//// and if so perturbs point so it is only on one face.
|
||||
//template <class Type>
|
||||
//void Foam::indexedOctree<Type>::checkMultipleFaces
|
||||
@ -2495,6 +2496,59 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
Foam::label Foam::indexedOctree<Type>::findInside(const point& sample) const
|
||||
{
|
||||
labelBits index = findNode(0, sample);
|
||||
|
||||
const node& nod = nodes_[getNode(index)];
|
||||
|
||||
labelBits contentIndex = nod.subNodes_[getOctant(index)];
|
||||
|
||||
// Need to check for the presence of content, in-case the node is empty
|
||||
if (isContent(contentIndex))
|
||||
{
|
||||
labelList indices = contents_[getContent(contentIndex)];
|
||||
|
||||
forAll(indices, elemI)
|
||||
{
|
||||
label shapeI = indices[elemI];
|
||||
|
||||
if (shapes_.contains(shapeI, sample))
|
||||
{
|
||||
return shapeI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
template <class Type>
|
||||
const Foam::labelList& Foam::indexedOctree<Type>::findIndices
|
||||
(
|
||||
const point& sample
|
||||
) const
|
||||
{
|
||||
labelBits index = findNode(0, sample);
|
||||
|
||||
const node& nod = nodes_[getNode(index)];
|
||||
|
||||
labelBits contentIndex = nod.subNodes_[getOctant(index)];
|
||||
|
||||
// Need to check for the presence of content, in-case the node is empty
|
||||
if (isContent(contentIndex))
|
||||
{
|
||||
return contents_[getContent(contentIndex)];
|
||||
}
|
||||
else
|
||||
{
|
||||
return emptyList<label>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Determine type (inside/outside/mixed) per node.
|
||||
template <class Type>
|
||||
typename Foam::indexedOctree<Type>::volumeType
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -549,9 +549,16 @@ public:
|
||||
|
||||
//- Find deepest node (as parent+octant) containing point. Starts
|
||||
// off from starting index in nodes_ (use 0 to start from top)
|
||||
// Use getNode, getOctant to extract info.
|
||||
// Use getNode and getOctant to extract info, or call findIndices.
|
||||
labelBits findNode(const label nodeI, const point&) const;
|
||||
|
||||
//- Find shape containing point. Only implemented for certain
|
||||
// shapes.
|
||||
label findInside(const point&) const;
|
||||
|
||||
//- Find the shape indices that occupy the result of findNode
|
||||
const labelList& findIndices(const point&) const;
|
||||
|
||||
//- Determine type (inside/outside/mixed) for point. unknown if
|
||||
// cannot be determined (e.g. non-manifold surface)
|
||||
volumeType getVolumeType(const point&) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -145,6 +145,16 @@ bool Foam::treeDataCell::overlaps
|
||||
}
|
||||
|
||||
|
||||
bool Foam::treeDataCell::contains
|
||||
(
|
||||
const label index,
|
||||
const point& sample
|
||||
) const
|
||||
{
|
||||
return mesh_.pointInCell(sample, cellLabels_[index]);
|
||||
}
|
||||
|
||||
|
||||
// Calculate nearest point to sample. Updates (if any) nearestDistSqr, minIndex,
|
||||
// nearestPoint.
|
||||
void Foam::treeDataCell::findNearest
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -142,6 +142,13 @@ public:
|
||||
const treeBoundBox& sampleBb
|
||||
) const;
|
||||
|
||||
//- Does shape at index contain sample
|
||||
bool contains
|
||||
(
|
||||
const label index,
|
||||
const point& sample
|
||||
) const;
|
||||
|
||||
//- Calculates nearest (to sample) point in shape.
|
||||
// Returns actual point and distance (squared)
|
||||
void findNearest
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -103,6 +103,11 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
const labelList& edgeLabels() const
|
||||
{
|
||||
return edgeLabels_;
|
||||
}
|
||||
|
||||
label size() const
|
||||
{
|
||||
return edgeLabels_.size();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -99,7 +99,7 @@ bool Foam::meshSearch::findNearer
|
||||
// tree based searching
|
||||
Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
|
||||
{
|
||||
const indexedOctree<treeDataPoint>& tree = cellCentreTree();
|
||||
const indexedOctree<treeDataCell>& tree = cellTree();
|
||||
|
||||
scalar span = tree.bb().mag();
|
||||
|
||||
@ -176,7 +176,7 @@ Foam::label Foam::meshSearch::findNearestCellWalk
|
||||
Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
|
||||
{
|
||||
// Search nearest cell centre.
|
||||
const indexedOctree<treeDataPoint>& tree = cellCentreTree();
|
||||
const indexedOctree<treeDataCell>& tree = cellTree();
|
||||
|
||||
scalar span = tree.bb().mag();
|
||||
|
||||
@ -320,6 +320,80 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const
|
||||
}
|
||||
|
||||
|
||||
// walking from seed
|
||||
Foam::label Foam::meshSearch::findCellWalk
|
||||
(
|
||||
const point& location,
|
||||
const label seedCellI
|
||||
) const
|
||||
{
|
||||
if (seedCellI < 0)
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"meshSearch::findCellWalk(const point&, const label)"
|
||||
) << "illegal seedCell:" << seedCellI << exit(FatalError);
|
||||
}
|
||||
|
||||
if (pointInCell(location, seedCellI))
|
||||
{
|
||||
return seedCellI;
|
||||
}
|
||||
|
||||
// Walk in direction of face that decreases distance
|
||||
label curCellI = seedCellI;
|
||||
scalar nearestDistSqr = magSqr(mesh_.cellCentres()[curCellI] - location);
|
||||
|
||||
while(true)
|
||||
{
|
||||
// Try neighbours of curCellI
|
||||
|
||||
const cell& cFaces = mesh_.cells()[curCellI];
|
||||
|
||||
label nearestCellI = -1;
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
label faceI = cFaces[i];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
{
|
||||
label cellI = mesh_.faceOwner()[faceI];
|
||||
if (cellI == curCellI)
|
||||
{
|
||||
cellI = mesh_.faceNeighbour()[faceI];
|
||||
}
|
||||
|
||||
// Check if this is the correct cell
|
||||
if (pointInCell(location, cellI))
|
||||
{
|
||||
return cellI;
|
||||
}
|
||||
|
||||
// Also calculate the nearest cell
|
||||
scalar distSqr = magSqr(mesh_.cellCentres()[cellI] - location);
|
||||
|
||||
if (distSqr < nearestDistSqr)
|
||||
{
|
||||
nearestDistSqr = distSqr;
|
||||
nearestCellI = cellI;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nearestCellI == -1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Continue with the nearest cell
|
||||
curCellI = nearestCellI;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Foam::label Foam::meshSearch::findNearestBoundaryFaceWalk
|
||||
(
|
||||
const point& location,
|
||||
@ -426,11 +500,7 @@ Foam::vector Foam::meshSearch::offset
|
||||
Foam::meshSearch::meshSearch(const polyMesh& mesh, const bool faceDecomp)
|
||||
:
|
||||
mesh_(mesh),
|
||||
faceDecomp_(faceDecomp),
|
||||
cloud_(mesh_, "meshSearchCloud", IDLList<passiveParticle>()),
|
||||
boundaryTreePtr_(NULL),
|
||||
cellTreePtr_(NULL),
|
||||
cellCentreTreePtr_(NULL)
|
||||
faceDecomp_(faceDecomp)
|
||||
{}
|
||||
|
||||
|
||||
@ -447,7 +517,7 @@ Foam::meshSearch::~meshSearch()
|
||||
const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
|
||||
const
|
||||
{
|
||||
if (!boundaryTreePtr_)
|
||||
if (!boundaryTreePtr_.valid())
|
||||
{
|
||||
//
|
||||
// Construct tree
|
||||
@ -466,85 +536,59 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
|
||||
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
|
||||
boundaryTreePtr_ = new indexedOctree<treeDataFace>
|
||||
boundaryTreePtr_.reset
|
||||
(
|
||||
treeDataFace // all information needed to search faces
|
||||
new indexedOctree<treeDataFace>
|
||||
(
|
||||
false, // do not cache bb
|
||||
mesh_,
|
||||
bndFaces // boundary faces only
|
||||
),
|
||||
overallBb, // overall search domain
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
3.0 // duplicity
|
||||
treeDataFace // all information needed to search faces
|
||||
(
|
||||
false, // do not cache bb
|
||||
mesh_,
|
||||
bndFaces // boundary faces only
|
||||
),
|
||||
overallBb, // overall search domain
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
3.0 // duplicity
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return *boundaryTreePtr_;
|
||||
return boundaryTreePtr_();
|
||||
}
|
||||
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataCell>& Foam::meshSearch::cellTree()
|
||||
const
|
||||
const
|
||||
{
|
||||
if (!cellTreePtr_)
|
||||
if (!cellTreePtr_.valid())
|
||||
{
|
||||
//
|
||||
// Construct tree
|
||||
//
|
||||
|
||||
treeBoundBox overallBb(mesh_.points());
|
||||
Random rndGen(123456);
|
||||
|
||||
Random rndGen(261782);
|
||||
|
||||
overallBb = overallBb.extend(rndGen, 1E-4);
|
||||
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
|
||||
cellTreePtr_ = new indexedOctree<treeDataCell>
|
||||
cellTreePtr_.reset
|
||||
(
|
||||
treeDataCell
|
||||
new indexedOctree<treeDataCell>
|
||||
(
|
||||
false, // not cache bb
|
||||
mesh_
|
||||
),
|
||||
overallBb, // overall search domain
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
3.0 // duplicity
|
||||
treeDataCell
|
||||
(
|
||||
false, // not cache bb
|
||||
mesh_
|
||||
),
|
||||
overallBb,
|
||||
8, // maxLevel
|
||||
10, // leafsize
|
||||
3.0 // duplicity
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return *cellTreePtr_;
|
||||
|
||||
}
|
||||
|
||||
|
||||
const Foam::indexedOctree<Foam::treeDataPoint>&
|
||||
Foam::meshSearch::cellCentreTree() const
|
||||
{
|
||||
if (!cellCentreTreePtr_)
|
||||
{
|
||||
//
|
||||
// Construct tree
|
||||
//
|
||||
|
||||
treeBoundBox overallBb(mesh_.cellCentres());
|
||||
Random rndGen(123456);
|
||||
overallBb = overallBb.extend(rndGen, 1E-4);
|
||||
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
||||
|
||||
cellCentreTreePtr_ = new indexedOctree<treeDataPoint>
|
||||
(
|
||||
treeDataPoint(mesh_.cellCentres()),
|
||||
overallBb, // overall search domain
|
||||
10, // max levels
|
||||
10.0, // maximum ratio of cubes v.s. cells
|
||||
100.0 // max. duplicity; n/a since no bounding boxes.
|
||||
);
|
||||
}
|
||||
|
||||
return *cellCentreTreePtr_;
|
||||
return cellTreePtr_();
|
||||
}
|
||||
|
||||
|
||||
@ -697,107 +741,21 @@ Foam::label Foam::meshSearch::findCell
|
||||
) const
|
||||
{
|
||||
// Find the nearest cell centre to this location
|
||||
label nearCellI = findNearestCell(location, seedCellI, useTreeSearch);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "findCell : nearCellI:" << nearCellI
|
||||
<< " ctr:" << mesh_.cellCentres()[nearCellI]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (pointInCell(location, nearCellI))
|
||||
{
|
||||
return nearCellI;
|
||||
}
|
||||
else
|
||||
if (seedCellI == -1)
|
||||
{
|
||||
if (useTreeSearch)
|
||||
{
|
||||
// Start searching from cell centre of nearCell
|
||||
point curPoint = mesh_.cellCentres()[nearCellI];
|
||||
|
||||
vector edgeVec = location - curPoint;
|
||||
edgeVec /= mag(edgeVec);
|
||||
|
||||
do
|
||||
{
|
||||
// Walk neighbours (using tracking) to get closer
|
||||
passiveParticle tracker(cloud_, curPoint, nearCellI);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "findCell : tracked from curPoint:" << curPoint
|
||||
<< " nearCellI:" << nearCellI;
|
||||
}
|
||||
|
||||
tracker.track(location);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< " to " << tracker.position()
|
||||
<< " need:" << location
|
||||
<< " onB:" << tracker.onBoundary()
|
||||
<< " cell:" << tracker.cell()
|
||||
<< " face:" << tracker.face() << endl;
|
||||
}
|
||||
|
||||
if (!tracker.onBoundary())
|
||||
{
|
||||
// stopped not on boundary -> reached location
|
||||
return tracker.cell();
|
||||
}
|
||||
|
||||
// stopped on boundary face. Compare positions
|
||||
scalar typDim = sqrt(mag(mesh_.faceAreas()[tracker.face()]));
|
||||
|
||||
if ((mag(tracker.position() - location)/typDim) < SMALL)
|
||||
{
|
||||
return tracker.cell();
|
||||
}
|
||||
|
||||
// tracking stopped at boundary. Find next boundary
|
||||
// intersection from current point (shifted out a little bit)
|
||||
// in the direction of the destination
|
||||
|
||||
curPoint =
|
||||
tracker.position()
|
||||
+ offset(tracker.position(), tracker.face(), edgeVec);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Searching for next boundary from curPoint:"
|
||||
<< curPoint
|
||||
<< " to location:" << location << endl;
|
||||
}
|
||||
pointIndexHit curHit = intersection(curPoint, location);
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Returned from line search with ";
|
||||
curHit.write(Pout);
|
||||
Pout<< endl;
|
||||
}
|
||||
|
||||
if (!curHit.hit())
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
nearCellI = mesh_.faceOwner()[curHit.index()];
|
||||
curPoint =
|
||||
curHit.hitPoint()
|
||||
+ offset(curHit.hitPoint(), curHit.index(), edgeVec);
|
||||
}
|
||||
}
|
||||
while (true);
|
||||
return cellTree().findInside(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
return findCellLinear(location);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
else
|
||||
{
|
||||
return findCellWalk(location, seedCellI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -947,9 +905,8 @@ bool Foam::meshSearch::isInside(const point& p) const
|
||||
// Delete all storage
|
||||
void Foam::meshSearch::clearOut()
|
||||
{
|
||||
deleteDemandDrivenData(boundaryTreePtr_);
|
||||
deleteDemandDrivenData(cellTreePtr_);
|
||||
deleteDemandDrivenData(cellCentreTreePtr_);
|
||||
boundaryTreePtr_.clear();
|
||||
cellTreePtr_.clear();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -37,7 +37,7 @@ SourceFiles
|
||||
#define meshSearch_H
|
||||
|
||||
#include "pointIndexHit.H"
|
||||
#include "passiveParticleCloud.H"
|
||||
#include "pointField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -48,7 +48,6 @@ namespace Foam
|
||||
class polyMesh;
|
||||
class treeDataCell;
|
||||
class treeDataFace;
|
||||
class treeDataPoint;
|
||||
template<class Type> class indexedOctree;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -65,14 +64,10 @@ class meshSearch
|
||||
//- Whether to use face decomposition for all geometric tests
|
||||
const bool faceDecomp_;
|
||||
|
||||
//- Dummy cloud to put particles on for tracking.
|
||||
passiveParticleCloud cloud_;
|
||||
|
||||
//- demand driven octrees
|
||||
|
||||
mutable indexedOctree<treeDataFace>* boundaryTreePtr_;
|
||||
mutable indexedOctree<treeDataCell>* cellTreePtr_;
|
||||
mutable indexedOctree<treeDataPoint>* cellCentreTreePtr_;
|
||||
mutable autoPtr<indexedOctree<treeDataFace> > boundaryTreePtr_;
|
||||
mutable autoPtr<indexedOctree<treeDataCell> > cellTreePtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
@ -112,8 +107,12 @@ class meshSearch
|
||||
//- cell containing location. Linear search.
|
||||
label findCellLinear(const point&) const;
|
||||
|
||||
//- walk from seed. Does not 'go around' boundary, just returns
|
||||
// last cell before boundary.
|
||||
label findCellWalk(const point&, const label) const;
|
||||
|
||||
// Cells
|
||||
|
||||
// Faces
|
||||
|
||||
label findNearestFaceTree(const point&) const;
|
||||
|
||||
@ -188,9 +187,6 @@ public:
|
||||
//- Get (demand driven) reference to octree holding all cells
|
||||
const indexedOctree<treeDataCell>& cellTree() const;
|
||||
|
||||
//- Get (demand driven) reference to octree holding all cell centres
|
||||
const indexedOctree<treeDataPoint>& cellCentreTree() const;
|
||||
|
||||
|
||||
// Queries
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -139,7 +139,7 @@ void Foam::cylinderToCell::applyToSet
|
||||
}
|
||||
else if (action == topoSetSource::DELETE)
|
||||
{
|
||||
Info<< " Removing cells with centre within sphere, with p1 = "
|
||||
Info<< " Removing cells with centre within cylinder, with p1 = "
|
||||
<< p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl;
|
||||
|
||||
combine(set, false);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "triSurface.H"
|
||||
#include "triSurfaceSearch.H"
|
||||
#include "cellClassification.H"
|
||||
#include "cpuTime.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,6 +27,7 @@ License
|
||||
#include "polyMesh.H"
|
||||
#include "meshSearch.H"
|
||||
#include "triSurfaceSearch.H"
|
||||
#include "cpuTime.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(WM_THIRD_PARTY_DIR)/metis-5.0pre2/include \
|
||||
-I../../dummyThirdParty/metisDecomp /* location of dummy metis.h */ \
|
||||
-I../decompositionMethods/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.6 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -29,6 +29,7 @@ License
|
||||
#include "polyMesh.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "triSurfaceMesh.H"
|
||||
#include "Time.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -27,7 +27,8 @@ Class
|
||||
Description
|
||||
A sampledSurface defined by a cuttingPlane. Always triangulated.
|
||||
|
||||
Note: does not actually cut until update() called.
|
||||
Note
|
||||
Does not actually cut until update() called.
|
||||
|
||||
SourceFiles
|
||||
sampledPlane.C
|
||||
|
||||
@ -28,6 +28,7 @@ License
|
||||
#include "meshSearch.H"
|
||||
#include "Tuple2.H"
|
||||
#include "globalIndex.H"
|
||||
#include "treeDataCell.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
@ -166,8 +167,7 @@ bool Foam::sampledTriSurfaceMesh::update()
|
||||
|
||||
meshSearch meshSearcher(mesh(), false);
|
||||
|
||||
const indexedOctree<treeDataPoint>& cellCentreTree =
|
||||
meshSearcher.cellCentreTree();
|
||||
const indexedOctree<treeDataCell>& cellTree = meshSearcher.cellTree();
|
||||
|
||||
|
||||
// Global numbering for cells - only used to uniquely identify local cells.
|
||||
@ -182,7 +182,7 @@ bool Foam::sampledTriSurfaceMesh::update()
|
||||
// Search triangles using nearest on local mesh
|
||||
forAll(fc, triI)
|
||||
{
|
||||
pointIndexHit nearInfo = cellCentreTree.findNearest
|
||||
pointIndexHit nearInfo = cellTree.findNearest
|
||||
(
|
||||
fc[triI],
|
||||
sqr(GREAT)
|
||||
|
||||
@ -73,6 +73,17 @@ void Foam::foamFileSurfaceWriter<Type>::write
|
||||
|
||||
// Faces
|
||||
OFstream(surfaceDir/"faces")() << faces;
|
||||
|
||||
// Face centers. Not really necessary but very handy when reusing as inputs
|
||||
// for e.g. timeVaryingMapped bc.
|
||||
pointField faceCentres(faces.size(),point::zero);
|
||||
|
||||
forAll (faces, faceI)
|
||||
{
|
||||
faceCentres[faceI] = faces[faceI].centre(points);
|
||||
}
|
||||
|
||||
OFstream(surfaceDir/"faceCentres")() << faceCentres;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -123,8 +123,8 @@ bool Foam::fileFormats::STLsurfaceFormatCore::readBINARY
|
||||
(
|
||||
!is
|
||||
|| nTris < 0
|
||||
|| nTris < (dataFileSize - headerSize)/50
|
||||
|| nTris > (dataFileSize - headerSize)/25
|
||||
|| nTris < int(dataFileSize - headerSize)/50
|
||||
|| nTris > int(dataFileSize - headerSize)/25
|
||||
)
|
||||
{
|
||||
FatalErrorIn
|
||||
|
||||
@ -57,7 +57,7 @@ makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
constTransport,
|
||||
hConstThermo,
|
||||
eConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
@ -65,15 +65,16 @@ makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
sutherlandTransport,
|
||||
hConstThermo,
|
||||
eConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
|
||||
makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
constTransport,
|
||||
eConstThermo,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
@ -81,7 +82,7 @@ makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
sutherlandTransport,
|
||||
eConstThermo,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
|
||||
@ -63,6 +63,7 @@ makeBasicPsiThermo
|
||||
perfectGas
|
||||
);
|
||||
|
||||
|
||||
makeBasicPsiThermo
|
||||
(
|
||||
ePsiThermo,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
constSolidThermo/constSolidThermo.C
|
||||
directionalSolidThermo/directionalSolidThermo.C
|
||||
basicSolidThermo/basicSolidThermo.C
|
||||
basicSolidThermo/newBasicSolidThermo.C
|
||||
basicSolidThermo/basicSolidThermoNew.C
|
||||
interpolatedSolidThermo/interpolatedSolidThermo.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libbasicSolidThermo
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -53,6 +53,8 @@ namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// constTransport, hConstThermo
|
||||
|
||||
makeCombustionThermo
|
||||
(
|
||||
hCombustionThermo,
|
||||
@ -83,6 +85,42 @@ makeCombustionThermo
|
||||
perfectGas
|
||||
);
|
||||
|
||||
|
||||
// sutherlandTransport, hConstThermo
|
||||
|
||||
makeCombustionThermo
|
||||
(
|
||||
hCombustionThermo,
|
||||
hPsiMixtureThermo,
|
||||
homogeneousMixture,
|
||||
sutherlandTransport,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeCombustionThermo
|
||||
(
|
||||
hCombustionThermo,
|
||||
hPsiMixtureThermo,
|
||||
inhomogeneousMixture,
|
||||
sutherlandTransport,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeCombustionThermo
|
||||
(
|
||||
hCombustionThermo,
|
||||
hPsiMixtureThermo,
|
||||
veryInhomogeneousMixture,
|
||||
sutherlandTransport,
|
||||
hConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
|
||||
// sutherlandTransport, janafThermo
|
||||
|
||||
makeCombustionThermo
|
||||
(
|
||||
hCombustionThermo,
|
||||
@ -113,6 +151,7 @@ makeCombustionThermo
|
||||
perfectGas
|
||||
);
|
||||
|
||||
|
||||
makeCombustionThermo
|
||||
(
|
||||
hCombustionThermo,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,12 +32,12 @@ License
|
||||
|
||||
Foam::thermalPorousZone::thermalPorousZone
|
||||
(
|
||||
const word& name,
|
||||
const keyType& key,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
porousZone(name, mesh, dict),
|
||||
porousZone(key, mesh, dict),
|
||||
T_("T", dimTemperature, -GREAT)
|
||||
{
|
||||
if (const dictionary* dictPtr = dict.subDictPtr("thermalModel"))
|
||||
@ -53,11 +53,7 @@ Foam::thermalPorousZone::thermalPorousZone
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"thermalPorousZone::thermalPorousZone"
|
||||
"("
|
||||
"const word& name, "
|
||||
"const fvMesh& mesh, "
|
||||
"const dictionary& dict"
|
||||
")",
|
||||
"(const keyType&, const fvMesh&, const dictionary&)",
|
||||
*dictPtr
|
||||
) << "thermalModel " << thermalModel << " is not supported" << nl
|
||||
<< " Supported thermalModels are: fixedTemperature"
|
||||
@ -76,23 +72,28 @@ void Foam::thermalPorousZone::addEnthalpySource
|
||||
fvScalarMatrix& hEqn
|
||||
) const
|
||||
{
|
||||
if (zoneId() == -1 || T_.value() < 0.0)
|
||||
const labelList& zones = this->zoneIds();
|
||||
if (zones.empty() || T_.value() < 0.0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const labelList& cells = mesh().cellZones()[zoneId()];
|
||||
const scalarField& V = mesh().V();
|
||||
scalarField& hDiag = hEqn.diag();
|
||||
scalarField& hSource = hEqn.source();
|
||||
|
||||
scalarField hZone = thermo.h(scalarField(cells.size(), T_.value()), cells);
|
||||
scalar rate = 1e6;
|
||||
// TODO: generalize for non-fixedTemperature methods
|
||||
const scalar rate = 1e6;
|
||||
|
||||
forAll(cells, i)
|
||||
forAll(zones, zoneI)
|
||||
{
|
||||
hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
|
||||
hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*hZone[i];
|
||||
const labelList& cells = mesh().cellZones()[zones[zoneI]];
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
|
||||
hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*T_.value();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -33,7 +33,6 @@ See Also
|
||||
|
||||
SourceFiles
|
||||
thermalPorousZone.C
|
||||
thermalPorousZoneTemplates.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -76,7 +75,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
thermalPorousZone(const word& name, const fvMesh&, const dictionary&);
|
||||
thermalPorousZone(const keyType& key, const fvMesh&, const dictionary&);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<thermalPorousZone> clone() const
|
||||
@ -101,12 +100,12 @@ public:
|
||||
|
||||
autoPtr<thermalPorousZone> operator()(Istream& is) const
|
||||
{
|
||||
word name(is);
|
||||
keyType key(is);
|
||||
dictionary dict(is);
|
||||
|
||||
return autoPtr<thermalPorousZone>
|
||||
(
|
||||
new thermalPorousZone(name, mesh_, dict)
|
||||
new thermalPorousZone(key, mesh_, dict)
|
||||
);
|
||||
}
|
||||
};
|
||||
@ -149,12 +148,6 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
//# include "thermalPorousZoneTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,79 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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 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 "porousZone.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class RhoFieldType>
|
||||
void Foam::porousZone::addPowerLawResistance
|
||||
(
|
||||
scalarField& Udiag,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const vectorField& U
|
||||
) const
|
||||
{
|
||||
const scalar C0 = C0_;
|
||||
const scalar C1m1b2 = (C1_ - 1.0)/2.0;
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
Udiag[cells[i]] +=
|
||||
V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class RhoFieldType>
|
||||
void Foam::porousZone::addViscousInertialResistance
|
||||
(
|
||||
scalarField& Udiag,
|
||||
vectorField& Usource,
|
||||
const labelList& cells,
|
||||
const scalarField& V,
|
||||
const RhoFieldType& rho,
|
||||
const scalarField& mu,
|
||||
const vectorField& U
|
||||
) const
|
||||
{
|
||||
const tensor& D = D_.value();
|
||||
const tensor& F = F_.value();
|
||||
|
||||
forAll(cells, i)
|
||||
{
|
||||
tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
|
||||
scalar isoDragCoeff = tr(dragCoeff);
|
||||
|
||||
Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
|
||||
Usource[cells[i]] -=
|
||||
V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,7 +46,11 @@ Description
|
||||
d d [0 -2 0 0 0] (-1000 -1000 0.50753e+08);
|
||||
f f [0 -1 0 0 0] (-1000 -1000 12.83);
|
||||
}
|
||||
Temperature [0 0 1 0 0] 600;
|
||||
thermalModel
|
||||
{
|
||||
type fixedTemperature;
|
||||
T T [0 0 1 0 0] 600;
|
||||
}
|
||||
}
|
||||
)
|
||||
@endverbatim
|
||||
@ -69,7 +73,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class thermalPorousZones Declaration
|
||||
Class thermalPorousZones Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class thermalPorousZones
|
||||
|
||||
@ -204,8 +204,6 @@ void epsilonWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
const tmp<volScalarField> tk = rasModel.k();
|
||||
const volScalarField& k = tk();
|
||||
|
||||
const scalarField& rhow = rasModel.rho().boundaryField()[patchI];
|
||||
|
||||
const scalarField& muw = rasModel.mu().boundaryField()[patchI];
|
||||
|
||||
const tmp<volScalarField> tmut = rasModel.mut();
|
||||
|
||||
Reference in New Issue
Block a user