mirror of
https://github.com/ParticulateFlow/CFDEMcoupling-PFM.git
synced 2025-12-08 06:37:44 +00:00
Merge pull request #70 from ParticulateFlow/feature/constness
fix up const/mutable usage
This commit is contained in:
@ -782,7 +782,7 @@ tmp<volScalarField> cfdemCloud::ddtVoidfraction() const
|
||||
return tmp<volScalarField> (ddtVoidfraction_ * 1.) ;
|
||||
}
|
||||
|
||||
void cfdemCloud::calcDdtVoidfraction(volScalarField& voidfraction) const
|
||||
void cfdemCloud::calcDdtVoidfraction(volScalarField& voidfraction)
|
||||
{
|
||||
// version if ddt is calculated only at coupling time
|
||||
//Info << "calculating ddt(voidfraction) based on couplingTime" << endl;
|
||||
|
||||
@ -106,39 +106,39 @@ protected:
|
||||
|
||||
const word modelType_;
|
||||
|
||||
mutable double **positions_;
|
||||
double **positions_;
|
||||
|
||||
mutable double **velocities_;
|
||||
double **velocities_;
|
||||
|
||||
mutable double **fluidVel_;
|
||||
double **fluidVel_;
|
||||
|
||||
mutable double **fAcc_;
|
||||
double **fAcc_;
|
||||
|
||||
mutable double **impForces_;
|
||||
double **impForces_;
|
||||
|
||||
mutable double **expForces_;
|
||||
double **expForces_;
|
||||
|
||||
mutable double **DEMForces_;
|
||||
double **DEMForces_;
|
||||
|
||||
mutable double **Cds_;
|
||||
double **Cds_;
|
||||
|
||||
mutable double **radii_;
|
||||
double **radii_;
|
||||
|
||||
mutable double **voidfractions_;
|
||||
double **voidfractions_;
|
||||
|
||||
mutable int **cellIDs_;
|
||||
int **cellIDs_;
|
||||
|
||||
mutable double **particleDensities_;
|
||||
double **particleDensities_;
|
||||
|
||||
mutable double **particleEffVolFactors_;
|
||||
double **particleEffVolFactors_;
|
||||
|
||||
mutable int **particleTypes_;
|
||||
int **particleTypes_;
|
||||
|
||||
mutable double **particleWeights_;
|
||||
double **particleWeights_;
|
||||
|
||||
mutable double **particleVolumes_;
|
||||
double **particleVolumes_;
|
||||
|
||||
mutable double **particleV_;
|
||||
double **particleV_;
|
||||
|
||||
int numberOfParticles_;
|
||||
|
||||
@ -146,7 +146,7 @@ protected:
|
||||
|
||||
bool numberOfParticlesChanged_;
|
||||
|
||||
mutable bool arraysReallocated_;
|
||||
bool arraysReallocated_;
|
||||
|
||||
const wordList forceModels_;
|
||||
|
||||
@ -158,7 +158,7 @@ protected:
|
||||
|
||||
const word turbulenceModelType_;
|
||||
|
||||
mutable scalar cg_;
|
||||
scalar cg_;
|
||||
|
||||
bool cgOK_;
|
||||
|
||||
@ -172,11 +172,11 @@ protected:
|
||||
|
||||
const bool useDDTvoidfraction_;
|
||||
|
||||
mutable volScalarField ddtVoidfraction_;
|
||||
volScalarField ddtVoidfraction_;
|
||||
|
||||
mutable volScalarField particleDensityField_;
|
||||
volScalarField particleDensityField_;
|
||||
|
||||
mutable Switch checkPeriodicCells_;
|
||||
Switch checkPeriodicCells_;
|
||||
|
||||
const turbulenceModel& turbulence_;
|
||||
|
||||
@ -202,7 +202,7 @@ protected:
|
||||
|
||||
autoPtr<meshMotionModel> meshMotionModel_;
|
||||
|
||||
mutable PtrList<liggghtsCommandModel> liggghtsCommand_;
|
||||
PtrList<liggghtsCommandModel> liggghtsCommand_;
|
||||
|
||||
PtrList<otherForceModel> otherForceModel_;
|
||||
|
||||
@ -373,10 +373,12 @@ public:
|
||||
|
||||
inline const wordList& forceModels() const;
|
||||
|
||||
inline voidFractionModel& voidFractionM();
|
||||
inline const voidFractionModel& voidFractionM() const;
|
||||
|
||||
inline const locateModel& locateM() const;
|
||||
|
||||
inline momCoupleModel& momCoupleM(int);
|
||||
inline const momCoupleModel& momCoupleM(int) const;
|
||||
|
||||
inline dataExchangeModel& dataExchangeM();
|
||||
@ -385,6 +387,7 @@ public:
|
||||
|
||||
inline probeModel& probeM();
|
||||
|
||||
inline averagingModel& averagingM();
|
||||
inline const averagingModel& averagingM() const;
|
||||
|
||||
inline const clockModel& clockM() const;
|
||||
@ -395,7 +398,7 @@ public:
|
||||
|
||||
inline const wordList& liggghtsCommandModelList() const;
|
||||
|
||||
inline liggghtsCommandModel& liggghtsCommand(const label) const;
|
||||
inline liggghtsCommandModel& liggghtsCommand(const label);
|
||||
|
||||
inline const turbulenceModel& turbulence() const;
|
||||
|
||||
@ -418,7 +421,7 @@ public:
|
||||
|
||||
tmp<volScalarField> ddtVoidfraction() const;
|
||||
|
||||
void calcDdtVoidfraction(volScalarField& voidfraction) const;
|
||||
void calcDdtVoidfraction(volScalarField& voidfraction);
|
||||
|
||||
//tmp<fvVectorMatrix> ddtVoidfractionU(volVectorField& ,volScalarField&) const;
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ inline const fvMesh& cfdemCloud::mesh() const
|
||||
|
||||
inline bool cfdemCloud::solveFlow() const
|
||||
{
|
||||
return bool(solveFlow_);
|
||||
return solveFlow_;
|
||||
}
|
||||
|
||||
inline bool cfdemCloud::verbose() const
|
||||
@ -299,6 +299,11 @@ inline const locateModel& cfdemCloud::locateM() const
|
||||
return locateModel_;
|
||||
}
|
||||
|
||||
inline momCoupleModel& cfdemCloud::momCoupleM(int i)
|
||||
{
|
||||
return momCoupleModel_[i];
|
||||
}
|
||||
|
||||
inline const momCoupleModel& cfdemCloud::momCoupleM(int i) const
|
||||
{
|
||||
return momCoupleModel_[i];
|
||||
@ -319,14 +324,24 @@ inline probeModel& cfdemCloud::probeM()
|
||||
return probeModel_();
|
||||
}
|
||||
|
||||
inline voidFractionModel& cfdemCloud::voidFractionM()
|
||||
{
|
||||
return voidFractionModel_();
|
||||
}
|
||||
|
||||
inline const voidFractionModel& cfdemCloud::voidFractionM() const
|
||||
{
|
||||
return voidFractionModel_;
|
||||
return voidFractionModel_();
|
||||
}
|
||||
|
||||
inline averagingModel& cfdemCloud::averagingM()
|
||||
{
|
||||
return averagingModel_();
|
||||
}
|
||||
|
||||
inline const averagingModel& cfdemCloud::averagingM() const
|
||||
{
|
||||
return averagingModel_;
|
||||
return averagingModel_();
|
||||
}
|
||||
|
||||
inline const clockModel& cfdemCloud::clockM() const
|
||||
@ -349,7 +364,7 @@ inline const wordList& cfdemCloud::liggghtsCommandModelList() const
|
||||
return liggghtsCommandModelList_;
|
||||
}
|
||||
|
||||
inline liggghtsCommandModel& cfdemCloud::liggghtsCommand(const label modeli) const
|
||||
inline liggghtsCommandModel& cfdemCloud::liggghtsCommand(const label modeli)
|
||||
{
|
||||
return liggghtsCommand_[modeli];
|
||||
}
|
||||
|
||||
@ -98,15 +98,13 @@ public:
|
||||
|
||||
label nrEnergyModels() const;
|
||||
|
||||
inline const wordList& energyModels() const;
|
||||
|
||||
bool implicitEnergyModel() const;
|
||||
|
||||
int nrChemistryModels();
|
||||
|
||||
inline const wordList& energyModels();
|
||||
inline const wordList& energyModels() const;
|
||||
|
||||
inline const wordList& chemistryModels();
|
||||
inline const wordList& chemistryModels() const;
|
||||
|
||||
void energyContributions(volScalarField&);
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ inline const wordList& cfdemCloudEnergy::energyModels() const
|
||||
return energyModels_;
|
||||
}
|
||||
|
||||
inline const wordList& cfdemCloudEnergy::chemistryModels()
|
||||
inline const wordList& cfdemCloudEnergy::chemistryModels() const
|
||||
{
|
||||
return chemistryModels_;
|
||||
}
|
||||
|
||||
@ -58,12 +58,12 @@ class cfdemCloudIB
|
||||
{
|
||||
protected:
|
||||
|
||||
mutable double **angularVelocities_;
|
||||
double **angularVelocities_;
|
||||
label pRefCell_;
|
||||
scalar pRefValue_;
|
||||
|
||||
mutable bool haveEvolvedOnce_;
|
||||
mutable bool skipLagrangeToEulerMapping_;
|
||||
bool haveEvolvedOnce_;
|
||||
bool skipLagrangeToEulerMapping_;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -59,14 +59,14 @@ bool IOModel::dumpNow() const
|
||||
return time_.outputTime();
|
||||
}
|
||||
|
||||
fileName IOModel::createTimeDir(fileName path) const
|
||||
fileName IOModel::createTimeDir(const fileName& path) const
|
||||
{
|
||||
fileName timeDirPath(path/time_.timeName());
|
||||
mkDir(timeDirPath,0777);
|
||||
return timeDirPath;
|
||||
}
|
||||
|
||||
fileName IOModel::createLagrangianDir(fileName path) const
|
||||
fileName IOModel::createLagrangianDir(const fileName& path) const
|
||||
{
|
||||
fileName lagrangianDirPath(path/"lagrangian");
|
||||
mkDir(lagrangianDirPath,0777);
|
||||
@ -75,7 +75,7 @@ fileName IOModel::createLagrangianDir(fileName path) const
|
||||
return cfdemCloudDirPath;
|
||||
}
|
||||
|
||||
fileName IOModel::buildFilePath(word dirName) const
|
||||
fileName IOModel::buildFilePath(const word& dirName) const
|
||||
{
|
||||
// create file structure
|
||||
fileName path("");
|
||||
@ -94,7 +94,7 @@ fileName IOModel::buildFilePath(word dirName) const
|
||||
return path;
|
||||
}
|
||||
|
||||
void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word name,word type,word className) const
|
||||
void IOModel::streamDataToPath(const fileName& path, const double* const* array,int nPProc,const word& name,const word& type,const word& className) const
|
||||
{
|
||||
OFstream fileStream(path/name);
|
||||
|
||||
@ -107,7 +107,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam
|
||||
<< " object " << name << ";\n"
|
||||
<< "}" << nl;
|
||||
|
||||
fileStream << nPProc <<"\n";
|
||||
fileStream << nPProc << "\n";
|
||||
|
||||
if (type == "origProcId")
|
||||
{
|
||||
@ -118,7 +118,7 @@ void IOModel::streamDataToPath(fileName path, double** array,int nPProc,word nam
|
||||
|
||||
fileStream << token::BEGIN_LIST << nl;
|
||||
|
||||
int ** cellIDs = particleCloud_.cellIDs();
|
||||
const int * const* cellIDs = particleCloud_.cellIDs();
|
||||
for (int index = 0; index < particleCloud_.numberOfParticles(); ++index)
|
||||
{
|
||||
if (cellIDs[index][0] > -1) // particle Found
|
||||
|
||||
@ -115,13 +115,13 @@ public:
|
||||
|
||||
bool dumpNow() const;
|
||||
|
||||
fileName createTimeDir(fileName) const;
|
||||
fileName createTimeDir(const fileName&) const;
|
||||
|
||||
fileName createLagrangianDir(fileName) const;
|
||||
fileName createLagrangianDir(const fileName&) const;
|
||||
|
||||
fileName buildFilePath(word) const;
|
||||
fileName buildFilePath(const word&) const;
|
||||
|
||||
void streamDataToPath(fileName,double**,int,word,word type,word className) const;
|
||||
void streamDataToPath(const fileName&,const double* const*,int,const word&,const word& type,const word& className) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -332,13 +332,13 @@ void averagingModel::resetVectorAverage(volVectorField& prev,volVectorField& nex
|
||||
next.primitiveFieldRef() = vector::zero;
|
||||
}
|
||||
|
||||
void averagingModel::resetWeightFields() const
|
||||
void averagingModel::resetWeightFields()
|
||||
{
|
||||
UsWeightField_.ref() = 0;
|
||||
}
|
||||
|
||||
|
||||
void averagingModel::undoWeightFields(double**const& mask) const
|
||||
void averagingModel::undoWeightFields(double**const& mask)
|
||||
{
|
||||
for(int index=0; index< particleCloud_.numberOfParticles(); index++)
|
||||
{
|
||||
|
||||
@ -61,11 +61,11 @@ protected:
|
||||
|
||||
cfdemCloud& particleCloud_;
|
||||
|
||||
mutable volScalarField UsWeightField_;
|
||||
volScalarField UsWeightField_;
|
||||
|
||||
mutable volVectorField UsPrev_;
|
||||
volVectorField UsPrev_;
|
||||
|
||||
mutable volVectorField UsNext_;
|
||||
volVectorField UsNext_;
|
||||
|
||||
// Protected member functions
|
||||
|
||||
@ -194,23 +194,25 @@ public:
|
||||
|
||||
void resetVectorAverage(volVectorField& prev,volVectorField& next,bool single=false) const;
|
||||
|
||||
void resetWeightFields() const;
|
||||
void resetWeightFields();
|
||||
|
||||
void undoWeightFields(double**const&) const;
|
||||
void undoWeightFields(double**const&);
|
||||
|
||||
tmp<volVectorField> UsInterp() const;
|
||||
|
||||
virtual void setParticleType(label type) const {};
|
||||
virtual void setParticleType(label type) const {}
|
||||
|
||||
virtual bool checkParticleType(label) const {return true;}; //consider all particles by default
|
||||
virtual bool checkParticleType(label) const {return true;} //consider all particles by default
|
||||
|
||||
// Access
|
||||
inline volVectorField& UsPrev() const {return UsPrev_;};
|
||||
inline volVectorField& UsPrev() {return UsPrev_;}
|
||||
inline const volVectorField& UsPrev() const {return UsPrev_;}
|
||||
|
||||
inline volVectorField& UsNext() const {return UsNext_;};
|
||||
|
||||
inline volScalarField& UsWeightField() const {return UsWeightField_;};
|
||||
inline volVectorField& UsNext() {return UsNext_;}
|
||||
inline const volVectorField& UsNext() const {return UsNext_;}
|
||||
|
||||
inline volScalarField& UsWeightField() {return UsWeightField_;}
|
||||
inline const volScalarField& UsWeightField() const {return UsWeightField_;}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -195,7 +195,7 @@ void dataExchangeModel::destroy(double* array) const
|
||||
//====
|
||||
|
||||
|
||||
bool dataExchangeModel::couple(int i) const
|
||||
bool dataExchangeModel::couple(int i)
|
||||
{
|
||||
bool coupleNow = false;
|
||||
if (doCoupleNow())
|
||||
|
||||
@ -62,7 +62,7 @@ protected:
|
||||
|
||||
int maxNumberOfParticles_;
|
||||
|
||||
mutable int couplingStep_;
|
||||
int couplingStep_;
|
||||
|
||||
scalar DEMts_;
|
||||
|
||||
@ -176,7 +176,7 @@ public:
|
||||
virtual void destroy(double*) const;
|
||||
//====
|
||||
|
||||
virtual bool couple(int) const;
|
||||
virtual bool couple(int);
|
||||
|
||||
virtual scalar timeStepFraction() const;
|
||||
|
||||
|
||||
@ -204,7 +204,7 @@ void twoWayMPI::destroy(double* array) const
|
||||
}
|
||||
//============
|
||||
|
||||
bool twoWayMPI::couple(int i) const
|
||||
bool twoWayMPI::couple(int i)
|
||||
{
|
||||
bool coupleNow = false;
|
||||
if (i==0)
|
||||
|
||||
@ -151,7 +151,7 @@ public:
|
||||
void destroy(int*) const;
|
||||
//==============
|
||||
|
||||
bool couple(int) const;
|
||||
bool couple(int);
|
||||
|
||||
int getNumberOfParticles() const;
|
||||
int getNumberOfClumps() const;
|
||||
|
||||
@ -384,7 +384,7 @@ void inline twoWayMany2Many::destroy(int* array) const
|
||||
//==============
|
||||
|
||||
|
||||
bool twoWayMany2Many::couple(int i) const
|
||||
bool twoWayMany2Many::couple(int i)
|
||||
{
|
||||
bool coupleNow = false;
|
||||
if (i==0)
|
||||
|
||||
@ -201,7 +201,7 @@ public:
|
||||
void inline destroy(int*) const;
|
||||
//==============
|
||||
|
||||
bool couple(int) const;
|
||||
bool couple(int);
|
||||
|
||||
int getNumberOfParticles() const;
|
||||
int getNumberOfClumps() const;
|
||||
|
||||
@ -94,7 +94,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
word name(){return propsDict_.dictName();};
|
||||
word name() const {return propsDict_.dictName();}
|
||||
|
||||
const char* command(int);
|
||||
|
||||
|
||||
@ -165,15 +165,15 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
int nextRun(){return nextRun_;}
|
||||
int nextRun() const {return nextRun_;}
|
||||
|
||||
int lastRun(){return lastRun_;}
|
||||
int lastRun() const {return lastRun_;}
|
||||
|
||||
virtual word name()=0;
|
||||
virtual word name() const=0;
|
||||
|
||||
bool exactTiming(){return exactTiming_;}
|
||||
bool exactTiming() const {return exactTiming_;}
|
||||
|
||||
label commandLines(){return commandLines_;}
|
||||
label commandLines() const {return commandLines_;}
|
||||
|
||||
void parseCommandList(wordList&, labelList&, scalarList&, word&, dictionary&, bool&);
|
||||
};
|
||||
|
||||
@ -89,7 +89,7 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
word name(){return propsDict_.dictName();};
|
||||
word name() const {return propsDict_.dictName();}
|
||||
|
||||
const char* command(int);
|
||||
|
||||
|
||||
@ -92,7 +92,7 @@ public:
|
||||
|
||||
bool runCommand(int);
|
||||
|
||||
word name(){return "runLiggghts";};
|
||||
word name() const {return "runLiggghts";}
|
||||
|
||||
void set(int);
|
||||
};
|
||||
|
||||
@ -97,7 +97,7 @@ public:
|
||||
|
||||
bool runCommand(int);
|
||||
|
||||
word name(){return "writeLiggghts";};
|
||||
word name() const {return "writeLiggghts";}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -106,7 +106,7 @@ explicitCouple::~explicitCouple()
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
tmp<volVectorField> explicitCouple::expMomSource() const
|
||||
tmp<volVectorField> explicitCouple::expMomSource()
|
||||
{
|
||||
const scalar tsf = particleCloud_.dataExchangeM().timeStepFraction();
|
||||
|
||||
@ -136,7 +136,7 @@ tmp<volVectorField> explicitCouple::expMomSource() const
|
||||
);
|
||||
}
|
||||
|
||||
void explicitCouple::resetMomSourceField() const
|
||||
void explicitCouple::resetMomSourceField()
|
||||
{
|
||||
fPrev_.ref() = fNext_.ref();
|
||||
fNext_.primitiveFieldRef() = vector::zero;
|
||||
|
||||
@ -58,9 +58,9 @@ private:
|
||||
|
||||
dictionary propsDict_;
|
||||
|
||||
mutable volVectorField fPrev_;
|
||||
volVectorField fPrev_;
|
||||
|
||||
mutable volVectorField fNext_;
|
||||
volVectorField fNext_;
|
||||
|
||||
vector fLimit_; // limit for for exchange field
|
||||
|
||||
@ -87,9 +87,9 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
tmp<volVectorField> expMomSource() const;
|
||||
tmp<volVectorField> expMomSource();
|
||||
|
||||
void resetMomSourceField() const;
|
||||
void resetMomSourceField();
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -120,7 +120,7 @@ implicitCouple::~implicitCouple()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
tmp<volScalarField> implicitCouple::impMomSource() const
|
||||
tmp<volScalarField> implicitCouple::impMomSource()
|
||||
{
|
||||
const scalar tsf = particleCloud_.dataExchangeM().timeStepFraction();
|
||||
|
||||
@ -157,7 +157,7 @@ tmp<volScalarField> implicitCouple::impMomSource() const
|
||||
);
|
||||
}
|
||||
|
||||
void implicitCouple::resetMomSourceField() const
|
||||
void implicitCouple::resetMomSourceField()
|
||||
{
|
||||
KslPrev_.ref() = KslNext_.ref();
|
||||
KslNext_.primitiveFieldRef() = 0;
|
||||
|
||||
@ -73,9 +73,9 @@ private:
|
||||
|
||||
scalar KslLimit_; // limit for for exchange field
|
||||
|
||||
mutable volScalarField KslPrev_;
|
||||
volScalarField KslPrev_;
|
||||
|
||||
mutable volScalarField KslNext_;
|
||||
volScalarField KslNext_;
|
||||
|
||||
public:
|
||||
|
||||
@ -98,9 +98,9 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
tmp<volScalarField> impMomSource() const;
|
||||
tmp<volScalarField> impMomSource();
|
||||
|
||||
void resetMomSourceField() const;
|
||||
void resetMomSourceField();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ defineRunTimeSelectionTable(momCoupleModel, dictionary);
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
tmp<volScalarField> momCoupleModel::impMomSource() const
|
||||
tmp<volScalarField> momCoupleModel::impMomSource()
|
||||
{
|
||||
FatalError<<"the solver calls for impMomSource()\n"
|
||||
<<", please set 'momCoupleModel' to type 'implicitCouple'\n"
|
||||
@ -55,7 +55,7 @@ tmp<volScalarField> momCoupleModel::impMomSource() const
|
||||
return tsource;
|
||||
}
|
||||
|
||||
tmp<volVectorField> momCoupleModel::expMomSource() const
|
||||
tmp<volVectorField> momCoupleModel::expMomSource()
|
||||
{
|
||||
FatalError<<"the solver calls for expMomSource()\n"
|
||||
<<", please set 'momCoupleModel' to type 'explicitCouple'\n"
|
||||
|
||||
@ -111,12 +111,12 @@ public:
|
||||
// Member Functions
|
||||
|
||||
// implicit momentum source field
|
||||
virtual tmp<volScalarField> impMomSource() const;
|
||||
virtual tmp<volScalarField> impMomSource();
|
||||
|
||||
// explicit momentum source field
|
||||
virtual tmp<volVectorField> expMomSource() const;
|
||||
virtual tmp<volVectorField> expMomSource();
|
||||
|
||||
virtual void resetMomSourceField() const=0;
|
||||
virtual void resetMomSourceField() = 0;
|
||||
|
||||
virtual void setSourceField(volVectorField &) const;
|
||||
};
|
||||
|
||||
@ -72,7 +72,7 @@ noCouple::~noCouple()
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
void noCouple::resetMomSourceField() const
|
||||
void noCouple::resetMomSourceField()
|
||||
{
|
||||
FatalError<<"the solver calls for resetMomSourceField() although you use IB method where this is not needed!\n"
|
||||
<<", check your solver! - PANIC -\n";
|
||||
|
||||
@ -78,7 +78,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void resetMomSourceField() const;
|
||||
void resetMomSourceField();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -87,7 +87,7 @@ GaussVoidFraction::~GaussVoidFraction()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
|
||||
void GaussVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV)
|
||||
{
|
||||
reAllocArrays();
|
||||
|
||||
|
||||
@ -63,7 +63,7 @@ private:
|
||||
|
||||
const scalar alphaMin_; //NP min value of voidFraction
|
||||
|
||||
mutable bool alphaLimited_;
|
||||
bool alphaLimited_;
|
||||
|
||||
public:
|
||||
|
||||
@ -86,7 +86,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&);
|
||||
|
||||
void buildLabelHashSet
|
||||
(
|
||||
|
||||
@ -87,7 +87,7 @@ IBVoidFraction::~IBVoidFraction()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
|
||||
void IBVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV)
|
||||
{
|
||||
const boundBox& globalBb = particleCloud_.mesh().bounds();
|
||||
|
||||
@ -306,7 +306,7 @@ void IBVoidFraction::buildLabelHashSet
|
||||
const label cellID,
|
||||
labelHashSet& hashSett,
|
||||
bool initialInsert //initial insertion of own cell
|
||||
)const
|
||||
)
|
||||
{
|
||||
if(initialInsert)
|
||||
hashSett.insert(cellID);
|
||||
|
||||
@ -64,7 +64,7 @@ private:
|
||||
|
||||
const scalar alphaMin_; //NP min value of voidFraction
|
||||
|
||||
mutable bool alphaLimited_;
|
||||
bool alphaLimited_;
|
||||
|
||||
const scalar scaleUpVol_; //NP scaling radius, keeping volume of particle
|
||||
|
||||
@ -91,7 +91,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&);
|
||||
|
||||
void buildLabelHashSet
|
||||
(
|
||||
@ -100,7 +100,7 @@ public:
|
||||
const label cellID,
|
||||
labelHashSet& hashSett,
|
||||
bool initialInsert
|
||||
) const;
|
||||
);
|
||||
|
||||
virtual double segmentParticleIntersection(int index, vector positionCenter, vector pointInside, vector pointOutside) const;
|
||||
};
|
||||
|
||||
@ -86,7 +86,7 @@ bigParticleVoidFraction::~bigParticleVoidFraction()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
|
||||
void bigParticleVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV)
|
||||
{
|
||||
reAllocArrays();
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ private:
|
||||
|
||||
const scalar alphaMin_; // min value of voidFraction
|
||||
|
||||
mutable bool alphaLimited_;
|
||||
bool alphaLimited_;
|
||||
|
||||
public:
|
||||
|
||||
@ -83,7 +83,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&);
|
||||
|
||||
void buildLabelHashSet
|
||||
(
|
||||
|
||||
@ -78,7 +78,7 @@ centreVoidFraction::~centreVoidFraction()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
|
||||
void centreVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV)
|
||||
{
|
||||
reAllocArrays();
|
||||
|
||||
|
||||
@ -60,7 +60,7 @@ private:
|
||||
|
||||
const scalar alphaMin_; //NP min value of voidFraction
|
||||
|
||||
mutable bool alphaLimited_;
|
||||
bool alphaLimited_;
|
||||
|
||||
public:
|
||||
|
||||
@ -83,7 +83,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -156,7 +156,7 @@ dividedVoidFraction::~dividedVoidFraction()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes, double**& particleV) const
|
||||
void dividedVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes, double**& particleV)
|
||||
{
|
||||
if (cfdemUseOnly_)
|
||||
reAllocArrays(particleCloud_.numberOfParticles());
|
||||
|
||||
@ -68,9 +68,9 @@ private:
|
||||
|
||||
const scalar alphaMin_; // min value of voidFraction
|
||||
|
||||
mutable bool alphaLimited_;
|
||||
bool alphaLimited_;
|
||||
|
||||
mutable scalar tooMuch_; // particle volume which is lost due to voidFraction limitation
|
||||
scalar tooMuch_; // particle volume which is lost due to voidFraction limitation
|
||||
|
||||
const bool interpolation_;
|
||||
|
||||
@ -104,7 +104,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ trilinearVoidFraction::~trilinearVoidFraction()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void trilinearVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV) const
|
||||
void trilinearVoidFraction::setvoidFraction(double** const& mask,double**& voidfractions,double**& particleWeights,double**& particleVolumes,double**& particleV)
|
||||
{
|
||||
reAllocArrays();
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ public:
|
||||
|
||||
|
||||
// Member Functions
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&) const;
|
||||
void setvoidFraction(double** const& ,double**&, double**&, double**&, double**&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ tmp<volScalarField> voidFractionModel::voidFractionInterp() const
|
||||
);
|
||||
}
|
||||
|
||||
void voidFractionModel::resetVoidFractions() const
|
||||
void voidFractionModel::resetVoidFractions()
|
||||
{
|
||||
voidfractionPrev_.ref() = voidfractionNext_.ref();
|
||||
voidfractionNext_.ref() = 1.;
|
||||
@ -128,7 +128,7 @@ int voidFractionModel::maxCellsPerParticle() const
|
||||
return maxCellsPerParticle_;
|
||||
}
|
||||
|
||||
void voidFractionModel::reAllocArrays() const
|
||||
void voidFractionModel::reAllocArrays()
|
||||
{
|
||||
if(particleCloud_.numberOfParticlesChanged())
|
||||
{
|
||||
@ -137,7 +137,7 @@ void voidFractionModel::reAllocArrays() const
|
||||
}
|
||||
}
|
||||
|
||||
void voidFractionModel::reAllocArrays(int nP) const
|
||||
void voidFractionModel::reAllocArrays(int nP)
|
||||
{
|
||||
if(particleCloud_.numberOfParticlesChanged())
|
||||
{
|
||||
|
||||
@ -65,17 +65,17 @@ protected:
|
||||
|
||||
bool multiWeights_;
|
||||
|
||||
mutable volScalarField voidfractionPrev_;
|
||||
volScalarField voidfractionPrev_;
|
||||
|
||||
mutable volScalarField voidfractionNext_;
|
||||
volScalarField voidfractionNext_;
|
||||
|
||||
mutable int ** cellsPerParticle_;
|
||||
int ** cellsPerParticle_;
|
||||
|
||||
int maxCellsPerParticle_;
|
||||
|
||||
mutable scalar weight_;
|
||||
scalar weight_;
|
||||
|
||||
mutable scalar porosity_;
|
||||
scalar porosity_;
|
||||
|
||||
// Protected member functions
|
||||
|
||||
@ -124,30 +124,32 @@ public:
|
||||
|
||||
|
||||
// public member functions
|
||||
virtual void setvoidFraction(double** const&,double**&,double**&,double**&,double**&) const = 0;
|
||||
virtual void setvoidFraction(double** const&,double**&,double**&,double**&,double**&) = 0;
|
||||
|
||||
tmp<volScalarField> voidFractionInterp() const;
|
||||
|
||||
inline volScalarField& voidFractionPrev()const { return voidfractionPrev_; }
|
||||
volScalarField& voidFractionPrev() { return voidfractionPrev_; }
|
||||
const volScalarField& voidFractionPrev() const { return voidfractionPrev_; }
|
||||
|
||||
inline volScalarField& voidFractionNext()const { return voidfractionNext_; }
|
||||
volScalarField& voidFractionNext() { return voidfractionNext_; }
|
||||
const volScalarField& voidFractionNext() const { return voidfractionNext_; }
|
||||
|
||||
inline scalar weight()const { return weight_; }
|
||||
scalar weight() const { return weight_; }
|
||||
|
||||
inline scalar weight(label index) const
|
||||
scalar weight(label index) const
|
||||
{
|
||||
return particleCloud_.particleEffVolFactor(index);
|
||||
}
|
||||
|
||||
inline scalar porosity()const { return porosity_; }
|
||||
scalar porosity() const { return porosity_; }
|
||||
|
||||
inline void checkWeightNporosity(dictionary& propsDict) const
|
||||
void checkWeightNporosity(dictionary& propsDict)
|
||||
{
|
||||
if (propsDict.found("weight")) weight_ = readScalar(propsDict.lookup("weight"));
|
||||
if (propsDict.found("porosity")) porosity_ = readScalar(propsDict.lookup("porosity"));
|
||||
}
|
||||
|
||||
void resetVoidFractions() const;
|
||||
void resetVoidFractions();
|
||||
|
||||
//void undoVoidFractions(double**const&) const;
|
||||
|
||||
@ -155,9 +157,9 @@ public:
|
||||
|
||||
int maxCellsPerParticle() const;
|
||||
|
||||
void reAllocArrays() const;
|
||||
void reAllocArrays();
|
||||
|
||||
void reAllocArrays(int nP) const; //force number of particles during reallocation, for CFD offline-use
|
||||
void reAllocArrays(int nP); //force number of particles during reallocation, for CFD offline-use
|
||||
|
||||
virtual void setParticleType(label type) const {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user