mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -243,6 +243,7 @@ void Foam::uniqueOrder
|
||||
order[n++] = order[i];
|
||||
}
|
||||
}
|
||||
order[n++] = order[order.size()-1];
|
||||
order.setSize(n);
|
||||
}
|
||||
}
|
||||
|
||||
@ -170,7 +170,7 @@ void Foam::Time::setControls()
|
||||
|
||||
readDict();
|
||||
deltaTSave_ = deltaT_;
|
||||
deltaT0_ = deltaTSave_;
|
||||
deltaT0_ = deltaT_;
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
@ -203,11 +203,14 @@ void Foam::Time::setControls()
|
||||
)
|
||||
);
|
||||
|
||||
if (timeDict.readIfPresent("deltaT", deltaTSave_))
|
||||
if (timeDict.readIfPresent("deltaT", deltaT_))
|
||||
{
|
||||
deltaT0_ = deltaTSave_;
|
||||
deltaTSave_ = deltaT_;
|
||||
deltaT0_ = deltaT_;
|
||||
}
|
||||
|
||||
timeDict.readIfPresent("deltaT0", deltaT0_);
|
||||
|
||||
if (timeDict.readIfPresent("index", startTimeIndex_))
|
||||
{
|
||||
timeIndex_ = startTimeIndex_;
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "zone.H"
|
||||
#include "IOstream.H"
|
||||
#include "demandDrivenData.H"
|
||||
#include "HashSet.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -192,6 +193,9 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
// To check for duplicate entries
|
||||
labelHashSet elems(size());
|
||||
|
||||
forAll(addr, i)
|
||||
{
|
||||
if (addr[i] < 0 || addr[i] >= maxSize)
|
||||
@ -215,6 +219,18 @@ bool Foam::zone::checkDefinition(const label maxSize, const bool report) const
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (!elems.insert(addr[i]))
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
WarningIn
|
||||
(
|
||||
"bool zone::checkDefinition("
|
||||
"const label maxSize, const bool report) const"
|
||||
) << "Zone " << name_
|
||||
<< " contains duplicate index label " << addr[i] << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return hasError;
|
||||
|
||||
@ -26,11 +26,6 @@ License
|
||||
#include "cachedRandom.H"
|
||||
#include "OSspecific.H"
|
||||
|
||||
#if INT_MAX != 2147483647
|
||||
# error "INT_MAX != 2147483647"
|
||||
# error "The random number generator may not work!"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::cachedRandom::scalar01()
|
||||
@ -79,7 +74,7 @@ Foam::cachedRandom::cachedRandom(const label seed, const label count)
|
||||
osRandomSeed(seed_);
|
||||
forAll(samples_, i)
|
||||
{
|
||||
samples_[i] = drand48();
|
||||
samples_[i] = osRandomDouble();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -306,6 +306,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
||||
DynamicList<label> zoneIDs;
|
||||
const faceZoneMesh& fzm = owner.mesh().faceZones();
|
||||
const surfaceScalarField& magSf = owner.mesh().magSf();
|
||||
const polyBoundaryMesh& pbm = owner.mesh().boundaryMesh();
|
||||
forAll(faceZoneNames, i)
|
||||
{
|
||||
const word& zoneName = faceZoneNames[i];
|
||||
@ -314,16 +315,38 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
||||
{
|
||||
zoneIDs.append(zoneI);
|
||||
const faceZone& fz = fzm[zoneI];
|
||||
mass_[i].setSize(fz.size(), 0.0);
|
||||
massTotal_[i].setSize(fz.size(), 0.0);
|
||||
massFlux_[i].setSize(fz.size(), 0.0);
|
||||
|
||||
label nFaces = returnReduce(fz.size(), sumOp<label>());
|
||||
mass_[i].setSize(nFaces, 0.0);
|
||||
massTotal_[i].setSize(nFaces, 0.0);
|
||||
massFlux_[i].setSize(nFaces, 0.0);
|
||||
Info<< " " << zoneName << " faces: " << nFaces << nl;
|
||||
|
||||
scalar totArea = 0.0;
|
||||
forAll(fz, j)
|
||||
{
|
||||
totArea += magSf[fz[j]];
|
||||
label faceI = fz[j];
|
||||
label bFaceI = faceI - owner.mesh().nInternalFaces();
|
||||
label patchI = pbm.patchID()[bFaceI];
|
||||
|
||||
if (patchI == -1)
|
||||
{
|
||||
totArea += magSf[fz[j]];
|
||||
}
|
||||
else
|
||||
{
|
||||
const polyPatch& pp = pbm[patchI];
|
||||
|
||||
if
|
||||
(
|
||||
!pp.coupled()
|
||||
|| refCast<const coupledPolyPatch>(pp).owner()
|
||||
)
|
||||
{
|
||||
label localFaceI = pp.whichFace(faceI);
|
||||
totArea += magSf.boundaryField()[patchI][localFaceI];
|
||||
}
|
||||
}
|
||||
}
|
||||
totArea = returnReduce(totArea, sumOp<scalar>());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user