externalWallHeatFluxTemperature: Added support for relaxing the radiative contribution

Resolves bug-report http://openfoam.org/mantisbt/view.php?id=1704
This commit is contained in:
Henry 2015-05-25 21:46:48 +01:00
parent 9c08ae6fac
commit 95bc70a9f8
2 changed files with 30 additions and 0 deletions

View file

@ -70,6 +70,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(p.size(), 0.0), q_(p.size(), 0.0),
h_(p.size(), 0.0), h_(p.size(), 0.0),
Ta_(p.size(), 0.0), Ta_(p.size(), 0.0),
QrPrevious_(p.size()),
QrRelaxation_(1),
QrName_("undefined-Qr"), QrName_("undefined-Qr"),
thicknessLayers_(), thicknessLayers_(),
kappaLayers_() kappaLayers_()
@ -95,6 +97,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(ptf.q_, mapper), q_(ptf.q_, mapper),
h_(ptf.h_, mapper), h_(ptf.h_, mapper),
Ta_(ptf.Ta_, mapper), Ta_(ptf.Ta_, mapper),
QrPrevious_(ptf.QrPrevious_, mapper),
QrRelaxation_(ptf.QrRelaxation_),
QrName_(ptf.QrName_), QrName_(ptf.QrName_),
thicknessLayers_(ptf.thicknessLayers_), thicknessLayers_(ptf.thicknessLayers_),
kappaLayers_(ptf.kappaLayers_) kappaLayers_(ptf.kappaLayers_)
@ -115,6 +119,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(p.size(), 0.0), q_(p.size(), 0.0),
h_(p.size(), 0.0), h_(p.size(), 0.0),
Ta_(p.size(), 0.0), Ta_(p.size(), 0.0),
QrPrevious_(p.size(), 0.0),
QrRelaxation_(dict.lookupOrDefault<scalar>("relaxation", 1)),
QrName_(dict.lookupOrDefault<word>("Qr", "none")), QrName_(dict.lookupOrDefault<word>("Qr", "none")),
thicknessLayers_(), thicknessLayers_(),
kappaLayers_() kappaLayers_()
@ -156,6 +162,11 @@ externalWallHeatFluxTemperatureFvPatchScalarField
fvPatchScalarField::operator=(scalarField("value", dict, p.size())); fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
if (dict.found("QrPrevious"))
{
QrPrevious_ = scalarField("QrPrevious", dict, p.size());
}
if (dict.found("refValue")) if (dict.found("refValue"))
{ {
// Full restart // Full restart
@ -185,6 +196,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(tppsf.q_), q_(tppsf.q_),
h_(tppsf.h_), h_(tppsf.h_),
Ta_(tppsf.Ta_), Ta_(tppsf.Ta_),
QrPrevious_(tppsf.QrPrevious_),
QrRelaxation_(tppsf.QrRelaxation_),
QrName_(tppsf.QrName_), QrName_(tppsf.QrName_),
thicknessLayers_(tppsf.thicknessLayers_), thicknessLayers_(tppsf.thicknessLayers_),
kappaLayers_(tppsf.kappaLayers_) kappaLayers_(tppsf.kappaLayers_)
@ -204,6 +217,8 @@ externalWallHeatFluxTemperatureFvPatchScalarField
q_(tppsf.q_), q_(tppsf.q_),
h_(tppsf.h_), h_(tppsf.h_),
Ta_(tppsf.Ta_), Ta_(tppsf.Ta_),
QrPrevious_(tppsf.QrPrevious_),
QrRelaxation_(tppsf.QrRelaxation_),
QrName_(tppsf.QrName_), QrName_(tppsf.QrName_),
thicknessLayers_(tppsf.thicknessLayers_), thicknessLayers_(tppsf.thicknessLayers_),
kappaLayers_(tppsf.kappaLayers_) kappaLayers_(tppsf.kappaLayers_)
@ -255,6 +270,9 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
if (QrName_ != "none") if (QrName_ != "none")
{ {
Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_); Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_;
QrPrevious_ = Qr;
} }
switch (mode_) switch (mode_)
@ -328,7 +346,11 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
{ {
mixedFvPatchScalarField::write(os); mixedFvPatchScalarField::write(os);
temperatureCoupledBase::write(os); temperatureCoupledBase::write(os);
QrPrevious_.writeEntry("QrPrevious", os);
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl; os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
os.writeKeyword("relaxation")<< QrRelaxation_
<< token::END_STATEMENT << nl;
switch (mode_) switch (mode_)
{ {

View file

@ -61,6 +61,7 @@ Description
kappaLayers | list of thermal conductivites per layer [W/m/K] | yes | kappaLayers | list of thermal conductivites per layer [W/m/K] | yes |
kappaName | name of thermal conductivity field | yes | kappaName | name of thermal conductivity field | yes |
QrName | name of the radiative field | no | no QrName | name of the radiative field | no | no
relaxation | relaxation factor for radiative field | no | 1
\endtable \endtable
Example of the boundary condition specification: Example of the boundary condition specification:
@ -77,6 +78,7 @@ Description
value uniform 300.0; value uniform 300.0;
kappaName none; kappaName none;
QrName none; QrName none;
relaxation 1;
} }
\endverbatim \endverbatim
@ -140,6 +142,12 @@ private:
//- Ambient temperature / [K] //- Ambient temperature / [K]
scalarField Ta_; scalarField Ta_;
//- Chache Qr for relaxation
scalarField QrPrevious_;
//- Relaxation for Qr
scalar QrRelaxation_;
//- Name of the radiative heat flux //- Name of the radiative heat flux
const word QrName_; const word QrName_;