ENH: Updated film<>pyrolysis coupled BCs to make use of film alpha field

This commit is contained in:
andy
2012-11-12 15:09:26 +00:00
parent 8557ff0492
commit fe18dc7e7f
4 changed files with 23 additions and 80 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,8 +40,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
:
fixedValueFvPatchScalarField(p, iF),
phiName_("phi"),
rhoName_("rho"),
deltaWet_(1e-6)
rhoName_("rho")
{}
@ -56,8 +55,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
:
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_),
deltaWet_(ptf.deltaWet_)
rhoName_(ptf.rhoName_)
{}
@ -71,8 +69,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
:
fixedValueFvPatchScalarField(p, iF),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
deltaWet_(dict.lookupOrDefault<scalar>("deltaWet", 1e-6))
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
}
@ -86,8 +83,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
:
fixedValueFvPatchScalarField(fptpsf),
phiName_(fptpsf.phiName_),
rhoName_(fptpsf.rhoName_),
deltaWet_(fptpsf.deltaWet_)
rhoName_(fptpsf.rhoName_)
{}
@ -100,8 +96,7 @@ filmPyrolysisTemperatureCoupledFvPatchScalarField
:
fixedValueFvPatchScalarField(fptpsf, iF),
phiName_(fptpsf.phiName_),
rhoName_(fptpsf.rhoName_),
deltaWet_(fptpsf.deltaWet_)
rhoName_(fptpsf.rhoName_)
{}
@ -151,13 +146,12 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
const label filmPatchI = filmModel.regionPatchID(patchI);
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, deltaFilm);
scalarField alphaFilm = filmModel.alpha().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, alphaFilm);
scalarField TFilm = filmModel.Ts().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, TFilm);
// Retrieve pyrolysis model
const pyrModelType& pyrModel =
db().lookupObject<pyrModelType>("pyrolysisProperties");
@ -168,19 +162,8 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::updateCoeffs()
pyrModel.toPrimary(pyrPatchI, TPyr);
forAll(deltaFilm, i)
{
if (deltaFilm[i] > deltaWet_)
{
// temperature set by film
Tp[i] = TFilm[i];
}
else
{
// temperature set by pyrolysis model
Tp[i] = TPyr[i];
}
}
// Evaluate temperature
Tp = alphaFilm*TFilm + (1.0 - alphaFilm)*TPyr;
// Restore tag
UPstream::msgType() = oldTag;
@ -197,7 +180,6 @@ void Foam::filmPyrolysisTemperatureCoupledFvPatchScalarField::write
fvPatchScalarField::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
os.writeKeyword("deltaWet") << deltaWet_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}

View File

@ -28,15 +28,7 @@ Description
This boundary condition is designed to be used in conjunction with surface
film and pyrolysis modelling. It provides a temperature boundary condition
for patches on the primary region based on whether the patch is seen to
be 'wet', specified by:
\f[
delta > delta_wet
\f]
where
\var delta = film height [m]
\var delta_wet = film height above which the surface is considered wet
be 'wet', retrieved from the film alpha field.
\li if the patch is wet, the temperature is set using the film temperature
\li otherwise, it is set using pyrolysis temperature
@ -84,9 +76,6 @@ class filmPyrolysisTemperatureCoupledFvPatchScalarField
//- Name of density field
word rhoName_;
//- Film height threshold beyond which it is considered 'wet' [m]
scalar deltaWet_;
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,8 +40,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
:
fixedValueFvPatchVectorField(p, iF),
phiName_("phi"),
rhoName_("rho"),
deltaWet_(1e-6)
rhoName_("rho")
{}
@ -56,8 +55,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
:
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
phiName_(ptf.phiName_),
rhoName_(ptf.rhoName_),
deltaWet_(ptf.deltaWet_)
rhoName_(ptf.rhoName_)
{}
@ -71,8 +69,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
:
fixedValueFvPatchVectorField(p, iF),
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
deltaWet_(dict.lookupOrDefault<scalar>("deltaWet", 1e-6))
rhoName_(dict.lookupOrDefault<word>("rho", "rho"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
@ -86,8 +83,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
:
fixedValueFvPatchVectorField(fpvpvf),
phiName_(fpvpvf.phiName_),
rhoName_(fpvpvf.rhoName_),
deltaWet_(fpvpvf.deltaWet_)
rhoName_(fpvpvf.rhoName_)
{}
@ -100,8 +96,7 @@ filmPyrolysisVelocityCoupledFvPatchVectorField
:
fixedValueFvPatchVectorField(fpvpvf, iF),
phiName_(fpvpvf.phiName_),
rhoName_(fpvpvf.rhoName_),
deltaWet_(fpvpvf.deltaWet_)
rhoName_(fpvpvf.rhoName_)
{}
@ -154,13 +149,12 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
const label filmPatchI = filmModel.regionPatchID(patchI);
scalarField deltaFilm = filmModel.delta().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, deltaFilm);
scalarField alphaFilm = filmModel.alpha().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, alphaFilm);
vectorField UFilm = filmModel.Us().boundaryField()[filmPatchI];
filmModel.toPrimary(filmPatchI, UFilm);
// Retrieve pyrolysis model
const pyrModelType& pyrModel =
db().objectRegistry::lookupObject<pyrModelType>
@ -203,19 +197,9 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::updateCoeffs()
const scalarField UAvePyr(-phiPyr/patch().magSf());
const vectorField& nf = patch().nf();
forAll(deltaFilm, i)
{
if (deltaFilm[i] > deltaWet_)
{
// velocity set by film
Up[i] = UFilm[i];
}
else
{
// velocity set by pyrolysis model
Up[i] = UAvePyr[i]*nf[i];
}
}
// Evaluate velocity
Up = alphaFilm*UFilm + (1.0 - alphaFilm)*UAvePyr*nf;
// Restore tag
UPstream::msgType() = oldTag;
@ -232,7 +216,6 @@ void Foam::filmPyrolysisVelocityCoupledFvPatchVectorField::write
fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
os.writeKeyword("deltaWet") << deltaWet_ << token::END_STATEMENT << nl;
writeEntry("value", os);
}

View File

@ -28,15 +28,7 @@ Description
This boundary condition is designed to be used in conjunction with surface
film and pyrolysis modelling. It provides a velocity boundary condition
for patches on the primary region based on whether the patch is seen to
be 'wet', specified by:
\f[
delta > delta_wet
\f]
where
\var delta = film height [m]
\var delta_wet = film height above which the surface is considered wet
be 'wet', retrieved from the film alpha field.
\li if the patch is wet, the velocity is set using the film velocity
\li otherwise, it is set using pyrolysis out-gassing velocity
@ -84,9 +76,6 @@ class filmPyrolysisVelocityCoupledFvPatchVectorField
//- Name of density field
word rhoName_;
//- Film height threshold beyond which it is considered 'wet'
scalar deltaWet_;
public: