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