fvModels::filmCloudTransfer: Ensure film->cloud transfer consistency
This commit is contained in:
@ -527,9 +527,6 @@ void Foam::CloudFilmTransfer<CloudType>::cacheFilmFields(const label filmi)
|
||||
|
||||
this->deltaFilmPatch_ = filmCloudTransfer.deltaToCloud();
|
||||
|
||||
// Ensure the film->cloud ejection transfer is up-to-date
|
||||
filmCloudTransfer.correct();
|
||||
|
||||
if (filmCloudTransfer.ejecting())
|
||||
{
|
||||
this->massParcelPatch_ = filmCloudTransfer.ejectedMassToCloud();
|
||||
|
||||
@ -58,7 +58,7 @@ Foam::fv::filmCloudTransfer::filmCloudTransfer
|
||||
:
|
||||
fvModel(sourceName, modelType, mesh, dict),
|
||||
film_(mesh.lookupObject<solvers::isothermalFilm>(solver::typeName)),
|
||||
curTimeIndex_(-1),
|
||||
correctEjection_(false),
|
||||
ejection_
|
||||
(
|
||||
dict.found("ejection")
|
||||
@ -84,16 +84,13 @@ Foam::wordList Foam::fv::filmCloudTransfer::addSupFields() const
|
||||
|
||||
void Foam::fv::filmCloudTransfer::correct()
|
||||
{
|
||||
if (curTimeIndex_ == mesh().time().timeIndex())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
curTimeIndex_ = mesh().time().timeIndex();
|
||||
|
||||
if (ejection_.valid())
|
||||
if (ejection_.valid() && correctEjection_)
|
||||
{
|
||||
ejection_->correct();
|
||||
|
||||
// Do not correct ejection rate until the cloud has evolved
|
||||
// to include the last set of ejected parcels
|
||||
correctEjection_ = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,6 +267,9 @@ void Foam::fv::filmCloudTransfer::resetFromCloudFields()
|
||||
momentumFromCloud_ = Zero;
|
||||
pressureFromCloud_ = 0;
|
||||
energyFromCloud_ = 0;
|
||||
|
||||
// Enable ejection correction on next call to correct()
|
||||
correctEjection_ = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -70,9 +70,6 @@ class filmCloudTransfer
|
||||
//- The film model
|
||||
const solvers::isothermalFilm& film_;
|
||||
|
||||
//- Current time index (used for updating)
|
||||
mutable label curTimeIndex_;
|
||||
|
||||
// Transfers from cloud
|
||||
|
||||
scalarField massFromCloud_;
|
||||
@ -80,6 +77,10 @@ class filmCloudTransfer
|
||||
scalarField pressureFromCloud_;
|
||||
scalarField energyFromCloud_;
|
||||
|
||||
//- Switch to ensure the ejection rate is not updated until
|
||||
// the last set of ejected parcels have been included in the cloud
|
||||
bool correctEjection_;
|
||||
|
||||
//- Pointer to the ejection model
|
||||
autoPtr<ejectionModel> ejection_;
|
||||
|
||||
|
||||
@ -176,7 +176,7 @@ void Foam::fv::VoFFilmTransfer::correct()
|
||||
&& alpha[facei] < alphaToFilm_
|
||||
)
|
||||
{
|
||||
transferRate_[celli] = -transferRateCoeff_/deltaT;
|
||||
transferRate_[celli] = transferRateCoeff_/deltaT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,7 +260,7 @@ void Foam::fv::VoFFilmTransfer::addSup
|
||||
&filmVoFTransfer::transferRate,
|
||||
dimVolume
|
||||
)
|
||||
+ fvm::Sp(transferRate_, eqn.psi());
|
||||
- fvm::Sp(transferRate_, eqn.psi());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -291,7 +291,7 @@ void Foam::fv::VoFFilmTransfer::addSup
|
||||
&filmVoFTransfer::rhoTransferRate,
|
||||
dimMass
|
||||
)
|
||||
+ fvm::Sp(alpha()*transferRate_, eqn.psi());
|
||||
- fvm::Sp(alpha()*transferRate_, eqn.psi());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -323,7 +323,7 @@ void Foam::fv::VoFFilmTransfer::addSup
|
||||
&filmVoFTransfer::heTransferRate,
|
||||
dimEnergy
|
||||
)
|
||||
+ fvm::Sp(alpha()*rho()*transferRate_, eqn.psi());
|
||||
- fvm::Sp(alpha()*rho()*transferRate_, eqn.psi());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -352,7 +352,7 @@ void Foam::fv::VoFFilmTransfer::addSup
|
||||
&filmVoFTransfer::UTransferRate,
|
||||
dimMass*dimVelocity
|
||||
)
|
||||
+ fvm::Sp(alpha_()*thermo_.rho()()*transferRate_, eqn.psi());
|
||||
- fvm::Sp(alpha_()*thermo_.rho()()*transferRate_, eqn.psi());
|
||||
}
|
||||
|
||||
|
||||
@ -370,7 +370,7 @@ inline Foam::tmp<Foam::Field<Type>> Foam::fv::VoFFilmTransfer::TransferRate
|
||||
(
|
||||
UIndirectList<Type>
|
||||
(
|
||||
-alpha_()*transferRate_*mesh().V()*f,
|
||||
alpha_()*transferRate_*mesh().V()*f,
|
||||
faceCells
|
||||
)
|
||||
)
|
||||
|
||||
@ -159,7 +159,7 @@ void Foam::fv::filmVoFTransfer::correct()
|
||||
|| alphaVoF[facei] > alphaToVoF_
|
||||
)
|
||||
{
|
||||
transferRate_[celli] = -transferRateCoeff_/deltaT;
|
||||
transferRate_[celli] = transferRateCoeff_/deltaT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -260,7 +260,7 @@ void Foam::fv::filmVoFTransfer::addSup
|
||||
&VoFFilmTransfer::rhoTransferRate,
|
||||
dimMass
|
||||
)
|
||||
+ fvm::Sp(transferRate_*rho(), eqn.psi());
|
||||
- fvm::Sp(transferRate_*rho(), eqn.psi());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -292,7 +292,7 @@ void Foam::fv::filmVoFTransfer::addSup
|
||||
&VoFFilmTransfer::heTransferRate,
|
||||
dimEnergy
|
||||
)
|
||||
+ fvm::Sp(alpha()*rho()*transferRate_, eqn.psi());
|
||||
- fvm::Sp(alpha()*rho()*transferRate_, eqn.psi());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -322,7 +322,7 @@ void Foam::fv::filmVoFTransfer::addSup
|
||||
&VoFFilmTransfer::UTransferRate,
|
||||
dimMomentum
|
||||
)
|
||||
+ fvm::Sp(alpha()*rho()*transferRate_, eqn.psi());
|
||||
- fvm::Sp(alpha()*rho()*transferRate_, eqn.psi());
|
||||
}
|
||||
|
||||
|
||||
@ -340,7 +340,7 @@ inline Foam::tmp<Foam::Field<Type>> Foam::fv::filmVoFTransfer::TransferRate
|
||||
(
|
||||
UIndirectList<Type>
|
||||
(
|
||||
-film_.alpha()*transferRate_*mesh().V()*f,
|
||||
film_.alpha()*transferRate_*mesh().V()*f,
|
||||
faceCells
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user