ENH: Updated xxx::zero->Zero

This commit is contained in:
Andrew Heather
2016-04-28 14:17:06 +01:00
parent af14c117a9
commit 158a925235
35 changed files with 148 additions and 172 deletions

View File

@ -88,7 +88,7 @@ tmp<vectorField> calcVertexNormals(const triSurface& surf)
// Weight = fA / (mag(e0)^2 * mag(e1)^2); // Weight = fA / (mag(e0)^2 * mag(e1)^2);
tmp<vectorField> tpointNormals tmp<vectorField> tpointNormals
( (
new pointField(surf.nPoints(), vector::zero) new pointField(surf.nPoints(), Zero)
); );
vectorField& pointNormals = tpointNormals.ref(); vectorField& pointNormals = tpointNormals.ref();
@ -151,7 +151,7 @@ tmp<vectorField> calcPointNormals
{ {
if (!isFeaturePoint[e[i]]) if (!isFeaturePoint[e[i]])
{ {
pointNormals[e[i]] = vector::zero; pointNormals[e[i]] = Zero;
} }
} }
} }
@ -164,7 +164,7 @@ tmp<vectorField> calcPointNormals
const labelList& eFaces = edgeFaces[edgeI]; const labelList& eFaces = edgeFaces[edgeI];
// Get average edge normal // Get average edge normal
vector n = vector::zero; vector n = Zero;
forAll(eFaces, i) forAll(eFaces, i)
{ {
n += s.faceNormals()[eFaces[i]]; n += s.faceNormals()[eFaces[i]];
@ -483,7 +483,7 @@ void lloydsSmoothing
{ {
const labelList& pFaces = pointFaces[pointI]; const labelList& pFaces = pointFaces[pointI];
point avg = point::zero; point avg(Zero);
forAll(pFaces, pFaceI) forAll(pFaces, pFaceI)
{ {
avg += faceCentres[pFaces[pFaceI]]; avg += faceCentres[pFaces[pFaceI]];
@ -498,7 +498,7 @@ void lloydsSmoothing
const pointField& points = s.points(); const pointField& points = s.points();
vectorField pointSum(s.nPoints(), vector::zero); vectorField pointSum(s.nPoints(), Zero);
labelList nPointSum(s.nPoints(), 0); labelList nPointSum(s.nPoints(), 0);
forAll(edges, edgeI) forAll(edges, edgeI)

View File

@ -230,7 +230,7 @@ public:
// point and density specification // point and density specification
inline tensor inertia inline tensor inertia
( (
PointRef refPt = vector::zero, PointRef refPt = Zero,
scalar density = 1.0 scalar density = 1.0
) const; ) const;

View File

@ -525,7 +525,7 @@ void Foam::motionSmootherAlgo::setDisplacement
label pointI = cppMeshPoints[i]; label pointI = cppMeshPoints[i];
if (isPatchPoint[pointI]) if (isPatchPoint[pointI])
{ {
displacement[pointI] = vector::zero; displacement[pointI] = Zero;
} }
} }
} }

View File

@ -118,7 +118,7 @@ void Foam::polyMeshGeometry::updateCellCentresAndVols
const labelList& cFaces(cells[cellI]); const labelList& cFaces(cells[cellI]);
// Estimate the cell centre and bounding box using the face centres // Estimate the cell centre and bounding box using the face centres
vector cEst = vector::zero; vector cEst(Zero);
boundBox bb(boundBox::invertedBox); boundBox bb(boundBox::invertedBox);
forAll(cFaces, cFaceI) forAll(cFaces, cFaceI)

View File

@ -112,7 +112,7 @@ void Foam::pointMVCWeight::calcWeights
u(j) = uVec[toLocal[f[j]]]; u(j) = uVec[toLocal[f[j]]];
} }
vector v(point::zero); vector v(Zero);
forAll(f, j) forAll(f, j)
{ {
label jPlus1 = f.fcIndex(j); label jPlus1 = f.fcIndex(j);

View File

@ -124,7 +124,7 @@ displacementSBRStressFvMotionSolver
( (
"cellDisplacement", "cellDisplacement",
displacementMotionSolver::pointDisplacement().dimensions(), displacementMotionSolver::pointDisplacement().dimensions(),
vector::zero Zero
), ),
cellMotionBoundaryTypes<vector> cellMotionBoundaryTypes<vector>
( (

View File

@ -169,7 +169,7 @@ displacementLaplacianFvMotionSolver
( (
"cellDisplacement", "cellDisplacement",
pointDisplacement_.dimensions(), pointDisplacement_.dimensions(),
vector::zero Zero
), ),
cellMotionBoundaryTypes<vector>(pointDisplacement_.boundaryField()) cellMotionBoundaryTypes<vector>(pointDisplacement_.boundaryField())
), ),

View File

@ -74,7 +74,7 @@ surfaceAlignedSBRStressFvMotionSolver
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvMesh_, fvMesh_,
dimensionedVector("zero", dimless, vector::zero) dimensionedVector("zero", dimless, Zero)
), ),
maxAng_(coeffDict().lookupOrDefault<scalar>("maxAng", 80.0)), maxAng_(coeffDict().lookupOrDefault<scalar>("maxAng", 80.0)),
minAng_(coeffDict().lookupOrDefault<scalar>("minAng", 20.0)), minAng_(coeffDict().lookupOrDefault<scalar>("minAng", 20.0)),
@ -93,7 +93,7 @@ surfaceAlignedSBRStressFvMotionSolver
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvMesh_, fvMesh_,
dimensionedSymmTensor("zero", dimless, symmTensor::zero) dimensionedSymmTensor("zero", dimless, Zero)
), ),
minSigmaDiff_(coeffDict().lookupOrDefault<scalar>("minSigmaDiff", 1e-4)) minSigmaDiff_(coeffDict().lookupOrDefault<scalar>("minSigmaDiff", 1e-4))
{ {
@ -131,8 +131,8 @@ Foam::surfaceAlignedSBRStressFvMotionSolver::
void Foam::surfaceAlignedSBRStressFvMotionSolver::calculateCellRot() void Foam::surfaceAlignedSBRStressFvMotionSolver::calculateCellRot()
{ {
cellRot_.internalField() = vector::zero; cellRot_.internalField() = Zero;
pointDisplacement_.internalField() = vector::zero; pointDisplacement_.internalField() = Zero;
// Find intersections // Find intersections
pointField start(fvMesh_.nInternalFaces()); pointField start(fvMesh_.nInternalFaces());
@ -316,7 +316,7 @@ void Foam::surfaceAlignedSBRStressFvMotionSolver::solve()
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
fvMesh_, fvMesh_,
dimensionedVector("zero", dimLength, vector::zero), dimensionedVector("zero", dimLength, Zero),
cellMotionBoundaryTypes<vector> cellMotionBoundaryTypes<vector>
( (
pointDisplacement().boundaryField() pointDisplacement().boundaryField()

View File

@ -123,11 +123,11 @@ void Foam::patchTransformedInterpolation::interpolate
pointDisplacement.correctBoundaryConditions(); pointDisplacement.correctBoundaryConditions();
vectorField pointRotation(nPoints, vector::zero); vectorField pointRotation(nPoints, Zero);
scalarField pointExpansion(nPoints, scalar(0)); scalarField pointExpansion(nPoints, scalar(0));
labelList pointDisplacementNSum(nPoints, 0); labelList pointDisplacementNSum(nPoints, 0);
vectorField pointDisplacementSum(nPoints, vector::zero); vectorField pointDisplacementSum(nPoints, Zero);
forAll(patches_, patchI) forAll(patches_, patchI)
{ {

View File

@ -179,9 +179,9 @@ directionalPressureGradientExplicitSource
: :
cellSetOption(sourceName, modelType, dict, mesh), cellSetOption(sourceName, modelType, dict, mesh),
model_(PressureDropModelNames_.read(coeffs_.lookup("model"))), model_(PressureDropModelNames_.read(coeffs_.lookup("model"))),
gradP0_(cells_.size(), vector::zero), gradP0_(cells_.size(), Zero),
dGradP_(cells_.size(), vector::zero), dGradP_(cells_.size(), Zero),
gradPporous_(cells_.size(), vector::zero), gradPporous_(cells_.size(), Zero),
flowDir_(coeffs_.lookup("flowDir")), flowDir_(coeffs_.lookup("flowDir")),
invAPtr_(NULL), invAPtr_(NULL),
D_(0), D_(0),
@ -386,7 +386,7 @@ void Foam::fv::directionalPressureGradientExplicitSource::correct
} }
// Accumulate 'upstream' velocity into cells // Accumulate 'upstream' velocity into cells
vectorField UfCells(cells_.size(), vector::zero); vectorField UfCells(cells_.size(), Zero);
scalarField UfCellWeights(cells_.size(), 0.0); scalarField UfCellWeights(cells_.size(), 0.0);
const polyBoundaryMesh& pbm = mesh_.boundaryMesh(); const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
@ -486,7 +486,7 @@ void Foam::fv::directionalPressureGradientExplicitSource::addSup
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh_, mesh_,
dimensionedVector("zero", eqn.dimensions()/dimVolume, vector::zero) dimensionedVector("zero", eqn.dimensions()/dimVolume, Zero)
); );
UIndirectList<vector>(Su, cells_) = gradP0_ + dGradP_ + gradPporous_; UIndirectList<vector>(Su, cells_) = gradP0_ + dGradP_ + gradPporous_;
@ -536,7 +536,7 @@ void Foam::fv::directionalPressureGradientExplicitSource::constrain
} }
gradP0_ += dGradP_; gradP0_ += dGradP_;
dGradP_ = vector::zero; dGradP_ = Zero;
} }

View File

@ -36,7 +36,7 @@ namespace Foam
Foam::kinematicParcelInjectionData::kinematicParcelInjectionData() Foam::kinematicParcelInjectionData::kinematicParcelInjectionData()
: :
x_(point::zero), x_(Zero),
U_(Zero), U_(Zero),
d_(0.0), d_(0.0),
rho_(0.0), rho_(0.0),

View File

@ -630,13 +630,13 @@ bool Foam::medialAxisMeshMover::unmarkExtrusion
if (extrudeStatus[patchPointI] == snappyLayerDriver::EXTRUDE) if (extrudeStatus[patchPointI] == snappyLayerDriver::EXTRUDE)
{ {
extrudeStatus[patchPointI] = snappyLayerDriver::NOEXTRUDE; extrudeStatus[patchPointI] = snappyLayerDriver::NOEXTRUDE;
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
return true; return true;
} }
else if (extrudeStatus[patchPointI] == snappyLayerDriver::EXTRUDEREMOVE) else if (extrudeStatus[patchPointI] == snappyLayerDriver::EXTRUDEREMOVE)
{ {
extrudeStatus[patchPointI] = snappyLayerDriver::NOEXTRUDE; extrudeStatus[patchPointI] = snappyLayerDriver::NOEXTRUDE;
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
return true; return true;
} }
else else
@ -1224,7 +1224,7 @@ Foam::medialAxisMeshMover::medialAxisMeshMover
false false
), ),
pMesh(), pMesh(),
dimensionedVector("dispVec", dimLength, vector::zero) dimensionedVector("dispVec", dimLength, Zero)
), ),
medialRatio_ medialRatio_
( (
@ -1266,7 +1266,7 @@ Foam::medialAxisMeshMover::medialAxisMeshMover
false false
), ),
pMesh(), pMesh(),
dimensionedVector("medialVec", dimLength, vector::zero) dimensionedVector("medialVec", dimLength, Zero)
) )
{ {
update(dict); update(dict);
@ -1594,7 +1594,7 @@ void Foam::medialAxisMeshMover::calculateDisplacement
{ {
if (!pointWallDist[pointI].valid(dummyTrackData)) if (!pointWallDist[pointI].valid(dummyTrackData))
{ {
displacement[pointI] = vector::zero; displacement[pointI] = Zero;
} }
else else
{ {

View File

@ -1737,7 +1737,7 @@ Foam::tmp<Foam::pointVectorField> Foam::meshRefinement::makeDisplacementField
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
pMesh, pMesh,
dimensionedVector("displacement", dimLength, vector::zero), dimensionedVector("displacement", dimLength, Zero),
patchFieldTypes patchFieldTypes
) )
); );

View File

@ -1558,7 +1558,7 @@ bool Foam::meshRefinement::isGap
{ {
scalar cosAngle = (normal0 & normal1); scalar cosAngle = (normal0 & normal1);
vector avg = vector::zero; vector avg = Zero;
if (cosAngle < (-1+planarCos)) if (cosAngle < (-1+planarCos))
{ {
// Opposite normals // Opposite normals
@ -1615,7 +1615,7 @@ bool Foam::meshRefinement::isNormalGap
{ {
scalar cosAngle = (normal0 & normal1); scalar cosAngle = (normal0 & normal1);
vector avg = vector::zero; vector avg = Zero;
if (cosAngle < (-1+planarCos)) if (cosAngle < (-1+planarCos))
{ {
// Opposite normals // Opposite normals
@ -1782,8 +1782,8 @@ Foam::label Foam::meshRefinement::markProximityRefinement
// minLevel) and cache per cell the max surface level and the local normal // minLevel) and cache per cell the max surface level and the local normal
// on that surface. // on that surface.
labelList cellMaxLevel(mesh_.nCells(), -1); labelList cellMaxLevel(mesh_.nCells(), -1);
vectorField cellMaxNormal(mesh_.nCells(), vector::zero); vectorField cellMaxNormal(mesh_.nCells(), Zero);
pointField cellMaxLocation(mesh_.nCells(), vector::zero); pointField cellMaxLocation(mesh_.nCells(), Zero);
{ {
// Per segment the normals of the surfaces // Per segment the normals of the surfaces

View File

@ -536,7 +536,7 @@ void Foam::refinementFeatures::findNearestEdge
nearInfo.setSize(samples.size()); nearInfo.setSize(samples.size());
nearInfo = pointIndexHit(); nearInfo = pointIndexHit();
nearNormal.setSize(samples.size()); nearNormal.setSize(samples.size());
nearNormal = vector::zero; nearNormal = Zero;
forAll(edgeTrees_, featI) forAll(edgeTrees_, featI)
{ {
@ -595,7 +595,7 @@ void Foam::refinementFeatures::findNearestRegionEdge
nearInfo.setSize(samples.size()); nearInfo.setSize(samples.size());
nearInfo = pointIndexHit(); nearInfo = pointIndexHit();
nearNormal.setSize(samples.size()); nearNormal.setSize(samples.size());
nearNormal = vector::zero; nearNormal = Zero;
const PtrList<indexedOctree<treeDataEdge>>& regionTrees = const PtrList<indexedOctree<treeDataEdge>>& regionTrees =

View File

@ -1216,7 +1216,7 @@ void Foam::refinementSurfaces::findNearestIntersection
region1.setSize(start.size()); region1.setSize(start.size());
region1 = -1; region1 = -1;
normal1.setSize(start.size()); normal1.setSize(start.size());
normal1 = vector::zero; normal1 = Zero;
// Current end of segment to test. // Current end of segment to test.
pointField nearest(end); pointField nearest(end);
@ -1325,7 +1325,7 @@ void Foam::refinementSurfaces::findNearestIntersection
surface1.setSize(start.size()); surface1.setSize(start.size());
surface1 = -1; surface1 = -1;
normal1.setSize(start.size()); normal1.setSize(start.size());
normal1 = vector::zero; normal1 = Zero;
// Current end of segment to test. // Current end of segment to test.
pointField nearest(end); pointField nearest(end);
@ -1374,7 +1374,7 @@ void Foam::refinementSurfaces::findNearestIntersection
hitInfo1.setSize(start.size()); hitInfo1.setSize(start.size());
hitInfo1 = pointIndexHit(); hitInfo1 = pointIndexHit();
normal1.setSize(start.size()); normal1.setSize(start.size());
normal1 = vector::zero; normal1 = Zero;
// Current end of segment to test. // Current end of segment to test.
pointField nearest(end); pointField nearest(end);
@ -1559,7 +1559,7 @@ void Foam::refinementSurfaces::findNearestRegion
hitRegion.setSize(hitSurface.size()); hitRegion.setSize(hitSurface.size());
hitRegion = -1; hitRegion = -1;
hitNormal.setSize(hitSurface.size()); hitNormal.setSize(hitSurface.size());
hitNormal = vector::zero; hitNormal = Zero;
forAll(surfacesToTest, i) forAll(surfacesToTest, i)
{ {
@ -1784,7 +1784,7 @@ void Foam::refinementSurfaces::findNearestRegion
hitRegion.setSize(hitSurface.size()); hitRegion.setSize(hitSurface.size());
hitRegion = -1; hitRegion = -1;
hitNormal.setSize(hitSurface.size()); hitNormal.setSize(hitSurface.size());
hitNormal = vector::zero; hitNormal = Zero;
forAll(surfacesToTest, i) forAll(surfacesToTest, i)
{ {

View File

@ -223,14 +223,14 @@ bool Foam::snappyLayerDriver::unmarkExtrusion
{ {
extrudeStatus[patchPointI] = NOEXTRUDE; extrudeStatus[patchPointI] = NOEXTRUDE;
patchNLayers[patchPointI] = 0; patchNLayers[patchPointI] = 0;
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
return true; return true;
} }
else if (extrudeStatus[patchPointI] == EXTRUDEREMOVE) else if (extrudeStatus[patchPointI] == EXTRUDEREMOVE)
{ {
extrudeStatus[patchPointI] = NOEXTRUDE; extrudeStatus[patchPointI] = NOEXTRUDE;
patchNLayers[patchPointI] = 0; patchNLayers[patchPointI] = 0;
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
return true; return true;
} }
else else
@ -866,7 +866,7 @@ Foam::snappyLayerDriver::makeLayerDisplacementField
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
), ),
pMesh, pMesh,
dimensionedVector("displacement", dimLength, vector::zero), dimensionedVector("displacement", dimLength, Zero),
patchFieldTypes, patchFieldTypes,
actualPatchTypes actualPatchTypes
) )
@ -953,7 +953,7 @@ void Foam::snappyLayerDriver::growNoExtrusion
{ {
if (extrudeStatus[patchPointI] == NOEXTRUDE) if (extrudeStatus[patchPointI] == NOEXTRUDE)
{ {
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
patchNLayers[patchPointI] = 0; patchNLayers[patchPointI] = 0;
} }
} }
@ -1532,7 +1532,7 @@ void Foam::snappyLayerDriver::getPatchDisplacement
{ {
// Do not use unmarkExtrusion; forcibly set to zero extrusion. // Do not use unmarkExtrusion; forcibly set to zero extrusion.
patchNLayers[patchPointI] = 0; patchNLayers[patchPointI] = 0;
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
} }
else else
{ {
@ -1561,7 +1561,7 @@ void Foam::snappyLayerDriver::getPatchDisplacement
{ {
if (extrudeStatus[patchPointI] == EXTRUDEREMOVE) if (extrudeStatus[patchPointI] == EXTRUDEREMOVE)
{ {
point avg(vector::zero); point avg(Zero);
label nPoints = 0; label nPoints = 0;
const labelList& pEdges = pp.pointEdges()[patchPointI]; const labelList& pEdges = pp.pointEdges()[patchPointI];
@ -1798,7 +1798,7 @@ Foam::label Foam::snappyLayerDriver::truncateDisplacement
else if (extrudeStatus[patchPointI] == NOEXTRUDE) else if (extrudeStatus[patchPointI] == NOEXTRUDE)
{ {
// Make sure displacement is 0. Should already be so but ... // Make sure displacement is 0. Should already be so but ...
patchDisp[patchPointI] = vector::zero; patchDisp[patchPointI] = Zero;
patchNLayers[patchPointI] = 0; patchNLayers[patchPointI] = 0;
} }
} }
@ -3681,7 +3681,7 @@ void Foam::snappyLayerDriver::addLayers
// Calculate displacement for final layer for addPatchLayer. // Calculate displacement for final layer for addPatchLayer.
// (layer of cells next to the original mesh) // (layer of cells next to the original mesh)
vectorField finalDisp(patchNLayers.size(), vector::zero); vectorField finalDisp(patchNLayers.size(), Zero);
forAll(nPatchPointLayers, i) forAll(nPatchPointLayers, i)
{ {

View File

@ -1025,7 +1025,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
// const scalar rCVol = pow(cellVolumes[cellI], -5.0/3.0); // const scalar rCVol = pow(cellVolumes[cellI], -5.0/3.0);
// //
// // Determine principal axes of cell // // Determine principal axes of cell
// symmTensor R(symmTensor::zero); // symmTensor R(Zero);
// //
// forAll(cFaces, i) // forAll(cFaces, i)
// { // {

View File

@ -250,7 +250,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothInternalDisplacement
// Calculate average of connected cells // Calculate average of connected cells
labelList nCells(mesh.nPoints(), 0); labelList nCells(mesh.nPoints(), 0);
pointField sumLocation(mesh.nPoints(), vector::zero); pointField sumLocation(mesh.nPoints(), Zero);
forAll(isMovingPoint, pointI) forAll(isMovingPoint, pointI)
{ {
@ -276,7 +276,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothInternalDisplacement
vector::zero vector::zero
); );
tmp<pointField> tdisplacement(new pointField(mesh.nPoints(), vector::zero)); tmp<pointField> tdisplacement(new pointField(mesh.nPoints(), Zero));
pointField& displacement = tdisplacement.ref(); pointField& displacement = tdisplacement.ref();
label nAdapted = 0; label nAdapted = 0;
@ -370,7 +370,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothPatchDisplacement
// Get average position of boundary face centres // Get average position of boundary face centres
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vectorField avgBoundary(pointFaces.size(), vector::zero); vectorField avgBoundary(pointFaces.size(), Zero);
labelList nBoundary(pointFaces.size(), 0); labelList nBoundary(pointFaces.size(), 0);
forAll(pointFaces, patchPointI) forAll(pointFaces, patchPointI)
@ -418,7 +418,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothPatchDisplacement
vectorField avgInternal; vectorField avgInternal;
labelList nInternal; labelList nInternal;
{ {
vectorField globalSum(mesh.nPoints(), vector::zero); vectorField globalSum(mesh.nPoints(), Zero);
labelList globalNum(mesh.nPoints(), 0); labelList globalNum(mesh.nPoints(), 0);
// Note: no use of pointFaces // Note: no use of pointFaces
@ -521,7 +521,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothPatchDisplacement
// Displacement to calculate. // Displacement to calculate.
tmp<pointField> tpatchDisp(new pointField(meshPoints.size(), vector::zero)); tmp<pointField> tpatchDisp(new pointField(meshPoints.size(), Zero));
pointField& patchDisp = tpatchDisp.ref(); pointField& patchDisp = tpatchDisp.ref();
forAll(pointFaces, i) forAll(pointFaces, i)
@ -597,7 +597,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::smoothPatchDisplacement
// const labelListList& pointEdges = pp.pointEdges(); // const labelListList& pointEdges = pp.pointEdges();
// const edgeList& edges = pp.edges(); // const edgeList& edges = pp.edges();
// //
// tmp<pointField> tavg(new pointField(pointEdges.size(), vector::zero)); // tmp<pointField> tavg(new pointField(pointEdges.size(), Zero));
// pointField& avg = tavg(); // pointField& avg = tavg();
// //
// forAll(pointEdges, vertI) // forAll(pointEdges, vertI)
@ -997,7 +997,7 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::avgCellCentres
tmp<pointField> tavgBoundary tmp<pointField> tavgBoundary
( (
new pointField(pointFaces.size(), vector::zero) new pointField(pointFaces.size(), Zero)
); );
pointField& avgBoundary = tavgBoundary.ref(); pointField& avgBoundary = tavgBoundary.ref();
labelList nBoundary(pointFaces.size(), 0); labelList nBoundary(pointFaces.size(), 0);
@ -1805,7 +1805,7 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurface
const fvMesh& mesh = meshRefiner.mesh(); const fvMesh& mesh = meshRefiner.mesh();
// Displacement per patch point // Displacement per patch point
vectorField patchDisp(localPoints.size(), vector::zero); vectorField patchDisp(localPoints.size(), Zero);
if (returnReduce(localPoints.size(), sumOp<label>()) > 0) if (returnReduce(localPoints.size(), sumOp<label>()) > 0)
{ {
@ -2754,7 +2754,7 @@ void Foam::snappySnapDriver::doSnap
if (snapParams.detectNearSurfacesSnap()) if (snapParams.detectNearSurfacesSnap())
{ {
nearestPoint.setSize(pp.nPoints(), vector::max); nearestPoint.setSize(pp.nPoints(), vector::max);
nearestNormal.setSize(pp.nPoints(), vector::zero); nearestNormal.setSize(pp.nPoints(), Zero);
} }
vectorField disp = calcNearestSurface vectorField disp = calcNearestSurface

View File

@ -152,7 +152,7 @@ void Foam::snappySnapDriver::smoothAndConstrain
// - same for feature points. They are already attracted to the // - same for feature points. They are already attracted to the
// nearest feature point. // nearest feature point.
vectorField dispSum(pp.nPoints(), vector::zero); vectorField dispSum(pp.nPoints(), Zero);
labelList dispCount(pp.nPoints(), 0); labelList dispCount(pp.nPoints(), 0);
const labelListList& pointEdges = pp.pointEdges(); const labelListList& pointEdges = pp.pointEdges();
@ -233,9 +233,9 @@ void Foam::snappySnapDriver::calcNearestFace
// Displacement and orientation per pp face. // Displacement and orientation per pp face.
faceDisp.setSize(pp.size()); faceDisp.setSize(pp.size());
faceDisp = vector::zero; faceDisp = Zero;
faceSurfaceNormal.setSize(pp.size()); faceSurfaceNormal.setSize(pp.size());
faceSurfaceNormal = vector::zero; faceSurfaceNormal = Zero;
faceSurfaceGlobalRegion.setSize(pp.size()); faceSurfaceGlobalRegion.setSize(pp.size());
faceSurfaceGlobalRegion = -1; faceSurfaceGlobalRegion = -1;
@ -408,7 +408,7 @@ void Foam::snappySnapDriver::calcNearestFace
// //
//// Determine rotation axis //// Determine rotation axis
//faceRotation.setSize(pp.size()); //faceRotation.setSize(pp.size());
//faceRotation = vector::zero; //faceRotation = Zero;
// //
//forAll(faceRotation, faceI) //forAll(faceRotation, faceI)
//{ //{
@ -745,7 +745,7 @@ Foam::pointIndexHit Foam::snappySnapDriver::findMultiPatchPoint
} }
} }
} }
return pointIndexHit(false, vector::zero, labelMax); return pointIndexHit(false, Zero, labelMax);
} }
@ -933,7 +933,7 @@ void Foam::snappySnapDriver::featureAttractionUsingReconstruction
pointConstraint& patchConstraint pointConstraint& patchConstraint
) const ) const
{ {
patchAttraction = vector::zero; patchAttraction = Zero;
patchConstraint = pointConstraint(); patchConstraint = pointConstraint();
const List<point>& pfSurfNormals = pointFaceSurfNormals[pointI]; const List<point>& pfSurfNormals = pointFaceSurfNormals[pointI];
@ -1155,7 +1155,7 @@ void Foam::snappySnapDriver::featureAttractionUsingReconstruction
forAll(pp.localPoints(), pointI) forAll(pp.localPoints(), pointI)
{ {
vector attraction = vector::zero; vector attraction = Zero;
pointConstraint constraint; pointConstraint constraint;
featureAttractionUsingReconstruction featureAttractionUsingReconstruction
@ -1510,7 +1510,7 @@ void Foam::snappySnapDriver::releasePointsNextToMultiPatch
//Pout<< "Knocking out constraint" //Pout<< "Knocking out constraint"
// << " on non-multiPatchPoint:" // << " on non-multiPatchPoint:"
// << pp.localPoints()[pointI] << endl; // << pp.localPoints()[pointI] << endl;
patchAttraction[pointI] = vector::zero; patchAttraction[pointI] = Zero;
patchConstraints[pointI] = pointConstraint(); patchConstraints[pointI] = pointConstraint();
nChanged++; nChanged++;
@ -2193,14 +2193,14 @@ Foam::snappySnapDriver::findNearFeaturePoint
// Current pointI nearer. // Current pointI nearer.
pointAttractor[featI][featPointI] = pointI; pointAttractor[featI][featPointI] = pointI;
pointConstraints[featI][featPointI].first() = 3; pointConstraints[featI][featPointI].first() = 3;
pointConstraints[featI][featPointI].second() = vector::zero; pointConstraints[featI][featPointI].second() = Zero;
// Store for later use // Store for later use
patchAttraction[pointI] = featPt-pt; patchAttraction[pointI] = featPt-pt;
patchConstraints[pointI] = pointConstraints[featI][featPointI]; patchConstraints[pointI] = pointConstraints[featI][featPointI];
// Reset oldPointI to nearest on feature edge // Reset oldPointI to nearest on feature edge
patchAttraction[oldPointI] = vector::zero; patchAttraction[oldPointI] = Zero;
patchConstraints[oldPointI] = pointConstraint(); patchConstraints[oldPointI] = pointConstraint();
findNearFeatureEdge findNearFeatureEdge
@ -2224,7 +2224,7 @@ Foam::snappySnapDriver::findNearFeaturePoint
// Current pointI nearer. // Current pointI nearer.
pointAttractor[featI][featPointI] = pointI; pointAttractor[featI][featPointI] = pointI;
pointConstraints[featI][featPointI].first() = 3; pointConstraints[featI][featPointI].first() = 3;
pointConstraints[featI][featPointI].second() = vector::zero; pointConstraints[featI][featPointI].second() = Zero;
// Store for later use // Store for later use
patchAttraction[pointI] = featPt-pt; patchAttraction[pointI] = featPt-pt;
@ -2346,7 +2346,7 @@ void Foam::snappySnapDriver::determineFeatures
// 2: attract to feature line, constraint is feature line direction // 2: attract to feature line, constraint is feature line direction
// 3: attract to feature point, constraint is zero) // 3: attract to feature point, constraint is zero)
vector attraction = vector::zero; vector attraction = Zero;
pointConstraint constraint; pointConstraint constraint;
featureAttractionUsingReconstruction featureAttractionUsingReconstruction
@ -3029,8 +3029,7 @@ void Foam::snappySnapDriver::determineBaffleFeatures
{ {
pointAttractor[featI][featPointI] = pointI; pointAttractor[featI][featPointI] = pointI;
pointConstraints[featI][featPointI].first() = 3; pointConstraints[featI][featPointI].first() = 3;
pointConstraints[featI][featPointI].second() = pointConstraints[featI][featPointI].second() = Zero;
vector::zero;
// Store for later use // Store for later use
patchAttraction[pointI] = featPt-pt; patchAttraction[pointI] = featPt-pt;
@ -3245,7 +3244,7 @@ void Foam::snappySnapDriver::reverseAttractMeshPoints
// Per mesh point the point on nearest feature edge. // Per mesh point the point on nearest feature edge.
patchAttraction.setSize(pp.nPoints()); patchAttraction.setSize(pp.nPoints());
patchAttraction = vector::zero; patchAttraction = Zero;
patchConstraints.setSize(pp.nPoints()); patchConstraints.setSize(pp.nPoints());
patchConstraints = pointConstraint(); patchConstraints = pointConstraint();
@ -3440,7 +3439,7 @@ void Foam::snappySnapDriver::featureAttractionUsingFeatureEdges
} }
// Reverse: from pp point to nearest feature // Reverse: from pp point to nearest feature
vectorField rawPatchAttraction(pp.nPoints(), vector::zero); vectorField rawPatchAttraction(pp.nPoints(), Zero);
List<pointConstraint> rawPatchConstraints(pp.nPoints()); List<pointConstraint> rawPatchConstraints(pp.nPoints());
determineFeatures determineFeatures
@ -3875,11 +3874,11 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurfaceFeature
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// vector from point on surface back to face centre // vector from point on surface back to face centre
vectorField faceDisp(pp.size(), vector::zero); vectorField faceDisp(pp.size(), Zero);
// normal of surface at point on surface // normal of surface at point on surface
vectorField faceSurfaceNormal(pp.size(), vector::zero); vectorField faceSurfaceNormal(pp.size(), Zero);
labelList faceSurfaceGlobalRegion(pp.size(), -1); labelList faceSurfaceGlobalRegion(pp.size(), -1);
//vectorField faceRotation(pp.size(), vector::zero); //vectorField faceRotation(pp.size(), Zero);
calcNearestFace calcNearestFace
( (
@ -3927,7 +3926,7 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurfaceFeature
// Nearest feature // Nearest feature
patchAttraction.setSize(localPoints.size()); patchAttraction.setSize(localPoints.size());
patchAttraction = vector::zero; patchAttraction = Zero;
// Constraints at feature // Constraints at feature
patchConstraints.setSize(localPoints.size()); patchConstraints.setSize(localPoints.size());
patchConstraints = pointConstraint(); patchConstraints = pointConstraint();

View File

@ -490,7 +490,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
nbrPatchName_(word::null), nbrPatchName_(word::null),
nbrPatchID_(-1), nbrPatchID_(-1),
rotationAxis_(Zero), rotationAxis_(Zero),
rotationCentre_(point::zero), rotationCentre_(Zero),
rotationAngleDefined_(false), rotationAngleDefined_(false),
rotationAngle_(0.0), rotationAngle_(0.0),
separationVector_(Zero), separationVector_(Zero),
@ -521,7 +521,7 @@ Foam::cyclicAMIPolyPatch::cyclicAMIPolyPatch
coupleGroup_(dict), coupleGroup_(dict),
nbrPatchID_(-1), nbrPatchID_(-1),
rotationAxis_(Zero), rotationAxis_(Zero),
rotationCentre_(point::zero), rotationCentre_(Zero),
rotationAngleDefined_(false), rotationAngleDefined_(false),
rotationAngle_(0.0), rotationAngle_(0.0),
separationVector_(Zero), separationVector_(Zero),

View File

@ -99,7 +99,7 @@ Foam::cylindrical::cylindrical
) )
: :
Rptr_(), Rptr_(),
origin_(point::zero), origin_(Zero),
e3_(Zero) e3_(Zero)
{ {
// If origin is specified in the coordinateSystem // If origin is specified in the coordinateSystem

View File

@ -43,7 +43,7 @@ Foam::coordinateSystem::coordinateSystem()
: :
name_(), name_(),
note_(), note_(),
origin_(point::zero), origin_(Zero),
R_(new axesRotation(sphericalTensor::I)) R_(new axesRotation(sphericalTensor::I))
{} {}
@ -98,7 +98,7 @@ Foam::coordinateSystem::coordinateSystem
: :
name_(name), name_(name),
note_(), note_(),
origin_(point::zero), origin_(Zero),
R_() R_()
{ {
init(dict); init(dict);
@ -109,7 +109,7 @@ Foam::coordinateSystem::coordinateSystem(const dictionary& dict)
: :
name_(), name_(),
note_(), note_(),
origin_(point::zero), origin_(Zero),
R_() R_()
{ {
init(dict); init(dict);
@ -124,7 +124,7 @@ Foam::coordinateSystem::coordinateSystem
: :
name_(), name_(),
note_(), note_(),
origin_(point::zero), origin_(Zero),
R_() R_()
{ {
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false); const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
@ -168,7 +168,7 @@ Foam::coordinateSystem::coordinateSystem(Istream& is)
: :
name_(is), name_(is),
note_(), note_(),
origin_(point::zero), origin_(Zero),
R_() R_()
{ {
dictionary dict(is); dictionary dict(is);

View File

@ -100,7 +100,7 @@ void Foam::searchableCone::findNearestAndNormal
scalar magV = mag(v); scalar magV = mag(v);
if (magV < ROOTVSMALL) if (magV < ROOTVSMALL)
{ {
v = vector::zero; v = Zero;
} }
else else
{ {
@ -1045,7 +1045,7 @@ void Foam::searchableCone::getNormal
) const ) const
{ {
normal.setSize(info.size()); normal.setSize(info.size());
normal = vector::zero; normal = Zero;
forAll(info, i) forAll(info, i)
{ {

View File

@ -57,7 +57,7 @@ Foam::searchableRotatedBox::searchableRotatedBox
io.writeOpt(), io.writeOpt(),
false //io.registerObject(), false //io.registerObject(),
), ),
treeBoundBox(point::zero, dict.lookup("span")) treeBoundBox(Zero, dict.lookup("span"))
), ),
transform_ transform_
( (

View File

@ -70,7 +70,7 @@ class tetOverlapVolume
inline sumMomentOp() inline sumMomentOp()
: :
vol_(0.0, vector::zero) vol_(0.0, Zero)
{} {}
inline void operator()(const tetPoints& tet) inline void operator()(const tetPoints& tet)

View File

@ -273,7 +273,7 @@ void Foam::forceCoeffs::read(const dictionary& dict)
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("0", dimless, vector::zero) dimensionedVector("0", dimless, Zero)
) )
); );
@ -292,7 +292,7 @@ void Foam::forceCoeffs::read(const dictionary& dict)
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("0", dimless, vector::zero) dimensionedVector("0", dimless, Zero)
) )
); );

View File

@ -304,7 +304,7 @@ void Foam::forces::resetFields()
obr_.lookupObject<volVectorField>(fieldName("force")) obr_.lookupObject<volVectorField>(fieldName("force"))
); );
force == dimensionedVector("0", force.dimensions(), vector::zero); force == dimensionedVector("0", force.dimensions(), Zero);
volVectorField& moment = volVectorField& moment =
const_cast<volVectorField&> const_cast<volVectorField&>
@ -312,7 +312,7 @@ void Foam::forces::resetFields()
obr_.lookupObject<volVectorField>(fieldName("moment")) obr_.lookupObject<volVectorField>(fieldName("moment"))
); );
moment == dimensionedVector("0", moment.dimensions(), vector::zero); moment == dimensionedVector("0", moment.dimensions(), Zero);
} }
} }
@ -968,7 +968,7 @@ void Foam::forces::read(const dictionary& dict)
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("0", dimForce, vector::zero) dimensionedVector("0", dimForce, Zero)
) )
); );
@ -987,7 +987,7 @@ void Foam::forces::read(const dictionary& dict)
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
mesh, mesh,
dimensionedVector("0", dimForce*dimLength, vector::zero) dimensionedVector("0", dimForce*dimLength, Zero)
) )
); );

View File

@ -186,7 +186,7 @@ void Foam::fluxSummary::initialiseFaceZoneAndDirection
const surfaceVectorField& Sf = mesh.Sf(); const surfaceVectorField& Sf = mesh.Sf();
const surfaceScalarField& magSf = mesh.magSf(); const surfaceScalarField& magSf = mesh.magSf();
vector n = vector::zero; vector n(Zero);
forAll(fZone, i) forAll(fZone, i)
{ {

View File

@ -146,7 +146,7 @@ Foam::meshToMeshMethod::interVolAndCentroid
if (volAndInertia.first() <= ROOTVSMALL) if (volAndInertia.first() <= ROOTVSMALL)
{ {
volAndInertia.first() = 0.0; volAndInertia.first() = 0.0;
volAndInertia.second() = vector::zero; volAndInertia.second() = Zero;
} }
else else
{ {

View File

@ -80,7 +80,7 @@ Foam::fileName Foam::foamFileSurfaceWriter::write
// Face centers. Not really necessary but very handy when reusing as inputs // Face centers. Not really necessary but very handy when reusing as inputs
// for e.g. timeVaryingMapped bc. // for e.g. timeVaryingMapped bc.
pointField faceCentres(faces.size(),point::zero); pointField faceCentres(faces.size(), Zero);
forAll(faces, faceI) forAll(faces, faceI)
{ {

View File

@ -323,7 +323,7 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
solarLoad_(), solarLoad_(),
meshOrientation_ meshOrientation_
( (
coeffs_.lookupOrDefault<vector>("meshOrientation", vector::zero) coeffs_.lookupOrDefault<vector>("meshOrientation", Zero)
) )
{ {
initialise(); initialise();
@ -418,7 +418,7 @@ Foam::radiation::fvDOM::fvDOM
solarLoad_(), solarLoad_(),
meshOrientation_ meshOrientation_
( (
coeffs_.lookupOrDefault<vector>("meshOrientation", vector::zero) coeffs_.lookupOrDefault<vector>("meshOrientation", Zero)
) )
{ {
initialise(); initialise();

View File

@ -137,7 +137,7 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
if (mesh_.nSolutionD() == 2) if (mesh_.nSolutionD() == 2)
{ {
vector meshDir(vector::zero); vector meshDir(Zero);
if (dom_.meshOrientation() != vector::zero) if (dom_.meshOrientation() != vector::zero)
{ {
meshDir = dom_.meshOrientation(); meshDir = dom_.meshOrientation();
@ -161,7 +161,7 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
} }
else if (mesh_.nSolutionD() == 1) else if (mesh_.nSolutionD() == 1)
{ {
vector meshDir(vector::zero); vector meshDir(Zero);
if (dom_.meshOrientation() != vector::zero) if (dom_.meshOrientation() != vector::zero)
{ {
meshDir = dom_.meshOrientation(); meshDir = dom_.meshOrientation();
@ -195,7 +195,7 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
IOobject::AUTO_WRITE IOobject::AUTO_WRITE
); );
// check if field exists and can be read // Check if field exists and can be read
if (IHeader.typeHeaderOk<volScalarField>(true)) if (IHeader.typeHeaderOk<volScalarField>(true))
{ {
ILambda_.set ILambda_.set

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -44,8 +44,8 @@ namespace Foam
} }
} }
const Foam::word Foam::radiation::solarLoad::viewFactorWalls const Foam::word Foam::radiation::solarLoad::viewFactorWalls = "viewFactorWall";
= "viewFactorWall";
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -126,9 +126,7 @@ void Foam::radiation::solarLoad::updateDirectHitRadiation
label patchID = patches.whichPatch(faceI); label patchID = patches.whichPatch(faceI);
const polyPatch& pp = patches[patchID]; const polyPatch& pp = patches[patchID];
const label localFaceI = faceI - pp.start(); const label localFaceI = faceI - pp.start();
const vector qPrim = const vector qPrim = solarCalc_.directSolarRad()*solarCalc_.direction();
solarCalc_.directSolarRad()
* solarCalc_.direction();
if (includeMappedPatchBasePatches[patchID]) if (includeMappedPatchBasePatches[patchID])
{ {
@ -220,9 +218,9 @@ void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation
// Ground reflected // Ground reflected
Er = Er =
solarCalc_.directSolarRad() solarCalc_.directSolarRad()
* (solarCalc_.C() + Foam::sin(solarCalc_.beta())) * (solarCalc_.C() + Foam::sin(solarCalc_.beta()))
* solarCalc_.groundReflectivity() * solarCalc_.groundReflectivity()
* (1.0 - cosEpsilon)/2.0; * (1.0 - cosEpsilon)/2.0;
} }
const label cellI = cellIds[faceI]; const label cellI = cellIds[faceI];
@ -241,10 +239,10 @@ void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation
for (label bandI = 0; bandI < nBands_; bandI++) for (label bandI = 0; bandI < nBands_; bandI++)
{ {
Ru_[cellI] += Ru_[cellI] +=
(Ed + Er) (Ed + Er)
* spectralDistribution_[bandI] * spectralDistribution_[bandI]
* absorptivity_[patchID][bandI]()[faceI] * absorptivity_[patchID][bandI]()[faceI]
* sf[faceI]/V[cellI]; * sf[faceI]/V[cellI];
} }
} }
} }
@ -337,20 +335,9 @@ void Foam::radiation::solarLoad::initialise(const dictionary& coeffs)
); );
} }
if (coeffs.found("solidCoupled")) coeffs.readIfPresent("solidCoupled", solidCoupled_);
{ coeffs.readIfPresent("wallCoupled", wallCoupled_);
coeffs.lookup("solidCoupled") >> solidCoupled_; coeffs.readIfPresent("updateAbsorptivity", updateAbsorptivity_);
}
if (coeffs.found("wallCoupled"))
{
coeffs.lookup("wallCoupled") >> wallCoupled_;
}
if (coeffs.found("updateAbsorptivity"))
{
coeffs.lookup("updateAbsorptivity") >> updateAbsorptivity_;
}
} }
@ -399,8 +386,7 @@ void Foam::radiation::solarLoad::calculateQdiff
forAll(includePatches_, i) forAll(includePatches_, i)
{ {
const label patchI = includePatches_[i]; const label patchI = includePatches_[i];
nLocalVFCoarseFaces += nLocalVFCoarseFaces += coarseMesh_->boundaryMesh()[patchI].size();
coarseMesh_->boundaryMesh()[patchI].size();
} }
label totalFVNCoarseFaces = nLocalVFCoarseFaces; label totalFVNCoarseFaces = nLocalVFCoarseFaces;
@ -413,7 +399,7 @@ void Foam::radiation::solarLoad::calculateQdiff
scalarField compactCoarseRave(map_->constructSize(), 0.0); scalarField compactCoarseRave(map_->constructSize(), 0.0);
scalarField compactCoarsePartialArea(map_->constructSize(), 0.0); scalarField compactCoarsePartialArea(map_->constructSize(), 0.0);
vectorList compactCoarseNorm(map_->constructSize(), vector::zero); vectorList compactCoarseNorm(map_->constructSize(), Zero);
const boundaryRadiationProperties& boundaryRadiation = const boundaryRadiationProperties& boundaryRadiation =
boundaryRadiationProperties::New(mesh_); boundaryRadiationProperties::New(mesh_);
@ -443,8 +429,8 @@ void Foam::radiation::solarLoad::calculateQdiff
for (label bandI = 0; bandI < nBands_; bandI++) for (label bandI = 0; bandI < nBands_; bandI++)
{ {
const tmp<scalarField> tr = const tmp<scalarField> tr =
spectralDistribution_[bandI] spectralDistribution_[bandI]
*boundaryRadiation.reflectivity(patchID, bandI); *boundaryRadiation.reflectivity(patchID, bandI);
r += tr(); r += tr();
} }
@ -459,14 +445,9 @@ void Foam::radiation::solarLoad::calculateQdiff
forAll(cpp, coarseI) forAll(cpp, coarseI)
{ {
const label coarseFaceID = coarsePatchFace[coarseI]; const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = const labelList& fineFaces = coarseToFine_[i][coarseFaceID];
coarseToFine_[i][coarseFaceID];
UIndirectList<scalar> fineSf UIndirectList<scalar> fineSf(sf, fineFaces);
(
sf,
fineFaces
);
scalar fineArea = sum(fineSf()); scalar fineArea = sum(fineSf());
scalar fullArea = 0.0; scalar fullArea = 0.0;
@ -503,18 +484,18 @@ void Foam::radiation::solarLoad::calculateQdiff
} }
SubList<scalar>(compactCoarsePartialArea, nLocalVFCoarseFaces) = SubList<scalar>(compactCoarsePartialArea, nLocalVFCoarseFaces) =
localCoarsePartialArea; localCoarsePartialArea;
SubList<scalar>(compactCoarseRave, nLocalVFCoarseFaces) = SubList<scalar>(compactCoarseRave, nLocalVFCoarseFaces) =
localCoarseRave; localCoarseRave;
SubList<vector>(compactCoarseNorm, nLocalVFCoarseFaces) = SubList<vector>(compactCoarseNorm, nLocalVFCoarseFaces) =
localCoarseNorm; localCoarseNorm;
map_->distribute(compactCoarsePartialArea); map_->distribute(compactCoarsePartialArea);
map_->distribute(compactCoarseRave); map_->distribute(compactCoarseRave);
map_->distribute(compactCoarseNorm); map_->distribute(compactCoarseNorm);
// Calculate coarse hitFaces and Sun direct hit heat fluxes // Calculate coarse hitFaces and Sun direct hit heat fluxes
@ -527,8 +508,7 @@ void Foam::radiation::solarLoad::calculateQdiff
const polyPatch& pp = coarseMesh_->boundaryMesh()[patchID]; const polyPatch& pp = coarseMesh_->boundaryMesh()[patchID];
const polyPatch& ppf = mesh_.boundaryMesh()[patchID]; const polyPatch& ppf = mesh_.boundaryMesh()[patchID];
const labelList& coarsePatchFace = const labelList& coarsePatchFace = coarseMesh_->patchFaceMap()[patchID];
coarseMesh_->patchFaceMap()[patchID];
const scalarField& sf = mesh_.magSf().boundaryField()[patchID]; const scalarField& sf = mesh_.magSf().boundaryField()[patchID];
scalarField a(ppf.size(), 0.0); scalarField a(ppf.size(), 0.0);
@ -544,11 +524,7 @@ void Foam::radiation::solarLoad::calculateQdiff
{ {
const label coarseFaceID = coarsePatchFace[coarseI]; const label coarseFaceID = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine_[i][coarseFaceID]; const labelList& fineFaces = coarseToFine_[i][coarseFaceID];
UIndirectList<scalar> fineSf UIndirectList<scalar> fineSf(sf, fineFaces);
(
sf,
fineFaces
);
scalar fineArea = sum(fineSf()); scalar fineArea = sum(fineSf());
scalar aAve = 0.0; scalar aAve = 0.0;
@ -568,12 +544,12 @@ void Foam::radiation::solarLoad::calculateQdiff
label compactI = compactFaces[j]; label compactI = compactFaces[j];
localqDiffusive[locaFaceI] += localqDiffusive[locaFaceI] +=
compactCoarsePartialArea[compactI] compactCoarsePartialArea[compactI]
* aAve * aAve
* (solarCalc_.directSolarRad()*solarCalc_.direction()) * (solarCalc_.directSolarRad()*solarCalc_.direction())
& compactCoarseNorm[compactI] & compactCoarseNorm[compactI]
* vf[j] * vf[j]
* compactCoarseRave[compactI]; * compactCoarseRave[compactI];
} }
locaFaceI++; locaFaceI++;
@ -693,7 +669,7 @@ Foam::radiation::solarLoad::solarLoad(const volScalarField& T)
dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0) dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0)
), ),
solarCalc_(this->subDict(typeName + "Coeffs"), mesh_), solarCalc_(this->subDict(typeName + "Coeffs"), mesh_),
verticalDir_(vector::zero), verticalDir_(Zero),
useVFbeamToDiffuse_(false), useVFbeamToDiffuse_(false),
includePatches_(mesh_.boundary().size(), -1), includePatches_(mesh_.boundary().size(), -1),
coarseToFine_(), coarseToFine_(),
@ -783,7 +759,7 @@ Foam::radiation::solarLoad::solarLoad
dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0) dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0)
), ),
solarCalc_(coeffs_, mesh_), solarCalc_(coeffs_, mesh_),
verticalDir_(vector::zero), verticalDir_(Zero),
useVFbeamToDiffuse_(false), useVFbeamToDiffuse_(false),
includePatches_(mesh_.boundary().size(), -1), includePatches_(mesh_.boundary().size(), -1),
coarseToFine_(), coarseToFine_(),
@ -875,7 +851,7 @@ Foam::radiation::solarLoad::solarLoad
dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0) dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0)
), ),
solarCalc_(dict, mesh_), solarCalc_(dict, mesh_),
verticalDir_(vector::zero), verticalDir_(Zero),
useVFbeamToDiffuse_(false), useVFbeamToDiffuse_(false),
includePatches_(mesh_.boundary().size(), -1), includePatches_(mesh_.boundary().size(), -1),
coarseToFine_(), coarseToFine_(),
@ -1034,4 +1010,5 @@ Foam::radiation::solarLoad::Ru() const
return Ru_; return Ru_;
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -123,7 +123,7 @@ void Foam::solarCalculator::calculateSunDirection()
coord_.reset coord_.reset
( (
new coordinateSystem("grid", vector::zero, gridUp_, eastDir_) new coordinateSystem("grid", Zero, gridUp_, eastDir_)
); );
direction_.z() = -sin(beta_); direction_.z() = -sin(beta_);
@ -236,7 +236,7 @@ Foam::solarCalculator::solarCalculator
: :
mesh_(mesh), mesh_(mesh),
dict_(dict), dict_(dict),
direction_(vector::zero), direction_(Zero),
directSolarRad_(0.0), directSolarRad_(0.0),
diffuseSolarRad_(0.0), diffuseSolarRad_(0.0),
groundReflectivity_(0.0), groundReflectivity_(0.0),