BUG: wallPoint: initialise to -GREAT to handle ami interpolation

This commit is contained in:
mattijs
2012-03-05 11:03:40 +00:00
parent 95b29c7ee4
commit f82f5ff3fb
4 changed files with 41 additions and 42 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -42,6 +42,8 @@ inline bool wallPointYPlus::update
{
scalar dist2 = magSqr(pt - w2.origin());
if (valid(td))
{
scalar diff = distSqr() - dist2;
if (diff < 0)
@ -55,12 +57,14 @@ inline bool wallPointYPlus::update
// don't propagate small changes
return false;
}
else
}
// Either *this is not yet valid or w2 is closer
{
// only propagate if interesting (i.e. y+ < 100)
scalar yPlus = Foam::sqrt(dist2)/w2.data();
if (yPlus < yPlusCutOff)
{
// update with new values

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,8 +101,9 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
else
{
// Illegal/unset value. What to do with data?
// Note: mag for now. Should maybe be member of TransferType?
distance_[cellI] = dist;
distance_[cellI] = mag(dist);
//cellData_[cellI] = point::max;
cellData_[cellI] = cellInfo[cellI].data();
@ -149,7 +150,7 @@ Foam::label Foam::patchDataWave<TransferType>::getValues
{
// Illegal/unset value. What to do with data?
patchField[patchFaceI] = dist;
patchField[patchFaceI] = mag(dist);
//patchDataField[patchFaceI] = point::max;
patchDataField[patchFaceI] = faceInfo[meshFaceI].data();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -43,16 +43,8 @@ inline bool wallPointData<Type>::update
{
scalar dist2 = magSqr(pt - w2.origin());
if (!valid(td))
if (valid(td))
{
// current not yet set so use any value
distSqr() = dist2;
origin() = w2.origin();
data_ = w2.data();
return true;
}
scalar diff = distSqr() - dist2;
if (diff < 0)
@ -66,9 +58,11 @@ inline bool wallPointData<Type>::update
// don't propagate small changes
return false;
}
else
}
// Either *this is not yet valid or w2 is closer
{
// update with new values
// current not yet set so use any value
distSqr() = dist2;
origin() = w2.origin();
data_ = w2.data();

View File

@ -85,7 +85,7 @@ inline bool Foam::wallPoint::update
inline Foam::wallPoint::wallPoint()
:
origin_(point::max),
distSqr_(GREAT)
distSqr_(-GREAT)
{}