mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Updated film<>pyrolysis coupled BCs to make use of film alpha field
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,8 +40,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
phiName_("phi"),
|
phiName_("phi"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho")
|
||||||
deltaWet_(1e-6)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -56,8 +55,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_)
|
||||||
deltaWet_(ptf.deltaWet_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -71,8 +69,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||||
deltaWet_(dict.lookupOrDefault<scalar>("deltaWet", 1e-6))
|
|
||||||
{
|
{
|
||||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||||
}
|
}
|
||||||
@ -86,8 +83,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(fptpsf),
|
fixedValueFvPatchScalarField(fptpsf),
|
||||||
phiName_(fptpsf.phiName_),
|
phiName_(fptpsf.phiName_),
|
||||||
rhoName_(fptpsf.rhoName_),
|
rhoName_(fptpsf.rhoName_)
|
||||||
deltaWet_(fptpsf.deltaWet_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -100,8 +96,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(fptpsf, iF),
|
fixedValueFvPatchScalarField(fptpsf, iF),
|
||||||
phiName_(fptpsf.phiName_),
|
phiName_(fptpsf.phiName_),
|
||||||
rhoName_(fptpsf.rhoName_),
|
rhoName_(fptpsf.rhoName_)
|
||||||
deltaWet_(fptpsf.deltaWet_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -151,13 +146,12 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
const label filmPatchI = filmModel.regionPatchID(patchI);
|
const label filmPatchI = filmModel.regionPatchID(patchI);
|
||||||
|
|
||||||
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
|
scalarField alphaFilm = filmModel.alpha().boundaryField()[filmPatchI];
|
||||||
filmModel.toPrimary(filmPatchI, deltaFilm);
|
filmModel.toPrimary(filmPatchI, alphaFilm);
|
||||||
|
|
||||||
scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchI];
|
scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchI];
|
||||||
filmModel.toPrimary(filmPatchI, TFilm);
|
filmModel.toPrimary(filmPatchI, TFilm);
|
||||||
|
|
||||||
|
|
||||||
// Retrieve pyrolysis model
|
// Retrieve pyrolysis model
|
||||||
const pyrModelType& pyrModel =
|
const pyrModelType& pyrModel =
|
||||||
db().lookupObject<pyrModelType>("pyrolysisProperties");
|
db().lookupObject<pyrModelType>("pyrolysisProperties");
|
||||||
@ -168,19 +162,8 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
|
|||||||
pyrModel.toPrimary(pyrPatchI, TPyr);
|
pyrModel.toPrimary(pyrPatchI, TPyr);
|
||||||
|
|
||||||
|
|
||||||
forAll(deltaFilm, i)
|
// Evaluate temperature
|
||||||
{
|
Tp = alphaFilm*TFilm + (1.0 - alphaFilm)*TPyr;
|
||||||
if (deltaFilm[i] > deltaWet_)
|
|
||||||
{
|
|
||||||
// temperature set by film
|
|
||||||
Tp[i] = TFilm[i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// temperature set by pyrolysis model
|
|
||||||
Tp[i] = TPyr[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore tag
|
// Restore tag
|
||||||
UPstream::msgType() = oldTag;
|
UPstream::msgType() = oldTag;
|
||||||
@ -197,7 +180,6 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::write
|
|||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||||
os.writeKeyword("deltaWet") << deltaWet_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,15 +28,7 @@ Description
|
|||||||
This boundary condition is designed to be used in conjunction with surface
|
This boundary condition is designed to be used in conjunction with surface
|
||||||
film and pyrolysis modelling. It provides a temperature boundary condition
|
film and pyrolysis modelling. It provides a temperature boundary condition
|
||||||
for patches on the primary region based on whether the patch is seen to
|
for patches on the primary region based on whether the patch is seen to
|
||||||
be 'wet', specified by:
|
be 'wet', retrieved from the film alpha field.
|
||||||
|
|
||||||
\f[
|
|
||||||
delta > delta_wet
|
|
||||||
\f]
|
|
||||||
|
|
||||||
where
|
|
||||||
\var delta = film height [m]
|
|
||||||
\var delta_wet = film height above which the surface is considered wet
|
|
||||||
|
|
||||||
\li if the patch is wet, the temperature is set using the film temperature
|
\li if the patch is wet, the temperature is set using the film temperature
|
||||||
\li otherwise, it is set using pyrolysis temperature
|
\li otherwise, it is set using pyrolysis temperature
|
||||||
@ -84,9 +76,6 @@ class filmPyrolysisTemperatureCoupledFvPatchScalarField
|
|||||||
//- Name of density field
|
//- Name of density field
|
||||||
word rhoName_;
|
word rhoName_;
|
||||||
|
|
||||||
//- Film height threshold beyond which it is considered 'wet' [m]
|
|
||||||
scalar deltaWet_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,8 +40,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
phiName_("phi"),
|
phiName_("phi"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho")
|
||||||
deltaWet_(1e-6)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -56,8 +55,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
phiName_(ptf.phiName_),
|
phiName_(ptf.phiName_),
|
||||||
rhoName_(ptf.rhoName_),
|
rhoName_(ptf.rhoName_)
|
||||||
deltaWet_(ptf.deltaWet_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -71,8 +69,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(p, iF),
|
fixedValueFvPatchVectorField(p, iF),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
|
||||||
deltaWet_(dict.lookupOrDefault<scalar>("deltaWet", 1e-6))
|
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
|
||||||
}
|
}
|
||||||
@ -86,8 +83,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(fpvpvf),
|
fixedValueFvPatchVectorField(fpvpvf),
|
||||||
phiName_(fpvpvf.phiName_),
|
phiName_(fpvpvf.phiName_),
|
||||||
rhoName_(fpvpvf.rhoName_),
|
rhoName_(fpvpvf.rhoName_)
|
||||||
deltaWet_(fpvpvf.deltaWet_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -100,8 +96,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
|
|||||||
:
|
:
|
||||||
fixedValueFvPatchVectorField(fpvpvf, iF),
|
fixedValueFvPatchVectorField(fpvpvf, iF),
|
||||||
phiName_(fpvpvf.phiName_),
|
phiName_(fpvpvf.phiName_),
|
||||||
rhoName_(fpvpvf.rhoName_),
|
rhoName_(fpvpvf.rhoName_)
|
||||||
deltaWet_(fpvpvf.deltaWet_)
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -154,13 +149,12 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
const label filmPatchI = filmModel.regionPatchID(patchI);
|
const label filmPatchI = filmModel.regionPatchID(patchI);
|
||||||
|
|
||||||
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
|
scalarField alphaFilm = filmModel.alpha().boundaryField()[filmPatchI];
|
||||||
filmModel.toPrimary(filmPatchI, deltaFilm);
|
filmModel.toPrimary(filmPatchI, alphaFilm);
|
||||||
|
|
||||||
vectorField UFilm = filmModel.Us().boundaryField()[filmPatchI];
|
vectorField UFilm = filmModel.Us().boundaryField()[filmPatchI];
|
||||||
filmModel.toPrimary(filmPatchI, UFilm);
|
filmModel.toPrimary(filmPatchI, UFilm);
|
||||||
|
|
||||||
|
|
||||||
// Retrieve pyrolysis model
|
// Retrieve pyrolysis model
|
||||||
const pyrModelType& pyrModel =
|
const pyrModelType& pyrModel =
|
||||||
db().objectRegistry::lookupObject<pyrModelType>
|
db().objectRegistry::lookupObject<pyrModelType>
|
||||||
@ -203,19 +197,9 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
|
|||||||
const scalarField UAvePyr(-phiPyr/patch().magSf());
|
const scalarField UAvePyr(-phiPyr/patch().magSf());
|
||||||
const vectorField& nf = patch().nf();
|
const vectorField& nf = patch().nf();
|
||||||
|
|
||||||
forAll(deltaFilm, i)
|
|
||||||
{
|
// Evaluate velocity
|
||||||
if (deltaFilm[i] > deltaWet_)
|
Up = alphaFilm*UFilm + (1.0 - alphaFilm)*UAvePyr*nf;
|
||||||
{
|
|
||||||
// velocity set by film
|
|
||||||
Up[i] = UFilm[i];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// velocity set by pyrolysis model
|
|
||||||
Up[i] = UAvePyr[i]*nf[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Restore tag
|
// Restore tag
|
||||||
UPstream::msgType() = oldTag;
|
UPstream::msgType() = oldTag;
|
||||||
@ -232,7 +216,6 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::write
|
|||||||
fvPatchVectorField::write(os);
|
fvPatchVectorField::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||||
os.writeKeyword("deltaWet") << deltaWet_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,15 +28,7 @@ Description
|
|||||||
This boundary condition is designed to be used in conjunction with surface
|
This boundary condition is designed to be used in conjunction with surface
|
||||||
film and pyrolysis modelling. It provides a velocity boundary condition
|
film and pyrolysis modelling. It provides a velocity boundary condition
|
||||||
for patches on the primary region based on whether the patch is seen to
|
for patches on the primary region based on whether the patch is seen to
|
||||||
be 'wet', specified by:
|
be 'wet', retrieved from the film alpha field.
|
||||||
|
|
||||||
\f[
|
|
||||||
delta > delta_wet
|
|
||||||
\f]
|
|
||||||
|
|
||||||
where
|
|
||||||
\var delta = film height [m]
|
|
||||||
\var delta_wet = film height above which the surface is considered wet
|
|
||||||
|
|
||||||
\li if the patch is wet, the velocity is set using the film velocity
|
\li if the patch is wet, the velocity is set using the film velocity
|
||||||
\li otherwise, it is set using pyrolysis out-gassing velocity
|
\li otherwise, it is set using pyrolysis out-gassing velocity
|
||||||
@ -84,9 +76,6 @@ class filmPyrolysisVelocityCoupledFvPatchVectorField
|
|||||||
//- Name of density field
|
//- Name of density field
|
||||||
word rhoName_;
|
word rhoName_;
|
||||||
|
|
||||||
//- Film height threshold beyond which it is considered 'wet'
|
|
||||||
scalar deltaWet_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user