Skip to content
Snippets Groups Projects
Commit cdc2a2e1 authored by Sergio Ferraris's avatar Sergio Ferraris
Browse files

Optimization of greyDiffusiveRadiationMixed and wideBandDiffusiveRadiationMixed to

avoid lagging the calculation of Qin.
parent 2cb72509
Branches
Tags
No related merge requests found
...@@ -197,7 +197,14 @@ updateCoeffs() ...@@ -197,7 +197,14 @@ updateCoeffs()
const vector& myRayId = dom.IRay(rayId).d(); 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) forAll(Iw, faceI)
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,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) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
...@@ -187,7 +187,9 @@ updateCoeffs() ...@@ -187,7 +187,9 @@ updateCoeffs()
radiativeIntensityRay& ray = radiativeIntensityRay& ray =
const_cast<radiativeIntensityRay&>(dom.IRay(rayId)); 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 const scalarField Eb
( (
...@@ -196,23 +198,20 @@ updateCoeffs() ...@@ -196,23 +198,20 @@ updateCoeffs()
scalarField temissivity = emissivity(); scalarField temissivity = emissivity();
forAll(Iw, faceI) scalarField& Qem = ray.Qem().boundaryField()[patchI];
{ scalarField& Qin = ray.Qin().boundaryField()[patchI];
scalar Ir = 0.0;
for (label rayI=0; rayI < dom.nRay(); rayI++)
{
const vector& d = dom.IRay(rayI).d();
const scalarField& IFace = // Use updated Ir while iterating over rays
dom.IRay(rayI).ILambda(lambdaId).boundaryField()[patchI]; // avoids to used lagged Qin
scalarField Ir = dom.IRay(0).Qin().boundaryField()[patchI];
if ((-n[faceI] & d) < 0.0) // qin into the wall for (label rayI=1; rayI < dom.nRay(); rayI++)
{ {
const vector& dAve = dom.IRay(rayI).dAve(); Ir += dom.IRay(rayI).Qin().boundaryField()[patchI];
Ir = Ir + IFace[faceI]*mag(n[faceI] & dAve); }
}
}
forAll(Iw, faceI)
{
const vector& d = dom.IRay(rayId).d(); const vector& d = dom.IRay(rayId).d();
if ((-n[faceI] & d) > 0.0) if ((-n[faceI] & d) > 0.0)
...@@ -222,9 +221,12 @@ updateCoeffs() ...@@ -222,9 +221,12 @@ updateCoeffs()
valueFraction()[faceI] = 1.0; valueFraction()[faceI] = 1.0;
refValue()[faceI] = refValue()[faceI] =
( (
Ir*(1.0 - temissivity[faceI]) Ir[faceI]*(1.0 - temissivity[faceI])
+ temissivity[faceI]*Eb[faceI] + temissivity[faceI]*Eb[faceI]
)/pi; )/pi;
// Emmited heat flux from this ray direction
Qem[faceI] = refValue()[faceI]*nAve[faceI];
} }
else else
{ {
...@@ -232,6 +234,9 @@ updateCoeffs() ...@@ -232,6 +234,9 @@ updateCoeffs()
valueFraction()[faceI] = 0.0; valueFraction()[faceI] = 0.0;
refGrad()[faceI] = 0.0; refGrad()[faceI] = 0.0;
refValue()[faceI] = 0.0; //not used refValue()[faceI] = 0.0; //not used
// Incident heat flux on this ray direction
Qin[faceI] = Iw[faceI]*nAve[faceI];
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment