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>
|
template<class CloudType>
|
||||||
void Foam::KinematicSurfaceFilm<CloudType>::init(bool binitThermo)
|
void Foam::KinematicSurfaceFilm<CloudType>::initFilmModels()
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = this->owner().mesh();
|
const fvMesh& mesh = this->owner().mesh();
|
||||||
|
|
||||||
// set up filmModel pointer
|
// set up filmModel pointer
|
||||||
filmModel_ =
|
if (!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)
|
|
||||||
{
|
{
|
||||||
const regionModels::regionFaModel* regionFa =
|
filmModel_ =
|
||||||
mesh.time().objectRegistry::template findObject
|
const_cast<regionFilm*>
|
||||||
<
|
(
|
||||||
regionModels::regionFaModel
|
mesh.time().objectRegistry::template findObject
|
||||||
>(names[i]);
|
<
|
||||||
|
regionFilm
|
||||||
if (regionFa && isA<areaFilm>(*regionFa))
|
>
|
||||||
{
|
(
|
||||||
areaFilm& film =
|
"surfaceFilmProperties"
|
||||||
const_cast<areaFilm&>(refCast<const areaFilm>(*regionFa));
|
)
|
||||||
areaFilms_.append(&film);
|
);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initiate thermo ref for filmModel
|
if (areaFilms_.size() == 0)
|
||||||
if (filmModel_ && binitThermo)
|
{
|
||||||
|
// 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("pRef", pRef_);
|
||||||
this->coeffDict().readEntry("TRef", TRef_);
|
this->coeffDict().readEntry("TRef", TRef_);
|
||||||
@ -569,9 +578,8 @@ Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
|
|||||||
this->coeffDict().readEntry("Adry", Adry_);
|
this->coeffDict().readEntry("Adry", Adry_);
|
||||||
this->coeffDict().readEntry("Awet", Awet_);
|
this->coeffDict().readEntry("Awet", Awet_);
|
||||||
this->coeffDict().readEntry("Cf", Cf_);
|
this->coeffDict().readEntry("Cf", Cf_);
|
||||||
|
init(initThermo);
|
||||||
}
|
}
|
||||||
|
|
||||||
init(initThermo);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -596,7 +604,10 @@ Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
|
|||||||
Cf_(sfm.Cf_),
|
Cf_(sfm.Cf_),
|
||||||
nParcelsSplashed_(sfm.nParcelsSplashed_)
|
nParcelsSplashed_(sfm.nParcelsSplashed_)
|
||||||
{
|
{
|
||||||
init(initThermo);
|
if (interactionType_ == itSplashBai)
|
||||||
|
{
|
||||||
|
init(initThermo);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -614,59 +625,64 @@ bool Foam::KinematicSurfaceFilm<CloudType>::transferParcel
|
|||||||
|
|
||||||
bool bInteraction(false);
|
bool bInteraction(false);
|
||||||
|
|
||||||
|
initFilmModels();
|
||||||
|
|
||||||
// Check the singleLayer film models
|
// Check the singleLayer film models
|
||||||
if (filmModel_ && filmModel_->isRegionPatch(patchi))
|
if (filmModel_)
|
||||||
{
|
{
|
||||||
const label facei = pp.whichFace(p.face());
|
if (filmModel_->isRegionPatch(patchi))
|
||||||
|
|
||||||
switch (interactionType_)
|
|
||||||
{
|
{
|
||||||
case itBounce:
|
const label facei = pp.whichFace(p.face());
|
||||||
|
|
||||||
|
switch (interactionType_)
|
||||||
{
|
{
|
||||||
bounceInteraction(p, pp, facei, keepParticle);
|
case itBounce:
|
||||||
|
|
||||||
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>
|
bounceInteraction(p, pp, facei, keepParticle);
|
||||||
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
wetSplashInteraction<regionFilm>
|
|
||||||
(*filmModel_, sigma, mu, p, pp, facei, keepParticle);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
case itAbsorb:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
const scalar m = p.nParticle()*p.mass();
|
||||||
<< "Unknown interaction type enumeration"
|
|
||||||
<< abort(FatalError);
|
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 vector& nf
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Initialise pointers of films
|
//- Initialise thermo
|
||||||
void init(bool binitThermo);
|
void init(bool binitThermo);
|
||||||
|
|
||||||
|
//- Initialise pointers of films
|
||||||
|
void initFilmModels();
|
||||||
|
|
||||||
|
|
||||||
// Injection from sheet (ejection) helper functions
|
// Injection from sheet (ejection) helper functions
|
||||||
|
|
||||||
|
|||||||
@ -72,68 +72,72 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
|||||||
{
|
{
|
||||||
const label patchi = pp.index();
|
const label patchi = pp.index();
|
||||||
|
|
||||||
|
this->initFilmModels();
|
||||||
|
|
||||||
bool bInteraction(false);
|
bool bInteraction(false);
|
||||||
|
|
||||||
// Check the singleLayer film models
|
// Check the singleLayer film models
|
||||||
if (this->filmModel_ && this->filmModel_->isRegionPatch(patchi))
|
if (this->filmModel_)
|
||||||
{
|
{
|
||||||
const label facei = pp.whichFace(p.face());
|
if (this->filmModel_->isRegionPatch(patchi))
|
||||||
|
|
||||||
switch (this->interactionType_)
|
|
||||||
{
|
{
|
||||||
case KinematicSurfaceFilm<CloudType>::itBounce:
|
const label facei = pp.whichFace(p.face());
|
||||||
|
|
||||||
|
switch (this->interactionType_)
|
||||||
{
|
{
|
||||||
this->bounceInteraction(p, pp, facei, keepParticle);
|
case KinematicSurfaceFilm<CloudType>::itBounce:
|
||||||
|
|
||||||
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->bounceInteraction(p, pp, facei, keepParticle);
|
||||||
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this->wetSplashInteraction //<regionFilm>
|
|
||||||
(*(this->filmModel_), sigma, mu, p, pp, facei, keepParticle);
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
case KinematicSurfaceFilm<CloudType>::itAbsorb:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
const scalar m = p.nParticle()*p.mass();
|
||||||
<< "Unknown interaction type enumeration"
|
|
||||||
<< abort(FatalError);
|
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_)
|
for (areaFilm& film : this->areaFilms_)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (patchi == film.patchID())
|
if (patchi == film.patchID())
|
||||||
{
|
{
|
||||||
const label facei = pp.whichFace(p.face());
|
const label facei = pp.whichFace(p.face());
|
||||||
|
|||||||
@ -272,9 +272,8 @@ scalar liquidFilmBase::CourantNumber() const
|
|||||||
reduce(CoNum, maxOp<scalar>());
|
reduce(CoNum, maxOp<scalar>());
|
||||||
reduce(velMag, maxOp<scalar>());
|
reduce(velMag, maxOp<scalar>());
|
||||||
|
|
||||||
Info<< "Film Courant Number: "
|
Info<< "Max film Courant Number: " << CoNum
|
||||||
<< " max: " << CoNum
|
<< " Film velocity magnitude: " << velMag << endl;
|
||||||
<< " Film velocity magnitude: (h)" << velMag << endl;
|
|
||||||
|
|
||||||
return CoNum;
|
return CoNum;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -304,13 +304,13 @@ const volScalarField& liquidFilmModel::cloudMassTrans() const
|
|||||||
return cloudMassTrans_;
|
return cloudMassTrans_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const volScalarField& liquidFilmModel::cloudDiameterTrans() const
|
const volScalarField& liquidFilmModel::cloudDiameterTrans() const
|
||||||
{
|
{
|
||||||
return cloudDiameterTrans_;
|
return cloudDiameterTrans_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void liquidFilmModel::preEvolveRegion()
|
void liquidFilmModel::preEvolveRegion()
|
||||||
{
|
{
|
||||||
liquidFilmBase::preEvolveRegion();
|
liquidFilmBase::preEvolveRegion();
|
||||||
@ -359,17 +359,16 @@ void liquidFilmModel::info()
|
|||||||
|
|
||||||
const DimensionedField<scalar, areaMesh>& sf = regionMesh().S();
|
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
|
<< 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 = "
|
<< indent << "coverage = "
|
||||||
<< gSum(alpha()().field()*mag(sf.field()))/gSum(mag(sf.field())) << nl
|
<< gSum(alpha()().field()*mag(sf.field()))/gSum(mag(sf.field())) << nl
|
||||||
<< indent << "total mass = "
|
<< indent << "total mass = "
|
||||||
<< gSum(availableMass_) << nl;
|
<< gSum(availableMass_) << nl;
|
||||||
|
|
||||||
|
|
||||||
Info<< indent << CourantNumber() << endl;
|
|
||||||
|
|
||||||
injection_.info(Info);
|
injection_.info(Info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user