mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
patchInjection: Check for 0-patches
This commit is contained in:
@ -82,6 +82,13 @@ patchInjection::patchInjection
|
|||||||
|
|
||||||
patchInjectedMasses_.setSize(pbm.size(), 0);
|
patchInjectedMasses_.setSize(pbm.size(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!patchIDs_.size())
|
||||||
|
{
|
||||||
|
FatalErrorIn("patchInjection::patchInjection")
|
||||||
|
<< "No patches selected"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -100,6 +107,9 @@ void patchInjection::correct
|
|||||||
scalarField& diameterToInject
|
scalarField& diameterToInject
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Do not correct if no patches selected
|
||||||
|
if (!patchIDs_.size()) return;
|
||||||
|
|
||||||
const scalarField& delta = owner().delta();
|
const scalarField& delta = owner().delta();
|
||||||
const scalarField& rho = owner().rho();
|
const scalarField& rho = owner().rho();
|
||||||
const scalarField& magSf = owner().magSf();
|
const scalarField& magSf = owner().magSf();
|
||||||
@ -160,6 +170,9 @@ void patchInjection::correct
|
|||||||
|
|
||||||
void patchInjection::patchInjectedMassTotals(scalarField& patchMasses) const
|
void patchInjection::patchInjectedMassTotals(scalarField& patchMasses) const
|
||||||
{
|
{
|
||||||
|
// Do not correct if no patches selected
|
||||||
|
if (!patchIDs_.size()) return;
|
||||||
|
|
||||||
scalarField patchInjectedMasses
|
scalarField patchInjectedMasses
|
||||||
(
|
(
|
||||||
getModelProperty<scalarField>
|
getModelProperty<scalarField>
|
||||||
@ -170,7 +183,6 @@ void patchInjection::patchInjectedMassTotals(scalarField& patchMasses) const
|
|||||||
);
|
);
|
||||||
|
|
||||||
scalarField patchInjectedMassTotals(patchInjectedMasses_);
|
scalarField patchInjectedMassTotals(patchInjectedMasses_);
|
||||||
//combineReduce(patchInjectedMassTotals, plusEqOp<scalarField>());
|
|
||||||
Pstream::listCombineGather(patchInjectedMassTotals, plusEqOp<scalar>());
|
Pstream::listCombineGather(patchInjectedMassTotals, plusEqOp<scalar>());
|
||||||
|
|
||||||
forAll(patchIDs_, pidi)
|
forAll(patchIDs_, pidi)
|
||||||
|
|||||||
Reference in New Issue
Block a user