move calculation of Us field to separate function in cfdemCloudIB

refactoring, use same name as the function doing Us field calculations
in cfdemCloudIBContinuousForcing;
note that cfdemCloudIB is considering angular velocities of particles
while cfdemCloudIBContinuousForcing does not
This commit is contained in:
danielque
2022-02-16 14:58:23 +01:00
parent d1dad545ae
commit 0820d99e85
2 changed files with 29 additions and 21 deletions

View File

@ -154,27 +154,7 @@ bool cfdemCloudIB::evolve(volVectorField& Us)
// set particle velocity field // set particle velocity field
if(verbose_) Info << "- setVelocity(velocities_)" << endl; if(verbose_) Info << "- setVelocity(velocities_)" << endl;
label cell = 0; calcForcingTerm(Us); // only needed for continuous forcing
vector uP(0,0,0);
vector rVec(0,0,0);
vector velRot(0,0,0);
vector angVel(0,0,0);
for (int index = 0; index < numberOfParticles(); ++index){
for(int subCell = 0; subCell < voidFractionM().cellsPerParticle()[index][0]; subCell++)
{
cell = cellIDs()[index][subCell];
if(cell >=0){
// calc particle velocity
for(int i=0;i<3;i++) rVec[i]=Us.mesh().C()[cell][i]-position(index)[i];
for(int i=0;i<3;i++) angVel[i]=angularVelocities()[index][i];
velRot=angVel^rVec;
for(int i=0;i<3;i++) uP[i] = velocities()[index][i]+velRot[i];
Us[cell] = (1-voidfractions_[index][subCell])*uP;
}
}
}
if(verbose_) Info << "setVelocity done." << endl;
// write DEM data // write DEM data
if(verbose_) Info << " -giveDEMdata()" << endl; if(verbose_) Info << " -giveDEMdata()" << endl;
@ -194,6 +174,32 @@ bool cfdemCloudIB::evolve(volVectorField& Us)
return doCouple; return doCouple;
} }
void cfdemCloudIB::calcForcingTerm(volVectorField& Us)
{
label cell = 0;
vector uP(0,0,0);
vector rVec(0,0,0);
vector velRot(0,0,0);
vector angVel(0,0,0);
for (int index = 0; index < numberOfParticles(); ++index)
{
for (int subCell = 0; subCell < voidFractionM().cellsPerParticle()[index][0]; subCell++)
{
cell = cellIDs()[index][subCell];
if (cell >=0)
{
// calc particle velocity
for (int i=0;i<3;i++) rVec[i]=Us.mesh().C()[cell][i]-position(index)[i];
for (int i=0;i<3;i++) angVel[i]=angularVelocities()[index][i];
velRot=angVel^rVec;
for (int i=0;i<3;i++) uP[i] = velocities()[index][i]+velRot[i];
Us[cell] = (1-voidfractions_[index][subCell])*uP;
}
}
}
}
void cfdemCloudIB::calcVelocityCorrection void cfdemCloudIB::calcVelocityCorrection
( (
volScalarField& p, volScalarField& p,

View File

@ -93,6 +93,8 @@ public:
bool evolve(volVectorField&); bool evolve(volVectorField&);
void calcForcingTerm(volVectorField&);
void calcVelocityCorrection(volScalarField&,volVectorField&,volScalarField&,volScalarField&); // this could be moved to an IB mom couple model void calcVelocityCorrection(volScalarField&,volVectorField&,volScalarField&,volScalarField&); // this could be moved to an IB mom couple model
// Access // Access