BUG: viewFactor: incorrect number of unknowns. Fixes #2585

This commit is contained in:
mattijs
2022-09-20 11:34:27 +01:00
parent afffec446a
commit 1a15bd08f7
2 changed files with 51 additions and 3 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2013-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019,2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -324,7 +324,31 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
lowerAddr_(l, reuse),
upperAddr_(u, reuse),
comm_(comm)
{}
{
if (debug && lowerAddr_.size())
{
if (max(lowerAddr_) >= nCells || min(lowerAddr_) < 0)
{
FatalErrorInFunction << "Illegal lower addressing."
<< " nCells:" << nCells
<< " max(lower):" << max(lowerAddr_)
<< " min(lower):" << min(lowerAddr_)
<< exit(FatalError);
}
}
if (debug && upperAddr_.size())
{
if (max(upperAddr_) >= nCells || min(upperAddr_) < 0)
{
FatalErrorInFunction << "Illegal upper addressing."
<< " nCells:" << nCells
<< " max(upper):" << max(upperAddr_)
<< " min(upper):" << min(upperAddr_)
<< exit(FatalError);
}
}
}
void Foam::lduPrimitiveMesh::addInterfaces
(
@ -374,6 +398,30 @@ Foam::lduPrimitiveMesh::lduPrimitiveMesh
patchSchedule_(ps),
comm_(comm)
{
if (debug && lowerAddr_.size())
{
if (max(lowerAddr_) >= nCells || min(lowerAddr_) < 0)
{
FatalErrorInFunction << "Illegal lower addressing."
<< " nCells:" << nCells
<< " max(lower):" << max(lowerAddr_)
<< " min(lower):" << min(lowerAddr_)
<< exit(FatalError);
}
}
if (debug && upperAddr_.size())
{
if (max(upperAddr_) >= nCells || min(upperAddr_) < 0)
{
FatalErrorInFunction << "Illegal upper addressing."
<< " nCells:" << nCells
<< " max(upper):" << max(upperAddr_)
<< " min(upper):" << min(upperAddr_)
<< exit(FatalError);
}
}
primitiveInterfaces_.transfer(primitiveInterfaces);
// Create interfaces

View File

@ -401,7 +401,7 @@ void Foam::radiation::viewFactor::initialise()
(
new lduPrimitiveMesh
(
rays_.size(),
globalFaceFaces_().size(), //rays_.size(),
lower,
upper,
allInterfacesPtr,