functionObjects::interfaceHeight: Corrected parallel operation
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -93,16 +93,16 @@ void Foam::functionObjects::interfaceHeight::writePositions()
|
|||||||
// line. The latter is equal to the equivalent length with alpha equal
|
// line. The latter is equal to the equivalent length with alpha equal
|
||||||
// to one.
|
// to one.
|
||||||
scalar sumLength = 0, sumLengthAlpha = 0;
|
scalar sumLength = 0, sumLengthAlpha = 0;
|
||||||
for(label si = 0; si < set.size() - 1; ++ si)
|
for (label si = 0; si < set.size() - 1; ++ si)
|
||||||
{
|
{
|
||||||
if (set.segments()[si] != set.segments()[si+1])
|
if (set.segments()[si] != set.segments()[si+1]) continue;
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const vector& p0 = set.pointCoord(si), p1 = set.pointCoord(si+1);
|
const vector& p0 = set.pointCoord(si), p1 = set.pointCoord(si+1);
|
||||||
const label c0 = set.cells()[si], c1 = set.cells()[si+1];
|
const label c0 = set.cells()[si], c1 = set.cells()[si+1];
|
||||||
const label f0 = set.faces()[si], f1 = set.faces()[si+1];
|
const label f0 = set.faces()[si], f1 = set.faces()[si+1];
|
||||||
|
|
||||||
|
if (f0 != -1 && f1 != -1) continue;
|
||||||
|
|
||||||
const scalar a0 = interpolator->interpolate(p0, c0, f0);
|
const scalar a0 = interpolator->interpolate(p0, c0, f0);
|
||||||
const scalar a1 = interpolator->interpolate(p1, c1, f1);
|
const scalar a1 = interpolator->interpolate(p1, c1, f1);
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -58,7 +58,7 @@ void Foam::sampledSets::lineCell::calcSamples
|
|||||||
searchEngine(),
|
searchEngine(),
|
||||||
start_,
|
start_,
|
||||||
end_,
|
end_,
|
||||||
false,
|
0,
|
||||||
true,
|
true,
|
||||||
samplingPositions,
|
samplingPositions,
|
||||||
samplingDistances,
|
samplingDistances,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,6 +45,7 @@ namespace sampledSets
|
|||||||
|
|
||||||
void Foam::sampledSets::lineCellFace::calcSamples
|
void Foam::sampledSets::lineCellFace::calcSamples
|
||||||
(
|
(
|
||||||
|
const label storeFaces,
|
||||||
DynamicList<point>& samplingPositions,
|
DynamicList<point>& samplingPositions,
|
||||||
DynamicList<scalar>& samplingDistances,
|
DynamicList<scalar>& samplingDistances,
|
||||||
DynamicList<label>& samplingSegments,
|
DynamicList<label>& samplingSegments,
|
||||||
@ -58,7 +59,7 @@ void Foam::sampledSets::lineCellFace::calcSamples
|
|||||||
searchEngine(),
|
searchEngine(),
|
||||||
start_,
|
start_,
|
||||||
end_,
|
end_,
|
||||||
true,
|
storeFaces,
|
||||||
true,
|
true,
|
||||||
samplingPositions,
|
samplingPositions,
|
||||||
samplingDistances,
|
samplingDistances,
|
||||||
@ -69,7 +70,7 @@ void Foam::sampledSets::lineCellFace::calcSamples
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::sampledSets::lineCellFace::genSamples()
|
void Foam::sampledSets::lineCellFace::genSamples(const label storeFaces)
|
||||||
{
|
{
|
||||||
DynamicList<point> samplingPositions;
|
DynamicList<point> samplingPositions;
|
||||||
DynamicList<scalar> samplingDistances;
|
DynamicList<scalar> samplingDistances;
|
||||||
@ -79,6 +80,7 @@ void Foam::sampledSets::lineCellFace::genSamples()
|
|||||||
|
|
||||||
calcSamples
|
calcSamples
|
||||||
(
|
(
|
||||||
|
storeFaces,
|
||||||
samplingPositions,
|
samplingPositions,
|
||||||
samplingDistances,
|
samplingDistances,
|
||||||
samplingSegments,
|
samplingSegments,
|
||||||
@ -117,7 +119,7 @@ Foam::sampledSets::lineCellFace::lineCellFace
|
|||||||
start_(dict.lookup("start")),
|
start_(dict.lookup("start")),
|
||||||
end_(dict.lookup("end"))
|
end_(dict.lookup("end"))
|
||||||
{
|
{
|
||||||
genSamples();
|
genSamples(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -135,7 +137,7 @@ Foam::sampledSets::lineCellFace::lineCellFace
|
|||||||
start_(start),
|
start_(start),
|
||||||
end_(end)
|
end_(end)
|
||||||
{
|
{
|
||||||
genSamples();
|
genSamples(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -85,6 +85,7 @@ class lineCellFace
|
|||||||
//- Calculate all the sampling points
|
//- Calculate all the sampling points
|
||||||
virtual void calcSamples
|
virtual void calcSamples
|
||||||
(
|
(
|
||||||
|
const label storeFaces,
|
||||||
DynamicList<point>& samplingPositions,
|
DynamicList<point>& samplingPositions,
|
||||||
DynamicList<scalar>& samplingDistances,
|
DynamicList<scalar>& samplingDistances,
|
||||||
DynamicList<label>& samplingSegments,
|
DynamicList<label>& samplingSegments,
|
||||||
@ -93,7 +94,7 @@ class lineCellFace
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Uses calcSamples to obtain samples and copies them into *this
|
//- Uses calcSamples to obtain samples and copies them into *this
|
||||||
void genSamples();
|
void genSamples(const label storeFaces);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,7 +51,7 @@ void Foam::sampledSets::lineFace::calcSamples
|
|||||||
const meshSearch& searchEngine,
|
const meshSearch& searchEngine,
|
||||||
const vector& start,
|
const vector& start,
|
||||||
const vector& end,
|
const vector& end,
|
||||||
const bool storeFaces,
|
const label storeFaces,
|
||||||
const bool storeCells,
|
const bool storeCells,
|
||||||
DynamicList<point>& samplingPositions,
|
DynamicList<point>& samplingPositions,
|
||||||
DynamicList<scalar>& samplingDistances,
|
DynamicList<scalar>& samplingDistances,
|
||||||
@ -280,7 +280,7 @@ void Foam::sampledSets::lineFace::calcSamples
|
|||||||
searchEngine(),
|
searchEngine(),
|
||||||
start_,
|
start_,
|
||||||
end_,
|
end_,
|
||||||
true,
|
1,
|
||||||
false,
|
false,
|
||||||
samplingPositions,
|
samplingPositions,
|
||||||
samplingDistances,
|
samplingDistances,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -112,7 +112,7 @@ public:
|
|||||||
const meshSearch& searchEngine,
|
const meshSearch& searchEngine,
|
||||||
const vector& start,
|
const vector& start,
|
||||||
const vector& end,
|
const vector& end,
|
||||||
const bool storeFaces,
|
const label storeFaces,
|
||||||
const bool storeCells,
|
const bool storeCells,
|
||||||
DynamicList<point>& samplingPositions,
|
DynamicList<point>& samplingPositions,
|
||||||
DynamicList<scalar>& samplingDistances,
|
DynamicList<scalar>& samplingDistances,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -139,7 +139,7 @@ bool Foam::sampledSetParticle::move
|
|||||||
while (onInternalFace(td.mesh))
|
while (onInternalFace(td.mesh))
|
||||||
{
|
{
|
||||||
if (td.storeCells_) storeCell(cloud, td);
|
if (td.storeCells_) storeCell(cloud, td);
|
||||||
if (td.storeFaces_) storeFace(cloud, td);
|
if (td.storeFaces_ > 0) storeFace(cloud, td);
|
||||||
|
|
||||||
hitFace(setF_*s, 0, cloud, td);
|
hitFace(setF_*s, 0, cloud, td);
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ bool Foam::sampledSetParticle::move
|
|||||||
if (onFace())
|
if (onFace())
|
||||||
{
|
{
|
||||||
if (td.storeCells_) storeCell(cloud, td);
|
if (td.storeCells_) storeCell(cloud, td);
|
||||||
if (td.storeFaces_) storeFace(cloud, td);
|
if (td.storeFaces_ > 0) storeFace(cloud, td);
|
||||||
|
|
||||||
hitFace(setF_*s, 0, cloud, td);
|
hitFace(setF_*s, 0, cloud, td);
|
||||||
}
|
}
|
||||||
@ -247,6 +247,18 @@ void Foam::sampledSetParticle::hitWallPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sampledSetParticle::correctAfterParallelTransfer
|
||||||
|
(
|
||||||
|
sampledSetCloud& cloud,
|
||||||
|
trackingData& td
|
||||||
|
)
|
||||||
|
{
|
||||||
|
particle::correctAfterParallelTransfer(cloud, td);
|
||||||
|
|
||||||
|
if (td.storeFaces_ > 1) storeFace(cloud, td);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::Ostream& Foam::operator<<(Ostream& os, const sampledSetParticle& p)
|
Foam::Ostream& Foam::operator<<(Ostream& os, const sampledSetParticle& p)
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -75,7 +75,7 @@ public:
|
|||||||
const bool storeSet_;
|
const bool storeSet_;
|
||||||
|
|
||||||
//- Are we storing the faces we track through?
|
//- Are we storing the faces we track through?
|
||||||
const bool storeFaces_;
|
const label storeFaces_;
|
||||||
|
|
||||||
//- Are we storing the cells we track through?
|
//- Are we storing the cells we track through?
|
||||||
const bool storeCells_;
|
const bool storeCells_;
|
||||||
@ -97,9 +97,9 @@ public:
|
|||||||
(
|
(
|
||||||
sampledSetCloud& cloud,
|
sampledSetCloud& cloud,
|
||||||
const List<point>& set,
|
const List<point>& set,
|
||||||
bool storeSet,
|
const bool storeSet,
|
||||||
bool storeFaces,
|
const label storeFaces,
|
||||||
bool storeCells,
|
const bool storeCells,
|
||||||
DynamicList<point>& positions,
|
DynamicList<point>& positions,
|
||||||
DynamicList<scalar>& distances,
|
DynamicList<scalar>& distances,
|
||||||
DynamicList<label>& cells,
|
DynamicList<label>& cells,
|
||||||
@ -211,6 +211,10 @@ public:
|
|||||||
//- Hit a wall patch. Ends the track.
|
//- Hit a wall patch. Ends the track.
|
||||||
void hitWallPatch(sampledSetCloud&, trackingData&);
|
void hitWallPatch(sampledSetCloud&, trackingData&);
|
||||||
|
|
||||||
|
//- Do corrections to the particle and tracking data following a
|
||||||
|
// transfer between processors
|
||||||
|
void correctAfterParallelTransfer(sampledSetCloud&, trackingData&);
|
||||||
|
|
||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user