Merge branch 'master' of ssh://dm/home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
Henry
2013-08-19 11:49:39 +01:00
6 changed files with 89 additions and 40 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -90,6 +90,11 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
const labelPairList& info
) const
{
scalar tol = refCast<const coupledPolyPatch>
(
mesh_.boundaryMesh()[patchI]
).matchTolerance();
labelPairList sendInfo(info.size());
forAll(info, i)
@ -111,7 +116,8 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
(
globalIndexAndTransform::transformIndex(info[i]),
patchI,
true // patchI is sending side
true, // patchI is sending side
tol // tolerance for comparison
)
);
}

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -195,7 +195,8 @@ public:
(
const label transformIndex,
const label patchI,
const bool isSendingSide = true
const bool isSendingSide = true,
const scalar tol = SMALL
) const;
//- Combine two transformIndices

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -190,7 +190,8 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
(
const label transformIndex,
const label patchI,
const bool isSendingSide
const bool isSendingSide,
const scalar tol
) const
{
const Pair<label>& transSign = patchTransformSign_[patchI];
@ -227,6 +228,33 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
<< exit(FatalError);
}
else if (sign == permutation[matchTransI])
{
// This is usually illegal. The only exception is for points
// on the axis of a 180 degree cyclic wedge when the
// transformation is going to be (-1 0 0 0 -1 0 0 0 +1)
// (or a different permutation but always two times -1 and
// once +1)
bool antiCyclic = false;
const vectorTensorTransform& vt = transforms_[matchTransI];
if (mag(vt.t()) < SMALL && vt.hasR())
{
const tensor& R = vt.R();
scalar sumDiag = tr(R);
scalar sumMagDiag = mag(R.xx())+mag(R.yy())+mag(R.zz());
if (mag(sumMagDiag-3) < tol && mag(sumDiag+1) < tol)
{
antiCyclic = true;
}
}
if (antiCyclic)
{
// 180 degree rotational. Reset transformation.
permutation[matchTransI] = 0;
}
else
{
FatalErrorIn
(
@ -244,6 +272,7 @@ Foam::label Foam::globalIndexAndTransform::addToTransformIndex
<< " current transforms:" << permutation
<< exit(FatalError);
}
}
else
{
permutation[matchTransI] = 0;

View File

@ -201,6 +201,7 @@ void Foam::nastranSurfaceWriter::writeTemplate
{
v += values[f[fptI]];
}
v /= f.size();
writeFaceValue(nasFieldName, v, ++n, os);
}

View File

@ -197,7 +197,14 @@ updateCoeffs()
const vector& myRayId = dom.IRay(rayId).d();
const scalarField& Ir = dom.Qin().boundaryField()[patchI];
// Use updated Ir while iterating over rays
// avoids to used lagged Qin
scalarField Ir = dom.IRay(0).Qin().boundaryField()[patchI];
for (label rayI=1; rayI < dom.nRay(); rayI++)
{
Ir += dom.IRay(rayI).Qin().boundaryField()[patchI];
}
forAll(Iw, faceI)
{

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-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -187,7 +187,9 @@ updateCoeffs()
radiativeIntensityRay& ray =
const_cast<radiativeIntensityRay&>(dom.IRay(rayId));
ray.Qr().boundaryField()[patchI] += Iw*(n & ray.dAve());
const scalarField nAve(n & ray.dAve());
ray.Qr().boundaryField()[patchI] += Iw*nAve;
const scalarField Eb
(
@ -196,23 +198,20 @@ updateCoeffs()
scalarField temissivity = emissivity();
scalarField& Qem = ray.Qem().boundaryField()[patchI];
scalarField& Qin = ray.Qin().boundaryField()[patchI];
// Use updated Ir while iterating over rays
// avoids to used lagged Qin
scalarField Ir = dom.IRay(0).Qin().boundaryField()[patchI];
for (label rayI=1; rayI < dom.nRay(); rayI++)
{
Ir += dom.IRay(rayI).Qin().boundaryField()[patchI];
}
forAll(Iw, faceI)
{
scalar Ir = 0.0;
for (label rayI=0; rayI < dom.nRay(); rayI++)
{
const vector& d = dom.IRay(rayI).d();
const scalarField& IFace =
dom.IRay(rayI).ILambda(lambdaId).boundaryField()[patchI];
if ((-n[faceI] & d) < 0.0) // qin into the wall
{
const vector& dAve = dom.IRay(rayI).dAve();
Ir = Ir + IFace[faceI]*mag(n[faceI] & dAve);
}
}
const vector& d = dom.IRay(rayId).d();
if ((-n[faceI] & d) > 0.0)
@ -222,9 +221,12 @@ updateCoeffs()
valueFraction()[faceI] = 1.0;
refValue()[faceI] =
(
Ir*(1.0 - temissivity[faceI])
Ir[faceI]*(1.0 - temissivity[faceI])
+ temissivity[faceI]*Eb[faceI]
)/pi;
// Emmited heat flux from this ray direction
Qem[faceI] = refValue()[faceI]*nAve[faceI];
}
else
{
@ -232,6 +234,9 @@ updateCoeffs()
valueFraction()[faceI] = 0.0;
refGrad()[faceI] = 0.0;
refValue()[faceI] = 0.0; //not used
// Incident heat flux on this ray direction
Qin[faceI] = Iw[faceI]*nAve[faceI];
}
}