mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
This commit is contained in:
@ -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
|
|||||||
{
|
{
|
||||||
// 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
|
|||||||
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
|
|||||||
<< "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));
|
||||||
|
|||||||
Reference in New Issue
Block a user