mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Deactivate face/cell sources if no faces/cells present
This commit is contained in:
@ -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) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -122,7 +122,22 @@ void Foam::fieldValues::cellSource::initialise(const dictionary& dict)
|
|||||||
{
|
{
|
||||||
setCellZoneCells();
|
setCellZoneCells();
|
||||||
|
|
||||||
Info<< type() << " " << name_ << ":" << nl
|
if (nCells_ == 0)
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"Foam::fieldValues::cellSource::initialise(const dictionary&)"
|
||||||
|
)
|
||||||
|
<< type() << " " << name_ << ": "
|
||||||
|
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
|
||||||
|
<< " Source has no cells - deactivating" << endl;
|
||||||
|
|
||||||
|
active_ = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info<< type() << " " << name_ << ":"
|
||||||
|
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
|
||||||
<< " total cells = " << nCells_ << nl
|
<< " total cells = " << nCells_ << nl
|
||||||
<< " total volume = " << gSum(filterField(mesh().V()))
|
<< " total volume = " << gSum(filterField(mesh().V()))
|
||||||
<< nl << endl;
|
<< nl << endl;
|
||||||
|
|||||||
@ -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) 2009-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2009-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -249,6 +249,20 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (nFaces_ == 0)
|
||||||
|
{
|
||||||
|
WarningIn
|
||||||
|
(
|
||||||
|
"Foam::fieldValues::faceSource::initialise(const dictionary&)"
|
||||||
|
)
|
||||||
|
<< type() << " " << name_ << ": "
|
||||||
|
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
|
||||||
|
<< " Source has no faces - deactivating" << endl;
|
||||||
|
|
||||||
|
active_ = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
scalar totalArea;
|
scalar totalArea;
|
||||||
|
|
||||||
if (surfacePtr_.valid())
|
if (surfacePtr_.valid())
|
||||||
|
|||||||
Reference in New Issue
Block a user