VoFPatchTransfer: Rationalised the names of the cached fields and their origin
required rationalisation of the names of variables and functions in surfaceFilmModels to clarify which relate to the film region.
This commit is contained in:
@ -169,8 +169,6 @@ void VoFPatchTransfer::correct
|
||||
const volScalarField& alphaVoF = thermo.alpha1();
|
||||
const volScalarField& rhoVoF = thermo.thermo1().rho()();
|
||||
const volScalarField& heVoF = thermo.thermo1().he();
|
||||
const volScalarField& TVoF = thermo.thermo1().T();
|
||||
const volScalarField CpVoF(thermo.thermo1().Cp());
|
||||
|
||||
forAll(patchIDs_, pidi)
|
||||
{
|
||||
@ -189,36 +187,44 @@ void VoFPatchTransfer::correct
|
||||
|
||||
if (primaryPatchi != -1)
|
||||
{
|
||||
scalarField deltaCoeffs
|
||||
const scalarField deltaCoeffsVoF
|
||||
(
|
||||
film.toFilm
|
||||
(
|
||||
patchi,
|
||||
film.primaryMesh().boundary()[primaryPatchi].deltaCoeffs()
|
||||
)
|
||||
);
|
||||
film.toRegion(patchi, deltaCoeffs);
|
||||
|
||||
scalarField alphap(alphaVoF.boundaryField()[primaryPatchi]);
|
||||
film.toRegion(patchi, alphap);
|
||||
|
||||
scalarField rhop(rhoVoF.boundaryField()[primaryPatchi]);
|
||||
film.toRegion(patchi, rhop);
|
||||
|
||||
vectorField Up(UVoF.boundaryField()[primaryPatchi]);
|
||||
film.toRegion(patchi, Up);
|
||||
|
||||
scalarField hp(heVoF.boundaryField()[primaryPatchi]);
|
||||
film.toRegion(patchi, hp);
|
||||
|
||||
scalarField Tp(TVoF.boundaryField()[primaryPatchi]);
|
||||
film.toRegion(patchi, Tp);
|
||||
|
||||
scalarField Cpp(CpVoF.boundaryField()[primaryPatchi]);
|
||||
film.toRegion(patchi, Cpp);
|
||||
|
||||
scalarField Vp
|
||||
const scalarField alphaVoFp
|
||||
(
|
||||
film.toFilm(patchi, alphaVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const scalarField rhoVoFp
|
||||
(
|
||||
film.toFilm(patchi, rhoVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const vectorField UVoFp
|
||||
(
|
||||
film.toFilm(patchi, UVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const scalarField heVoFp
|
||||
(
|
||||
film.toFilm(patchi, heVoF.boundaryField()[primaryPatchi])
|
||||
);
|
||||
|
||||
const scalarField VVoFp
|
||||
(
|
||||
film.toFilm
|
||||
(
|
||||
patchi,
|
||||
film.primaryMesh().boundary()[primaryPatchi]
|
||||
.patchInternalField(film.primaryMesh().V())
|
||||
)
|
||||
);
|
||||
film.toRegion(patchi, Vp);
|
||||
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
const labelList& faceCells = pp.faceCells();
|
||||
@ -235,10 +241,11 @@ void VoFPatchTransfer::correct
|
||||
|
||||
scalar dMass = 0;
|
||||
|
||||
// Film->VoF transfer
|
||||
if
|
||||
(
|
||||
delta[celli] > 2*deltaFactorToVoF_/deltaCoeffs[facei]
|
||||
|| alphap[facei] > alphaToVoF_
|
||||
delta[celli] > 2*deltaFactorToVoF_/deltaCoeffsVoF[facei]
|
||||
|| alphaVoFp[facei] > alphaToVoF_
|
||||
)
|
||||
{
|
||||
dMass =
|
||||
@ -249,19 +256,21 @@ void VoFPatchTransfer::correct
|
||||
energyToTransfer[celli] += dMass*he[celli];
|
||||
}
|
||||
|
||||
// VoF->film transfer
|
||||
if
|
||||
(
|
||||
alphap[facei] > 0
|
||||
&& delta[celli] < 2*deltaFactorToFilm_/deltaCoeffs[facei]
|
||||
&& alphap[facei] < alphaToFilm_
|
||||
alphaVoFp[facei] > 0
|
||||
&& delta[celli] < 2*deltaFactorToFilm_/deltaCoeffsVoF[facei]
|
||||
&& alphaVoFp[facei] < alphaToFilm_
|
||||
)
|
||||
{
|
||||
dMass =
|
||||
-transferRateCoeff_*alphap[facei]*rhop[facei]*Vp[facei];
|
||||
-transferRateCoeff_
|
||||
*alphaVoFp[facei]*rhoVoFp[facei]*VVoFp[facei];
|
||||
|
||||
massToTransfer[celli] += dMass;
|
||||
momentumToTransfer[celli] += dMass*Up[facei];
|
||||
energyToTransfer[celli] += dMass*hp[facei];
|
||||
momentumToTransfer[celli] += dMass*UVoFp[facei];
|
||||
energyToTransfer[celli] += dMass*heVoFp[facei];
|
||||
}
|
||||
|
||||
availableMass[celli] -= dMass;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -620,7 +620,7 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
|
||||
{
|
||||
surfaceFilm& filmModel = this->surfaceFilmPtrs()[filmi];
|
||||
|
||||
if (filmModel.isRegionPatch(patchi))
|
||||
if (filmModel.isFilmPatch(patchi))
|
||||
{
|
||||
const label facei = pp.whichFace(p.face());
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -111,7 +111,7 @@ void Foam::inclinedFilmNusseltHeightFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// retrieve the film region from the database
|
||||
// retrieve the film film from the database
|
||||
|
||||
const momentumSurfaceFilm& film =
|
||||
db().time().lookupObject<momentumSurfaceFilm>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -111,7 +111,7 @@ void Foam::inclinedFilmNusseltInletVelocityFvPatchVectorField::updateCoeffs()
|
||||
|
||||
const label patchi = patch().index();
|
||||
|
||||
// Retrieve the film region from the database
|
||||
// Retrieve the film film from the database
|
||||
|
||||
const momentumSurfaceFilm& film =
|
||||
db().time().lookupObject<momentumSurfaceFilm>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -152,7 +152,7 @@ void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs()
|
||||
const modelType& filmModel =
|
||||
db().time().lookupObject<modelType>(filmName_ + "Properties");
|
||||
|
||||
const label filmPatchi = filmModel.regionPatchID(patchi);
|
||||
const label filmPatchi = filmModel.filmPatchID(patchi);
|
||||
|
||||
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
||||
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchi];
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -68,7 +68,7 @@ tmp<scalarField> nutkFilmWallFunctionFvPatchScalarField::calcUTau
|
||||
const modelType& filmModel =
|
||||
db().time().lookupObject<modelType>(filmName_+ "Properties");
|
||||
|
||||
const label filmPatchi = filmModel.regionPatchID(patchi);
|
||||
const label filmPatchi = filmModel.filmPatchID(patchi);
|
||||
|
||||
tmp<volScalarField> mDotFilm(filmModel.primaryMassTrans());
|
||||
scalarField mDotFilmp = mDotFilm().boundaryField()[filmPatchi];
|
||||
|
||||
@ -69,7 +69,7 @@ class surfaceFilms
|
||||
PtrList<thermoSurfaceFilm> surfaceFilms_;
|
||||
|
||||
//- For each surface film model, the corresponding density name in the
|
||||
// primary region
|
||||
// primary film
|
||||
wordList surfaceFilmPrimaryRhoNames_;
|
||||
|
||||
//- List of fields for which the fvModel adds source term
|
||||
|
||||
@ -59,7 +59,7 @@ bool Foam::momentumSurfaceFilm::read()
|
||||
}
|
||||
|
||||
|
||||
void Foam::momentumSurfaceFilm::resetPrimaryRegionSourceTerms()
|
||||
void Foam::momentumSurfaceFilm::resetPrimaryFilmSourceTerms()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
@ -70,11 +70,11 @@ void Foam::momentumSurfaceFilm::resetPrimaryRegionSourceTerms()
|
||||
|
||||
|
||||
void Foam::momentumSurfaceFilm::
|
||||
transferPrimaryRegionThermoFields()
|
||||
transferPrimaryFilmThermoFields()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
// Update fields from primary region via direct mapped
|
||||
// Update fields from primary film via direct mapped
|
||||
// (coupled) boundary conditions
|
||||
UPrimary_.correctBoundaryConditions();
|
||||
p_.correctBoundaryConditions();
|
||||
@ -84,7 +84,7 @@ transferPrimaryRegionThermoFields()
|
||||
|
||||
|
||||
void Foam::momentumSurfaceFilm::
|
||||
transferPrimaryRegionSourceFields()
|
||||
transferPrimaryFilmSourceFields()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
@ -112,12 +112,12 @@ transferPrimaryRegionSourceFields()
|
||||
pSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
|
||||
}
|
||||
|
||||
// Retrieve the source fields from the primary region
|
||||
toRegion(rhoSp_, rhoSpPrimaryBf);
|
||||
// Retrieve the source fields from the primary film
|
||||
toFilm(rhoSp_, rhoSpPrimaryBf);
|
||||
rhoSp_.field() /= VbyA();
|
||||
toRegion(USp_, USpPrimaryBf);
|
||||
toFilm(USp_, USpPrimaryBf);
|
||||
USp_.field() /= VbyA();
|
||||
toRegion(pSp_, pSpPrimaryBf);
|
||||
toFilm(pSp_, pSpPrimaryBf);
|
||||
|
||||
// update addedMassTotal counter
|
||||
if (time().writeTime())
|
||||
@ -158,7 +158,7 @@ Foam::momentumSurfaceFilm::pe()
|
||||
return volScalarField::New
|
||||
(
|
||||
typedName("pe"),
|
||||
p_ // Pressure (mapped from primary region)
|
||||
p_ // Pressure (mapped from primary film)
|
||||
- tpSp // Accumulated particle impingement
|
||||
);
|
||||
}
|
||||
@ -464,11 +464,11 @@ Foam::momentumSurfaceFilm::momentumSurfaceFilm
|
||||
const word& modelType,
|
||||
const fvMesh& primaryMesh,
|
||||
const dimensionedVector& g,
|
||||
const word& regionType,
|
||||
const word& filmType,
|
||||
const bool readFields
|
||||
)
|
||||
:
|
||||
surfaceFilm(modelType, primaryMesh, g, regionType),
|
||||
surfaceFilm(modelType, primaryMesh, g, filmType),
|
||||
phaseName_(coeffs_.lookupOrDefault("phase", word::null)),
|
||||
pimple_(mesh_),
|
||||
|
||||
@ -829,7 +829,7 @@ Foam::momentumSurfaceFilm::momentumSurfaceFilm
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
transferPrimaryRegionThermoFields();
|
||||
transferPrimaryFilmThermoFields();
|
||||
|
||||
correctCoverage();
|
||||
|
||||
@ -907,15 +907,15 @@ void Foam::momentumSurfaceFilm::addSources
|
||||
}
|
||||
|
||||
|
||||
void Foam::momentumSurfaceFilm::preEvolveRegion()
|
||||
void Foam::momentumSurfaceFilm::preEvolveFilm()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
surfaceFilm::preEvolveRegion();
|
||||
surfaceFilm::preEvolveFilm();
|
||||
|
||||
transferPrimaryRegionThermoFields();
|
||||
transferPrimaryFilmThermoFields();
|
||||
|
||||
transferPrimaryRegionSourceFields();
|
||||
transferPrimaryFilmSourceFields();
|
||||
|
||||
// Reset transfer fields
|
||||
availableMass_ = mass();
|
||||
@ -926,7 +926,7 @@ void Foam::momentumSurfaceFilm::preEvolveRegion()
|
||||
}
|
||||
|
||||
|
||||
void Foam::momentumSurfaceFilm::evolveRegion()
|
||||
void Foam::momentumSurfaceFilm::evolveFilm()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
@ -961,7 +961,7 @@ void Foam::momentumSurfaceFilm::evolveRegion()
|
||||
}
|
||||
|
||||
// Reset source terms for next time integration
|
||||
resetPrimaryRegionSourceTerms();
|
||||
resetPrimaryFilmSourceTerms();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -125,7 +125,7 @@ protected:
|
||||
|
||||
// Transfer fields
|
||||
|
||||
//- Film mass available for transfer to the primary region
|
||||
//- Film mass available for transfer to the primary film
|
||||
volScalarField primaryMassTrans_;
|
||||
|
||||
//- Film mass available for transfer to cloud
|
||||
@ -140,8 +140,8 @@ protected:
|
||||
|
||||
// Source term fields
|
||||
|
||||
// Film region - registered to the film region mesh
|
||||
// Note: need boundary value mapped from primary region, and then
|
||||
// Film film - registered to the film film mesh
|
||||
// Note: need boundary value mapped from primary film, and then
|
||||
// pushed into the patch internal field
|
||||
|
||||
//- Mass [kg/m^2/s]
|
||||
@ -154,20 +154,20 @@ protected:
|
||||
volScalarField::Internal pSp_;
|
||||
|
||||
|
||||
// Primary region - registered to the primary region mesh
|
||||
// Primary film - registered to the primary film mesh
|
||||
// Internal use only - not read-in
|
||||
|
||||
//- Primary region mass source [kg]
|
||||
//- Primary film mass source [kg]
|
||||
volScalarField rhoSpPrimary_;
|
||||
|
||||
//- Primary region tangential momentum source [kg m/s]
|
||||
//- Primary film tangential momentum source [kg m/s]
|
||||
volVectorField USpPrimary_;
|
||||
|
||||
//- Primary region normal momentum source (pressure) [kg m/s]
|
||||
//- Primary film normal momentum source (pressure) [kg m/s]
|
||||
volScalarField pSpPrimary_;
|
||||
|
||||
|
||||
// Fields mapped from primary region - registered to the film region
|
||||
// Fields mapped from primary film - registered to the film film
|
||||
// Note: need both boundary AND patch internal fields to be mapped
|
||||
|
||||
//- Velocity [m/s]
|
||||
@ -217,13 +217,13 @@ protected:
|
||||
virtual bool read();
|
||||
|
||||
//- Reset source term fields
|
||||
virtual void resetPrimaryRegionSourceTerms();
|
||||
virtual void resetPrimaryFilmSourceTerms();
|
||||
|
||||
//- Transfer thermo fields from the primary region to the film region
|
||||
virtual void transferPrimaryRegionThermoFields();
|
||||
//- Transfer thermo fields from the primary film to the film film
|
||||
virtual void transferPrimaryFilmThermoFields();
|
||||
|
||||
//- Transfer source fields from the primary region to the film region
|
||||
virtual void transferPrimaryRegionSourceFields();
|
||||
//- Transfer source fields from the primary film to the film film
|
||||
virtual void transferPrimaryFilmSourceFields();
|
||||
|
||||
//- Hydrostatic pressure coefficient
|
||||
tmp<surfaceScalarField> rhog() const;
|
||||
@ -249,7 +249,7 @@ protected:
|
||||
//- Continuity check
|
||||
virtual void continuityCheck();
|
||||
|
||||
//- Constrain a film region master/slave boundaries of a field to a
|
||||
//- Constrain a film film master/slave boundaries of a field to a
|
||||
// given value
|
||||
template<class Type>
|
||||
tmp<Type> constrainFilmField
|
||||
@ -294,7 +294,7 @@ public:
|
||||
const word& modelType,
|
||||
const fvMesh& primaryMesh,
|
||||
const dimensionedVector& g,
|
||||
const word& regionType,
|
||||
const word& filmType,
|
||||
const bool readFields = true
|
||||
);
|
||||
|
||||
@ -369,7 +369,7 @@ public:
|
||||
tmp<volVectorField::Internal> Uw() const;
|
||||
|
||||
|
||||
// Transfer fields - to the primary region
|
||||
// Transfer fields - to the primary film
|
||||
|
||||
//- Return mass transfer source - Eulerian phase only
|
||||
virtual tmp<volScalarField> primaryMassTrans() const;
|
||||
@ -389,7 +389,7 @@ public:
|
||||
//- External hook to add sources to the film
|
||||
virtual void addSources
|
||||
(
|
||||
const label patchi, // patchi on primary region
|
||||
const label patchi, // patchi on primary film
|
||||
const label facei, // facei of patchi
|
||||
const scalar massSource, // [kg]
|
||||
const vector& momentumSource, // [kg m/s] (tang'l momentum)
|
||||
@ -400,7 +400,7 @@ public:
|
||||
|
||||
// Source fields (read/write access)
|
||||
|
||||
// Primary region
|
||||
// Primary film
|
||||
|
||||
//- Momentum [kg/m/s^2]
|
||||
inline volVectorField& USpPrimary();
|
||||
@ -412,7 +412,7 @@ public:
|
||||
inline volScalarField& rhoSpPrimary();
|
||||
|
||||
|
||||
// Film region
|
||||
// Film film
|
||||
|
||||
//- Momentum [kg/m/s^2]
|
||||
inline volVectorField::Internal& USp();
|
||||
@ -433,7 +433,7 @@ public:
|
||||
inline const volScalarField::Internal& rhoSp() const;
|
||||
|
||||
|
||||
// Fields mapped from primary region
|
||||
// Fields mapped from primary film
|
||||
|
||||
//- Velocity [m/s]
|
||||
inline const volVectorField& UPrimary() const;
|
||||
@ -476,13 +476,13 @@ public:
|
||||
// Evolution
|
||||
|
||||
//- Pre-evolve film hook
|
||||
virtual void preEvolveRegion();
|
||||
virtual void preEvolveFilm();
|
||||
|
||||
//- Evolve the film equations
|
||||
virtual void evolveRegion();
|
||||
virtual void evolveFilm();
|
||||
|
||||
|
||||
// Primary region source fields
|
||||
// Primary film source fields
|
||||
|
||||
//- Return total mass source - Eulerian phase only
|
||||
virtual tmp<volScalarField::Internal> Srho() const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -122,7 +122,7 @@ void ejectionModelList::correct
|
||||
im.correct(availableMass, massToEject, diameterToEject);
|
||||
}
|
||||
|
||||
// Push values to boundaries ready for transfer to the primary region
|
||||
// Push values to boundaries ready for transfer to the primary film
|
||||
massToEject.correctBoundaryConditions();
|
||||
diameterToEject.correctBoundaryConditions();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -121,7 +121,7 @@ void transferModelList::correct
|
||||
);
|
||||
}
|
||||
|
||||
// Push values to boundaries ready for transfer to the primary region
|
||||
// Push values to boundaries ready for transfer to the primary film
|
||||
massToTransfer.correctBoundaryConditions();
|
||||
|
||||
const labelList& patchIDs = film().intCoupledPatchIDs();
|
||||
@ -155,7 +155,7 @@ void transferModelList::correct
|
||||
);
|
||||
}
|
||||
|
||||
// Push values to boundaries ready for transfer to the primary region
|
||||
// Push values to boundaries ready for transfer to the primary film
|
||||
massToTransfer.correctBoundaryConditions();
|
||||
momentumToTransfer.correctBoundaryConditions();
|
||||
energyToTransfer.correctBoundaryConditions();
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -86,8 +86,8 @@ void primaryRadiation::correct()
|
||||
film().primaryMesh().lookupObject<volScalarField>("qin")
|
||||
);
|
||||
|
||||
// Map the primary-side radiative flux to the region internal field
|
||||
film().toRegion(qinFilm_, qinPrimary.boundaryField());
|
||||
// Map the primary-side radiative flux to the film internal field
|
||||
film().toFilm(qinFilm_, qinPrimary.boundaryField());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2012-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,7 +26,7 @@ Class
|
||||
|
||||
Description
|
||||
Radiation model whereby the radiative heat flux is mapped from the primary
|
||||
region
|
||||
film
|
||||
|
||||
SourceFiles
|
||||
primaryRadiation.C
|
||||
@ -56,7 +56,7 @@ class primaryRadiation
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Incident radiative flux mapped from the primary region [kg/s^3]
|
||||
//- Incident radiative flux mapped from the primary film [kg/s^3]
|
||||
volScalarField::Internal qinFilm_;
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -88,8 +88,8 @@ void standardRadiation::correct()
|
||||
film().primaryMesh().lookupObject<volScalarField>("qin")
|
||||
);
|
||||
|
||||
// Map the primary-side radiative flux to the region internal field
|
||||
film().toRegion(qinFilm_, qinPrimary.boundaryField());
|
||||
// Map the primary-side radiative flux to the film internal field
|
||||
film().toFilm(qinFilm_, qinPrimary.boundaryField());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -55,7 +55,7 @@ class standardRadiation
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Radiative incident flux mapped from the primary region [kg/s^3]
|
||||
//- Radiative incident flux mapped from the primary film [kg/s^3]
|
||||
volScalarField::Internal qinFilm_;
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -99,8 +99,8 @@ void mappedConvectiveHeatTransfer::correct()
|
||||
htcConvPrimary_.correctBoundaryConditions();
|
||||
|
||||
// Map the primary-side convective heat transfer coefficient
|
||||
// to the region internal field
|
||||
film().toRegion(htcConvFilm_, htcConvPrimary_.boundaryField());
|
||||
// to the film internal field
|
||||
film().toFilm(htcConvFilm_, htcConvPrimary_.boundaryField());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -56,10 +56,10 @@ class mappedConvectiveHeatTransfer
|
||||
{
|
||||
// Private Data
|
||||
|
||||
//- Heat transfer coefficient - primary region [W/m^2/K]
|
||||
//- Heat transfer coefficient - primary film [W/m^2/K]
|
||||
volScalarField htcConvPrimary_;
|
||||
|
||||
//- Heat transfer coefficient - film region [W/m^2/K]
|
||||
//- Heat transfer coefficient - film film [W/m^2/K]
|
||||
volScalarField::Internal htcConvFilm_;
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -165,10 +165,10 @@ void standardPhaseChange::correctModel
|
||||
}
|
||||
else
|
||||
{
|
||||
// Primary region density [kg/m^3]
|
||||
// Primary film density [kg/m^3]
|
||||
const scalar rhoInfc = rhoInf[celli];
|
||||
|
||||
// Primary region viscosity [Pa.s]
|
||||
// Primary film viscosity [Pa.s]
|
||||
const scalar muInfc = muInf[celli];
|
||||
|
||||
// Reynolds number
|
||||
@ -197,7 +197,7 @@ void standardPhaseChange::correctModel
|
||||
|
||||
dMass[celli] += dm;
|
||||
|
||||
// Assume that the vapour transferred to the primary region is
|
||||
// Assume that the vapour transferred to the primary film is
|
||||
// already at temperature Tloc so that all heat required for
|
||||
// the phase-change is provided by the film
|
||||
dEnergy[celli] += dm*primarySpecieThermo.Hs(vapId(), pc, Tloc);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2017-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2017-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -238,7 +238,7 @@ void waxSolventEvaporation::correctModel
|
||||
Ysolvent*Wsolvent/((1 - Ysolvent)*Wwax + Ysolvent*Wsolvent)
|
||||
);
|
||||
|
||||
// Primary region density [kg/m^3]
|
||||
// Primary film density [kg/m^3]
|
||||
const scalar rhoInfc = rhoInf[celli];
|
||||
|
||||
// Cell pressure [Pa]
|
||||
@ -276,7 +276,7 @@ void waxSolventEvaporation::correctModel
|
||||
XsCoeff/(XsCoeff*Xsolvent*Wsolvent + (1 - Xs)*Wvap)
|
||||
);
|
||||
|
||||
// Primary region viscosity [Pa.s]
|
||||
// Primary film viscosity [Pa.s]
|
||||
const scalar muInfc = muInf[celli];
|
||||
|
||||
// Reynolds number
|
||||
@ -374,7 +374,7 @@ void waxSolventEvaporation::correctModel
|
||||
|
||||
dMass += dm;
|
||||
|
||||
// Assume that the vapour transferred to the primary region is
|
||||
// Assume that the vapour transferred to the primary film is
|
||||
// already at temperature Tloc so that all heat required for
|
||||
// the phase-change is provided by the film
|
||||
dEnergy += dm*primarySpecieThermo.Hs(vapId(), pInf, Tloc);
|
||||
|
||||
@ -59,56 +59,56 @@ bool Foam::surfaceFilm::read()
|
||||
|
||||
Foam::label Foam::surfaceFilm::nbrCoupledPatchID
|
||||
(
|
||||
const surfaceFilm& nbrRegion,
|
||||
const label regionPatchi
|
||||
const surfaceFilm& nbrFilm,
|
||||
const label filmPatchi
|
||||
) const
|
||||
{
|
||||
label nbrPatchi = -1;
|
||||
|
||||
// region
|
||||
const fvMesh& nbrRegionMesh = nbrRegion.mesh();
|
||||
// film
|
||||
const fvMesh& nbrFilmMesh = nbrFilm.mesh();
|
||||
|
||||
// boundary meshes
|
||||
const polyBoundaryMesh& pbm = mesh().boundaryMesh();
|
||||
const polyBoundaryMesh& nbrPbm = nbrRegionMesh.boundaryMesh();
|
||||
const polyBoundaryMesh& nbrPbm = nbrFilmMesh.boundaryMesh();
|
||||
|
||||
if (regionPatchi > pbm.size() - 1)
|
||||
if (filmPatchi > pbm.size() - 1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "region patch index out of bounds: "
|
||||
<< "region patch index = " << regionPatchi
|
||||
<< "film patch index out of bounds: "
|
||||
<< "film patch index = " << filmPatchi
|
||||
<< ", maximum index = " << pbm.size() - 1
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
const mappedPatchBase& mpb =
|
||||
mappedPatchBase::getMap(pbm[regionPatchi]);
|
||||
mappedPatchBase::getMap(pbm[filmPatchi]);
|
||||
|
||||
// sample patch name on the primary region
|
||||
// sample patch name on the primary film
|
||||
const word& primaryPatchName = mpb.nbrPatchName();
|
||||
|
||||
// find patch on nbr region that has the same sample patch name
|
||||
forAll(nbrRegion.intCoupledPatchIDs(), j)
|
||||
// find patch on nbr film that has the same sample patch name
|
||||
forAll(nbrFilm.intCoupledPatchIDs(), j)
|
||||
{
|
||||
const label nbrRegionPatchi = nbrRegion.intCoupledPatchIDs()[j];
|
||||
const label nbrFilmPatchi = nbrFilm.intCoupledPatchIDs()[j];
|
||||
|
||||
const mappedPatchBase& mpb =
|
||||
mappedPatchBase::getMap(nbrPbm[nbrRegionPatchi]);
|
||||
mappedPatchBase::getMap(nbrPbm[nbrFilmPatchi]);
|
||||
|
||||
if (mpb.nbrPatchName() == primaryPatchName)
|
||||
{
|
||||
nbrPatchi = nbrRegionPatchi;
|
||||
nbrPatchi = nbrFilmPatchi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (nbrPatchi == -1)
|
||||
{
|
||||
const polyPatch& p = mesh().boundaryMesh()[regionPatchi];
|
||||
const polyPatch& p = mesh().boundaryMesh()[filmPatchi];
|
||||
|
||||
FatalErrorInFunction
|
||||
<< "Unable to find patch pair for local patch "
|
||||
<< p.name() << " and region " << nbrRegion.name()
|
||||
<< p.name() << " and film " << nbrFilm.name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -123,14 +123,14 @@ Foam::surfaceFilm::surfaceFilm
|
||||
const word& modelType,
|
||||
const fvMesh& primaryMesh,
|
||||
const dimensionedVector& g,
|
||||
const word& regionType
|
||||
const word& filmType
|
||||
)
|
||||
:
|
||||
IOdictionary
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionType + "Properties",
|
||||
filmType + "Properties",
|
||||
primaryMesh.time().constant(),
|
||||
primaryMesh.time(),
|
||||
IOobject::MUST_READ,
|
||||
@ -141,12 +141,12 @@ Foam::surfaceFilm::surfaceFilm
|
||||
time_(primaryMesh.time()),
|
||||
infoOutput_(true),
|
||||
modelType_(modelType),
|
||||
regionName_(lookup("regionName")),
|
||||
filmName_(lookup("filmName")),
|
||||
mesh_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName_,
|
||||
filmName_,
|
||||
time_.name(),
|
||||
time_,
|
||||
IOobject::MUST_READ
|
||||
@ -201,16 +201,16 @@ Foam::surfaceFilm::surfaceFilm
|
||||
|
||||
forAll(rbm, patchi)
|
||||
{
|
||||
const polyPatch& regionPatch = rbm[patchi];
|
||||
const polyPatch& filmPatch = rbm[patchi];
|
||||
|
||||
if (isA<mappedPatchBase>(regionPatch))
|
||||
if (isA<mappedPatchBase>(filmPatch))
|
||||
{
|
||||
intCoupledPatchIDs.append(patchi);
|
||||
|
||||
nBoundaryFaces += regionPatch.faceCells().size();
|
||||
nBoundaryFaces += filmPatch.faceCells().size();
|
||||
|
||||
const mappedPatchBase& mapPatch =
|
||||
refCast<const mappedPatchBase>(regionPatch);
|
||||
refCast<const mappedPatchBase>(filmPatch);
|
||||
|
||||
if
|
||||
(
|
||||
@ -232,8 +232,8 @@ Foam::surfaceFilm::surfaceFilm
|
||||
if (returnReduce(nBoundaryFaces, sumOp<label>()) == 0)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Region model has no mapped boundary conditions - transfer "
|
||||
<< "between regions will not be possible" << endl;
|
||||
<< "Film model has no mapped boundary conditions - transfer "
|
||||
<< "between films will not be possible" << endl;
|
||||
}
|
||||
|
||||
if (!outputPropertiesPtr_.valid())
|
||||
@ -244,9 +244,9 @@ Foam::surfaceFilm::surfaceFilm
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName_ + "OutputProperties",
|
||||
filmName_ + "OutputProperties",
|
||||
time_.name(),
|
||||
"uniform"/regionName_,
|
||||
"uniform"/filmName_,
|
||||
primaryMesh_,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE
|
||||
@ -275,8 +275,8 @@ Foam::surfaceFilm::surfaceFilm
|
||||
if (nBoundaryFaces != mesh_.nCells())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Number of primary region coupled boundary faces not equal to "
|
||||
<< "the number of cells in the local region" << nl << nl
|
||||
<< "Number of primary film coupled boundary faces not equal to "
|
||||
<< "the number of cells in the local film" << nl << nl
|
||||
<< "Number of cells = " << mesh_.nCells() << nl
|
||||
<< "Boundary faces = " << nBoundaryFaces << nl
|
||||
<< abort(FatalError);
|
||||
@ -348,14 +348,14 @@ Foam::surfaceFilm::passivePatchIDs() const
|
||||
|
||||
void Foam::surfaceFilm::evolve()
|
||||
{
|
||||
Info<< "\nEvolving " << modelType_ << " for region "
|
||||
Info<< "\nEvolving " << modelType_ << " for film "
|
||||
<< mesh_.name() << endl;
|
||||
|
||||
preEvolveRegion();
|
||||
preEvolveFilm();
|
||||
|
||||
evolveRegion();
|
||||
evolveFilm();
|
||||
|
||||
postEvolveRegion();
|
||||
postEvolveFilm();
|
||||
|
||||
// Provide some feedback
|
||||
if (infoOutput_)
|
||||
@ -378,15 +378,15 @@ void Foam::surfaceFilm::evolve()
|
||||
}
|
||||
|
||||
|
||||
void Foam::surfaceFilm::preEvolveRegion()
|
||||
void Foam::surfaceFilm::preEvolveFilm()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::surfaceFilm::evolveRegion()
|
||||
void Foam::surfaceFilm::evolveFilm()
|
||||
{}
|
||||
|
||||
|
||||
void Foam::surfaceFilm::postEvolveRegion()
|
||||
void Foam::surfaceFilm::postEvolveFilm()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -67,10 +67,10 @@ protected:
|
||||
//- Model type
|
||||
const word modelType_;
|
||||
|
||||
//- Region name
|
||||
word regionName_;
|
||||
//- Film name
|
||||
word filmName_;
|
||||
|
||||
//- Region mesh
|
||||
//- Film mesh
|
||||
fvMesh mesh_;
|
||||
|
||||
//- Model coefficients dictionary
|
||||
@ -82,10 +82,10 @@ protected:
|
||||
|
||||
// Addressing
|
||||
|
||||
//- List of patch IDs on the primary region coupled to this region
|
||||
//- List of patch IDs on the primary film coupled to this film
|
||||
labelList primaryPatchIDs_;
|
||||
|
||||
//- List of patch IDs internally coupled with the primary region
|
||||
//- List of patch IDs internally coupled with the primary film
|
||||
labelList intCoupledPatchIDs_;
|
||||
|
||||
//- List of patch IDs opposite to internally coupled patches
|
||||
@ -127,7 +127,7 @@ public:
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dimensionedVector& g,
|
||||
const word& regionType
|
||||
const word& filmType
|
||||
);
|
||||
|
||||
//- Disallow default bitwise copy construction
|
||||
@ -148,7 +148,7 @@ public:
|
||||
//- Return the reference to the primary mesh
|
||||
inline const fvMesh& primaryMesh() const;
|
||||
|
||||
//- Return the region mesh
|
||||
//- Return the film mesh
|
||||
inline const fvMesh& mesh() const;
|
||||
|
||||
//- Return the information flag
|
||||
@ -170,7 +170,7 @@ public:
|
||||
inline const dimensionedVector& g() const;
|
||||
|
||||
|
||||
// Region geometry
|
||||
// Film geometry
|
||||
|
||||
//- Return the patch normal vectors
|
||||
const volVectorField& nHat() const;
|
||||
@ -183,24 +183,24 @@ public:
|
||||
|
||||
// Addressing
|
||||
|
||||
//- Return true if patchi on the local region is a coupled
|
||||
// patch to the primary region
|
||||
inline bool isCoupledPatch(const label regionPatchi) const;
|
||||
//- Return true if patchi on the film is a coupled
|
||||
// patch to the primary film
|
||||
inline bool isCoupledPatch(const label filmPatchi) const;
|
||||
|
||||
//- Return true if patchi on the primary region is a coupled
|
||||
// patch to the local region
|
||||
inline bool isRegionPatch(const label primaryPatchi) const;
|
||||
//- Return true if patchi on the primary film is a coupled
|
||||
// patch to the film
|
||||
inline bool isFilmPatch(const label primaryPatchi) const;
|
||||
|
||||
//- Return the list of patch IDs on the primary region coupled
|
||||
// to this region
|
||||
//- Return the list of patch IDs on the primary film coupled
|
||||
// to this film
|
||||
inline const labelList& primaryPatchIDs() const;
|
||||
|
||||
//- Return the list of patch IDs internally coupled with the
|
||||
// primary region
|
||||
// primary film
|
||||
inline const labelList& intCoupledPatchIDs() const;
|
||||
|
||||
//- Return region ID corresponding to primaryPatchID
|
||||
inline label regionPatchID(const label primaryPatchID) const;
|
||||
//- Return film ID corresponding to primaryPatchID
|
||||
inline label filmPatchID(const label primaryPatchID) const;
|
||||
|
||||
//- Return the list of patch IDs opposite to internally
|
||||
// coupled patches
|
||||
@ -211,39 +211,47 @@ public:
|
||||
|
||||
//- Return boundary types for mapped field patches
|
||||
// Also maps internal field value
|
||||
// Mapping region prescribed by underlying mapped poly patch
|
||||
// Mapping film prescribed by underlying mapped poly patch
|
||||
template<class Type>
|
||||
wordList mappedFieldAndInternalPatchTypes() const;
|
||||
|
||||
// Helper
|
||||
|
||||
//- Return the coupled patch ID paired with coupled patch
|
||||
// regionPatchi
|
||||
// filmPatchi
|
||||
label nbrCoupledPatchID
|
||||
(
|
||||
const surfaceFilm& nbrRegion,
|
||||
const label regionPatchi
|
||||
const surfaceFilm& nbrFilm,
|
||||
const label filmPatchi
|
||||
) const;
|
||||
|
||||
//- Convert a local region field to the primary region
|
||||
//- Convert a film field to the primary film
|
||||
template<class Type>
|
||||
void toPrimary
|
||||
(
|
||||
const label regionPatchi,
|
||||
Field<Type>& regionField
|
||||
const label filmPatchi,
|
||||
Field<Type>& filmField
|
||||
) const;
|
||||
|
||||
//- Convert a primary region field to the local region
|
||||
//- Convert a primary film field to the film
|
||||
template<class Type>
|
||||
void toRegion
|
||||
tmp<Field<Type>> toFilm
|
||||
(
|
||||
const label regionPatchi,
|
||||
Field<Type>& primaryFieldField
|
||||
const label filmPatchi,
|
||||
const Field<Type>& primaryPatchField
|
||||
) const;
|
||||
|
||||
//- Return a primary patch field mapped the local region
|
||||
//- Convert a primary film field to the film
|
||||
template<class Type>
|
||||
void toRegion
|
||||
tmp<Field<Type>> toFilm
|
||||
(
|
||||
const label filmPatchi,
|
||||
const tmp<Field<Type>> & primaryPatchField
|
||||
) const;
|
||||
|
||||
//- Return a primary patch field mapped the film
|
||||
template<class Type>
|
||||
void toFilm
|
||||
(
|
||||
Field<Type>& rf,
|
||||
const typename VolField<Type>::Boundary& pBf
|
||||
@ -274,7 +282,7 @@ public:
|
||||
virtual tmp<volScalarField> sigma() const = 0;
|
||||
|
||||
|
||||
// Transfer fields - to the primary region
|
||||
// Transfer fields - to the primary film
|
||||
|
||||
//- Return mass transfer source - Eulerian phase only
|
||||
virtual tmp<volScalarField> primaryMassTrans() const = 0;
|
||||
@ -299,17 +307,17 @@ public:
|
||||
const scalar energySource
|
||||
) = 0;
|
||||
|
||||
//- Main driver routing to evolve the region - calls other evolves
|
||||
//- Main driver routing to evolve the film - calls other evolves
|
||||
virtual void evolve();
|
||||
|
||||
//- Pre-evolve region
|
||||
virtual void preEvolveRegion();
|
||||
//- Pre-evolve film
|
||||
virtual void preEvolveFilm();
|
||||
|
||||
//- Evolve the region
|
||||
virtual void evolveRegion();
|
||||
//- Evolve the film
|
||||
virtual void evolveFilm();
|
||||
|
||||
//- Post-evolve region
|
||||
virtual void postEvolveRegion();
|
||||
//- Post-evolve film
|
||||
virtual void postEvolveFilm();
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -89,12 +89,12 @@ inline Foam::IOdictionary& Foam::surfaceFilm::outputProperties()
|
||||
|
||||
inline bool Foam::surfaceFilm::isCoupledPatch
|
||||
(
|
||||
const label regionPatchi
|
||||
const label filmPatchi
|
||||
) const
|
||||
{
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
if (intCoupledPatchIDs_[i] == regionPatchi)
|
||||
if (intCoupledPatchIDs_[i] == filmPatchi)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -104,7 +104,7 @@ inline bool Foam::surfaceFilm::isCoupledPatch
|
||||
}
|
||||
|
||||
|
||||
inline bool Foam::surfaceFilm::isRegionPatch
|
||||
inline bool Foam::surfaceFilm::isFilmPatch
|
||||
(
|
||||
const label primaryPatchi
|
||||
) const
|
||||
@ -133,7 +133,7 @@ inline const Foam::labelList& Foam::surfaceFilm::intCoupledPatchIDs() const
|
||||
}
|
||||
|
||||
|
||||
inline Foam::label Foam::surfaceFilm::regionPatchID
|
||||
inline Foam::label Foam::surfaceFilm::filmPatchID
|
||||
(
|
||||
const label primaryPatchID
|
||||
) const
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,59 +32,90 @@ License
|
||||
template<class Type>
|
||||
void Foam::surfaceFilm::toPrimary
|
||||
(
|
||||
const label regionPatchi,
|
||||
Field<Type>& regionField
|
||||
const label filmPatchi,
|
||||
Field<Type>& filmField
|
||||
) const
|
||||
{
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
if (intCoupledPatchIDs_[i] == regionPatchi)
|
||||
if (intCoupledPatchIDs_[i] == filmPatchi)
|
||||
{
|
||||
const mappedPatchBase& mpb =
|
||||
refCast<const mappedPatchBase>
|
||||
(
|
||||
mesh().boundaryMesh()[regionPatchi]
|
||||
mesh().boundaryMesh()[filmPatchi]
|
||||
);
|
||||
regionField = mpb.reverseDistribute(regionField);
|
||||
filmField = mpb.reverseDistribute(filmField);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
<< "Region patch ID " << regionPatchi << " not found in region mesh"
|
||||
<< "Film patch ID " << filmPatchi << " not found in film mesh"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::surfaceFilm::toRegion
|
||||
Foam::tmp<Foam::Field<Type>> Foam::surfaceFilm::toFilm
|
||||
(
|
||||
const label regionPatchi,
|
||||
Field<Type>& primaryField
|
||||
const label filmPatchi,
|
||||
const Field<Type>& primaryPatchField
|
||||
) const
|
||||
{
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
if (intCoupledPatchIDs_[i] == regionPatchi)
|
||||
if (intCoupledPatchIDs_[i] == filmPatchi)
|
||||
{
|
||||
const mappedPatchBase& mpb =
|
||||
refCast<const mappedPatchBase>
|
||||
(
|
||||
mesh().boundaryMesh()[regionPatchi]
|
||||
mesh().boundaryMesh()[filmPatchi]
|
||||
);
|
||||
primaryField = mpb.distribute(primaryField);
|
||||
return;
|
||||
|
||||
return mpb.distribute(primaryPatchField);
|
||||
}
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
<< "Region patch ID " << regionPatchi << " not found in region mesh"
|
||||
<< "Film patch ID " << filmPatchi << " not found in film mesh"
|
||||
<< abort(FatalError);
|
||||
|
||||
return tmp<Field<Type>>(nullptr);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::surfaceFilm::toRegion
|
||||
Foam::tmp<Foam::Field<Type>> Foam::surfaceFilm::toFilm
|
||||
(
|
||||
const label filmPatchi,
|
||||
const tmp<Field<Type>>& tprimaryPatchField
|
||||
) const
|
||||
{
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
if (intCoupledPatchIDs_[i] == filmPatchi)
|
||||
{
|
||||
const mappedPatchBase& mpb =
|
||||
refCast<const mappedPatchBase>
|
||||
(
|
||||
mesh().boundaryMesh()[filmPatchi]
|
||||
);
|
||||
|
||||
return mpb.distribute(tprimaryPatchField);
|
||||
}
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
<< "Film patch ID " << filmPatchi << " not found in film mesh"
|
||||
<< abort(FatalError);
|
||||
|
||||
return tmp<Field<Type>>(nullptr);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::surfaceFilm::toFilm
|
||||
(
|
||||
Field<Type>& rf,
|
||||
const typename VolField<Type>::Boundary& pBf
|
||||
@ -92,16 +123,16 @@ void Foam::surfaceFilm::toRegion
|
||||
{
|
||||
forAll(intCoupledPatchIDs_, i)
|
||||
{
|
||||
const label regionPatchi = intCoupledPatchIDs_[i];
|
||||
const label filmPatchi = intCoupledPatchIDs_[i];
|
||||
const label primaryPatchi = primaryPatchIDs_[i];
|
||||
|
||||
const polyPatch& regionPatch =
|
||||
mesh().boundaryMesh()[regionPatchi];
|
||||
const polyPatch& filmPatch =
|
||||
mesh().boundaryMesh()[filmPatchi];
|
||||
|
||||
const mappedPatchBase& mpb =
|
||||
refCast<const mappedPatchBase>(regionPatch);
|
||||
refCast<const mappedPatchBase>(filmPatch);
|
||||
|
||||
UIndirectList<Type>(rf, regionPatch.faceCells()) =
|
||||
UIndirectList<Type>(rf, filmPatch.faceCells()) =
|
||||
mpb.distribute(pBf[primaryPatchi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,23 +53,23 @@ bool Foam::thermoSurfaceFilm::read()
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermoSurfaceFilm::resetPrimaryRegionSourceTerms()
|
||||
void Foam::thermoSurfaceFilm::resetPrimaryFilmSourceTerms()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
momentumSurfaceFilm::resetPrimaryRegionSourceTerms();
|
||||
momentumSurfaceFilm::resetPrimaryFilmSourceTerms();
|
||||
|
||||
hSpPrimary_ == dimensionedScalar(hSp_.dimensions(), 0);
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermoSurfaceFilm::transferPrimaryRegionThermoFields()
|
||||
void Foam::thermoSurfaceFilm::transferPrimaryFilmThermoFields()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
momentumSurfaceFilm::transferPrimaryRegionThermoFields();
|
||||
momentumSurfaceFilm::transferPrimaryFilmThermoFields();
|
||||
|
||||
// Update primary region fields on local region via direct mapped (coupled)
|
||||
// Update primary film fields on local film via direct mapped (coupled)
|
||||
// boundary conditions
|
||||
TPrimary_.correctBoundaryConditions();
|
||||
forAll(YPrimary_, i)
|
||||
@ -79,11 +79,11 @@ void Foam::thermoSurfaceFilm::transferPrimaryRegionThermoFields()
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermoSurfaceFilm::transferPrimaryRegionSourceFields()
|
||||
void Foam::thermoSurfaceFilm::transferPrimaryFilmSourceFields()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
momentumSurfaceFilm::transferPrimaryRegionSourceFields();
|
||||
momentumSurfaceFilm::transferPrimaryFilmSourceFields();
|
||||
|
||||
volScalarField::Boundary& hSpPrimaryBf = hSpPrimary_.boundaryFieldRef();
|
||||
|
||||
@ -99,8 +99,8 @@ void Foam::thermoSurfaceFilm::transferPrimaryRegionSourceFields()
|
||||
hSpPrimaryBf[patchi] *= rpriMagSfdeltaT;
|
||||
}
|
||||
|
||||
// Retrieve the source fields from the primary region
|
||||
toRegion(hSp_, hSpPrimaryBf);
|
||||
// Retrieve the source fields from the primary film
|
||||
toFilm(hSp_, hSpPrimaryBf);
|
||||
hSp_.field() /= VbyA();
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ Foam::tmp<Foam::fvScalarMatrix> Foam::thermoSurfaceFilm::q
|
||||
|
||||
return
|
||||
(
|
||||
// Heat-transfer to the primary region
|
||||
// Heat-transfer to the primary film
|
||||
- fvm::Sp((htcs_->h()/VbyA())/Cpv, h)
|
||||
+ (htcs_->h()/VbyA())*(h()/Cpv + coverage*(TPrimary_() - T))
|
||||
|
||||
@ -241,11 +241,11 @@ Foam::thermoSurfaceFilm::thermoSurfaceFilm
|
||||
const word& modelType,
|
||||
const fvMesh& primaryMesh,
|
||||
const dimensionedVector& g,
|
||||
const word& regionType,
|
||||
const word& filmType,
|
||||
const bool readFields
|
||||
)
|
||||
:
|
||||
momentumSurfaceFilm(modelType, primaryMesh, g, regionType, false),
|
||||
momentumSurfaceFilm(modelType, primaryMesh, g, filmType, false),
|
||||
|
||||
primaryThermo_
|
||||
(
|
||||
@ -307,7 +307,7 @@ Foam::thermoSurfaceFilm::thermoSurfaceFilm
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"T", // Same name as T on primary region to enable mapping
|
||||
"T", // Same name as T on primary film to enable mapping
|
||||
time().name(),
|
||||
mesh(),
|
||||
IOobject::NO_READ,
|
||||
@ -391,7 +391,7 @@ Foam::thermoSurfaceFilm::thermoSurfaceFilm
|
||||
|
||||
if (readFields)
|
||||
{
|
||||
transferPrimaryRegionThermoFields();
|
||||
transferPrimaryFilmThermoFields();
|
||||
|
||||
correctCoverage();
|
||||
|
||||
@ -448,16 +448,16 @@ void Foam::thermoSurfaceFilm::addSources
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermoSurfaceFilm::preEvolveRegion()
|
||||
void Foam::thermoSurfaceFilm::preEvolveFilm()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
momentumSurfaceFilm::preEvolveRegion();
|
||||
momentumSurfaceFilm::preEvolveFilm();
|
||||
primaryEnergyTrans_ == dimensionedScalar(dimEnergy, 0);
|
||||
}
|
||||
|
||||
|
||||
void Foam::thermoSurfaceFilm::evolveRegion()
|
||||
void Foam::thermoSurfaceFilm::evolveFilm()
|
||||
{
|
||||
DebugInFunction << endl;
|
||||
|
||||
@ -495,7 +495,7 @@ void Foam::thermoSurfaceFilm::evolveRegion()
|
||||
}
|
||||
|
||||
// Reset source terms for next time integration
|
||||
resetPrimaryRegionSourceTerms();
|
||||
resetPrimaryFilmSourceTerms();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -71,10 +71,10 @@ protected:
|
||||
|
||||
// Thermo properties
|
||||
|
||||
//- Reference to the primary region thermo
|
||||
//- Reference to the primary film thermo
|
||||
const fluidThermo& primaryThermo_;
|
||||
|
||||
// Transfer fields - to the primary region
|
||||
// Transfer fields - to the primary film
|
||||
|
||||
//- Film energy transfer
|
||||
volScalarField primaryEnergyTrans_;
|
||||
@ -100,22 +100,22 @@ protected:
|
||||
|
||||
// Source term fields
|
||||
|
||||
// Film region - registered to the film region mesh
|
||||
// Note: need boundary value mapped from primary region, and then
|
||||
// Film film - registered to the film film mesh
|
||||
// Note: need boundary value mapped from primary film, and then
|
||||
// pushed into the patch internal field
|
||||
|
||||
//- Energy [J/m2/s]
|
||||
volScalarField::Internal hSp_;
|
||||
|
||||
|
||||
// Primary region - registered to the primary region mesh
|
||||
// Primary film - registered to the primary film mesh
|
||||
// Internal use only - not read-in
|
||||
|
||||
//- Energy [J/m2/s]
|
||||
volScalarField hSpPrimary_;
|
||||
|
||||
|
||||
// Fields mapped from primary region - registered to the film region
|
||||
// Fields mapped from primary film - registered to the film film
|
||||
// Note: need both boundary AND patch internal fields to be mapped
|
||||
|
||||
//- Temperature [K]
|
||||
@ -128,7 +128,7 @@ protected:
|
||||
// Sub-models
|
||||
|
||||
//- Heat transfer coefficient between film surface and primary
|
||||
// region [W/m^2/K]
|
||||
// film [W/m^2/K]
|
||||
autoPtr<surfaceFilmModels::heatTransferModel> htcs_;
|
||||
|
||||
//- Heat transfer coefficient between wall and film [W/m^2/K]
|
||||
@ -156,13 +156,13 @@ protected:
|
||||
virtual bool read();
|
||||
|
||||
//- Reset source term fields
|
||||
virtual void resetPrimaryRegionSourceTerms();
|
||||
virtual void resetPrimaryFilmSourceTerms();
|
||||
|
||||
//- Transfer thermo fields from the primary region to the film region
|
||||
virtual void transferPrimaryRegionThermoFields();
|
||||
//- Transfer thermo fields from the primary film to the film film
|
||||
virtual void transferPrimaryFilmThermoFields();
|
||||
|
||||
//- Transfer source fields from the primary region to the film region
|
||||
virtual void transferPrimaryRegionSourceFields();
|
||||
//- Transfer source fields from the primary film to the film film
|
||||
virtual void transferPrimaryFilmSourceFields();
|
||||
|
||||
//- Correct film coverage field
|
||||
virtual void correctCoverage();
|
||||
@ -194,7 +194,7 @@ public:
|
||||
const word& modelType,
|
||||
const fvMesh& primaryMesh,
|
||||
const dimensionedVector& g,
|
||||
const word& regionType,
|
||||
const word& filmType,
|
||||
const bool readFields = true
|
||||
);
|
||||
|
||||
@ -210,7 +210,7 @@ public:
|
||||
|
||||
// Thermo properties
|
||||
|
||||
//- Return const reference to the primary region thermo object
|
||||
//- Return const reference to the primary film thermo object
|
||||
inline const fluidThermo& primaryThermo() const;
|
||||
|
||||
|
||||
@ -230,7 +230,7 @@ public:
|
||||
//- External hook to add sources to the film
|
||||
virtual void addSources
|
||||
(
|
||||
const label patchi, // patchi on primary region
|
||||
const label patchi, // patchi on primary film
|
||||
const label facei, // facei of patchi
|
||||
const scalar massSource, // [kg]
|
||||
const vector& momentumSource, // [kg m/s] (tangential momentum)
|
||||
@ -241,19 +241,19 @@ public:
|
||||
|
||||
// Source term fields
|
||||
|
||||
// Film region
|
||||
// Film film
|
||||
|
||||
//- Energy [J/m2/s]
|
||||
inline const volScalarField::Internal& hSp() const;
|
||||
|
||||
|
||||
// Primary region
|
||||
// Primary film
|
||||
|
||||
//- Energy [J/m2/s]
|
||||
inline const volScalarField& hSpPrimary() const;
|
||||
|
||||
|
||||
// Fields mapped from the primary region
|
||||
// Fields mapped from the primary film
|
||||
|
||||
//- Temperature [K]
|
||||
inline const volScalarField& TPrimary() const;
|
||||
@ -283,15 +283,15 @@ public:
|
||||
// Evolution
|
||||
|
||||
//- Pre-evolve film hook
|
||||
virtual void preEvolveRegion();
|
||||
virtual void preEvolveFilm();
|
||||
|
||||
//- Evolve the film equations
|
||||
virtual void evolveRegion();
|
||||
virtual void evolveFilm();
|
||||
|
||||
|
||||
// Source fields
|
||||
|
||||
// Mapped into primary region
|
||||
// Mapped into primary film
|
||||
|
||||
//- Return mass source for specie i - Eulerian phase only
|
||||
virtual tmp<volScalarField::Internal> SYi
|
||||
|
||||
Reference in New Issue
Block a user