mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/noisy3/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -29,8 +29,9 @@ License
|
||||
|
||||
// Note: the use of this tolerance is ad-hoc, there may be extreme
|
||||
// cases where the resulting tetrahedra still have particle tracking
|
||||
// problems.
|
||||
const Foam::scalar Foam::polyMeshTetDecomposition::minTetQuality = SMALL;
|
||||
// problems, or tets with lower quality may track OK.
|
||||
// const Foam::scalar Foam::polyMeshTetDecomposition::minTetQuality = SMALL;
|
||||
const Foam::scalar Foam::polyMeshTetDecomposition::minTetQuality = ROOTVSMALL;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
|
||||
@ -104,11 +105,10 @@ Foam::label Foam::polyMeshTetDecomposition::findSharedBasePoint
|
||||
{
|
||||
return faceBasePtI;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// If a base point hasn't triggered a return by now, then there is
|
||||
// non that can produce a good decomposition
|
||||
// none that can produce a good decomposition
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -554,15 +554,17 @@ Foam::List<Foam::tetIndices> Foam::polyMeshTetDecomposition::faceTetIndices
|
||||
|
||||
if (tetBasePtI == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
WarningIn
|
||||
(
|
||||
"Foam::List<Foam::FixedList<Foam::label, 4> >"
|
||||
"Foam::Cloud<ParticleType>::"
|
||||
"faceTetIndices(label fI, label cI) const"
|
||||
)
|
||||
<< "No base point for face " << fI << ", " << f
|
||||
<< "No base point for face " << fI << ", " << f
|
||||
<< ", produces a valid tet decomposition."
|
||||
<< abort(FatalError);
|
||||
<< endl;
|
||||
|
||||
tetBasePtI = 0;
|
||||
}
|
||||
|
||||
for (label tetPtI = 1; tetPtI < f.size() - 1; tetPtI++)
|
||||
|
||||
@ -253,7 +253,11 @@ public:
|
||||
//- Increment the nTrackingRescues counter
|
||||
void trackingRescue() const
|
||||
{
|
||||
nTrackingRescues_++;
|
||||
if (++nTrackingRescues_ % size() == 0)
|
||||
{
|
||||
Info<< " " << nTrackingRescues_
|
||||
<< " tracking rescues " << endl;
|
||||
}
|
||||
}
|
||||
|
||||
//- Whether each cell has any wall faces (demand driven data)
|
||||
|
||||
@ -256,6 +256,17 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
|
||||
|
||||
faceI_ = -1;
|
||||
|
||||
// Pout<< "Particle " << origId_ << " " << origProc_
|
||||
// << " Tracking from " << position_
|
||||
// << " to " << endPosition
|
||||
// << endl;
|
||||
|
||||
// Pout<< "stepFraction " << stepFraction_ << nl
|
||||
// << "cellI " << cellI_ << nl
|
||||
// << "tetFaceI " << tetFaceI_ << nl
|
||||
// << "tetPtI " << tetPtI_
|
||||
// << endl;
|
||||
|
||||
scalar trackFraction = 0.0;
|
||||
|
||||
// Minimum tetrahedron decomposition of each cell of the mesh into
|
||||
@ -397,6 +408,8 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
|
||||
triI = -1;
|
||||
lambdaMin = VGREAT;
|
||||
|
||||
// Pout<< "tris " << tris << endl;
|
||||
|
||||
// Sets a value for lambdaMin and faceI_ if a wall face is hit
|
||||
// by the track.
|
||||
hitWallFaces(position_, endPosition, lambdaMin, faceHitTetIs);
|
||||
@ -461,6 +474,35 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
|
||||
faceI_ = -1;
|
||||
}
|
||||
|
||||
// Pout<< "track loop " << position_ << " " << endPosition << nl
|
||||
// << " " << cellI_
|
||||
// << " " << faceI_
|
||||
// << " " << tetFaceI_
|
||||
// << " " << tetPtI_
|
||||
// << " " << triI
|
||||
// << " " << lambdaMin
|
||||
// << " " << trackFraction
|
||||
// << endl;
|
||||
|
||||
// Pout<< "# Tracking loop tet "
|
||||
// << origId_ << " " << origProc_<< nl
|
||||
// << "# face: " << tetFaceI_ << nl
|
||||
// << "# tetPtI: " << tetPtI_ << nl
|
||||
// << "# tetBasePtI: " << mesh.tetBasePtIs()[tetFaceI_] << nl
|
||||
// << "# tet.mag(): " << tet.mag() << nl
|
||||
// << "# tet.quality(): " << tet.quality()
|
||||
// << endl;
|
||||
|
||||
// meshTools::writeOBJ(Pout, tet.a());
|
||||
// meshTools::writeOBJ(Pout, tet.b());
|
||||
// meshTools::writeOBJ(Pout, tet.c());
|
||||
// meshTools::writeOBJ(Pout, tet.d());
|
||||
|
||||
// Pout<< "f 1 3 2" << nl
|
||||
// << "f 2 3 4" << nl
|
||||
// << "f 1 4 3" << nl
|
||||
// << "f 1 2 4" << endl;
|
||||
|
||||
// The particle can be 'outside' the tet. This will yield a
|
||||
// lambda larger than 1, or smaller than 0. For values < 0,
|
||||
// the particle travels away from the tet and we don't move
|
||||
|
||||
@ -343,9 +343,6 @@ inline void Foam::Particle<ParticleType>::tetNeighbour(label triI)
|
||||
|
||||
label tetBasePtI = mesh.tetBasePtIs()[tetFaceI_];
|
||||
|
||||
label facePtI = (tetPtI_ + tetBasePtI) % f.size();
|
||||
label otherFacePtI = f.fcIndex(facePtI);
|
||||
|
||||
if (tetBasePtI == -1)
|
||||
{
|
||||
FatalErrorIn
|
||||
@ -357,6 +354,9 @@ inline void Foam::Particle<ParticleType>::tetNeighbour(label triI)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
label facePtI = (tetPtI_ + tetBasePtI) % f.size();
|
||||
label otherFacePtI = f.fcIndex(facePtI);
|
||||
|
||||
switch (triI)
|
||||
{
|
||||
case 0:
|
||||
|
||||
97
src/meshTools/sets/cellSources/fieldToCell/fieldDictionary.H
Normal file
97
src/meshTools/sets/cellSources/fieldToCell/fieldDictionary.H
Normal file
@ -0,0 +1,97 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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/>.
|
||||
|
||||
Class
|
||||
Foam::fieldDictionary
|
||||
|
||||
Description
|
||||
Read field as dictionary (without mesh).
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef fieldDictionary_H
|
||||
#define fieldDictionary_H
|
||||
|
||||
#include "regIOobject.H"
|
||||
#include "dictionary.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class fieldDictionary Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class fieldDictionary
|
||||
:
|
||||
public regIOobject,
|
||||
public dictionary
|
||||
{
|
||||
const word type_;
|
||||
|
||||
public:
|
||||
|
||||
// Redefine type name to be of the instantiated type
|
||||
virtual const word& type() const
|
||||
{
|
||||
return type_;
|
||||
}
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from ioobject and overloaded typename.
|
||||
explicit fieldDictionary(const IOobject& io, const word& type)
|
||||
:
|
||||
regIOobject(io),
|
||||
dictionary(readStream(type)),
|
||||
type_(type)
|
||||
{
|
||||
close();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
bool writeData(Ostream& os) const
|
||||
{
|
||||
static_cast<const dictionary&>(*this).write(os, false);
|
||||
|
||||
return os.good();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -28,6 +28,7 @@ License
|
||||
#include "cellSet.H"
|
||||
#include "Time.H"
|
||||
#include "IFstream.H"
|
||||
#include "fieldDictionary.H"
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
@ -207,7 +208,7 @@ void Foam::fieldToCell::applyToSet
|
||||
IFstream str(fieldObject.filePath());
|
||||
|
||||
// Read dictionary
|
||||
dictionary fieldDict(str);
|
||||
fieldDictionary fieldDict(fieldObject, fieldObject.headerClassName());
|
||||
|
||||
scalarField internalVals("internalField", fieldDict, mesh().nCells());
|
||||
|
||||
@ -218,7 +219,7 @@ void Foam::fieldToCell::applyToSet
|
||||
IFstream str(fieldObject.filePath());
|
||||
|
||||
// Read dictionary
|
||||
dictionary fieldDict(str);
|
||||
fieldDictionary fieldDict(fieldObject, fieldObject.headerClassName());
|
||||
|
||||
vectorField internalVals("internalField", fieldDict, mesh().nCells());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user