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,11 +130,13 @@ 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
|
||||||
|
if (!filmModel_)
|
||||||
|
{
|
||||||
filmModel_ =
|
filmModel_ =
|
||||||
const_cast<regionFilm*>
|
const_cast<regionFilm*>
|
||||||
(
|
(
|
||||||
@ -146,8 +148,10 @@ void Foam::KinematicSurfaceFilm<CloudType>::init(bool binitThermo)
|
|||||||
"surfaceFilmProperties"
|
"surfaceFilmProperties"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (areaFilms_.size() == 0)
|
||||||
|
{
|
||||||
// set up areaFilms
|
// set up areaFilms
|
||||||
const wordList names =
|
const wordList names =
|
||||||
mesh.time().objectRegistry::template
|
mesh.time().objectRegistry::template
|
||||||
@ -168,9 +172,14 @@ void Foam::KinematicSurfaceFilm<CloudType>::init(bool binitThermo)
|
|||||||
areaFilms_.append(&film);
|
areaFilms_.append(&film);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Initiate thermo ref for filmModel
|
|
||||||
if (filmModel_ && binitThermo)
|
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,10 +578,9 @@ 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);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -595,9 +603,12 @@ Foam::KinematicSurfaceFilm<CloudType>::KinematicSurfaceFilm
|
|||||||
Awet_(sfm.Awet_),
|
Awet_(sfm.Awet_),
|
||||||
Cf_(sfm.Cf_),
|
Cf_(sfm.Cf_),
|
||||||
nParcelsSplashed_(sfm.nParcelsSplashed_)
|
nParcelsSplashed_(sfm.nParcelsSplashed_)
|
||||||
|
{
|
||||||
|
if (interactionType_ == itSplashBai)
|
||||||
{
|
{
|
||||||
init(initThermo);
|
init(initThermo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
@ -614,8 +625,12 @@ 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_)
|
||||||
|
{
|
||||||
|
if (filmModel_->isRegionPatch(patchi))
|
||||||
{
|
{
|
||||||
const label facei = pp.whichFace(p.face());
|
const label facei = pp.whichFace(p.face());
|
||||||
|
|
||||||
@ -668,6 +683,7 @@ bool Foam::KinematicSurfaceFilm<CloudType>::transferParcel
|
|||||||
// Transfer parcel/parcel interactions complete
|
// Transfer parcel/parcel interactions complete
|
||||||
bInteraction = true;
|
bInteraction = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (areaFilm& film : areaFilms_)
|
for (areaFilm& film : areaFilms_)
|
||||||
|
|||||||
@ -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,10 +72,14 @@ 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_)
|
||||||
|
{
|
||||||
|
if (this->filmModel_->isRegionPatch(patchi))
|
||||||
{
|
{
|
||||||
const label facei = pp.whichFace(p.face());
|
const label facei = pp.whichFace(p.face());
|
||||||
|
|
||||||
@ -130,10 +134,10 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
|||||||
// Transfer parcel/parcel interactions complete
|
// Transfer parcel/parcel interactions complete
|
||||||
bInteraction = true;
|
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