ENH: Adding Qr to externalWallHeatFluxTemperature

This commit is contained in:
sergio
2014-10-14 15:11:58 +01:00
committed by Andrew Heather
parent 994cda140e
commit 02cb25aecd
2 changed files with 23 additions and 3 deletions

View File

@ -69,6 +69,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(p.size(), 0.0),
h_(p.size(), 0.0),
Ta_(p.size(), 0.0),
QrName_("undefined-Qr"),
thicknessLayers_(),
kappaLayers_()
{
@ -93,6 +94,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(ptf.q_, mapper),
h_(ptf.h_, mapper),
Ta_(ptf.Ta_, mapper),
QrName_(ptf.QrName_),
thicknessLayers_(ptf.thicknessLayers_),
kappaLayers_(ptf.kappaLayers_)
{}
@ -112,6 +114,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(p.size(), 0.0),
h_(p.size(), 0.0),
Ta_(p.size(), 0.0),
QrName_(dict.lookupOrDefault<word>("Qr", "none")),
thicknessLayers_(),
kappaLayers_()
{
@ -181,6 +184,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(tppsf.q_),
h_(tppsf.h_),
Ta_(tppsf.Ta_),
QrName_(tppsf.QrName_),
thicknessLayers_(tppsf.thicknessLayers_),
kappaLayers_(tppsf.kappaLayers_)
{}
@ -199,6 +203,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(tppsf.q_),
h_(tppsf.h_),
Ta_(tppsf.Ta_),
QrName_(tppsf.QrName_),
thicknessLayers_(tppsf.thicknessLayers_),
kappaLayers_(tppsf.kappaLayers_)
{}
@ -245,6 +250,12 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
const scalarField Tp(*this);
scalarField hp(patch().size(), 0.0);
scalarField Qr(Tp.size(), 0.0);
if (QrName_ != "none")
{
Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
}
switch (mode_)
{
case fixedHeatFlux:
@ -281,15 +292,17 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
if (mode_ == fixedHeatFlux)
{
refGrad() = q_/kappa(Tp);
refGrad() = (q_ + Qr)/kappa(Tp);
refValue() = 0.0;
valueFraction() = 0.0;
}
else if (mode_ == fixedHeatTransferCoeff)
{
Qr /= Tp;
refGrad() = 0.0;
refValue() = Ta_;
valueFraction() = hp/(hp + kappa(Tp)*patch().deltaCoeffs());
refValue() = hp*Ta_/(hp - Qr);
valueFraction() =
(hp - Qr)/((hp - Qr) + kappa(Tp)*patch().deltaCoeffs());
}
mixedFvPatchScalarField::updateCoeffs();
@ -318,9 +331,11 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
{
mixedFvPatchScalarField::write(os);
temperatureCoupledBase::write(os);
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
switch (mode_)
{
case fixedHeatFlux:
{
q_.writeEntry("q", os);

View File

@ -60,6 +60,7 @@ Description
thicknessLayers | list of thicknesses per layer [m] | yes |
kappaLayers | list of thermal conductivites per layer [W/m/K] | yes |
kappaName | name of thermal conductivity field | yes |
QrName | name of the radiative field | no | no
\endtable
Example of the boundary condition specification:
@ -75,6 +76,7 @@ Description
kappaLayers (1 2 3 4)
value uniform 300.0;
kappaName none;
QrName none;
}
\endverbatim
@ -137,6 +139,9 @@ private:
//- Ambient temperature / [K]
scalarField Ta_;
//- Name of the radiative heat flux
const word QrName_;
//- Thickness of layers
scalarList thicknessLayers_;