mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Initialization for area and single layer films for lagrangian
This commit is contained in:
@ -130,47 +130,56 @@ Foam::vector Foam::KinematicSurfaceFilm<CloudType>::splashDirection
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicSurfaceFilm<CloudType>::init(bool binitThermo)
|
||||
void Foam::KinematicSurfaceFilm<CloudType>::initFilmModels()
|
||||
{
|
||||
const fvMesh& mesh = this->owner().mesh();
|
||||
|
||||
// set up filmModel pointer
|
||||
filmModel_ =
|
||||
const_cast<regionFilm*>
|
||||
(
|
||||
mesh.time().objectRegistry::template findObject
|
||||
<
|
||||
regionFilm
|
||||
>
|
||||
(
|
||||
"surfaceFilmProperties"
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
// set up areaFilms
|
||||
const wordList names =
|
||||
mesh.time().objectRegistry::template
|
||||
sortedNames<regionModels::regionFaModel>();
|
||||
|
||||
forAll(names, i)
|
||||
if (!filmModel_)
|
||||
{
|
||||
const regionModels::regionFaModel* regionFa =
|
||||
mesh.time().objectRegistry::template findObject
|
||||
<
|
||||
regionModels::regionFaModel
|
||||
>(names[i]);
|
||||
|
||||
if (regionFa && isA<areaFilm>(*regionFa))
|
||||
{
|
||||
areaFilm& film =
|
||||
const_cast<areaFilm&>(refCast<const areaFilm>(*regionFa));
|
||||
areaFilms_.append(&film);
|
||||
}
|
||||
filmModel_ =
|
||||
const_cast<regionFilm*>
|
||||
(
|
||||
mesh.time().objectRegistry::template findObject
|
||||
<
|
||||
regionFilm
|
||||
>
|
||||
(
|
||||
"surfaceFilmProperties"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// Initiate thermo ref for filmModel
|
||||
if (filmModel_ && binitThermo)
|
||||
if (areaFilms_.size() == 0)
|
||||
{
|
||||
// set up areaFilms
|
||||
const wordList names =
|
||||
mesh.time().objectRegistry::template
|
||||
sortedNames<regionModels::regionFaModel>();
|
||||
|
||||
forAll(names, i)
|
||||
{
|
||||
const regionModels::regionFaModel* regionFa =
|
||||
mesh.time().objectRegistry::template findObject
|
||||
<
|
||||
regionModels::regionFaModel
|
||||
>(names[i]);
|
||||
|
||||
if (regionFa && isA<areaFilm>(*regionFa))
|
||||
{
|
||||
areaFilm& film =
|
||||
const_cast<areaFilm&>(refCast<const areaFilm>(*regionFa));
|
||||
areaFilms_.append(&film);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicSurfaceFilm<CloudType>::init(bool binitThermo)
|
||||
{
|
||||
if (binitThermo)
|
||||
{
|
||||
this->coeffDict().readEntry("pRef", pRef_);
|
||||
this->coeffDict().readEntry("TRef", TRef_);
|
||||
@ -569,9 +578,8 @@ Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
|
||||
this->coeffDict().readEntry("Adry", Adry_);
|
||||
this->coeffDict().readEntry("Awet", Awet_);
|
||||
this->coeffDict().readEntry("Cf", Cf_);
|
||||
init(initThermo);
|
||||
}
|
||||
|
||||
init(initThermo);
|
||||
}
|
||||
|
||||
|
||||
@ -596,7 +604,10 @@ Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
|
||||
Cf_(sfm.Cf_),
|
||||
nParcelsSplashed_(sfm.nParcelsSplashed_)
|
||||
{
|
||||
init(initThermo);
|
||||
if (interactionType_ == itSplashBai)
|
||||
{
|
||||
init(initThermo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -614,59 +625,64 @@ bool Foam::KinematicSurfaceFilm<CloudType>::transferParcel
|
||||
|
||||
bool bInteraction(false);
|
||||
|
||||
initFilmModels();
|
||||
|
||||
// Check the singleLayer film models
|
||||
if (filmModel_ && filmModel_->isRegionPatch(patchi))
|
||||
if (filmModel_)
|
||||
{
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
switch (interactionType_)
|
||||
if (filmModel_->isRegionPatch(patchi))
|
||||
{
|
||||
case itBounce:
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
switch (interactionType_)
|
||||
{
|
||||
bounceInteraction(p, pp, facei, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
case itAbsorb:
|
||||
{
|
||||
const scalar m = p.nParticle()*p.mass();
|
||||
|
||||
absorbInteraction<regionFilm>
|
||||
(*filmModel_, p, pp, facei, m, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
case itSplashBai:
|
||||
{
|
||||
bool dry = this->deltaFilmPatch_[patchi][facei] < deltaWet_;
|
||||
|
||||
const scalarField X(thermo_->size(), 1);
|
||||
const scalar mu = thermo_->mu(pRef_, TRef_, X);
|
||||
const scalar sigma = thermo_->sigma(pRef_, TRef_, X);
|
||||
|
||||
if (dry)
|
||||
case itBounce:
|
||||
{
|
||||
drySplashInteraction<regionFilm>
|
||||
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
else
|
||||
{
|
||||
wetSplashInteraction<regionFilm>
|
||||
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
bounceInteraction(p, pp, facei, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown interaction type enumeration"
|
||||
<< abort(FatalError);
|
||||
break;
|
||||
}
|
||||
case itAbsorb:
|
||||
{
|
||||
const scalar m = p.nParticle()*p.mass();
|
||||
|
||||
absorbInteraction<regionFilm>
|
||||
(*filmModel_, p, pp, facei, m, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
case itSplashBai:
|
||||
{
|
||||
bool dry = this->deltaFilmPatch_[patchi][facei] < deltaWet_;
|
||||
|
||||
const scalarField X(thermo_->size(), 1);
|
||||
const scalar mu = thermo_->mu(pRef_, TRef_, X);
|
||||
const scalar sigma = thermo_->sigma(pRef_, TRef_, X);
|
||||
|
||||
if (dry)
|
||||
{
|
||||
drySplashInteraction<regionFilm>
|
||||
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
else
|
||||
{
|
||||
wetSplashInteraction<regionFilm>
|
||||
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown interaction type enumeration"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer parcel/parcel interactions complete
|
||||
bInteraction = true;
|
||||
}
|
||||
|
||||
// Transfer parcel/parcel interactions complete
|
||||
bInteraction = true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -192,9 +192,12 @@ protected:
|
||||
const vector& nf
|
||||
) const;
|
||||
|
||||
//- Initialise pointers of films
|
||||
//- Initialise thermo
|
||||
void init(bool binitThermo);
|
||||
|
||||
//- Initialise pointers of films
|
||||
void initFilmModels();
|
||||
|
||||
|
||||
// Injection from sheet (ejection) helper functions
|
||||
|
||||
|
||||
@ -72,68 +72,72 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
{
|
||||
const label patchi = pp.index();
|
||||
|
||||
this->initFilmModels();
|
||||
|
||||
bool bInteraction(false);
|
||||
|
||||
// Check the singleLayer film models
|
||||
if (this->filmModel_ && this->filmModel_->isRegionPatch(patchi))
|
||||
if (this->filmModel_)
|
||||
{
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
switch (this->interactionType_)
|
||||
if (this->filmModel_->isRegionPatch(patchi))
|
||||
{
|
||||
case KinematicSurfaceFilm<CloudType>::itBounce:
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
switch (this->interactionType_)
|
||||
{
|
||||
this->bounceInteraction(p, pp, facei, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
case KinematicSurfaceFilm<CloudType>::itAbsorb:
|
||||
{
|
||||
const scalar m = p.nParticle()*p.mass();
|
||||
|
||||
this->absorbInteraction //<regionFilm>
|
||||
(*(this->filmModel_), p, pp, facei, m, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
case KinematicSurfaceFilm<CloudType>::itSplashBai:
|
||||
{
|
||||
// Local pressure
|
||||
const scalar pc = thermo_.thermo().p()[p.cell()];
|
||||
const liquidProperties& liq = thermo_.liquids().properties()[0];
|
||||
const scalar sigma = liq.sigma(pc, p.T());
|
||||
const scalar mu = liq.mu(pc, p.T());
|
||||
|
||||
bool dry = this->deltaFilmPatch_[patchi][facei] < this->deltaWet_;
|
||||
|
||||
if (dry)
|
||||
case KinematicSurfaceFilm<CloudType>::itBounce:
|
||||
{
|
||||
this->drySplashInteraction //<CloudType, regionFilm>
|
||||
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->wetSplashInteraction //<regionFilm>
|
||||
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
this->bounceInteraction(p, pp, facei, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown interaction type enumeration"
|
||||
<< abort(FatalError);
|
||||
break;
|
||||
}
|
||||
case KinematicSurfaceFilm<CloudType>::itAbsorb:
|
||||
{
|
||||
const scalar m = p.nParticle()*p.mass();
|
||||
|
||||
this->absorbInteraction //<regionFilm>
|
||||
(*(this->filmModel_), p, pp, facei, m, keepParticle);
|
||||
|
||||
break;
|
||||
}
|
||||
case KinematicSurfaceFilm<CloudType>::itSplashBai:
|
||||
{
|
||||
// Local pressure
|
||||
const scalar pc = thermo_.thermo().p()[p.cell()];
|
||||
const liquidProperties& liq = thermo_.liquids().properties()[0];
|
||||
const scalar sigma = liq.sigma(pc, p.T());
|
||||
const scalar mu = liq.mu(pc, p.T());
|
||||
|
||||
bool dry = this->deltaFilmPatch_[patchi][facei] < this->deltaWet_;
|
||||
|
||||
if (dry)
|
||||
{
|
||||
this->drySplashInteraction //<CloudType, regionFilm>
|
||||
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->wetSplashInteraction //<regionFilm>
|
||||
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unknown interaction type enumeration"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer parcel/parcel interactions complete
|
||||
bInteraction = true;
|
||||
}
|
||||
|
||||
// Transfer parcel/parcel interactions complete
|
||||
bInteraction = true;
|
||||
}
|
||||
|
||||
for (areaFilm& film : this->areaFilms_)
|
||||
{
|
||||
|
||||
if (patchi == film.patchID())
|
||||
{
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
@ -272,9 +272,8 @@ scalar liquidFilmBase::CourantNumber() const
|
||||
reduce(CoNum, maxOp<scalar>());
|
||||
reduce(velMag, maxOp<scalar>());
|
||||
|
||||
Info<< "Film Courant Number: "
|
||||
<< " max: " << CoNum
|
||||
<< " Film velocity magnitude: (h)" << velMag << endl;
|
||||
Info<< "Max film Courant Number: " << CoNum
|
||||
<< " Film velocity magnitude: " << velMag << endl;
|
||||
|
||||
return CoNum;
|
||||
}
|
||||
|
||||
@ -304,13 +304,13 @@ const volScalarField& liquidFilmModel::cloudMassTrans() const
|
||||
return cloudMassTrans_;
|
||||
}
|
||||
|
||||
|
||||
const volScalarField& liquidFilmModel::cloudDiameterTrans() const
|
||||
{
|
||||
return cloudDiameterTrans_;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void liquidFilmModel::preEvolveRegion()
|
||||
{
|
||||
liquidFilmBase::preEvolveRegion();
|
||||
@ -359,17 +359,16 @@ void liquidFilmModel::info()
|
||||
|
||||
const DimensionedField<scalar, areaMesh>& sf = regionMesh().S();
|
||||
|
||||
Info<< indent << "min/max(mag(Uf)) = " << gMin(mag(Uf_.field())) << ", "
|
||||
Info<< indent << "min/max(mag(Uf)) = "
|
||||
<< gMin(mag(Uf_.field())) << ", "
|
||||
<< gMax(mag(Uf_.field())) << nl
|
||||
<< indent << "min/max(delta) = " << gMin(h_.field()) << ", " << gMax(h_.field()) << nl
|
||||
<< indent << "min/max(delta) = "
|
||||
<< gMin(h_.field()) << ", " << gMax(h_.field()) << nl
|
||||
<< indent << "coverage = "
|
||||
<< gSum(alpha()().field()*mag(sf.field()))/gSum(mag(sf.field())) << nl
|
||||
<< indent << "total mass = "
|
||||
<< gSum(availableMass_) << nl;
|
||||
|
||||
|
||||
Info<< indent << CourantNumber() << endl;
|
||||
|
||||
injection_.info(Info);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user