Skip to content
Snippets Groups Projects
Commit 9fa89e67 authored by sergio's avatar sergio
Browse files

Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop

parents 4418c192 f92ee225
Branches
Tags
No related merge requests found
...@@ -95,8 +95,8 @@ Foam::label Foam::mergePoints ...@@ -95,8 +95,8 @@ Foam::label Foam::mergePoints
sortedTol[sortI] = sortedTol[sortI] =
2*mergeTol* 2*mergeTol*
( (
mag(scalar(pt.x() - compareOrigin.x())), mag(scalar(pt.x() - compareOrigin.x()))
+ mag(scalar(pt.y() - compareOrigin.y())), + mag(scalar(pt.y() - compareOrigin.y()))
+ mag(scalar(pt.z() - compareOrigin.z())) + mag(scalar(pt.z() - compareOrigin.z()))
); );
} }
......
...@@ -232,6 +232,39 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge ...@@ -232,6 +232,39 @@ Foam::scalar Foam::wallBoundedParticle::trackToEdge
{ {
// Negative tet volume. Track back by setting the end point // Negative tet volume. Track back by setting the end point
projectedEndPosition = position() - (endPosition-position()); projectedEndPosition = position() - (endPosition-position());
// Make sure to use a large enough vector to cross the negative
// face. Bit overkill.
const vector d(endPosition-position());
const scalar magD(mag(d));
if (magD > ROOTVSMALL)
{
// Get overall mesh bounding box
treeBoundBox meshBb(mesh_.bounds());
// Extend to make 3D
meshBb.inflate(ROOTSMALL);
// Create vector guaranteed to cross mesh bounds
projectedEndPosition = position()-meshBb.mag()*d/magD;
// Clip to mesh bounds
point intPt;
direction intPtBits;
bool ok = meshBb.intersects
(
projectedEndPosition,
position()-projectedEndPosition,
projectedEndPosition,
position(),
intPt,
intPtBits
);
if (ok)
{
// Should always be the case
projectedEndPosition = intPt;
}
}
} }
// Remove normal component // Remove normal component
......
...@@ -190,7 +190,7 @@ void Foam::fieldToCell::applyToSet ...@@ -190,7 +190,7 @@ void Foam::fieldToCell::applyToSet
false false
); );
// Note: should check for volScalarField but that introduces depencendy // Note: should check for volScalarField but that introduces dependency
// on volMesh so just use another type with processor-local scope // on volMesh so just use another type with processor-local scope
if (!fieldObject.typeHeaderOk<labelIOList>(false)) if (!fieldObject.typeHeaderOk<labelIOList>(false))
{ {
...@@ -198,6 +198,9 @@ void Foam::fieldToCell::applyToSet ...@@ -198,6 +198,9 @@ void Foam::fieldToCell::applyToSet
<< "Cannot read field " << fieldName_ << "Cannot read field " << fieldName_
<< " from time " << mesh().time().timeName() << endl; << " from time " << mesh().time().timeName() << endl;
} }
// Note: should use volScalarField::typeName instead below
// but that would introduce linkage problems (finiteVolume needs
// meshTools)
else if (fieldObject.headerClassName() == "volScalarField") else if (fieldObject.headerClassName() == "volScalarField")
{ {
IFstream str(typeFilePath<labelIOList>(fieldObject)); IFstream str(typeFilePath<labelIOList>(fieldObject));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment