determine necessity of periodic cell check in cfdemCloud class

only check for periodic cells in submodels if all boundary patches are
cyclic
This commit is contained in:
danielque
2017-08-17 16:30:09 +02:00
parent 807c6e30e7
commit 1a98e6eaee
2 changed files with 28 additions and 0 deletions

View File

@ -126,6 +126,7 @@ cfdemCloud::cfdemCloud
mesh,
dimensionedScalar("zero", dimensionSet(0,0,-1,0,0), 0) // 1/s
),
checkPeriodicCells_(false),
turbulence_
(
mesh.lookupObject<turbulenceModel>
@ -298,6 +299,29 @@ cfdemCloud::cfdemCloud
dataExchangeM().setCG();
if (!cgOK_ && cg_ > 1) FatalError<< "at least one of your models is not fit for cg !!!"<< abort(FatalError);
// check if simulation is a fully periodic box
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
int nPatchesCyclic(0);
int nPatchesNonCyclic(0);
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
if (isA<cyclicPolyPatch>(pp) || isA<cyclicAMIPolyPatch>(pp))
++nPatchesCyclic;
else if (!isA<processorPolyPatch>(pp))
++nPatchesNonCyclic;
}
if (nPatchesNonCyclic == 0)
{
checkPeriodicCells_ = true;
}
else if (nPatchesCyclic > 0 && nPatchesNonCyclic > 0)
{
if (verbose_) Info << "nPatchesNonCyclic=" << nPatchesNonCyclic << ", nPatchesCyclic=" << nPatchesCyclic << endl;
Warning << "Periodic handing is disabled because the domain is not fully periodic!\n" << endl;
}
}
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * //

View File

@ -160,6 +160,8 @@ protected:
mutable volScalarField ddtVoidfraction_;
mutable Switch checkPeriodicCells_;
const turbulenceModel& turbulence_;
autoPtr<forceModel>* forceModel_;
@ -395,6 +397,8 @@ public:
void resetArray(double**&,int,int,double resetVal=0.);
void otherForces(volVectorField&);
bool checkPeriodicCells() { return checkPeriodicCells_; }
};