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:
@ -13,7 +13,7 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
volVectorField force =
|
volVectorField force =
|
||||||
U/dimensionedScalar("dt", dimTime, runTime.deltaT().value());
|
U/dimensionedScalar("dt", dimTime, runTime.deltaTValue());
|
||||||
|
|
||||||
Kmesh K(mesh);
|
Kmesh K(mesh);
|
||||||
UOprocess forceGen(K, runTime.deltaT().value(), turbulenceProperties);
|
UOprocess forceGen(K, runTime.deltaTValue(), turbulenceProperties);
|
||||||
|
|||||||
@ -41,11 +41,11 @@ Description
|
|||||||
|
|
||||||
StCoNum =
|
StCoNum =
|
||||||
max(SfUfbyDelta/mesh.magSf()).value()
|
max(SfUfbyDelta/mesh.magSf()).value()
|
||||||
*runTime.deltaT().value();
|
*runTime.deltaTValue();
|
||||||
|
|
||||||
meanStCoNum =
|
meanStCoNum =
|
||||||
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
|
(sum(SfUfbyDelta)/sum(mesh.magSf())).value()
|
||||||
*runTime.deltaT().value();
|
*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "St courant Number mean: " << meanStCoNum
|
Info<< "St courant Number mean: " << meanStCoNum
|
||||||
|
|||||||
@ -41,12 +41,12 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
deltaTFact*runTime.deltaT().value(),
|
deltaTFact*runTime.deltaTValue(),
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -40,7 +40,7 @@ if (ign.ignited())
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
|
*mag(phiSt)/(fvc::interpolate(rho)*mesh.magSf())
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "Max St-Courant Number = " << StCoNum << endl;
|
Info<< "Max St-Courant Number = " << StCoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -89,8 +89,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -80,8 +80,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -38,11 +38,11 @@ if (mesh.nInternalFaces())
|
|||||||
surfaceScalarField amaxSfbyDelta =
|
surfaceScalarField amaxSfbyDelta =
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf;
|
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf;
|
||||||
|
|
||||||
CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaT().value();
|
CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum =
|
meanCoNum =
|
||||||
(sum(amaxSfbyDelta)/sum(mesh.magSf())).value()
|
(sum(amaxSfbyDelta)/sum(mesh.magSf())).value()
|
||||||
*runTime.deltaT().value();
|
*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Mean and max Courant Numbers = "
|
Info<< "Mean and max Courant Numbers = "
|
||||||
|
|||||||
@ -68,7 +68,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*mag(phiv)/mesh.magSf()
|
*mag(phiv)/mesh.magSf()
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "\nMax Courant Number = " << CoNum << endl;
|
Info<< "\nMax Courant Number = " << CoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*mag(phiv)/mesh.magSf()
|
*mag(phiv)/mesh.magSf()
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "Max Courant Number = " << CoNum << endl;
|
Info<< "Max Courant Number = " << CoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
Info<< "magnetic flux divergence error = "
|
Info<< "magnetic flux divergence error = "
|
||||||
<< runTime.deltaT().value()
|
<< runTime.deltaTValue()
|
||||||
*mag(fvc::div(phiB))().weightedAverage(mesh.V()).value()
|
*mag(fvc::div(phiB))().weightedAverage(mesh.V()).value()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|||||||
@ -47,10 +47,10 @@ Foam::scalar Foam::compressibleCourantNo
|
|||||||
/ fvc::interpolate(rho);
|
/ fvc::interpolate(rho);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum
|
Info<< "Region: " << mesh.name() << " Courant Number mean: " << meanCoNum
|
||||||
|
|||||||
@ -42,10 +42,10 @@ if (mesh.nInternalFaces())
|
|||||||
*mag(phi)/fvc::interpolate(h);
|
*mag(phi)/fvc::interpolate(h);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
// Gravity wave Courant number
|
// Gravity wave Courant number
|
||||||
waveCoNum =
|
waveCoNum =
|
||||||
@ -53,7 +53,7 @@ if (mesh.nInternalFaces())
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()
|
mesh.surfaceInterpolation::deltaCoeffs()
|
||||||
*sqrt(fvc::interpolate(h))
|
*sqrt(fvc::interpolate(h))
|
||||||
).value()*sqrt(magg).value()*runTime.deltaT().value();
|
).value()*sqrt(magg).value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Courant number mean: " << meanCoNum
|
Info<< "Courant number mean: " << meanCoNum
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
chemistry.solve
|
chemistry.solve
|
||||||
(
|
(
|
||||||
runTime.value() - runTime.deltaT().value(),
|
runTime.value() - runTime.deltaTValue(),
|
||||||
runTime.deltaT().value()
|
runTime.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
// turbulent time scale
|
// turbulent time scale
|
||||||
|
|||||||
@ -40,15 +40,15 @@ if (mesh.nInternalFaces())
|
|||||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv);
|
mesh.surfaceInterpolation::deltaCoeffs()*mag(phiv);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
acousticCoNum = max
|
acousticCoNum = max
|
||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi))
|
mesh.surfaceInterpolation::deltaCoeffs()/sqrt(fvc::interpolate(psi))
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "phiv Courant Number mean: " << meanCoNum
|
Info<< "phiv Courant Number mean: " << meanCoNum
|
||||||
|
|||||||
@ -43,12 +43,12 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
deltaTFact*runTime.deltaT().value(),
|
deltaTFact*runTime.deltaTValue(),
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -44,7 +44,7 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
maxDeltaTFact*runTime.deltaT().value(),
|
maxDeltaTFact*runTime.deltaTValue(),
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
scalar sumLocalContErr =
|
scalar sumLocalContErr =
|
||||||
runTime.deltaT().value()*
|
runTime.deltaTValue()*
|
||||||
mag
|
mag
|
||||||
(
|
(
|
||||||
fvc::ddt(rho)
|
fvc::ddt(rho)
|
||||||
@ -7,7 +7,7 @@
|
|||||||
)().weightedAverage(rho*mesh.V()).value();
|
)().weightedAverage(rho*mesh.V()).value();
|
||||||
|
|
||||||
scalar globalContErr =
|
scalar globalContErr =
|
||||||
runTime.deltaT().value()*
|
runTime.deltaTValue()*
|
||||||
(
|
(
|
||||||
fvc::ddt(rho)
|
fvc::ddt(rho)
|
||||||
+ fvc::div(phi)
|
+ fvc::div(phi)
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
(
|
(
|
||||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib)
|
mesh.surfaceInterpolation::deltaCoeffs()*mag(phia - phib)
|
||||||
/mesh.magSf()
|
/mesh.magSf()
|
||||||
).value()*runTime.deltaT().value();
|
).value()*runTime.deltaTValue();
|
||||||
|
|
||||||
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
Info<< "Max Ur Courant Number = " << UrCoNum << endl;
|
||||||
|
|
||||||
|
|||||||
@ -50,6 +50,7 @@ Description
|
|||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
#include "PackedBoolList.H"
|
#include "PackedBoolList.H"
|
||||||
#include "SortableList.H"
|
#include "SortableList.H"
|
||||||
|
#include "unitConversion.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -467,7 +468,7 @@ int main(int argc, char *argv[])
|
|||||||
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
scalar angle(readScalar(IStringStream(args.additionalArgs()[1])()));
|
||||||
bool overwrite = args.optionFound("overwrite");
|
bool overwrite = args.optionFound("overwrite");
|
||||||
|
|
||||||
scalar maxCos = Foam::cos(angle*180/constant::mathematical::pi);
|
scalar maxCos = Foam::cos(degToRad(angle));
|
||||||
|
|
||||||
Info<< "Merging:" << nl
|
Info<< "Merging:" << nl
|
||||||
<< " edges with length less than " << minLen << " meters" << nl
|
<< " edges with length less than " << minLen << " meters" << nl
|
||||||
|
|||||||
@ -208,12 +208,13 @@ void readPoints
|
|||||||
{
|
{
|
||||||
hasWarned = true;
|
hasWarned = true;
|
||||||
|
|
||||||
WarningIn
|
IOWarningIn
|
||||||
(
|
(
|
||||||
"readPoints(IFstream&, label&, DynamicList<point>"
|
"readPoints(IFstream&, label&, DynamicList<point>"
|
||||||
", DynamicList<label>&)"
|
", DynamicList<label>&)",
|
||||||
|
is
|
||||||
) << "Points not in order starting at point " << pointI
|
) << "Points not in order starting at point " << pointI
|
||||||
<< " at line " << is.lineNumber()
|
//<< " at line " << is.lineNumber()
|
||||||
//<< abort(FatalError);
|
//<< abort(FatalError);
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
@ -429,47 +430,53 @@ void readPatches
|
|||||||
>> dofSet >> tempSet >> contactSet >> nFaces;
|
>> dofSet >> tempSet >> contactSet >> nFaces;
|
||||||
|
|
||||||
is.getLine(line);
|
is.getLine(line);
|
||||||
patchNames.append(string::validate<word>(line));
|
word groupName = string::validate<word>(line);
|
||||||
|
|
||||||
Info<< "For facegroup " << group
|
Info<< "For group " << group
|
||||||
<< " named " << patchNames[patchNames.size()-1]
|
<< " named " << groupName
|
||||||
<< " trying to read " << nFaces << " patch face indices."
|
<< " trying to read " << nFaces << " patch face indices."
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
patchFaceIndices.append(labelList(0));
|
labelList groupIndices(nFaces);
|
||||||
labelList& faceIndices = patchFaceIndices[patchFaceIndices.size()-1];
|
label groupType = -1;
|
||||||
faceIndices.setSize(nFaces);
|
nFaces = 0;
|
||||||
label faceI = 0;
|
|
||||||
|
|
||||||
while (faceI < faceIndices.size())
|
while (nFaces < groupIndices.size())
|
||||||
{
|
{
|
||||||
is.getLine(line);
|
is.getLine(line);
|
||||||
IStringStream lineStr(line);
|
IStringStream lineStr(line);
|
||||||
|
|
||||||
// Read one (for last face) or two entries from line.
|
// Read one (for last face) or two entries from line.
|
||||||
label nRead = 2;
|
label nRead = 2;
|
||||||
if (faceI == faceIndices.size()-1)
|
if (nFaces == groupIndices.size()-1)
|
||||||
{
|
{
|
||||||
nRead = 1;
|
nRead = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (label i = 0; i < nRead; i++)
|
for (label i = 0; i < nRead; i++)
|
||||||
{
|
{
|
||||||
label typeCode, tag, nodeLeaf, component;
|
label tag, nodeLeaf, component;
|
||||||
|
|
||||||
lineStr >> typeCode >> tag >> nodeLeaf >> component;
|
lineStr >> groupType >> tag >> nodeLeaf >> component;
|
||||||
|
|
||||||
if (typeCode != 8)
|
groupIndices[nFaces++] = tag;
|
||||||
{
|
|
||||||
FatalErrorIn("readPatches")
|
|
||||||
<< "When reading patches expect Entity Type Code 8"
|
|
||||||
<< nl << "At line " << is.lineNumber()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
|
|
||||||
faceIndices[faceI++] = tag;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Store
|
||||||
|
if (groupType == 8)
|
||||||
|
{
|
||||||
|
patchNames.append(groupName);
|
||||||
|
patchFaceIndices.append(groupIndices);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
IOWarningIn("readPatches(..)", is)
|
||||||
|
<< "When reading patches expect entity type code 8"
|
||||||
|
<< nl << " Skipping group code " << groupType
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
patchNames.shrink();
|
patchNames.shrink();
|
||||||
|
|||||||
@ -0,0 +1,394 @@
|
|||||||
|
-1
|
||||||
|
2411
|
||||||
|
1 0 0 0
|
||||||
|
2.0000000000000000E+02 3.0000000000000000E+02 0.0000000000000000E+00
|
||||||
|
2 0 0 0
|
||||||
|
2.0000000000000000E+02 3.0000000000000000E+02 2.1000000000000000E+02
|
||||||
|
3 0 0 0
|
||||||
|
2.0000000000000000E+02 0.0000000000000000E+00 0.0000000000000000E+00
|
||||||
|
4 0 0 0
|
||||||
|
2.0000000000000000E+02 0.0000000000000000E+00 2.1000000000000000E+02
|
||||||
|
5 0 0 0
|
||||||
|
0.0000000000000000E+00 3.0000000000000000E+02 0.0000000000000000E+00
|
||||||
|
6 0 0 0
|
||||||
|
0.0000000000000000E+00 3.0000000000000000E+02 2.1000000000000000E+02
|
||||||
|
7 0 0 0
|
||||||
|
0.0000000000000000E+00 0.0000000000000000E+00 0.0000000000000000E+00
|
||||||
|
8 0 0 0
|
||||||
|
0.0000000000000000E+00 0.0000000000000000E+00 2.1000000000000000E+02
|
||||||
|
9 0 0 0
|
||||||
|
0.0000000000000000E+00 1.0020000000000000E+02 2.1000000000000000E+02
|
||||||
|
10 0 0 0
|
||||||
|
0.0000000000000000E+00 2.0009999999999999E+02 2.1000000000000000E+02
|
||||||
|
11 0 0 0
|
||||||
|
1.0000000000000000E+02 3.0000000000000000E+02 2.1000000000000000E+02
|
||||||
|
12 0 0 0
|
||||||
|
2.0000000000000000E+02 1.0020000000000000E+02 2.1000000000000000E+02
|
||||||
|
13 0 0 0
|
||||||
|
2.0000000000000000E+02 2.0009999999999999E+02 2.1000000000000000E+02
|
||||||
|
14 0 0 0
|
||||||
|
1.0000000000000000E+02 0.0000000000000000E+00 2.1000000000000000E+02
|
||||||
|
15 0 0 0
|
||||||
|
0.0000000000000000E+00 1.0020000000000000E+02 0.0000000000000000E+00
|
||||||
|
16 0 0 0
|
||||||
|
0.0000000000000000E+00 2.0009999999999999E+02 0.0000000000000000E+00
|
||||||
|
17 0 0 0
|
||||||
|
1.0000000000000000E+02 3.0000000000000000E+02 0.0000000000000000E+00
|
||||||
|
18 0 0 0
|
||||||
|
2.0000000000000000E+02 1.0020000000000000E+02 0.0000000000000000E+00
|
||||||
|
19 0 0 0
|
||||||
|
2.0000000000000000E+02 2.0009999999999999E+02 0.0000000000000000E+00
|
||||||
|
20 0 0 0
|
||||||
|
1.0000000000000000E+02 0.0000000000000000E+00 0.0000000000000000E+00
|
||||||
|
21 0 0 0
|
||||||
|
2.0000000000000000E+02 3.0000000000000000E+02 1.0500000000000000E+02
|
||||||
|
22 0 0 0
|
||||||
|
0.0000000000000000E+00 3.0000000000000000E+02 1.0500000000000000E+02
|
||||||
|
23 0 0 0
|
||||||
|
2.0000000000000000E+02 0.0000000000000000E+00 1.0500000000000000E+02
|
||||||
|
24 0 0 0
|
||||||
|
0.0000000000000000E+00 0.0000000000000000E+00 1.0500000000000000E+02
|
||||||
|
25 0 0 0
|
||||||
|
9.6161727574445891E+01 1.3290789499900029E+02 2.1000000000000000E+02
|
||||||
|
26 0 0 0
|
||||||
|
8.0082880863556014E+01 2.2412763570985578E+02 2.1000000000000000E+02
|
||||||
|
27 0 0 0
|
||||||
|
9.6161727574240444E+01 1.3290789499883087E+02 0.0000000000000000E+00
|
||||||
|
28 0 0 0
|
||||||
|
8.0082880863392205E+01 2.2412763570989483E+02 0.0000000000000000E+00
|
||||||
|
29 0 0 0
|
||||||
|
2.0000000000000000E+02 1.5011560268321134E+02 1.0500000000592973E+02
|
||||||
|
30 0 0 0
|
||||||
|
0.0000000000000000E+00 1.5011560299451648E+02 1.0499999963389952E+02
|
||||||
|
31 0 0 0
|
||||||
|
9.9094099553883055E+01 7.2457929267250009E+01 1.0499999994714025E+02
|
||||||
|
-1
|
||||||
|
-1
|
||||||
|
2412
|
||||||
|
1 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
9 8
|
||||||
|
2 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
10 9
|
||||||
|
3 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
6 10
|
||||||
|
4 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
11 6
|
||||||
|
5 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
2 11
|
||||||
|
6 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
4 12
|
||||||
|
7 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
12 13
|
||||||
|
8 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
13 2
|
||||||
|
9 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
8 14
|
||||||
|
10 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
14 4
|
||||||
|
11 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
7 15
|
||||||
|
12 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
15 16
|
||||||
|
13 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
16 5
|
||||||
|
14 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
5 17
|
||||||
|
15 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
17 1
|
||||||
|
16 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
18 3
|
||||||
|
17 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
19 18
|
||||||
|
18 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
1 19
|
||||||
|
19 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
20 7
|
||||||
|
20 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
3 20
|
||||||
|
21 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
21 1
|
||||||
|
22 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
2 21
|
||||||
|
23 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
5 22
|
||||||
|
24 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
22 6
|
||||||
|
25 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
3 23
|
||||||
|
26 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
23 4
|
||||||
|
27 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
24 7
|
||||||
|
28 11 2 1 7 2
|
||||||
|
0 0 0
|
||||||
|
8 24
|
||||||
|
29 41 2 1 7 3
|
||||||
|
9 8 14
|
||||||
|
30 41 2 1 7 3
|
||||||
|
10 9 25
|
||||||
|
31 41 2 1 7 3
|
||||||
|
6 10 26
|
||||||
|
32 41 2 1 7 3
|
||||||
|
11 6 26
|
||||||
|
33 41 2 1 7 3
|
||||||
|
10 25 26
|
||||||
|
34 41 2 1 7 3
|
||||||
|
2 11 13
|
||||||
|
35 41 2 1 7 3
|
||||||
|
4 12 14
|
||||||
|
36 41 2 1 7 3
|
||||||
|
12 13 25
|
||||||
|
37 41 2 1 7 3
|
||||||
|
14 12 25
|
||||||
|
38 41 2 1 7 3
|
||||||
|
9 14 25
|
||||||
|
39 41 2 1 7 3
|
||||||
|
13 11 26
|
||||||
|
40 41 2 1 7 3
|
||||||
|
13 26 25
|
||||||
|
41 41 2 1 7 3
|
||||||
|
7 15 20
|
||||||
|
42 41 2 1 7 3
|
||||||
|
15 16 27
|
||||||
|
43 41 2 1 7 3
|
||||||
|
16 5 28
|
||||||
|
44 41 2 1 7 3
|
||||||
|
27 16 28
|
||||||
|
45 41 2 1 7 3
|
||||||
|
5 17 28
|
||||||
|
46 41 2 1 7 3
|
||||||
|
17 1 19
|
||||||
|
47 41 2 1 7 3
|
||||||
|
18 3 20
|
||||||
|
48 41 2 1 7 3
|
||||||
|
19 18 27
|
||||||
|
49 41 2 1 7 3
|
||||||
|
18 20 27
|
||||||
|
50 41 2 1 7 3
|
||||||
|
20 15 27
|
||||||
|
51 41 2 1 7 3
|
||||||
|
17 19 28
|
||||||
|
52 41 2 1 7 3
|
||||||
|
28 19 27
|
||||||
|
53 41 2 1 7 3
|
||||||
|
17 5 22
|
||||||
|
54 41 2 1 7 3
|
||||||
|
1 17 21
|
||||||
|
55 41 2 1 7 3
|
||||||
|
2 21 11
|
||||||
|
56 41 2 1 7 3
|
||||||
|
6 11 22
|
||||||
|
57 41 2 1 7 3
|
||||||
|
22 11 21
|
||||||
|
58 41 2 1 7 3
|
||||||
|
22 21 17
|
||||||
|
59 41 2 1 7 3
|
||||||
|
7 20 24
|
||||||
|
60 41 2 1 7 3
|
||||||
|
20 3 23
|
||||||
|
61 41 2 1 7 3
|
||||||
|
23 4 14
|
||||||
|
62 41 2 1 7 3
|
||||||
|
14 8 24
|
||||||
|
63 41 2 1 7 3
|
||||||
|
14 24 23
|
||||||
|
64 41 2 1 7 3
|
||||||
|
20 23 24
|
||||||
|
65 41 2 1 7 3
|
||||||
|
23 3 18
|
||||||
|
66 41 2 1 7 3
|
||||||
|
4 23 12
|
||||||
|
67 41 2 1 7 3
|
||||||
|
13 12 29
|
||||||
|
68 41 2 1 7 3
|
||||||
|
2 13 21
|
||||||
|
69 41 2 1 7 3
|
||||||
|
22 16 30
|
||||||
|
70 41 2 1 7 3
|
||||||
|
13 29 21
|
||||||
|
71 41 2 1 7 3
|
||||||
|
1 21 19
|
||||||
|
72 41 2 1 7 3
|
||||||
|
12 23 29
|
||||||
|
73 41 2 1 7 3
|
||||||
|
18 19 29
|
||||||
|
74 41 2 1 7 3
|
||||||
|
23 18 29
|
||||||
|
75 41 2 1 7 3
|
||||||
|
15 24 30
|
||||||
|
76 41 2 1 7 3
|
||||||
|
29 19 21
|
||||||
|
77 41 2 1 7 3
|
||||||
|
7 24 15
|
||||||
|
78 41 2 1 7 3
|
||||||
|
24 8 9
|
||||||
|
79 41 2 1 7 3
|
||||||
|
9 10 30
|
||||||
|
80 41 2 1 7 3
|
||||||
|
10 6 22
|
||||||
|
81 41 2 1 7 3
|
||||||
|
30 10 22
|
||||||
|
82 41 2 1 7 3
|
||||||
|
16 15 30
|
||||||
|
83 41 2 1 7 3
|
||||||
|
22 5 16
|
||||||
|
84 41 2 1 7 3
|
||||||
|
24 9 30
|
||||||
|
85 111 2 1 7 4
|
||||||
|
21 28 22 17
|
||||||
|
86 111 2 1 7 4
|
||||||
|
31 18 29 23
|
||||||
|
87 111 2 1 7 4
|
||||||
|
31 29 18 27
|
||||||
|
88 111 2 1 7 4
|
||||||
|
29 21 26 13
|
||||||
|
89 111 2 1 7 4
|
||||||
|
29 25 26 30
|
||||||
|
90 111 2 1 7 4
|
||||||
|
26 28 29 30
|
||||||
|
91 111 2 1 7 4
|
||||||
|
16 28 5 22
|
||||||
|
92 111 2 1 7 4
|
||||||
|
30 25 10 9
|
||||||
|
93 111 2 1 7 4
|
||||||
|
16 30 15 27
|
||||||
|
94 111 2 1 7 4
|
||||||
|
26 25 10 30
|
||||||
|
95 111 2 1 7 4
|
||||||
|
21 28 26 22
|
||||||
|
96 111 2 1 7 4
|
||||||
|
31 20 18 23
|
||||||
|
97 111 2 1 7 4
|
||||||
|
27 28 16 30
|
||||||
|
98 111 2 1 7 4
|
||||||
|
18 27 29 19
|
||||||
|
99 111 2 1 7 4
|
||||||
|
21 22 26 11
|
||||||
|
100 111 2 1 7 4
|
||||||
|
23 4 12 14
|
||||||
|
101 111 2 1 7 4
|
||||||
|
31 25 29 30
|
||||||
|
102 111 2 1 7 4
|
||||||
|
31 18 20 27
|
||||||
|
103 111 2 1 7 4
|
||||||
|
21 11 26 13
|
||||||
|
104 111 2 1 7 4
|
||||||
|
22 28 5 17
|
||||||
|
105 111 2 1 7 4
|
||||||
|
2 11 21 13
|
||||||
|
106 111 2 1 7 4
|
||||||
|
29 25 12 13
|
||||||
|
107 111 2 1 7 4
|
||||||
|
30 28 16 22
|
||||||
|
108 111 2 1 7 4
|
||||||
|
31 24 20 23
|
||||||
|
109 111 2 1 7 4
|
||||||
|
26 28 30 22
|
||||||
|
110 111 2 1 7 4
|
||||||
|
21 17 19 28
|
||||||
|
111 111 2 1 7 4
|
||||||
|
15 24 31 30
|
||||||
|
112 111 2 1 7 4
|
||||||
|
31 9 30 24
|
||||||
|
113 111 2 1 7 4
|
||||||
|
15 30 31 27
|
||||||
|
114 111 2 1 7 4
|
||||||
|
8 14 24 9
|
||||||
|
115 111 2 1 7 4
|
||||||
|
26 22 10 6
|
||||||
|
116 111 2 1 7 4
|
||||||
|
31 25 12 29
|
||||||
|
117 111 2 1 7 4
|
||||||
|
31 29 12 23
|
||||||
|
118 111 2 1 7 4
|
||||||
|
31 30 9 25
|
||||||
|
119 111 2 1 7 4
|
||||||
|
21 1 19 17
|
||||||
|
120 111 2 1 7 4
|
||||||
|
29 19 27 28
|
||||||
|
121 111 2 1 7 4
|
||||||
|
10 22 26 30
|
||||||
|
122 111 2 1 7 4
|
||||||
|
29 28 26 21
|
||||||
|
123 111 2 1 7 4
|
||||||
|
7 20 15 24
|
||||||
|
124 111 2 1 7 4
|
||||||
|
11 22 26 6
|
||||||
|
125 111 2 1 7 4
|
||||||
|
29 28 27 30
|
||||||
|
126 111 2 1 7 4
|
||||||
|
31 23 12 14
|
||||||
|
127 111 2 1 7 4
|
||||||
|
26 25 29 13
|
||||||
|
128 111 2 1 7 4
|
||||||
|
15 27 31 20
|
||||||
|
129 111 2 1 7 4
|
||||||
|
21 19 29 28
|
||||||
|
130 111 2 1 7 4
|
||||||
|
18 3 23 20
|
||||||
|
131 111 2 1 7 4
|
||||||
|
15 20 31 24
|
||||||
|
132 111 2 1 7 4
|
||||||
|
27 31 29 30
|
||||||
|
133 111 2 1 7 4
|
||||||
|
31 14 9 24
|
||||||
|
134 111 2 1 7 4
|
||||||
|
31 9 14 25
|
||||||
|
135 111 2 1 7 4
|
||||||
|
31 14 12 25
|
||||||
|
136 111 2 1 7 4
|
||||||
|
31 23 14 24
|
||||||
|
-1
|
||||||
|
-1
|
||||||
|
2467
|
||||||
|
0 0 0 0 0 0 0 10
|
||||||
|
outlet
|
||||||
|
8 70 0 0 8 67 0 0
|
||||||
|
8 68 0 0 8 71 0 0
|
||||||
|
8 76 0 0 8 66 0 0
|
||||||
|
8 72 0 0 8 73 0 0
|
||||||
|
8 74 0 0 8 65 0 0
|
||||||
|
1 0 0 0 0 0 0 12
|
||||||
|
inlet
|
||||||
|
8 36 0 0 8 30 0 0
|
||||||
|
8 31 0 0 8 37 0 0
|
||||||
|
8 34 0 0 8 38 0 0
|
||||||
|
8 33 0 0 8 35 0 0
|
||||||
|
8 32 0 0 8 29 0 0
|
||||||
|
8 39 0 0 8 40 0 0
|
||||||
|
2 0 0 0 0 0 0 12
|
||||||
|
nodes
|
||||||
|
7 2 0 0 7 4 0 0
|
||||||
|
7 6 0 0 7 8 0 0
|
||||||
|
7 9 0 0 7 10 0 0
|
||||||
|
7 11 0 0 7 12 0 0
|
||||||
|
7 13 0 0 7 14 0 0
|
||||||
|
7 25 0 0 7 26 0 0
|
||||||
|
-1
|
||||||
@ -94,7 +94,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
noFailedChecks += checkGeometry(mesh, allGeometry);
|
noFailedChecks += checkGeometry(mesh, allGeometry);
|
||||||
|
|
||||||
reduce(noFailedChecks, sumOp<label>());
|
// Note: no reduction in noFailedChecks necessary since is
|
||||||
|
// counter of checks, not counter of failed cells,faces etc.
|
||||||
|
|
||||||
if (noFailedChecks == 0)
|
if (noFailedChecks == 0)
|
||||||
{
|
{
|
||||||
@ -112,8 +113,6 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nFailedChecks = checkGeometry(mesh, allGeometry);
|
label nFailedChecks = checkGeometry(mesh, allGeometry);
|
||||||
|
|
||||||
reduce(nFailedChecks, sumOp<label>());
|
|
||||||
|
|
||||||
if (nFailedChecks)
|
if (nFailedChecks)
|
||||||
{
|
{
|
||||||
Info<< "\nFailed " << nFailedChecks << " mesh checks.\n"
|
Info<< "\nFailed " << nFailedChecks << " mesh checks.\n"
|
||||||
|
|||||||
@ -121,7 +121,7 @@ void Foam::SIBS::solve
|
|||||||
kMax_ = kOpt_;
|
kMax_ = kOpt_;
|
||||||
}
|
}
|
||||||
|
|
||||||
label k=0;
|
label k = 0;
|
||||||
scalar h = hTry;
|
scalar h = hTry;
|
||||||
yTemp_ = y;
|
yTemp_ = y;
|
||||||
|
|
||||||
@ -213,7 +213,7 @@ void Foam::SIBS::solve
|
|||||||
|
|
||||||
x = xNew_;
|
x = xNew_;
|
||||||
hDid = h;
|
hDid = h;
|
||||||
first_=0;
|
first_ = 0;
|
||||||
scalar wrkmin = GREAT;
|
scalar wrkmin = GREAT;
|
||||||
scalar scale = 1.0;
|
scalar scale = 1.0;
|
||||||
|
|
||||||
|
|||||||
@ -27,7 +27,7 @@ License
|
|||||||
#include "mapDistribute.H"
|
#include "mapDistribute.H"
|
||||||
#include "commSchedule.H"
|
#include "commSchedule.H"
|
||||||
#include "HashSet.H"
|
#include "HashSet.H"
|
||||||
#include "ListOps.H"
|
#include "globalIndex.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -257,6 +257,292 @@ Foam::mapDistribute::mapDistribute
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::mapDistribute::mapDistribute
|
||||||
|
(
|
||||||
|
const globalIndex& globalNumbering,
|
||||||
|
labelList& elements,
|
||||||
|
List<Map<label> >& compactMap
|
||||||
|
)
|
||||||
|
:
|
||||||
|
constructSize_(0),
|
||||||
|
schedulePtr_()
|
||||||
|
{
|
||||||
|
// 1. Construct per processor compact addressing of the global elements
|
||||||
|
// needed. The ones from the local processor are not included since
|
||||||
|
// these are always all needed.
|
||||||
|
compactMap.setSize(Pstream::nProcs());
|
||||||
|
{
|
||||||
|
// Count all (non-local) elements needed. Just for presizing map.
|
||||||
|
labelList nNonLocal(Pstream::nProcs(), 0);
|
||||||
|
|
||||||
|
forAll(elements, i)
|
||||||
|
{
|
||||||
|
label globalIndex = elements[i];
|
||||||
|
|
||||||
|
if (!globalNumbering.isLocal(globalIndex))
|
||||||
|
{
|
||||||
|
label procI = globalNumbering.whichProcID(globalIndex);
|
||||||
|
nNonLocal[procI]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(compactMap, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
compactMap[procI].resize(2*nNonLocal[procI]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Collect all (non-local) elements needed.
|
||||||
|
forAll(elements, i)
|
||||||
|
{
|
||||||
|
label globalIndex = elements[i];
|
||||||
|
|
||||||
|
if (!globalNumbering.isLocal(globalIndex))
|
||||||
|
{
|
||||||
|
label procI = globalNumbering.whichProcID(globalIndex);
|
||||||
|
label index = globalNumbering.toLocal(procI, globalIndex);
|
||||||
|
label nCompact = compactMap[procI].size();
|
||||||
|
compactMap[procI].insert(index, nCompact);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//// Sort remote elements needed (not really necessary)
|
||||||
|
//forAll(compactMap, procI)
|
||||||
|
//{
|
||||||
|
// if (procI != Pstream::myProcNo())
|
||||||
|
// {
|
||||||
|
// Map<label>& globalMap = compactMap[procI];
|
||||||
|
//
|
||||||
|
// SortableList<label> sorted(globalMap.toc().xfer());
|
||||||
|
//
|
||||||
|
// forAll(sorted, i)
|
||||||
|
// {
|
||||||
|
// Map<label>::iterator iter = globalMap.find(sorted[i]);
|
||||||
|
// iter() = i;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. The overall compact addressing is
|
||||||
|
// - myProcNo data first (uncompacted)
|
||||||
|
// - all other processors consecutively
|
||||||
|
|
||||||
|
labelList compactStart(Pstream::nProcs());
|
||||||
|
compactStart[Pstream::myProcNo()] = 0;
|
||||||
|
constructSize_ = globalNumbering.localSize();
|
||||||
|
forAll(compactStart, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
compactStart[procI] = constructSize_;
|
||||||
|
constructSize_ += compactMap[procI].size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 3. Find out what to receive/send in compact addressing.
|
||||||
|
|
||||||
|
// What I want to receive is what others have to send
|
||||||
|
labelListList wantedRemoteElements(Pstream::nProcs());
|
||||||
|
// Compact addressing for received data
|
||||||
|
constructMap_.setSize(Pstream::nProcs());
|
||||||
|
forAll(compactMap, procI)
|
||||||
|
{
|
||||||
|
if (procI == Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
// All my own elements are used
|
||||||
|
label nLocal = globalNumbering.localSize();
|
||||||
|
wantedRemoteElements[procI] = identity(nLocal);
|
||||||
|
constructMap_[procI] = identity(nLocal);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Remote elements wanted from processor procI
|
||||||
|
labelList& remoteElem = wantedRemoteElements[procI];
|
||||||
|
labelList& localElem = constructMap_[procI];
|
||||||
|
remoteElem.setSize(compactMap[procI].size());
|
||||||
|
localElem.setSize(compactMap[procI].size());
|
||||||
|
label i = 0;
|
||||||
|
forAllIter(Map<label>, compactMap[procI], iter)
|
||||||
|
{
|
||||||
|
remoteElem[i] = iter.key();
|
||||||
|
label compactI = compactStart[procI]+iter();
|
||||||
|
localElem[i] = compactI;
|
||||||
|
iter() = compactI;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subMap_.setSize(Pstream::nProcs());
|
||||||
|
exchange(wantedRemoteElements, subMap_);
|
||||||
|
|
||||||
|
// Renumber elements
|
||||||
|
forAll(elements, i)
|
||||||
|
{
|
||||||
|
elements[i] = renumber(globalNumbering, compactMap, elements[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::mapDistribute::mapDistribute
|
||||||
|
(
|
||||||
|
const globalIndex& globalNumbering,
|
||||||
|
labelListList& cellCells,
|
||||||
|
List<Map<label> >& compactMap
|
||||||
|
)
|
||||||
|
:
|
||||||
|
constructSize_(0),
|
||||||
|
schedulePtr_()
|
||||||
|
{
|
||||||
|
// 1. Construct per processor compact addressing of the global elements
|
||||||
|
// needed. The ones from the local processor are not included since
|
||||||
|
// these are always all needed.
|
||||||
|
compactMap.setSize(Pstream::nProcs());
|
||||||
|
{
|
||||||
|
// Count all (non-local) elements needed. Just for presizing map.
|
||||||
|
labelList nNonLocal(Pstream::nProcs(), 0);
|
||||||
|
|
||||||
|
forAll(cellCells, cellI)
|
||||||
|
{
|
||||||
|
const labelList& cCells = cellCells[cellI];
|
||||||
|
|
||||||
|
forAll(cCells, i)
|
||||||
|
{
|
||||||
|
label globalIndex = cCells[i];
|
||||||
|
|
||||||
|
if (!globalNumbering.isLocal(globalIndex))
|
||||||
|
{
|
||||||
|
label procI = globalNumbering.whichProcID(globalIndex);
|
||||||
|
nNonLocal[procI]++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
forAll(compactMap, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
compactMap[procI].resize(2*nNonLocal[procI]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Collect all (non-local) elements needed.
|
||||||
|
|
||||||
|
|
||||||
|
// Collect all (non-local) elements needed.
|
||||||
|
forAll(cellCells, cellI)
|
||||||
|
{
|
||||||
|
const labelList& cCells = cellCells[cellI];
|
||||||
|
|
||||||
|
forAll(cCells, i)
|
||||||
|
{
|
||||||
|
label globalIndex = cCells[i];
|
||||||
|
|
||||||
|
if (!globalNumbering.isLocal(globalIndex))
|
||||||
|
{
|
||||||
|
label procI = globalNumbering.whichProcID(globalIndex);
|
||||||
|
label index = globalNumbering.toLocal(procI, globalIndex);
|
||||||
|
label nCompact = compactMap[procI].size();
|
||||||
|
compactMap[procI].insert(index, nCompact);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//// Sort remote elements needed (not really necessary)
|
||||||
|
//forAll(compactMap, procI)
|
||||||
|
//{
|
||||||
|
// if (procI != Pstream::myProcNo())
|
||||||
|
// {
|
||||||
|
// Map<label>& globalMap = compactMap[procI];
|
||||||
|
//
|
||||||
|
// SortableList<label> sorted(globalMap.toc().xfer());
|
||||||
|
//
|
||||||
|
// forAll(sorted, i)
|
||||||
|
// {
|
||||||
|
// Map<label>::iterator iter = globalMap.find(sorted[i]);
|
||||||
|
// iter() = i;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 2. The overall compact addressing is
|
||||||
|
// - myProcNo data first (uncompacted)
|
||||||
|
// - all other processors consecutively
|
||||||
|
|
||||||
|
labelList compactStart(Pstream::nProcs());
|
||||||
|
compactStart[Pstream::myProcNo()] = 0;
|
||||||
|
constructSize_ = globalNumbering.localSize();
|
||||||
|
forAll(compactStart, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
compactStart[procI] = constructSize_;
|
||||||
|
constructSize_ += compactMap[procI].size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 3. Find out what to receive/send in compact addressing.
|
||||||
|
|
||||||
|
// What I want to receive is what others have to send
|
||||||
|
labelListList wantedRemoteElements(Pstream::nProcs());
|
||||||
|
// Compact addressing for received data
|
||||||
|
constructMap_.setSize(Pstream::nProcs());
|
||||||
|
forAll(compactMap, procI)
|
||||||
|
{
|
||||||
|
if (procI == Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
// All my own elements are used
|
||||||
|
label nLocal = globalNumbering.localSize();
|
||||||
|
wantedRemoteElements[procI] = identity(nLocal);
|
||||||
|
constructMap_[procI] = identity(nLocal);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Remote elements wanted from processor procI
|
||||||
|
labelList& remoteElem = wantedRemoteElements[procI];
|
||||||
|
labelList& localElem = constructMap_[procI];
|
||||||
|
remoteElem.setSize(compactMap[procI].size());
|
||||||
|
localElem.setSize(compactMap[procI].size());
|
||||||
|
label i = 0;
|
||||||
|
forAllIter(Map<label>, compactMap[procI], iter)
|
||||||
|
{
|
||||||
|
remoteElem[i] = iter.key();
|
||||||
|
label compactI = compactStart[procI]+iter();
|
||||||
|
localElem[i] = compactI;
|
||||||
|
iter() = compactI;
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
subMap_.setSize(Pstream::nProcs());
|
||||||
|
exchange(wantedRemoteElements, subMap_);
|
||||||
|
|
||||||
|
// Renumber elements
|
||||||
|
forAll(cellCells, cellI)
|
||||||
|
{
|
||||||
|
labelList& cCells = cellCells[cellI];
|
||||||
|
|
||||||
|
forAll(cCells, i)
|
||||||
|
{
|
||||||
|
cCells[i] = renumber(globalNumbering, compactMap, cCells[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::mapDistribute::mapDistribute(const mapDistribute& map)
|
Foam::mapDistribute::mapDistribute(const mapDistribute& map)
|
||||||
:
|
:
|
||||||
constructSize_(map.constructSize_),
|
constructSize_(map.constructSize_),
|
||||||
@ -266,7 +552,27 @@ Foam::mapDistribute::mapDistribute(const mapDistribute& map)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::label Foam::mapDistribute::renumber
|
||||||
|
(
|
||||||
|
const globalIndex& globalNumbering,
|
||||||
|
const List<Map<label> >& compactMap,
|
||||||
|
const label globalI
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (globalNumbering.isLocal(globalI))
|
||||||
|
{
|
||||||
|
return globalNumbering.toLocal(globalI);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
label procI = globalNumbering.whichProcID(globalI);
|
||||||
|
label index = globalNumbering.toLocal(procI, globalI);
|
||||||
|
return compactMap[procI][index];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::mapDistribute::compact(const boolList& elemIsUsed)
|
void Foam::mapDistribute::compact(const boolList& elemIsUsed)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -39,6 +39,16 @@ Note:
|
|||||||
Note2: number of items send on one processor have to equal the number
|
Note2: number of items send on one processor have to equal the number
|
||||||
of items received on the other processor.
|
of items received on the other processor.
|
||||||
|
|
||||||
|
Constructors using compact numbering: all my own elements first
|
||||||
|
(whether used or not) followed by used-only remote elements.
|
||||||
|
So e.g 4 procs and on proc 1 the compact
|
||||||
|
table will first have all globalIndex.localSize() elements from proc1
|
||||||
|
followed by used-only elements of proc0, proc2, proc3.
|
||||||
|
The constructed mapDistribute sends the local elements from and
|
||||||
|
receives the remote elements into their compact position.
|
||||||
|
compactMap[procI] is the position of elements from procI in the compact
|
||||||
|
map. compactMap[myProcNo()] is empty since trivial addressing. The indices
|
||||||
|
into compactMap[procI] are local, not global, indices.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
mapDistribute.C
|
mapDistribute.C
|
||||||
@ -52,6 +62,7 @@ SourceFiles
|
|||||||
#include "labelPair.H"
|
#include "labelPair.H"
|
||||||
#include "Pstream.H"
|
#include "Pstream.H"
|
||||||
#include "boolList.H"
|
#include "boolList.H"
|
||||||
|
#include "Map.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -59,6 +70,7 @@ namespace Foam
|
|||||||
{
|
{
|
||||||
|
|
||||||
class mapPolyMesh;
|
class mapPolyMesh;
|
||||||
|
class globalIndex;
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class mapDistribute Declaration
|
Class mapDistribute Declaration
|
||||||
@ -81,6 +93,15 @@ class mapDistribute
|
|||||||
mutable autoPtr<List<labelPair> > schedulePtr_;
|
mutable autoPtr<List<labelPair> > schedulePtr_;
|
||||||
|
|
||||||
|
|
||||||
|
//- Exchange data. sendBuf[procI] : data to send to processor procI
|
||||||
|
// To be moved into Pstream.
|
||||||
|
template<class T>
|
||||||
|
static void exchange
|
||||||
|
(
|
||||||
|
const List<List<T> >& sendBuf,
|
||||||
|
List<List<T> >& recvBuf
|
||||||
|
);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Public classes
|
// Public classes
|
||||||
@ -123,6 +144,27 @@ public:
|
|||||||
const labelList& recvProcs
|
const labelList& recvProcs
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Construct from list of (possibly) remote elements in globalIndex
|
||||||
|
// numbering. Determines compact numbering (see above) and
|
||||||
|
// distribute map to get data into this ordering and renumbers the
|
||||||
|
// elements to be in compact numbering.
|
||||||
|
mapDistribute
|
||||||
|
(
|
||||||
|
const globalIndex&,
|
||||||
|
labelList& elements,
|
||||||
|
List<Map<label> >& compactMap
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Special variant that works with the into sorted into bins
|
||||||
|
// according to local indices. E.g. think cellCells where
|
||||||
|
// cellCells[localCellI] is a list of global cells
|
||||||
|
mapDistribute
|
||||||
|
(
|
||||||
|
const globalIndex&,
|
||||||
|
labelListList& cellCells,
|
||||||
|
List<Map<label> >& compactMap
|
||||||
|
);
|
||||||
|
|
||||||
//- Construct copy
|
//- Construct copy
|
||||||
mapDistribute(const mapDistribute&);
|
mapDistribute(const mapDistribute&);
|
||||||
|
|
||||||
@ -180,6 +222,15 @@ public:
|
|||||||
|
|
||||||
// Other
|
// Other
|
||||||
|
|
||||||
|
//- Helper for construct from globalIndex. Renumbers element
|
||||||
|
// (in globalIndex numbering) into compact indices.
|
||||||
|
static label renumber
|
||||||
|
(
|
||||||
|
const globalIndex&,
|
||||||
|
const List<Map<label> >& compactMap,
|
||||||
|
const label globalElement
|
||||||
|
);
|
||||||
|
|
||||||
//- Compact maps. Gets per field a bool whether it is used (locally)
|
//- Compact maps. Gets per field a bool whether it is used (locally)
|
||||||
// and works out itself what this side and sender side can remove
|
// and works out itself what this side and sender side can remove
|
||||||
// from maps.
|
// from maps.
|
||||||
|
|||||||
@ -886,4 +886,78 @@ void Foam::mapDistribute::distribute
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class T>
|
||||||
|
void Foam::mapDistribute::exchange
|
||||||
|
(
|
||||||
|
const List<List<T> >& sendBuf,
|
||||||
|
List<List<T> >& recvBuf
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (!contiguous<T>())
|
||||||
|
{
|
||||||
|
FatalErrorIn("mapDistribute::exchange(..)")
|
||||||
|
<< "Not contiguous" << exit(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Pstream::parRun())
|
||||||
|
{
|
||||||
|
|
||||||
|
// Determine sizes
|
||||||
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
labelListList allNTrans(Pstream::nProcs());
|
||||||
|
allNTrans[Pstream::myProcNo()].setSize(Pstream::nProcs());
|
||||||
|
|
||||||
|
forAll(allNTrans, procI)
|
||||||
|
{
|
||||||
|
allNTrans[Pstream::myProcNo()][procI] = sendBuf[procI].size();
|
||||||
|
}
|
||||||
|
combineReduce(allNTrans, listEq());
|
||||||
|
|
||||||
|
|
||||||
|
// Set up receives
|
||||||
|
// ~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
recvBuf.setSize(Pstream::nProcs());
|
||||||
|
forAll(recvBuf, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
recvBuf[procI].setSize(allNTrans[procI][Pstream::myProcNo()]);
|
||||||
|
IPstream::read
|
||||||
|
(
|
||||||
|
Pstream::nonBlocking,
|
||||||
|
procI,
|
||||||
|
reinterpret_cast<char*>(recvBuf[procI].begin()),
|
||||||
|
recvBuf[procI].byteSize()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up sends
|
||||||
|
// ~~~~~~~~~~~~
|
||||||
|
|
||||||
|
forAll(sendBuf, procI)
|
||||||
|
{
|
||||||
|
if (procI != Pstream::myProcNo())
|
||||||
|
{
|
||||||
|
OPstream::write
|
||||||
|
(
|
||||||
|
Pstream::nonBlocking,
|
||||||
|
procI,
|
||||||
|
reinterpret_cast<const char*>(sendBuf[procI].begin()),
|
||||||
|
sendBuf[procI].byteSize()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Wait for completion
|
||||||
|
Pstream::waitRequests();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Do myself
|
||||||
|
recvBuf[Pstream::myProcNo()] = sendBuf[Pstream::myProcNo()];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -39,10 +39,10 @@ if (mesh.nInternalFaces())
|
|||||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi());
|
mesh.surfaceInterpolation::deltaCoeffs()*mag(mesh.phi());
|
||||||
|
|
||||||
meshCoNum = max(SfUfbyDelta/mesh.magSf())
|
meshCoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanMeshCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Mesh Courant Number mean: " << meanMeshCoNum
|
Info<< "Mesh Courant Number mean: " << meanMeshCoNum
|
||||||
|
|||||||
@ -119,7 +119,7 @@ void fvMotionSolverEngineMesh::move()
|
|||||||
|
|
||||||
|
|
||||||
pistonPosition_.value() += deltaZ;
|
pistonPosition_.value() += deltaZ;
|
||||||
scalar pistonSpeed = deltaZ/engineDB_.deltaT().value();
|
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
|
||||||
|
|
||||||
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
|
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
|
||||||
<< "Piston speed = " << pistonSpeed << " m/s" << endl;
|
<< "Piston speed = " << pistonSpeed << " m/s" << endl;
|
||||||
|
|||||||
@ -121,7 +121,7 @@ void layeredEngineMesh::move()
|
|||||||
}
|
}
|
||||||
|
|
||||||
pistonPosition_.value() += deltaZ;
|
pistonPosition_.value() += deltaZ;
|
||||||
scalar pistonSpeed = deltaZ/engineDB_.deltaT().value();
|
scalar pistonSpeed = deltaZ/engineDB_.deltaTValue();
|
||||||
|
|
||||||
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
|
Info<< "clearance: " << deckHeight_.value() - pistonPosition_.value() << nl
|
||||||
<< "Piston speed = " << pistonSpeed << " m/s" << endl;
|
<< "Piston speed = " << pistonSpeed << " m/s" << endl;
|
||||||
|
|||||||
@ -165,7 +165,7 @@ Foam::scalar Foam::engineTime::thetaRevolution() const
|
|||||||
|
|
||||||
Foam::scalar Foam::engineTime::deltaTheta() const
|
Foam::scalar Foam::engineTime::deltaTheta() const
|
||||||
{
|
{
|
||||||
return timeToDeg(deltaT().value());
|
return timeToDeg(deltaTValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ Foam::dimensionedScalar Foam::engineTime::pistonSpeed() const
|
|||||||
(
|
(
|
||||||
"pistonSpeed",
|
"pistonSpeed",
|
||||||
dimVelocity,
|
dimVelocity,
|
||||||
pistonDisplacement().value()/(deltaT().value() + VSMALL)
|
pistonDisplacement().value()/(deltaTValue() + VSMALL)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -208,7 +208,7 @@ Foam::scalar Foam::engineValve::curVelocity() const
|
|||||||
lift(engineDB_.theta() - engineDB_.deltaTheta()),
|
lift(engineDB_.theta() - engineDB_.deltaTheta()),
|
||||||
minLift_
|
minLift_
|
||||||
)
|
)
|
||||||
)/(engineDB_.deltaT().value() + VSMALL);
|
)/(engineDB_.deltaTValue() + VSMALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -106,7 +106,7 @@ const labelList& ignitionSite::cells() const
|
|||||||
bool ignitionSite::igniting() const
|
bool ignitionSite::igniting() const
|
||||||
{
|
{
|
||||||
scalar curTime = db_.value();
|
scalar curTime = db_.value();
|
||||||
scalar deltaT = db_.deltaT().value();
|
scalar deltaT = db_.deltaTValue();
|
||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
@ -120,7 +120,7 @@ bool ignitionSite::igniting() const
|
|||||||
bool ignitionSite::ignited() const
|
bool ignitionSite::ignited() const
|
||||||
{
|
{
|
||||||
scalar curTime = db_.value();
|
scalar curTime = db_.value();
|
||||||
scalar deltaT = db_.deltaT().value();
|
scalar deltaT = db_.deltaTValue();
|
||||||
|
|
||||||
return(curTime - deltaT >= time_);
|
return(curTime - deltaT >= time_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,10 +39,10 @@ if (mesh.nInternalFaces())
|
|||||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi)/fvc::interpolate(rho);
|
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi)/fvc::interpolate(rho);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Courant Number mean: " << meanCoNum
|
Info<< "Courant Number mean: " << meanCoNum
|
||||||
|
|||||||
@ -180,7 +180,7 @@ Foam::timeActivatedExplicitMulticomponentPointSource::Su
|
|||||||
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
||||||
|
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
const scalar dt = runTime_.deltaT().value();
|
const scalar dt = runTime_.deltaTValue();
|
||||||
|
|
||||||
forAll(pointSources_, sourceI)
|
forAll(pointSources_, sourceI)
|
||||||
{
|
{
|
||||||
@ -240,7 +240,7 @@ Foam::timeActivatedExplicitMulticomponentPointSource::Su()
|
|||||||
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
DimensionedField<scalar, volMesh>& sourceField = tSource();
|
||||||
|
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
const scalar dt = runTime_.deltaT().value();
|
const scalar dt = runTime_.deltaTValue();
|
||||||
|
|
||||||
forAll(pointSources_, sourceI)
|
forAll(pointSources_, sourceI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -41,12 +41,12 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
deltaTFact*runTime.deltaT().value(),
|
deltaTFact*runTime.deltaTValue(),
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "deltaT = " << runTime.deltaT().value() << endl;
|
Info<< "deltaT = " << runTime.deltaTValue() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if (adjustTimeStep)
|
|||||||
(
|
(
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
maxCo*runTime.deltaT().value()/CoNum,
|
maxCo*runTime.deltaTValue()/CoNum,
|
||||||
maxDeltaT
|
maxDeltaT
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -4,12 +4,12 @@
|
|||||||
// Backward Differencing in time.
|
// Backward Differencing in time.
|
||||||
|
|
||||||
conserve.internalField() +=
|
conserve.internalField() +=
|
||||||
(1.0 - mesh.V0()/mesh.V())/runTime.deltaT().value();
|
(1.0 - mesh.V0()/mesh.V())/runTime.deltaTValue();
|
||||||
|
|
||||||
scalar sumLocalContErr = runTime.deltaT().value()*
|
scalar sumLocalContErr = runTime.deltaTValue()*
|
||||||
mag(conserve)().weightedAverage(mesh.V()).value();
|
mag(conserve)().weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
scalar globalContErr = runTime.deltaT().value()*
|
scalar globalContErr = runTime.deltaTValue()*
|
||||||
conserve.weightedAverage(mesh.V()).value();
|
conserve.weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
Info<< "volume continuity errors : sum local = " << sumLocalContErr
|
Info<< "volume continuity errors : sum local = " << sumLocalContErr
|
||||||
|
|||||||
@ -39,10 +39,10 @@ if (mesh.nInternalFaces())
|
|||||||
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
|
mesh.surfaceInterpolation::deltaCoeffs()*mag(phi);
|
||||||
|
|
||||||
CoNum = max(SfUfbyDelta/mesh.magSf())
|
CoNum = max(SfUfbyDelta/mesh.magSf())
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
|
|
||||||
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
meanCoNum = (sum(SfUfbyDelta)/sum(mesh.magSf()))
|
||||||
.value()*runTime.deltaT().value();
|
.value()*runTime.deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Courant Number mean: " << meanCoNum
|
Info<< "Courant Number mean: " << meanCoNum
|
||||||
|
|||||||
@ -33,10 +33,10 @@ Description
|
|||||||
{
|
{
|
||||||
volScalarField contErr = fvc::div(phi);
|
volScalarField contErr = fvc::div(phi);
|
||||||
|
|
||||||
scalar sumLocalContErr = runTime.deltaT().value()*
|
scalar sumLocalContErr = runTime.deltaTValue()*
|
||||||
mag(contErr)().weightedAverage(mesh.V()).value();
|
mag(contErr)().weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
scalar globalContErr = runTime.deltaT().value()*
|
scalar globalContErr = runTime.deltaTValue()*
|
||||||
contErr.weightedAverage(mesh.V()).value();
|
contErr.weightedAverage(mesh.V()).value();
|
||||||
cumulativeContErr += globalContErr;
|
cumulativeContErr += globalContErr;
|
||||||
|
|
||||||
|
|||||||
@ -33,10 +33,10 @@ Description
|
|||||||
{
|
{
|
||||||
volScalarField contErr = fvc::div(phi + fvc::meshPhi(U));
|
volScalarField contErr = fvc::div(phi + fvc::meshPhi(U));
|
||||||
|
|
||||||
scalar sumLocalContErr = runTime.deltaT().value()*
|
scalar sumLocalContErr = runTime.deltaTValue()*
|
||||||
mag(contErr)().weightedAverage(mesh.V()).value();
|
mag(contErr)().weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
scalar globalContErr = runTime.deltaT().value()*
|
scalar globalContErr = runTime.deltaTValue()*
|
||||||
contErr.weightedAverage(mesh.V()).value();
|
contErr.weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
cumulativeContErr += globalContErr;
|
cumulativeContErr += globalContErr;
|
||||||
|
|||||||
@ -32,11 +32,11 @@ Description
|
|||||||
|
|
||||||
if (mesh.moving())
|
if (mesh.moving())
|
||||||
{
|
{
|
||||||
scalar sumLocalContErr = runTime.deltaT().value()*
|
scalar sumLocalContErr = runTime.deltaTValue()*
|
||||||
mag(fvc::div(phi + fvc::meshPhi(rho, U)))()
|
mag(fvc::div(phi + fvc::meshPhi(rho, U)))()
|
||||||
.weightedAverage(mesh.V()).value();
|
.weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
scalar globalContErr = runTime.deltaT().value()*
|
scalar globalContErr = runTime.deltaTValue()*
|
||||||
fvc::div(phi + fvc::meshPhi(rho, U))()
|
fvc::div(phi + fvc::meshPhi(rho, U))()
|
||||||
.weightedAverage(mesh.V()).value();
|
.weightedAverage(mesh.V()).value();
|
||||||
|
|
||||||
|
|||||||
@ -223,7 +223,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
openFraction_
|
openFraction_
|
||||||
+ max
|
+ max
|
||||||
(
|
(
|
||||||
this->db().time().deltaT().value()/openingTime_,
|
this->db().time().deltaTValue()/openingTime_,
|
||||||
maxOpenFractionDelta_
|
maxOpenFractionDelta_
|
||||||
)
|
)
|
||||||
*(orientation_*sign(forceDiff)),
|
*(orientation_*sign(forceDiff)),
|
||||||
|
|||||||
@ -202,7 +202,7 @@ void advectiveFvPatchField<Type>::updateCoeffs()
|
|||||||
this->dimensionedInternalField().mesh()
|
this->dimensionedInternalField().mesh()
|
||||||
.ddtScheme(this->dimensionedInternalField().name())
|
.ddtScheme(this->dimensionedInternalField().name())
|
||||||
);
|
);
|
||||||
scalar deltaT = this->db().time().deltaT().value();
|
scalar deltaT = this->db().time().deltaTValue();
|
||||||
|
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& field =
|
const GeometricField<Type, fvPatchField, volMesh>& field =
|
||||||
this->db().objectRegistry::
|
this->db().objectRegistry::
|
||||||
|
|||||||
@ -112,7 +112,7 @@ void movingWallVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
oldFc[i] = pp[i].centre(oldPoints);
|
oldFc[i] = pp[i].centre(oldPoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaT().value();
|
vectorField Up = (pp.faceCentres() - oldFc)/mesh.time().deltaTValue();
|
||||||
|
|
||||||
const volVectorField& U = db().lookupObject<volVectorField>("U");
|
const volVectorField& U = db().lookupObject<volVectorField>("U");
|
||||||
scalarField phip =
|
scalarField phip =
|
||||||
|
|||||||
@ -196,7 +196,7 @@ void syringePressureFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
scalar t = db().time().value();
|
scalar t = db().time().value();
|
||||||
scalar deltaT = db().time().deltaT().value();
|
scalar deltaT = db().time().deltaTValue();
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
const surfaceScalarField& phi =
|
||||||
db().lookupObject<surfaceScalarField>("phi");
|
db().lookupObject<surfaceScalarField>("phi");
|
||||||
|
|||||||
@ -59,8 +59,8 @@ EulerD2dt2Scheme<Type>::fvcD2dt2
|
|||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar deltaT = mesh().time().deltaT().value();
|
scalar deltaT = mesh().time().deltaTValue();
|
||||||
scalar deltaT0 = mesh().time().deltaT0().value();
|
scalar deltaT0 = mesh().time().deltaT0Value();
|
||||||
|
|
||||||
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
||||||
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
||||||
@ -137,8 +137,8 @@ EulerD2dt2Scheme<Type>::fvcD2dt2
|
|||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
);
|
);
|
||||||
|
|
||||||
scalar deltaT = mesh().time().deltaT().value();
|
scalar deltaT = mesh().time().deltaTValue();
|
||||||
scalar deltaT0 = mesh().time().deltaT0().value();
|
scalar deltaT0 = mesh().time().deltaT0Value();
|
||||||
|
|
||||||
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
||||||
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
||||||
@ -246,8 +246,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2
|
|||||||
|
|
||||||
fvMatrix<Type>& fvm = tfvm();
|
fvMatrix<Type>& fvm = tfvm();
|
||||||
|
|
||||||
scalar deltaT = mesh().time().deltaT().value();
|
scalar deltaT = mesh().time().deltaTValue();
|
||||||
scalar deltaT0 = mesh().time().deltaT0().value();
|
scalar deltaT0 = mesh().time().deltaT0Value();
|
||||||
|
|
||||||
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
||||||
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
||||||
@ -307,8 +307,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2
|
|||||||
|
|
||||||
fvMatrix<Type>& fvm = tfvm();
|
fvMatrix<Type>& fvm = tfvm();
|
||||||
|
|
||||||
scalar deltaT = mesh().time().deltaT().value();
|
scalar deltaT = mesh().time().deltaTValue();
|
||||||
scalar deltaT0 = mesh().time().deltaT0().value();
|
scalar deltaT0 = mesh().time().deltaT0Value();
|
||||||
|
|
||||||
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
||||||
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
||||||
@ -368,8 +368,8 @@ EulerD2dt2Scheme<Type>::fvmD2dt2
|
|||||||
|
|
||||||
fvMatrix<Type>& fvm = tfvm();
|
fvMatrix<Type>& fvm = tfvm();
|
||||||
|
|
||||||
scalar deltaT = mesh().time().deltaT().value();
|
scalar deltaT = mesh().time().deltaTValue();
|
||||||
scalar deltaT0 = mesh().time().deltaT0().value();
|
scalar deltaT0 = mesh().time().deltaT0Value();
|
||||||
|
|
||||||
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
scalar coefft = (deltaT + deltaT0)/(2*deltaT);
|
||||||
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
scalar coefft00 = (deltaT + deltaT0)/(2*deltaT0);
|
||||||
|
|||||||
@ -276,7 +276,7 @@ EulerDdtScheme<Type>::fvmDdt
|
|||||||
|
|
||||||
fvMatrix<Type>& fvm = tfvm();
|
fvMatrix<Type>& fvm = tfvm();
|
||||||
|
|
||||||
scalar rDeltaT = 1.0/mesh().time().deltaT().value();
|
scalar rDeltaT = 1.0/mesh().time().deltaTValue();
|
||||||
|
|
||||||
fvm.diag() = rDeltaT*mesh().V();
|
fvm.diag() = rDeltaT*mesh().V();
|
||||||
|
|
||||||
@ -311,7 +311,7 @@ EulerDdtScheme<Type>::fvmDdt
|
|||||||
);
|
);
|
||||||
fvMatrix<Type>& fvm = tfvm();
|
fvMatrix<Type>& fvm = tfvm();
|
||||||
|
|
||||||
scalar rDeltaT = 1.0/mesh().time().deltaT().value();
|
scalar rDeltaT = 1.0/mesh().time().deltaTValue();
|
||||||
|
|
||||||
fvm.diag() = rDeltaT*rho.value()*mesh().V();
|
fvm.diag() = rDeltaT*rho.value()*mesh().V();
|
||||||
|
|
||||||
@ -348,7 +348,7 @@ EulerDdtScheme<Type>::fvmDdt
|
|||||||
);
|
);
|
||||||
fvMatrix<Type>& fvm = tfvm();
|
fvMatrix<Type>& fvm = tfvm();
|
||||||
|
|
||||||
scalar rDeltaT = 1.0/mesh().time().deltaT().value();
|
scalar rDeltaT = 1.0/mesh().time().deltaTValue();
|
||||||
|
|
||||||
fvm.diag() = rDeltaT*rho.internalField()*mesh().V();
|
fvm.diag() = rDeltaT*rho.internalField()*mesh().V();
|
||||||
|
|
||||||
|
|||||||
@ -44,14 +44,14 @@ namespace fv
|
|||||||
template<class Type>
|
template<class Type>
|
||||||
scalar backwardDdtScheme<Type>::deltaT_() const
|
scalar backwardDdtScheme<Type>::deltaT_() const
|
||||||
{
|
{
|
||||||
return mesh().time().deltaT().value();
|
return mesh().time().deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
scalar backwardDdtScheme<Type>::deltaT0_() const
|
scalar backwardDdtScheme<Type>::deltaT0_() const
|
||||||
{
|
{
|
||||||
return mesh().time().deltaT0().value();
|
return mesh().time().deltaT0Value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -42,13 +42,13 @@ namespace fv
|
|||||||
|
|
||||||
scalar boundedBackwardDdtScheme::deltaT_() const
|
scalar boundedBackwardDdtScheme::deltaT_() const
|
||||||
{
|
{
|
||||||
return mesh().time().deltaT().value();
|
return mesh().time().deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
scalar boundedBackwardDdtScheme::deltaT0_() const
|
scalar boundedBackwardDdtScheme::deltaT0_() const
|
||||||
{
|
{
|
||||||
return mesh().time().deltaT0().value();
|
return mesh().time().deltaT0Value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -99,7 +99,7 @@ void Foam::MULES::explicitSolve
|
|||||||
|
|
||||||
scalarField& psiIf = psi;
|
scalarField& psiIf = psi;
|
||||||
const scalarField& psi0 = psi.oldTime();
|
const scalarField& psi0 = psi.oldTime();
|
||||||
const scalar deltaT = mesh.time().deltaT().value();
|
const scalar deltaT = mesh.time().deltaTValue();
|
||||||
|
|
||||||
psiIf = 0.0;
|
psiIf = 0.0;
|
||||||
fvc::surfaceIntegrate(psiIf, phiPsi);
|
fvc::surfaceIntegrate(psiIf, phiPsi);
|
||||||
@ -328,7 +328,7 @@ void Foam::MULES::limiter
|
|||||||
const unallocLabelList& owner = mesh.owner();
|
const unallocLabelList& owner = mesh.owner();
|
||||||
const unallocLabelList& neighb = mesh.neighbour();
|
const unallocLabelList& neighb = mesh.neighbour();
|
||||||
const scalarField& V = mesh.V();
|
const scalarField& V = mesh.V();
|
||||||
const scalar deltaT = mesh.time().deltaT().value();
|
const scalar deltaT = mesh.time().deltaTValue();
|
||||||
|
|
||||||
const scalarField& phiBDIf = phiBD;
|
const scalarField& phiBDIf = phiBD;
|
||||||
const surfaceScalarField::GeometricBoundaryField& phiBDBf =
|
const surfaceScalarField::GeometricBoundaryField& phiBDBf =
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class centredCPCCellToFaceStencilObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("centredCFCCellToFaceStencil");
|
TypeName("centredCPCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class centredFECCellToFaceStencilObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("centredCFCCellToFaceStencil");
|
TypeName("centredFECCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class upwindCECCellToFaceStencilObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCCellToFaceStencil");
|
TypeName("upwindCECCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class upwindCPCCellToFaceStencilObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCCellToFaceStencil");
|
TypeName("upwindCPCCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
|||||||
@ -55,7 +55,7 @@ class upwindFECCellToFaceStencilObject
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
TypeName("upwindCFCCellToFaceStencil");
|
TypeName("upwindFECCellToFaceStencil");
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
|
|||||||
@ -93,202 +93,6 @@ void Foam::extendedCellToFaceStencil::writeStencilStats
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Foam::autoPtr<Foam::mapDistribute>
|
|
||||||
Foam::extendedCellToFaceStencil::calcDistributeMap
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const globalIndex& globalNumbering,
|
|
||||||
labelListList& faceStencil
|
|
||||||
)
|
|
||||||
{
|
|
||||||
// Convert stencil to schedule
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
// We now know what information we need from other processors. This needs
|
|
||||||
// to be converted into what information I need to send as well
|
|
||||||
// (mapDistribute)
|
|
||||||
|
|
||||||
|
|
||||||
// 1. Construct per processor compact addressing of the global cells
|
|
||||||
// needed. The ones from the local processor are not included since
|
|
||||||
// these are always all needed.
|
|
||||||
List<Map<label> > globalToProc(Pstream::nProcs());
|
|
||||||
{
|
|
||||||
const labelList& procPatchMap = mesh.globalData().procPatchMap();
|
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
|
||||||
|
|
||||||
// Presize with (as estimate) size of patch to neighbour.
|
|
||||||
forAll(procPatchMap, procI)
|
|
||||||
{
|
|
||||||
if (procPatchMap[procI] != -1)
|
|
||||||
{
|
|
||||||
globalToProc[procI].resize
|
|
||||||
(
|
|
||||||
patches[procPatchMap[procI]].size()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Collect all (non-local) globalcells/faces needed.
|
|
||||||
forAll(faceStencil, faceI)
|
|
||||||
{
|
|
||||||
const labelList& stencilCells = faceStencil[faceI];
|
|
||||||
|
|
||||||
forAll(stencilCells, i)
|
|
||||||
{
|
|
||||||
label globalCellI = stencilCells[i];
|
|
||||||
label procI = globalNumbering.whichProcID(stencilCells[i]);
|
|
||||||
|
|
||||||
if (procI != Pstream::myProcNo())
|
|
||||||
{
|
|
||||||
label nCompact = globalToProc[procI].size();
|
|
||||||
globalToProc[procI].insert(globalCellI, nCompact);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Sort global cells needed (not really necessary)
|
|
||||||
forAll(globalToProc, procI)
|
|
||||||
{
|
|
||||||
if (procI != Pstream::myProcNo())
|
|
||||||
{
|
|
||||||
Map<label>& globalMap = globalToProc[procI];
|
|
||||||
|
|
||||||
SortableList<label> sorted(globalMap.toc().xfer());
|
|
||||||
|
|
||||||
forAll(sorted, i)
|
|
||||||
{
|
|
||||||
Map<label>::iterator iter = globalMap.find(sorted[i]);
|
|
||||||
iter() = i;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//forAll(globalToProc, procI)
|
|
||||||
//{
|
|
||||||
// Pout<< "From processor:" << procI << " want cells/faces:" << endl;
|
|
||||||
// forAllConstIter(Map<label>, globalToProc[procI], iter)
|
|
||||||
// {
|
|
||||||
// Pout<< " global:" << iter.key()
|
|
||||||
// << " local:" << globalNumbering.toLocal(procI, iter.key())
|
|
||||||
// << endl;
|
|
||||||
// }
|
|
||||||
// Pout<< endl;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 2. The overall compact addressing is
|
|
||||||
// - myProcNo data first (uncompacted)
|
|
||||||
// - all other processors consecutively
|
|
||||||
|
|
||||||
labelList compactStart(Pstream::nProcs());
|
|
||||||
compactStart[Pstream::myProcNo()] = 0;
|
|
||||||
label nCompact = globalNumbering.localSize();
|
|
||||||
forAll(compactStart, procI)
|
|
||||||
{
|
|
||||||
if (procI != Pstream::myProcNo())
|
|
||||||
{
|
|
||||||
compactStart[procI] = nCompact;
|
|
||||||
nCompact += globalToProc[procI].size();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 3. Find out what to receive/send in compact addressing.
|
|
||||||
labelListList recvCompact(Pstream::nProcs());
|
|
||||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
|
||||||
{
|
|
||||||
if (procI != Pstream::myProcNo())
|
|
||||||
{
|
|
||||||
labelList wantedGlobals(globalToProc[procI].size());
|
|
||||||
recvCompact[procI].setSize(globalToProc[procI].size());
|
|
||||||
|
|
||||||
label i = 0;
|
|
||||||
forAllConstIter(Map<label>, globalToProc[procI], iter)
|
|
||||||
{
|
|
||||||
wantedGlobals[i] = iter.key();
|
|
||||||
recvCompact[procI][i] = compactStart[procI]+iter();
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send the global cell numbers I need from procI
|
|
||||||
OPstream str(Pstream::blocking, procI);
|
|
||||||
str << wantedGlobals;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
recvCompact[procI] =
|
|
||||||
compactStart[procI]
|
|
||||||
+ identity(globalNumbering.localSize());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
labelListList sendCompact(Pstream::nProcs());
|
|
||||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
|
||||||
{
|
|
||||||
if (procI != Pstream::myProcNo())
|
|
||||||
{
|
|
||||||
// See what neighbour wants to receive (= what I need to send)
|
|
||||||
|
|
||||||
IPstream str(Pstream::blocking, procI);
|
|
||||||
labelList globalCells(str);
|
|
||||||
|
|
||||||
labelList& procCompact = sendCompact[procI];
|
|
||||||
procCompact.setSize(globalCells.size());
|
|
||||||
|
|
||||||
// Convert from globalCells (all on my processor!) into compact
|
|
||||||
// addressing
|
|
||||||
forAll(globalCells, i)
|
|
||||||
{
|
|
||||||
label cellI = globalNumbering.toLocal(globalCells[i]);
|
|
||||||
procCompact[i] = compactStart[Pstream::myProcNo()]+cellI;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sendCompact[procI] = recvCompact[procI];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert stencil to compact numbering
|
|
||||||
forAll(faceStencil, faceI)
|
|
||||||
{
|
|
||||||
labelList& stencilCells = faceStencil[faceI];
|
|
||||||
|
|
||||||
forAll(stencilCells, i)
|
|
||||||
{
|
|
||||||
label globalCellI = stencilCells[i];
|
|
||||||
label procI = globalNumbering.whichProcID(globalCellI);
|
|
||||||
if (procI != Pstream::myProcNo())
|
|
||||||
{
|
|
||||||
label localCompact = globalToProc[procI][globalCellI];
|
|
||||||
stencilCells[i] = compactStart[procI]+localCompact;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
label localCompact = globalNumbering.toLocal(globalCellI);
|
|
||||||
stencilCells[i] = compactStart[procI]+localCompact;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Constuct map for distribution of compact data.
|
|
||||||
autoPtr<mapDistribute> mapPtr
|
|
||||||
(
|
|
||||||
new mapDistribute
|
|
||||||
(
|
|
||||||
nCompact,
|
|
||||||
sendCompact.xfer(),
|
|
||||||
recvCompact.xfer()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
return mapPtr;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
|
Foam::extendedCellToFaceStencil::extendedCellToFaceStencil(const polyMesh& mesh)
|
||||||
|
|||||||
@ -112,14 +112,6 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
//- Calculate distribute map
|
|
||||||
static autoPtr<mapDistribute> calcDistributeMap
|
|
||||||
(
|
|
||||||
const polyMesh& mesh,
|
|
||||||
const globalIndex& globalNumbering,
|
|
||||||
labelListList& faceStencil
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Use map to get the data into stencil order
|
//- Use map to get the data into stencil order
|
||||||
template<class T>
|
template<class T>
|
||||||
static void collectData
|
static void collectData
|
||||||
|
|||||||
@ -35,16 +35,19 @@ Foam::extendedCentredCellToFaceStencil::extendedCentredCellToFaceStencil
|
|||||||
const cellToFaceStencil& stencil
|
const cellToFaceStencil& stencil
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
extendedCellToFaceStencil(stencil.mesh())
|
extendedCellToFaceStencil(stencil.mesh()),
|
||||||
|
stencil_(stencil)
|
||||||
{
|
{
|
||||||
stencil_ = stencil;
|
|
||||||
|
|
||||||
// Calculate distribute map (also renumbers elements in stencil)
|
// Calculate distribute map (also renumbers elements in stencil)
|
||||||
mapPtr_ = calcDistributeMap
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
|
mapPtr_.reset
|
||||||
(
|
(
|
||||||
stencil.mesh(),
|
new mapDistribute
|
||||||
stencil.globalNumbering(),
|
(
|
||||||
stencil_
|
stencil.globalNumbering(),
|
||||||
|
stencil_,
|
||||||
|
compactMap
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -419,19 +419,32 @@ Foam::extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil
|
|||||||
neiStencil_
|
neiStencil_
|
||||||
);
|
);
|
||||||
|
|
||||||
ownMapPtr_ = calcDistributeMap
|
{
|
||||||
(
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
stencil.mesh(),
|
ownMapPtr_.reset
|
||||||
stencil.globalNumbering(),
|
(
|
||||||
ownStencil_
|
new mapDistribute
|
||||||
);
|
(
|
||||||
|
stencil.globalNumbering(),
|
||||||
|
ownStencil_,
|
||||||
|
compactMap
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
neiMapPtr_ = calcDistributeMap
|
{
|
||||||
(
|
|
||||||
stencil.mesh(),
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
stencil.globalNumbering(),
|
neiMapPtr_.reset
|
||||||
neiStencil_
|
(
|
||||||
);
|
new mapDistribute
|
||||||
|
(
|
||||||
|
stencil.globalNumbering(),
|
||||||
|
neiStencil_,
|
||||||
|
compactMap
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// stencil now in compact form
|
// stencil now in compact form
|
||||||
if (pureUpwind_)
|
if (pureUpwind_)
|
||||||
@ -515,12 +528,18 @@ Foam::extendedUpwindCellToFaceStencil::extendedUpwindCellToFaceStencil
|
|||||||
|
|
||||||
ownStencil_ = stencil;
|
ownStencil_ = stencil;
|
||||||
|
|
||||||
ownMapPtr_ = calcDistributeMap
|
{
|
||||||
(
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
stencil.mesh(),
|
ownMapPtr_.reset
|
||||||
stencil.globalNumbering(),
|
(
|
||||||
ownStencil_
|
new mapDistribute
|
||||||
);
|
(
|
||||||
|
stencil.globalNumbering(),
|
||||||
|
ownStencil_,
|
||||||
|
compactMap
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const fvMesh& mesh = dynamic_cast<const fvMesh&>(stencil.mesh());
|
const fvMesh& mesh = dynamic_cast<const fvMesh&>(stencil.mesh());
|
||||||
|
|
||||||
|
|||||||
@ -28,9 +28,6 @@ License
|
|||||||
#include "extendedCentredFaceToCellStencil.H"
|
#include "extendedCentredFaceToCellStencil.H"
|
||||||
#include "faceToCellStencil.H"
|
#include "faceToCellStencil.H"
|
||||||
|
|
||||||
// Only for access to calcDistributeMap <- needs to be moved out
|
|
||||||
#include "extendedCellToFaceStencil.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::extendedCentredFaceToCellStencil::extendedCentredFaceToCellStencil
|
Foam::extendedCentredFaceToCellStencil::extendedCentredFaceToCellStencil
|
||||||
@ -38,16 +35,19 @@ Foam::extendedCentredFaceToCellStencil::extendedCentredFaceToCellStencil
|
|||||||
const faceToCellStencil& stencil
|
const faceToCellStencil& stencil
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
extendedFaceToCellStencil(stencil.mesh())
|
extendedFaceToCellStencil(stencil.mesh()),
|
||||||
|
stencil_(stencil)
|
||||||
{
|
{
|
||||||
stencil_ = stencil;
|
|
||||||
|
|
||||||
// Calculate distribute map (also renumbers elements in stencil)
|
// Calculate distribute map (also renumbers elements in stencil)
|
||||||
mapPtr_ = extendedCellToFaceStencil::calcDistributeMap
|
List<Map<label> > compactMap(Pstream::nProcs());
|
||||||
|
mapPtr_.reset
|
||||||
(
|
(
|
||||||
stencil.mesh(),
|
new mapDistribute
|
||||||
stencil.globalNumbering(),
|
(
|
||||||
stencil_
|
stencil.globalNumbering(),
|
||||||
|
stencil_,
|
||||||
|
compactMap
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -576,7 +576,7 @@ Foam::tmp<Foam::scalarField> Foam::fvMesh::movePoints(const pointField& p)
|
|||||||
|
|
||||||
// Move the polyMesh and set the mesh motion fluxes to the swept-volumes
|
// Move the polyMesh and set the mesh motion fluxes to the swept-volumes
|
||||||
|
|
||||||
scalar rDeltaT = 1.0/time().deltaT().value();
|
scalar rDeltaT = 1.0/time().deltaTValue();
|
||||||
|
|
||||||
tmp<scalarField> tsweptVols = polyMesh::movePoints(p);
|
tmp<scalarField> tsweptVols = polyMesh::movePoints(p);
|
||||||
scalarField& sweptVols = tsweptVols();
|
scalarField& sweptVols = tsweptVols();
|
||||||
|
|||||||
@ -142,7 +142,7 @@ Foam::velocityComponentLaplacianFvMotionSolver::curPoints() const
|
|||||||
(
|
(
|
||||||
cmpt_,
|
cmpt_,
|
||||||
tcurPoints().component(cmpt_)
|
tcurPoints().component(cmpt_)
|
||||||
+ fvMesh_.time().deltaT().value()*pointMotionU_.internalField()
|
+ fvMesh_.time().deltaTValue()*pointMotionU_.internalField()
|
||||||
);
|
);
|
||||||
|
|
||||||
twoDCorrectPoints(tcurPoints());
|
twoDCorrectPoints(tcurPoints());
|
||||||
|
|||||||
@ -112,7 +112,7 @@ Foam::velocityLaplacianFvMotionSolver::curPoints() const
|
|||||||
tmp<pointField> tcurPoints
|
tmp<pointField> tcurPoints
|
||||||
(
|
(
|
||||||
fvMesh_.points()
|
fvMesh_.points()
|
||||||
+ fvMesh_.time().deltaT().value()*pointMotionU_.internalField()
|
+ fvMesh_.time().deltaTValue()*pointMotionU_.internalField()
|
||||||
);
|
);
|
||||||
|
|
||||||
twoDCorrectPoints(tcurPoints());
|
twoDCorrectPoints(tcurPoints());
|
||||||
|
|||||||
@ -146,7 +146,7 @@ void angularOscillatingVelocityPointPatchVectorField::updateCoeffs()
|
|||||||
+ (axisHat ^ p0Rel*sin(angle))
|
+ (axisHat ^ p0Rel*sin(angle))
|
||||||
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
|
+ (axisHat & p0Rel)*(1 - cos(angle))*axisHat
|
||||||
- p.localPoints()
|
- p.localPoints()
|
||||||
)/t.deltaT().value()
|
)/t.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::updateCoeffs();
|
fixedValuePointPatchField<vector>::updateCoeffs();
|
||||||
|
|||||||
@ -125,7 +125,7 @@ void oscillatingVelocityPointPatchVectorField::updateCoeffs()
|
|||||||
Field<vector>::operator=
|
Field<vector>::operator=
|
||||||
(
|
(
|
||||||
(p0_ + amplitude_*sin(omega_*t.value()) - p.localPoints())
|
(p0_ + amplitude_*sin(omega_*t.value()) - p.localPoints())
|
||||||
/t.deltaT().value()
|
/t.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
fixedValuePointPatchField<vector>::updateCoeffs();
|
fixedValuePointPatchField<vector>::updateCoeffs();
|
||||||
|
|||||||
@ -129,7 +129,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
// calculate the forces on the motion object from this data, then
|
// calculate the forces on the motion object from this data, then
|
||||||
// update the positions
|
// update the positions
|
||||||
|
|
||||||
motion_.updatePosition(t.deltaT().value());
|
motion_.updatePosition(t.deltaTValue());
|
||||||
|
|
||||||
dictionary forcesDict;
|
dictionary forcesDict;
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
(
|
(
|
||||||
fm.first().first() + fm.first().second() + gravity*motion_.mass(),
|
fm.first().first() + fm.first().second() + gravity*motion_.mass(),
|
||||||
fm.second().first() + fm.second().second(),
|
fm.second().first() + fm.second().second(),
|
||||||
t.deltaT().value()
|
t.deltaTValue()
|
||||||
);
|
);
|
||||||
|
|
||||||
Field<vector>::operator=(motion_.generatePositions(p0_) - p0_);
|
Field<vector>::operator=(motion_.generatePositions(p0_) - p0_);
|
||||||
|
|||||||
@ -64,7 +64,7 @@ void surfaceDisplacementPointPatchVectorField::calcProjection
|
|||||||
const pointField& localPoints = patch().localPoints();
|
const pointField& localPoints = patch().localPoints();
|
||||||
const labelList& meshPoints = patch().meshPoints();
|
const labelList& meshPoints = patch().meshPoints();
|
||||||
|
|
||||||
//const scalar deltaT = mesh.time().deltaT().value();
|
//const scalar deltaT = mesh.time().deltaTValue();
|
||||||
|
|
||||||
// Construct large enough vector in direction of projectDir so
|
// Construct large enough vector in direction of projectDir so
|
||||||
// we're guaranteed to hit something.
|
// we're guaranteed to hit something.
|
||||||
@ -451,7 +451,7 @@ void surfaceDisplacementPointPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
// Clip offset to maximum displacement possible: velocity*timestep
|
// Clip offset to maximum displacement possible: velocity*timestep
|
||||||
|
|
||||||
const scalar deltaT = mesh.time().deltaT().value();
|
const scalar deltaT = mesh.time().deltaTValue();
|
||||||
const vector clipVelocity = velocity_*deltaT;
|
const vector clipVelocity = velocity_*deltaT;
|
||||||
|
|
||||||
forAll(displacement, i)
|
forAll(displacement, i)
|
||||||
|
|||||||
@ -63,7 +63,7 @@ void surfaceSlipDisplacementPointPatchVectorField::calcProjection
|
|||||||
const pointField& localPoints = patch().localPoints();
|
const pointField& localPoints = patch().localPoints();
|
||||||
const labelList& meshPoints = patch().meshPoints();
|
const labelList& meshPoints = patch().meshPoints();
|
||||||
|
|
||||||
//const scalar deltaT = mesh.time().deltaT().value();
|
//const scalar deltaT = mesh.time().deltaTValue();
|
||||||
|
|
||||||
// Construct large enough vector in direction of projectDir so
|
// Construct large enough vector in direction of projectDir so
|
||||||
// we're guaranteed to hit something.
|
// we're guaranteed to hit something.
|
||||||
|
|||||||
@ -373,7 +373,7 @@ inline Foam::scalar Foam::Particle<ParticleType>::currentTime() const
|
|||||||
{
|
{
|
||||||
return
|
return
|
||||||
cloud_.pMesh().time().value()
|
cloud_.pMesh().time().value()
|
||||||
+ stepFraction_*cloud_.pMesh().time().deltaT().value();
|
+ stepFraction_*cloud_.pMesh().time().deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -100,7 +100,7 @@ bool Foam::parcel::move(spray& sDB)
|
|||||||
|
|
||||||
const liquidMixture& fuels = sDB.fuels();
|
const liquidMixture& fuels = sDB.fuels();
|
||||||
|
|
||||||
scalar deltaT = sDB.runTime().deltaT().value();
|
scalar deltaT = sDB.runTime().deltaTValue();
|
||||||
label Nf = fuels.components().size();
|
label Nf = fuels.components().size();
|
||||||
label Ns = sDB.composition().Y().size();
|
label Ns = sDB.composition().Y().size();
|
||||||
|
|
||||||
|
|||||||
@ -157,7 +157,7 @@ inline tmp<volVectorField> spray::momentumSource() const
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
tsource().internalField() = sms_/runTime_.deltaT().value()/mesh_.V();
|
tsource().internalField() = sms_/runTime_.deltaTValue()/mesh_.V();
|
||||||
|
|
||||||
return tsource;
|
return tsource;
|
||||||
}
|
}
|
||||||
@ -185,7 +185,7 @@ inline tmp<volScalarField> spray::evaporationSource(const label si) const
|
|||||||
if (isLiquidFuel_[si])
|
if (isLiquidFuel_[si])
|
||||||
{
|
{
|
||||||
label fi = gasToLiquidIndex_[si];
|
label fi = gasToLiquidIndex_[si];
|
||||||
tsource().internalField() = srhos_[fi]/runTime_.deltaT().value()/mesh_.V();
|
tsource().internalField() = srhos_[fi]/runTime_.deltaTValue()/mesh_.V();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -216,7 +216,7 @@ inline tmp<volScalarField> spray::heatTransferSource() const
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
tsource().internalField() = shs_/runTime_.deltaT().value()/mesh_.V();
|
tsource().internalField() = shs_/runTime_.deltaTValue()/mesh_.V();
|
||||||
|
|
||||||
return tsource;
|
return tsource;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,7 @@ void spray::inject()
|
|||||||
// deltaT is the duration of injection during this timestep
|
// deltaT is the duration of injection during this timestep
|
||||||
scalar deltaT = min
|
scalar deltaT = min
|
||||||
(
|
(
|
||||||
runTime_.deltaT().value(),
|
runTime_.deltaTValue(),
|
||||||
min
|
min
|
||||||
(
|
(
|
||||||
time - it->tsoi(),
|
time - it->tsoi(),
|
||||||
@ -150,8 +150,8 @@ void spray::inject()
|
|||||||
scalar dt = time - toi;
|
scalar dt = time - toi;
|
||||||
|
|
||||||
pPtr->stepFraction() =
|
pPtr->stepFraction() =
|
||||||
(runTime_.deltaT().value() - dt)
|
(runTime_.deltaTValue() - dt)
|
||||||
/runTime_.deltaT().value();
|
/runTime_.deltaTValue();
|
||||||
|
|
||||||
bool keepParcel = pPtr->move(*this);
|
bool keepParcel = pPtr->move(*this);
|
||||||
|
|
||||||
|
|||||||
@ -58,7 +58,7 @@ void spray::evolve()
|
|||||||
|
|
||||||
calculateAmbientPressure();
|
calculateAmbientPressure();
|
||||||
calculateAmbientTemperature();
|
calculateAmbientTemperature();
|
||||||
collisions().collideParcels(runTime_.deltaT().value());
|
collisions().collideParcels(runTime_.deltaTValue());
|
||||||
move();
|
move();
|
||||||
dispersion().disperseParcels();
|
dispersion().disperseParcels();
|
||||||
inject();
|
inject();
|
||||||
@ -103,7 +103,7 @@ void spray::breakupLoop()
|
|||||||
breakup().updateParcelProperties
|
breakup().updateParcelProperties
|
||||||
(
|
(
|
||||||
elmnt(),
|
elmnt(),
|
||||||
runTime_.deltaT().value(),
|
runTime_.deltaTValue(),
|
||||||
velocity,
|
velocity,
|
||||||
fuels_
|
fuels_
|
||||||
);
|
);
|
||||||
@ -111,7 +111,7 @@ void spray::breakupLoop()
|
|||||||
breakup().breakupParcel
|
breakup().breakupParcel
|
||||||
(
|
(
|
||||||
elmnt(),
|
elmnt(),
|
||||||
runTime_.deltaT().value(),
|
runTime_.deltaTValue(),
|
||||||
velocity,
|
velocity,
|
||||||
fuels_
|
fuels_
|
||||||
);
|
);
|
||||||
@ -137,7 +137,7 @@ void spray::atomizationLoop()
|
|||||||
atomization().atomizeParcel
|
atomization().atomizeParcel
|
||||||
(
|
(
|
||||||
elmnt(),
|
elmnt(),
|
||||||
runTime_.deltaT().value(),
|
runTime_.deltaTValue(),
|
||||||
velocity,
|
velocity,
|
||||||
fuels_
|
fuels_
|
||||||
);
|
);
|
||||||
|
|||||||
@ -72,7 +72,7 @@ void gradientDispersionRAS::disperseParcels() const
|
|||||||
|
|
||||||
const scalar cps = 0.16432;
|
const scalar cps = 0.16432;
|
||||||
|
|
||||||
scalar dt = spray_.runTime().deltaT().value();
|
scalar dt = spray_.runTime().deltaTValue();
|
||||||
const volScalarField& k = turbulence().k();
|
const volScalarField& k = turbulence().k();
|
||||||
volVectorField gradk = fvc::grad(k);
|
volVectorField gradk = fvc::grad(k);
|
||||||
const volScalarField& epsilon = turbulence().epsilon();
|
const volScalarField& epsilon = turbulence().epsilon();
|
||||||
|
|||||||
@ -73,7 +73,7 @@ void stochasticDispersionRAS::disperseParcels() const
|
|||||||
const scalar cps = 0.16432;
|
const scalar cps = 0.16432;
|
||||||
const vector one(1.0, 1.0, 1.0);
|
const vector one(1.0, 1.0, 1.0);
|
||||||
|
|
||||||
scalar dt = spray_.runTime().deltaT().value();
|
scalar dt = spray_.runTime().deltaTValue();
|
||||||
const volScalarField& k = turbulence().k();
|
const volScalarField& k = turbulence().k();
|
||||||
//volVectorField gradk = fvc::grad(k);
|
//volVectorField gradk = fvc::grad(k);
|
||||||
const volScalarField& epsilon = turbulence().epsilon();
|
const volScalarField& epsilon = turbulence().epsilon();
|
||||||
|
|||||||
@ -104,7 +104,7 @@ bool reflectParcel::wallTreatment
|
|||||||
vector Ub1 = U_.boundaryField()[patchi][facei];
|
vector Ub1 = U_.boundaryField()[patchi][facei];
|
||||||
vector Ub0 = U_.oldTime().boundaryField()[patchi][facei];
|
vector Ub0 = U_.oldTime().boundaryField()[patchi][facei];
|
||||||
|
|
||||||
scalar dt = spray_.runTime().deltaT().value();
|
scalar dt = spray_.runTime().deltaTValue();
|
||||||
const vectorField& oldPoints = mesh.oldPoints();
|
const vectorField& oldPoints = mesh.oldPoints();
|
||||||
|
|
||||||
const vector& Cf1 = mesh.faceCentres()[globalFacei];
|
const vector& Cf1 = mesh.faceCentres()[globalFacei];
|
||||||
|
|||||||
@ -128,7 +128,7 @@ inline Foam::Random& Foam::DsmcCloud<ParcelType>::rndGen()
|
|||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
inline void Foam::DsmcCloud<ParcelType>::storeDeltaT()
|
inline void Foam::DsmcCloud<ParcelType>::storeDeltaT()
|
||||||
{
|
{
|
||||||
cachedDeltaT_ = mesh().time().deltaT().value();
|
cachedDeltaT_ = mesh().time().deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,6 +47,7 @@ $(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C
|
|||||||
/* bolt-on models */
|
/* bolt-on models */
|
||||||
submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
|
submodels/addOns/radiation/absorptionEmission/cloudAbsorptionEmission/cloudAbsorptionEmission.C
|
||||||
submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
|
submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C
|
||||||
|
submodels/Kinematic/PatchInteractionModel/LocalInteraction/patchInteractionData.C
|
||||||
|
|
||||||
|
|
||||||
/* data entries */
|
/* data entries */
|
||||||
|
|||||||
@ -167,7 +167,7 @@ void Foam::KinematicCloud<ParcelType>::checkParcelProperties
|
|||||||
parcel.rho() = constProps_.rho0();
|
parcel.rho() = constProps_.rho0();
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar carrierDt = this->db().time().deltaT().value();
|
scalar carrierDt = this->db().time().deltaTValue();
|
||||||
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
|
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -84,7 +84,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
this->mesh(),
|
this->mesh(),
|
||||||
dimensionedScalar("zero", dimensionSet(1, 2, -2, 0, 0), 0.0)
|
dimensionedScalar("zero", dimEnergy, 0.0)
|
||||||
),
|
),
|
||||||
hcTrans_
|
hcTrans_
|
||||||
(
|
(
|
||||||
@ -98,7 +98,7 @@ Foam::ThermoCloud<ParcelType>::ThermoCloud
|
|||||||
false
|
false
|
||||||
),
|
),
|
||||||
this->mesh(),
|
this->mesh(),
|
||||||
dimensionedScalar("zero", dimensionSet(1, 2, -2, 0, 0), 0.0)
|
dimensionedScalar("zero", dimEnergy, 0.0)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (readFields)
|
||||||
|
|||||||
@ -226,7 +226,7 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
|
|||||||
const polyMesh& mesh = td.cloud().pMesh();
|
const polyMesh& mesh = td.cloud().pMesh();
|
||||||
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
|
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
|
||||||
|
|
||||||
const scalar deltaT = mesh.time().deltaT().value();
|
const scalar deltaT = mesh.time().deltaTValue();
|
||||||
scalar tEnd = (1.0 - p.stepFraction())*deltaT;
|
scalar tEnd = (1.0 - p.stepFraction())*deltaT;
|
||||||
const scalar dtMax = tEnd;
|
const scalar dtMax = tEnd;
|
||||||
|
|
||||||
@ -286,7 +286,13 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
|
|||||||
ParcelType& p = static_cast<ParcelType&>(*this);
|
ParcelType& p = static_cast<ParcelType&>(*this);
|
||||||
td.cloud().postProcessing().postPatch(p, patchI);
|
td.cloud().postProcessing().postPatch(p, patchI);
|
||||||
|
|
||||||
return td.cloud().patchInteraction().correct(pp, this->face(), U_);
|
return td.cloud().patchInteraction().correct
|
||||||
|
(
|
||||||
|
pp,
|
||||||
|
this->face(),
|
||||||
|
td.keepParticle,
|
||||||
|
U_
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -462,15 +462,21 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
|
|||||||
{
|
{
|
||||||
const label idc =
|
const label idc =
|
||||||
td.cloud().composition().localToGlobalCarrierId(idPhase, i);
|
td.cloud().composition().localToGlobalCarrierId(idPhase, i);
|
||||||
const scalar hv = td.cloud().mcCarrierThermo().speciesData()[idc].H(T);
|
|
||||||
|
|
||||||
const label idl = td.cloud().composition().globalIds(idPhase)[i];
|
const label idl = td.cloud().composition().globalIds(idPhase)[i];
|
||||||
const scalar hl =
|
|
||||||
td.cloud().composition().liquids().properties()[idl].h(pc_, T);
|
|
||||||
|
|
||||||
// Enthalphy transfer to carrier phase
|
const scalar hv = td.cloud().mcCarrierThermo().speciesData()[idc].H(Ts);
|
||||||
|
const scalar hl =
|
||||||
|
td.cloud().composition().liquids().properties()[idl].h(pc_, Ts);
|
||||||
|
|
||||||
|
// Enthalphy transfer to carrier phase - method 1 using enthalpy diff
|
||||||
Sh += dMassPC[i]*(hl - hv)/dt;
|
Sh += dMassPC[i]*(hl - hv)/dt;
|
||||||
|
|
||||||
|
// Enthalphy transfer to carrier phase - method 2 using latent heat
|
||||||
|
// const scalar hl =
|
||||||
|
// td.cloud().composition().liquids().properties()[idl].hl(pc_, Ts);
|
||||||
|
// Sh -= dMassPC[i]*hl/dt;
|
||||||
|
|
||||||
|
// Update particle surface thermo properties
|
||||||
const scalar Dab =
|
const scalar Dab =
|
||||||
td.cloud().composition().liquids().properties()[idl].D(pc_, Ts, Wc);
|
td.cloud().composition().liquids().properties()[idl].D(pc_, Ts, Wc);
|
||||||
|
|
||||||
|
|||||||
@ -351,7 +351,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const scalar time = owner_.db().time().value();
|
const scalar time = owner_.db().time().value();
|
||||||
const scalar carrierDt = owner_.db().time().deltaT().value();
|
const scalar carrierDt = owner_.db().time().deltaTValue();
|
||||||
const polyMesh& mesh = owner_.mesh();
|
const polyMesh& mesh = owner_.mesh();
|
||||||
|
|
||||||
// Prepare for next time step
|
// Prepare for next time step
|
||||||
|
|||||||
@ -26,7 +26,7 @@ License
|
|||||||
|
|
||||||
#include "LocalInteraction.H"
|
#include "LocalInteraction.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template <class CloudType>
|
template <class CloudType>
|
||||||
Foam::label Foam::LocalInteraction<CloudType>::applyToPatch
|
Foam::label Foam::LocalInteraction<CloudType>::applyToPatch
|
||||||
@ -46,7 +46,7 @@ Foam::label Foam::LocalInteraction<CloudType>::applyToPatch
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template <class CloudType>
|
template <class CloudType>
|
||||||
Foam::LocalInteraction<CloudType>::LocalInteraction
|
Foam::LocalInteraction<CloudType>::LocalInteraction
|
||||||
@ -62,6 +62,7 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
|||||||
const polyMesh& mesh = cloud.mesh();
|
const polyMesh& mesh = cloud.mesh();
|
||||||
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
|
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();
|
||||||
|
|
||||||
|
// check that user patches are valid region patches
|
||||||
forAll(patchData_, patchI)
|
forAll(patchData_, patchI)
|
||||||
{
|
{
|
||||||
const word& patchName = patchData_[patchI].patchName();
|
const word& patchName = patchData_[patchI].patchName();
|
||||||
@ -70,7 +71,7 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
|||||||
{
|
{
|
||||||
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
|
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
|
||||||
<< "Patch " << patchName << " not found. Available patches "
|
<< "Patch " << patchName << " not found. Available patches "
|
||||||
<< "are: " << bMesh.names() << exit(FatalError);
|
<< "are: " << bMesh.names() << nl << exit(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,6 +96,26 @@ Foam::LocalInteraction<CloudType>::LocalInteraction
|
|||||||
<< "interaction. Please specify data for patches:" << nl
|
<< "interaction. Please specify data for patches:" << nl
|
||||||
<< badWalls << nl << exit(FatalError);
|
<< badWalls << nl << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// check that interactions are valid/specified
|
||||||
|
forAll(patchData_, patchI)
|
||||||
|
{
|
||||||
|
const word& interactionTypeName =
|
||||||
|
patchData_[patchI].interactionTypeName();
|
||||||
|
const typename PatchInteractionModel<CloudType>::interactionType& it =
|
||||||
|
this->wordToInteractionType(interactionTypeName);
|
||||||
|
|
||||||
|
if (it == PatchInteractionModel<CloudType>::itOther)
|
||||||
|
{
|
||||||
|
const word& patchName = patchData_[patchI].patchName();
|
||||||
|
FatalErrorIn("LocalInteraction(const dictionary&, CloudType&)")
|
||||||
|
<< "Unknown patch interaction type "
|
||||||
|
<< interactionTypeName << " for patch " << patchName
|
||||||
|
<< ". Valid selections are:"
|
||||||
|
<< this->PatchInteractionModel<CloudType>::interactionTypeNames_
|
||||||
|
<< nl << exit(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -105,7 +126,7 @@ Foam::LocalInteraction<CloudType>::~LocalInteraction()
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
bool Foam::LocalInteraction<CloudType>::active() const
|
bool Foam::LocalInteraction<CloudType>::active() const
|
||||||
@ -119,6 +140,7 @@ bool Foam::LocalInteraction<CloudType>::correct
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
@ -126,18 +148,64 @@ bool Foam::LocalInteraction<CloudType>::correct
|
|||||||
|
|
||||||
if (patchI >= 0)
|
if (patchI >= 0)
|
||||||
{
|
{
|
||||||
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
|
typename PatchInteractionModel<CloudType>::interactionType it =
|
||||||
nw /= mag(nw);
|
this->wordToInteractionType
|
||||||
|
(
|
||||||
|
patchData_[patchI].interactionTypeName()
|
||||||
|
);
|
||||||
|
|
||||||
scalar Un = U & nw;
|
switch (it)
|
||||||
vector Ut = U - Un*nw;
|
|
||||||
|
|
||||||
if (Un > 0)
|
|
||||||
{
|
{
|
||||||
U -= (1.0 + patchData_[patchI].e())*Un*nw;
|
case PatchInteractionModel<CloudType>::itEscape:
|
||||||
}
|
{
|
||||||
|
keepParticle = false;
|
||||||
|
U = vector::zero;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PatchInteractionModel<CloudType>::itStick:
|
||||||
|
{
|
||||||
|
keepParticle = true;
|
||||||
|
U = vector::zero;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PatchInteractionModel<CloudType>::itRebound:
|
||||||
|
{
|
||||||
|
keepParticle = true;
|
||||||
|
|
||||||
U -= patchData_[patchI].mu()*Ut;
|
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
|
||||||
|
nw /= mag(nw);
|
||||||
|
|
||||||
|
scalar Un = U & nw;
|
||||||
|
vector Ut = U - Un*nw;
|
||||||
|
|
||||||
|
if (Un > 0)
|
||||||
|
{
|
||||||
|
U -= (1.0 + patchData_[patchI].e())*Un*nw;
|
||||||
|
}
|
||||||
|
|
||||||
|
U -= patchData_[patchI].mu()*Ut;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"bool LocalInteraction<CloudType>::correct"
|
||||||
|
"("
|
||||||
|
"const polyPatch&, "
|
||||||
|
"const label, "
|
||||||
|
"bool&, "
|
||||||
|
"vector&"
|
||||||
|
") const"
|
||||||
|
) << "Unknown interaction type "
|
||||||
|
<< patchData_[patchI].interactionTypeName()
|
||||||
|
<< "(" << it << ") for patch "
|
||||||
|
<< patchData_[patchI].patchName()
|
||||||
|
<< ". Valid selections are:" << this->interactionTypeNames_
|
||||||
|
<< endl << abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ Description
|
|||||||
#define LocalInteraction_H
|
#define LocalInteraction_H
|
||||||
|
|
||||||
#include "PatchInteractionModel.H"
|
#include "PatchInteractionModel.H"
|
||||||
#include "dictionaryEntry.H"
|
#include "patchInteractionData.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -49,78 +49,6 @@ class LocalInteraction
|
|||||||
:
|
:
|
||||||
public PatchInteractionModel<CloudType>
|
public PatchInteractionModel<CloudType>
|
||||||
{
|
{
|
||||||
class patchInteractionData
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Patch name
|
|
||||||
word patchName_;
|
|
||||||
|
|
||||||
//- Elasticity coefficient
|
|
||||||
scalar e_;
|
|
||||||
|
|
||||||
//- Restitution coefficient
|
|
||||||
scalar mu_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Construct null
|
|
||||||
patchInteractionData()
|
|
||||||
:
|
|
||||||
patchName_("unknownPatch"),
|
|
||||||
e_(0.0),
|
|
||||||
mu_(0.0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct from dictionary
|
|
||||||
patchInteractionData(const dictionary& dict);
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return const access to the patch name
|
|
||||||
const word& patchName() const
|
|
||||||
{
|
|
||||||
return patchName_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return const access to the elasticity coefficient
|
|
||||||
scalar e() const
|
|
||||||
{
|
|
||||||
return e_;
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Return const access to the restitution coefficient
|
|
||||||
scalar mu() const
|
|
||||||
{
|
|
||||||
return mu_;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Istream operator
|
|
||||||
friend Istream& operator>>(Istream& is, patchInteractionData& pid)
|
|
||||||
{
|
|
||||||
is.check
|
|
||||||
(
|
|
||||||
"Istream& operator>>"
|
|
||||||
"(Istream&, patchInteractionData&)"
|
|
||||||
);
|
|
||||||
|
|
||||||
const dictionaryEntry entry(dictionary::null, is);
|
|
||||||
|
|
||||||
pid.patchName_ = entry.keyword();
|
|
||||||
entry.lookup("e") >> pid.e_;
|
|
||||||
entry.lookup("mu") >> pid.mu_;
|
|
||||||
|
|
||||||
return is;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- List of participating patches
|
//- List of participating patches
|
||||||
@ -164,6 +92,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -0,0 +1,89 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "patchInteractionData.H"
|
||||||
|
#include "dictionaryEntry.H"
|
||||||
|
#include "PatchInteractionModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::patchInteractionData::patchInteractionData()
|
||||||
|
:
|
||||||
|
interactionTypeName_("unknownInteractionTypeName"),
|
||||||
|
patchName_("unknownPatch"),
|
||||||
|
e_(0.0),
|
||||||
|
mu_(0.0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const Foam::word& Foam::patchInteractionData::interactionTypeName() const
|
||||||
|
{
|
||||||
|
return interactionTypeName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const Foam::word& Foam::patchInteractionData::patchName() const
|
||||||
|
{
|
||||||
|
return patchName_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::patchInteractionData::e() const
|
||||||
|
{
|
||||||
|
return e_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::scalar Foam::patchInteractionData::mu() const
|
||||||
|
{
|
||||||
|
return mu_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::Istream& Foam::operator>>
|
||||||
|
(
|
||||||
|
Istream& is,
|
||||||
|
patchInteractionData& pid
|
||||||
|
)
|
||||||
|
{
|
||||||
|
is.check("Istream& operator>>(Istream&, patchInteractionData&)");
|
||||||
|
|
||||||
|
const dictionaryEntry entry(dictionary::null, is);
|
||||||
|
|
||||||
|
pid.patchName_ = entry.keyword();
|
||||||
|
entry.lookup("type") >> pid.interactionTypeName_;
|
||||||
|
pid.e_ = entry.lookupOrDefault<scalar>("e", 1.0);
|
||||||
|
pid.mu_ = entry.lookupOrDefault<scalar>("mu", 0.0);
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,157 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2009-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 2 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, write to the Free Software Foundation,
|
||||||
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::patchInteractionData
|
||||||
|
|
||||||
|
Description
|
||||||
|
Helper class for the LocalInteraction patch interaction model
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef patchInteractionData_H
|
||||||
|
#define patchInteractionData_H
|
||||||
|
|
||||||
|
#include "Istream.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class patchInteractionData Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
// Forward declaration of classes
|
||||||
|
class patchInteractionData;
|
||||||
|
|
||||||
|
// Forward declaration of friend functions
|
||||||
|
Istream& operator>>
|
||||||
|
(
|
||||||
|
Istream& is,
|
||||||
|
patchInteractionData& pid
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
class patchInteractionData
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Interaction type name
|
||||||
|
word interactionTypeName_;
|
||||||
|
|
||||||
|
//- Patch name
|
||||||
|
word patchName_;
|
||||||
|
|
||||||
|
//- Elasticity coefficient
|
||||||
|
scalar e_;
|
||||||
|
|
||||||
|
//- Restitution coefficient
|
||||||
|
scalar mu_;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Constructor
|
||||||
|
|
||||||
|
//- Construct null
|
||||||
|
patchInteractionData();
|
||||||
|
|
||||||
|
|
||||||
|
// Member functions
|
||||||
|
|
||||||
|
// Access
|
||||||
|
|
||||||
|
//- Return const access to the interaction type name
|
||||||
|
const word& interactionTypeName() const;
|
||||||
|
|
||||||
|
//- Return const access to the patch name
|
||||||
|
const word& patchName() const;
|
||||||
|
|
||||||
|
//- Return const access to the elasticity coefficient
|
||||||
|
scalar e() const;
|
||||||
|
|
||||||
|
//- Return const access to the restitution coefficient
|
||||||
|
scalar mu() const;
|
||||||
|
|
||||||
|
|
||||||
|
// I-O
|
||||||
|
|
||||||
|
//- Istream operator
|
||||||
|
friend Istream& operator>>
|
||||||
|
(
|
||||||
|
Istream& is,
|
||||||
|
patchInteractionData& pid
|
||||||
|
);
|
||||||
|
/* {
|
||||||
|
is.check
|
||||||
|
(
|
||||||
|
"Istream& operator>>"
|
||||||
|
"(Istream&, patchInteractionData&)"
|
||||||
|
);
|
||||||
|
|
||||||
|
const dictionaryEntry entry(dictionary::null, is);
|
||||||
|
|
||||||
|
pid.patchName_ = entry.keyword();
|
||||||
|
entry.lookup("type") >> pid.interactionTypeName_;
|
||||||
|
pid.e_ = entry.lookupOrDefault<scalar>("e", 1.0);
|
||||||
|
pid.mu_ = entry.lookupOrDefault<scalar>("mu", 0.0);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
PatchInteractionModel<CloudType>::wordToInteractionType
|
||||||
|
(
|
||||||
|
pid.interactionTypeName_
|
||||||
|
)
|
||||||
|
== PatchInteractionModel<CloudType>::itOther)
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"friend Istream& operator>>"
|
||||||
|
"("
|
||||||
|
"Istream&, "
|
||||||
|
"patchInteractionData&"
|
||||||
|
")"
|
||||||
|
) << "Unknown patch interaction type "
|
||||||
|
<< pid.interactionTypeName_
|
||||||
|
<< ". Valid selections are:"
|
||||||
|
<< PatchInteractionModel<CloudType>::
|
||||||
|
interactionTypeNames_
|
||||||
|
<< endl << abort(FatalError);
|
||||||
|
}
|
||||||
|
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
*/};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -26,6 +26,76 @@ License
|
|||||||
|
|
||||||
#include "PatchInteractionModel.H"
|
#include "PatchInteractionModel.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::wordList Foam::PatchInteractionModel<CloudType>::interactionTypeNames_
|
||||||
|
(
|
||||||
|
IStringStream
|
||||||
|
(
|
||||||
|
"(rebound stick escape)"
|
||||||
|
)()
|
||||||
|
);
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
Foam::word Foam::PatchInteractionModel<CloudType>::interactionTypeToWord
|
||||||
|
(
|
||||||
|
const interactionType& itEnum
|
||||||
|
)
|
||||||
|
{
|
||||||
|
switch (itEnum)
|
||||||
|
{
|
||||||
|
case itRebound:
|
||||||
|
{
|
||||||
|
return "rebound";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case itStick:
|
||||||
|
{
|
||||||
|
return "stick";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case itEscape:
|
||||||
|
{
|
||||||
|
return "escape";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
return "other";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class CloudType>
|
||||||
|
typename Foam::PatchInteractionModel<CloudType>::interactionType
|
||||||
|
Foam::PatchInteractionModel<CloudType>::wordToInteractionType
|
||||||
|
(
|
||||||
|
const word& itWord
|
||||||
|
)
|
||||||
|
{
|
||||||
|
if (itWord == "rebound")
|
||||||
|
{
|
||||||
|
return itRebound;
|
||||||
|
}
|
||||||
|
else if (itWord == "stick")
|
||||||
|
{
|
||||||
|
return itStick;
|
||||||
|
}
|
||||||
|
else if (itWord == "escape")
|
||||||
|
{
|
||||||
|
return itEscape;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return itOther;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
|
|||||||
@ -40,6 +40,7 @@ SourceFiles
|
|||||||
#include "IOdictionary.H"
|
#include "IOdictionary.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
#include "polyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -53,6 +54,24 @@ namespace Foam
|
|||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
class PatchInteractionModel
|
class PatchInteractionModel
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Public enumerations
|
||||||
|
|
||||||
|
// Interaction types
|
||||||
|
enum interactionType
|
||||||
|
{
|
||||||
|
itRebound,
|
||||||
|
itStick,
|
||||||
|
itEscape,
|
||||||
|
itOther
|
||||||
|
};
|
||||||
|
|
||||||
|
static wordList interactionTypeNames_;
|
||||||
|
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- The cloud dictionary
|
//- The cloud dictionary
|
||||||
@ -121,6 +140,12 @@ public:
|
|||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|
||||||
|
//- Convert interaction result to word
|
||||||
|
static word interactionTypeToWord(const interactionType& itEnum);
|
||||||
|
|
||||||
|
//- Convert word to interaction result
|
||||||
|
static interactionType wordToInteractionType(const word& itWord);
|
||||||
|
|
||||||
//- Flag to indicate whether model activates patch interaction model
|
//- Flag to indicate whether model activates patch interaction model
|
||||||
virtual bool active() const = 0;
|
virtual bool active() const = 0;
|
||||||
|
|
||||||
@ -130,6 +155,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const = 0;
|
) const = 0;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -61,9 +61,12 @@ bool Foam::Rebound<CloudType>::correct
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
keepParticle = true;
|
||||||
|
|
||||||
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
|
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
|
||||||
nw /= mag(nw);
|
nw /= mag(nw);
|
||||||
|
|
||||||
|
|||||||
@ -82,6 +82,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -36,9 +36,45 @@ Foam::StandardWallInteraction<CloudType>::StandardWallInteraction
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
PatchInteractionModel<CloudType>(dict, cloud, typeName),
|
PatchInteractionModel<CloudType>(dict, cloud, typeName),
|
||||||
e_(dimensionedScalar(this->coeffDict().lookup("e")).value()),
|
interactionType_
|
||||||
mu_(dimensionedScalar(this->coeffDict().lookup("mu")).value())
|
(
|
||||||
{}
|
this->wordToInteractionType(this->coeffDict().lookup("type"))
|
||||||
|
),
|
||||||
|
e_(0.0),
|
||||||
|
mu_(0.0)
|
||||||
|
{
|
||||||
|
switch (interactionType_)
|
||||||
|
{
|
||||||
|
case PatchInteractionModel<CloudType>::itOther:
|
||||||
|
{
|
||||||
|
word interactionTypeName(this->coeffDict().lookup("type"));
|
||||||
|
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"StandardWallInteraction<CloudType>::StandardWallInteraction"
|
||||||
|
"("
|
||||||
|
"const dictionary&, "
|
||||||
|
"CloudType& cloud"
|
||||||
|
")"
|
||||||
|
) << "Unknown interaction result type "
|
||||||
|
<< interactionTypeName
|
||||||
|
<< ". Valid selections are:" << this->interactionTypeNames_
|
||||||
|
<< endl << exit(FatalError);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PatchInteractionModel<CloudType>::itRebound:
|
||||||
|
{
|
||||||
|
e_ = this->coeffDict().lookupOrDefault("e", 1.0);
|
||||||
|
mu_ = this->coeffDict().lookupOrDefault("mu", 0.0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
// do nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
@ -62,23 +98,62 @@ bool Foam::StandardWallInteraction<CloudType>::correct
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (isA<wallPolyPatch>(pp))
|
if (isA<wallPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
|
switch (interactionType_)
|
||||||
nw /= mag(nw);
|
|
||||||
|
|
||||||
scalar Un = U & nw;
|
|
||||||
vector Ut = U - Un*nw;
|
|
||||||
|
|
||||||
if (Un > 0)
|
|
||||||
{
|
{
|
||||||
U -= (1.0 + e_)*Un*nw;
|
case PatchInteractionModel<CloudType>::itEscape:
|
||||||
}
|
{
|
||||||
|
keepParticle = false;
|
||||||
|
U = vector::zero;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PatchInteractionModel<CloudType>::itStick:
|
||||||
|
{
|
||||||
|
keepParticle = true;
|
||||||
|
U = vector::zero;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case PatchInteractionModel<CloudType>::itRebound:
|
||||||
|
{
|
||||||
|
keepParticle = true;
|
||||||
|
|
||||||
U -= mu_*Ut;
|
vector nw = pp.faceAreas()[pp.whichFace(faceId)];
|
||||||
|
nw /= mag(nw);
|
||||||
|
|
||||||
|
scalar Un = U & nw;
|
||||||
|
vector Ut = U - Un*nw;
|
||||||
|
|
||||||
|
if (Un > 0)
|
||||||
|
{
|
||||||
|
U -= (1.0 + e_)*Un*nw;
|
||||||
|
}
|
||||||
|
|
||||||
|
U -= mu_*Ut;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
FatalErrorIn
|
||||||
|
(
|
||||||
|
"bool StandardWallInteraction<CloudType>::correct"
|
||||||
|
"("
|
||||||
|
"const polyPatch&, "
|
||||||
|
"const label, "
|
||||||
|
"bool&, "
|
||||||
|
"vector&"
|
||||||
|
") const"
|
||||||
|
) << "Unknown interaction type "
|
||||||
|
<< this->interactionTypeToWord(interactionType_)
|
||||||
|
<< "(" << interactionType_ << ")" << endl
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,7 +26,19 @@ Class
|
|||||||
Foam::StandardWallInteraction
|
Foam::StandardWallInteraction
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Wall interaction based on restitution and elasticity coefficients
|
Wall interaction model. Three choices:
|
||||||
|
- rebound - optionally specify elasticity and resitution coefficients
|
||||||
|
- stick - particles assigined zero velocity
|
||||||
|
- escape - remove particle from the domain
|
||||||
|
|
||||||
|
Example usage:
|
||||||
|
|
||||||
|
StandardWallInteractionCoeffs
|
||||||
|
{
|
||||||
|
type rebound; // stick, escape
|
||||||
|
e 1; // optional - elasticity coeff
|
||||||
|
mu 0; // optional - restitution coeff
|
||||||
|
}
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -40,7 +52,7 @@ Description
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
Class StandardWallInteraction Declaration
|
Class StandardWallInteraction Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -48,13 +60,19 @@ class StandardWallInteraction
|
|||||||
:
|
:
|
||||||
public PatchInteractionModel<CloudType>
|
public PatchInteractionModel<CloudType>
|
||||||
{
|
{
|
||||||
// Private data
|
protected:
|
||||||
|
|
||||||
//- Elasticity
|
// Protected data
|
||||||
const scalar e_;
|
|
||||||
|
//- Interaction type
|
||||||
|
typename PatchInteractionModel<CloudType>::interactionType
|
||||||
|
interactionType_;
|
||||||
|
|
||||||
|
//- Elasticity coefficient
|
||||||
|
scalar e_;
|
||||||
|
|
||||||
//- Restitution coefficient
|
//- Restitution coefficient
|
||||||
const scalar mu_;
|
scalar mu_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -84,6 +102,7 @@ public:
|
|||||||
(
|
(
|
||||||
const polyPatch& pp,
|
const polyPatch& pp,
|
||||||
const label faceId,
|
const label faceId,
|
||||||
|
bool& keepParticle,
|
||||||
vector& U
|
vector& U
|
||||||
) const;
|
) const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -161,7 +161,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||||||
// vapour diffusivity [m2/s]
|
// vapour diffusivity [m2/s]
|
||||||
scalar Dab = liquids_->properties()[lid].D(pc, Ts);
|
scalar Dab = liquids_->properties()[lid].D(pc, Ts);
|
||||||
|
|
||||||
// Saturation pressure for species i [pa]
|
// saturation pressure for species i [pa]
|
||||||
// - carrier phase pressure assumed equal to the liquid vapour pressure
|
// - carrier phase pressure assumed equal to the liquid vapour pressure
|
||||||
// close to the surface
|
// close to the surface
|
||||||
// NOTE: if pSat > pc then particle is superheated
|
// NOTE: if pSat > pc then particle is superheated
|
||||||
|
|||||||
@ -41,9 +41,9 @@ void Foam::correlationFunction<Type>::setTimesAndSizes
|
|||||||
const label tZeroBufferSize
|
const label tZeroBufferSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
sampleSteps_ = ceil(sampleInterval_/mesh_.time().deltaT().value());
|
sampleSteps_ = ceil(sampleInterval_/mesh_.time().deltaTValue());
|
||||||
|
|
||||||
sampleInterval_ = sampleSteps_*mesh_.time().deltaT().value();
|
sampleInterval_ = sampleSteps_*mesh_.time().deltaTValue();
|
||||||
|
|
||||||
label bufferLength(ceil(duration_/sampleInterval_));
|
label bufferLength(ceil(duration_/sampleInterval_));
|
||||||
|
|
||||||
|
|||||||
@ -88,7 +88,7 @@ bool Foam::molecule::move(molecule::trackData& td)
|
|||||||
|
|
||||||
const constantProperties& constProps(td.molCloud().constProps(id_));
|
const constantProperties& constProps(td.molCloud().constProps(id_));
|
||||||
|
|
||||||
scalar deltaT = cloud().pMesh().time().deltaT().value();
|
scalar deltaT = cloud().pMesh().time().deltaTValue();
|
||||||
|
|
||||||
if (td.part() == 0)
|
if (td.part() == 0)
|
||||||
{
|
{
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user