mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
externalWallHeatFluxTemperatureFvPatchScalarField: Added "power" heat source option
by combining with and rationalizing functionality from
turbulentHeatFluxTemperatureFvPatchScalarField.
externalWallHeatFluxTemperatureFvPatchScalarField now replaces
turbulentHeatFluxTemperatureFvPatchScalarField which is no longer needed and has
been removed.
Description
This boundary condition applies a heat flux condition to temperature
on an external wall in one of three modes:
- fixed power: supply Q
- fixed heat flux: supply q
- fixed heat transfer coefficient: supply h and Ta
where:
\vartable
Q | Power [W]
q | Heat flux [W/m^2]
h | Heat transfer coefficient [W/m^2/K]
Ta | Ambient temperature [K]
\endvartable
For heat transfer coefficient mode optional thin thermal layer resistances
can be specified through thicknessLayers and kappaLayers entries.
The thermal conductivity \c kappa can either be retrieved from various
possible sources, as detailed in the class temperatureCoupledBase.
Usage
\table
Property | Description | Required | Default value
mode | 'power', 'flux' or 'coefficient' | yes |
Q | Power [W] | for mode 'power' |
q | Heat flux [W/m^2] | for mode 'flux' |
h | Heat transfer coefficient [W/m^2/K] | for mode 'coefficent' |
Ta | Ambient temperature [K] | for mode 'coefficient' |
thicknessLayers | Layer thicknesses [m] | no |
kappaLayers | Layer thermal conductivities [W/m/K] | no |
qr | Name of the radiative field | no | none
qrRelaxation | Relaxation factor for radiative field | no | 1
kappaMethod | Inherited from temperatureCoupledBase | inherited |
kappa | Inherited from temperatureCoupledBase | inherited |
\endtable
Example of the boundary condition specification:
\verbatim
<patchName>
{
type externalWallHeatFluxTemperature;
mode coefficient;
Ta uniform 300.0;
h uniform 10.0;
thicknessLayers (0.1 0.2 0.3 0.4);
kappaLayers (1 2 3 4);
kappaMethod fluidThermo;
value $internalField;
}
\endverbatim
This commit is contained in:
@ -847,7 +847,6 @@ DebugSwitches
|
|||||||
triSurface 0;
|
triSurface 0;
|
||||||
triSurfaceMesh 0;
|
triSurfaceMesh 0;
|
||||||
turbulenceModel 0;
|
turbulenceModel 0;
|
||||||
turbulentHeatFluxTemperature 0;
|
|
||||||
turbulentInlet 0;
|
turbulentInlet 0;
|
||||||
turbulentIntensityKineticEnergyInlet 0;
|
turbulentIntensityKineticEnergyInlet 0;
|
||||||
turbulentMixingLengthDissipationRateInlet 0;
|
turbulentMixingLengthDissipationRateInlet 0;
|
||||||
|
|||||||
@ -2,7 +2,6 @@ compressibleTurbulenceModel.C
|
|||||||
turbulentFluidThermoModels/turbulentFluidThermoModels.C
|
turbulentFluidThermoModels/turbulentFluidThermoModels.C
|
||||||
|
|
||||||
BCs = turbulentFluidThermoModels/derivedFvPatchFields
|
BCs = turbulentFluidThermoModels/derivedFvPatchFields
|
||||||
$(BCs)/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
|
|
||||||
$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C
|
$(BCs)/temperatureCoupledBase/temperatureCoupledBase.C
|
||||||
$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
|
$(BCs)/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
|
||||||
$(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C
|
$(BCs)/thermalBaffle1D/thermalBaffle1DFvPatchScalarFields.C
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,12 +40,11 @@ namespace Foam
|
|||||||
3
|
3
|
||||||
>::names[] =
|
>::names[] =
|
||||||
{
|
{
|
||||||
"fixed_heat_flux",
|
"power",
|
||||||
"fixed_heat_transfer_coefficient",
|
"flux",
|
||||||
"unknown"
|
"coefficient"
|
||||||
};
|
};
|
||||||
|
}
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
const Foam::NamedEnum
|
const Foam::NamedEnum
|
||||||
<
|
<
|
||||||
@ -65,19 +64,93 @@ externalWallHeatFluxTemperatureFvPatchScalarField
|
|||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
|
temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
|
||||||
mode_(unknown),
|
mode_(fixedHeatFlux),
|
||||||
q_(p.size(), 0.0),
|
Q_(0),
|
||||||
h_(p.size(), 0.0),
|
qrRelaxation_(1),
|
||||||
Ta_(p.size(), 0.0),
|
qrName_("undefined-qr"),
|
||||||
QrPrevious_(p.size(), 0.0),
|
|
||||||
QrRelaxation_(1),
|
|
||||||
QrName_("undefined-Qr"),
|
|
||||||
thicknessLayers_(),
|
thicknessLayers_(),
|
||||||
kappaLayers_()
|
kappaLayers_()
|
||||||
{
|
{
|
||||||
refValue() = 0.0;
|
refValue() = 0;
|
||||||
refGrad() = 0.0;
|
refGrad() = 0;
|
||||||
valueFraction() = 1.0;
|
valueFraction() = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
|
||||||
|
externalWallHeatFluxTemperatureFvPatchScalarField
|
||||||
|
(
|
||||||
|
const fvPatch& p,
|
||||||
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
mixedFvPatchScalarField(p, iF),
|
||||||
|
temperatureCoupledBase(patch(), dict),
|
||||||
|
mode_(operationModeNames.read(dict.lookup("mode"))),
|
||||||
|
Q_(0),
|
||||||
|
qrRelaxation_(dict.lookupOrDefault<scalar>("qrRelaxation", 1)),
|
||||||
|
qrName_(dict.lookupOrDefault<word>("qr", "none")),
|
||||||
|
thicknessLayers_(),
|
||||||
|
kappaLayers_()
|
||||||
|
{
|
||||||
|
switch (mode_)
|
||||||
|
{
|
||||||
|
case fixedPower:
|
||||||
|
{
|
||||||
|
dict.lookup("Q") >> Q_;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case fixedHeatFlux:
|
||||||
|
{
|
||||||
|
q_ = scalarField("q", dict, p.size());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case fixedHeatTransferCoeff:
|
||||||
|
{
|
||||||
|
h_ = scalarField("h", dict, p.size());
|
||||||
|
Ta_ = scalarField("Ta", dict, p.size());
|
||||||
|
|
||||||
|
if (dict.found("thicknessLayers"))
|
||||||
|
{
|
||||||
|
dict.lookup("thicknessLayers") >> thicknessLayers_;
|
||||||
|
dict.lookup("kappaLayers") >> kappaLayers_;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||||
|
|
||||||
|
if (qrName_ != "none")
|
||||||
|
{
|
||||||
|
if (dict.found("qrPrevious"))
|
||||||
|
{
|
||||||
|
qrPrevious_ = scalarField("qrPrevious", dict, p.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qrPrevious_.setSize(p.size(), 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (dict.found("refValue"))
|
||||||
|
{
|
||||||
|
// Full restart
|
||||||
|
refValue() = scalarField("refValue", dict, p.size());
|
||||||
|
refGrad() = scalarField("refGradient", dict, p.size());
|
||||||
|
valueFraction() = scalarField("valueFraction", dict, p.size());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Start from user entered data. Assume fixedValue.
|
||||||
|
refValue() = *this;
|
||||||
|
refGrad() = 0;
|
||||||
|
valueFraction() = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -93,84 +166,36 @@ externalWallHeatFluxTemperatureFvPatchScalarField
|
|||||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
temperatureCoupledBase(patch(), ptf),
|
temperatureCoupledBase(patch(), ptf),
|
||||||
mode_(ptf.mode_),
|
mode_(ptf.mode_),
|
||||||
q_(ptf.q_, mapper),
|
Q_(ptf.Q_),
|
||||||
h_(ptf.h_, mapper),
|
qrRelaxation_(ptf.qrRelaxation_),
|
||||||
Ta_(ptf.Ta_, mapper),
|
qrName_(ptf.qrName_),
|
||||||
QrPrevious_(ptf.QrPrevious_, mapper),
|
|
||||||
QrRelaxation_(ptf.QrRelaxation_),
|
|
||||||
QrName_(ptf.QrName_),
|
|
||||||
thicknessLayers_(ptf.thicknessLayers_),
|
thicknessLayers_(ptf.thicknessLayers_),
|
||||||
kappaLayers_(ptf.kappaLayers_)
|
kappaLayers_(ptf.kappaLayers_)
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::externalWallHeatFluxTemperatureFvPatchScalarField::
|
|
||||||
externalWallHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
mixedFvPatchScalarField(p, iF),
|
|
||||||
temperatureCoupledBase(patch(), dict),
|
|
||||||
mode_(unknown),
|
|
||||||
q_(p.size(), 0.0),
|
|
||||||
h_(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")),
|
|
||||||
thicknessLayers_(),
|
|
||||||
kappaLayers_()
|
|
||||||
{
|
{
|
||||||
if (dict.found("q") && !dict.found("h") && !dict.found("Ta"))
|
switch (mode_)
|
||||||
{
|
{
|
||||||
mode_ = fixedHeatFlux;
|
case fixedPower:
|
||||||
q_ = scalarField("q", dict, p.size());
|
{
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else if (dict.found("h") && dict.found("Ta") && !dict.found("q"))
|
case fixedHeatFlux:
|
||||||
{
|
{
|
||||||
mode_ = fixedHeatTransferCoeff;
|
q_.autoMap(mapper);
|
||||||
h_ = scalarField("h", dict, p.size());
|
|
||||||
Ta_ = scalarField("Ta", dict, p.size());
|
break;
|
||||||
if (dict.found("thicknessLayers"))
|
|
||||||
{
|
|
||||||
dict.lookup("thicknessLayers") >> thicknessLayers_;
|
|
||||||
dict.lookup("kappaLayers") >> kappaLayers_;
|
|
||||||
}
|
}
|
||||||
}
|
case fixedHeatTransferCoeff:
|
||||||
else
|
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
h_.autoMap(mapper);
|
||||||
<< "\n patch type '" << p.type()
|
Ta_.autoMap(mapper);
|
||||||
<< "' either q or h and Ta were not found '"
|
|
||||||
<< "\n for patch " << p.name()
|
break;
|
||||||
<< " of field " << internalField().name()
|
}
|
||||||
<< " in file " << internalField().objectPath()
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
if (qrName_ != "none")
|
||||||
|
|
||||||
if (dict.found("QrPrevious"))
|
|
||||||
{
|
{
|
||||||
QrPrevious_ = scalarField("QrPrevious", dict, p.size());
|
qrPrevious_.autoMap(mapper);
|
||||||
}
|
|
||||||
|
|
||||||
if (dict.found("refValue"))
|
|
||||||
{
|
|
||||||
// Full restart
|
|
||||||
refValue() = scalarField("refValue", dict, p.size());
|
|
||||||
refGrad() = scalarField("refGradient", dict, p.size());
|
|
||||||
valueFraction() = scalarField("valueFraction", dict, p.size());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Start from user entered data. Assume fixedValue.
|
|
||||||
refValue() = *this;
|
|
||||||
refGrad() = 0.0;
|
|
||||||
valueFraction() = 1.0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,12 +209,13 @@ externalWallHeatFluxTemperatureFvPatchScalarField
|
|||||||
mixedFvPatchScalarField(tppsf),
|
mixedFvPatchScalarField(tppsf),
|
||||||
temperatureCoupledBase(tppsf),
|
temperatureCoupledBase(tppsf),
|
||||||
mode_(tppsf.mode_),
|
mode_(tppsf.mode_),
|
||||||
|
Q_(tppsf.Q_),
|
||||||
q_(tppsf.q_),
|
q_(tppsf.q_),
|
||||||
h_(tppsf.h_),
|
h_(tppsf.h_),
|
||||||
Ta_(tppsf.Ta_),
|
Ta_(tppsf.Ta_),
|
||||||
QrPrevious_(tppsf.QrPrevious_),
|
qrPrevious_(tppsf.qrPrevious_),
|
||||||
QrRelaxation_(tppsf.QrRelaxation_),
|
qrRelaxation_(tppsf.qrRelaxation_),
|
||||||
QrName_(tppsf.QrName_),
|
qrName_(tppsf.qrName_),
|
||||||
thicknessLayers_(tppsf.thicknessLayers_),
|
thicknessLayers_(tppsf.thicknessLayers_),
|
||||||
kappaLayers_(tppsf.kappaLayers_)
|
kappaLayers_(tppsf.kappaLayers_)
|
||||||
{}
|
{}
|
||||||
@ -205,12 +231,13 @@ externalWallHeatFluxTemperatureFvPatchScalarField
|
|||||||
mixedFvPatchScalarField(tppsf, iF),
|
mixedFvPatchScalarField(tppsf, iF),
|
||||||
temperatureCoupledBase(patch(), tppsf),
|
temperatureCoupledBase(patch(), tppsf),
|
||||||
mode_(tppsf.mode_),
|
mode_(tppsf.mode_),
|
||||||
|
Q_(tppsf.Q_),
|
||||||
q_(tppsf.q_),
|
q_(tppsf.q_),
|
||||||
h_(tppsf.h_),
|
h_(tppsf.h_),
|
||||||
Ta_(tppsf.Ta_),
|
Ta_(tppsf.Ta_),
|
||||||
QrPrevious_(tppsf.QrPrevious_),
|
qrPrevious_(tppsf.qrPrevious_),
|
||||||
QrRelaxation_(tppsf.QrRelaxation_),
|
qrRelaxation_(tppsf.qrRelaxation_),
|
||||||
QrName_(tppsf.QrName_),
|
qrName_(tppsf.qrName_),
|
||||||
thicknessLayers_(tppsf.thicknessLayers_),
|
thicknessLayers_(tppsf.thicknessLayers_),
|
||||||
kappaLayers_(tppsf.kappaLayers_)
|
kappaLayers_(tppsf.kappaLayers_)
|
||||||
{}
|
{}
|
||||||
@ -224,10 +251,32 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::autoMap
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
mixedFvPatchScalarField::autoMap(m);
|
mixedFvPatchScalarField::autoMap(m);
|
||||||
|
|
||||||
|
switch (mode_)
|
||||||
|
{
|
||||||
|
case fixedPower:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case fixedHeatFlux:
|
||||||
|
{
|
||||||
q_.autoMap(m);
|
q_.autoMap(m);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case fixedHeatTransferCoeff:
|
||||||
|
{
|
||||||
h_.autoMap(m);
|
h_.autoMap(m);
|
||||||
Ta_.autoMap(m);
|
Ta_.autoMap(m);
|
||||||
QrPrevious_.autoMap(m);
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qrName_ != "none")
|
||||||
|
{
|
||||||
|
qrPrevious_.autoMap(m);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -242,10 +291,31 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::rmap
|
|||||||
const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf =
|
const externalWallHeatFluxTemperatureFvPatchScalarField& tiptf =
|
||||||
refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
|
refCast<const externalWallHeatFluxTemperatureFvPatchScalarField>(ptf);
|
||||||
|
|
||||||
|
switch (mode_)
|
||||||
|
{
|
||||||
|
case fixedPower:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case fixedHeatFlux:
|
||||||
|
{
|
||||||
q_.rmap(tiptf.q_, addr);
|
q_.rmap(tiptf.q_, addr);
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case fixedHeatTransferCoeff:
|
||||||
|
{
|
||||||
h_.rmap(tiptf.h_, addr);
|
h_.rmap(tiptf.h_, addr);
|
||||||
Ta_.rmap(tiptf.Ta_, addr);
|
Ta_.rmap(tiptf.Ta_, addr);
|
||||||
QrPrevious_.rmap(tiptf.QrPrevious_, addr);
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (qrName_ != "none")
|
||||||
|
{
|
||||||
|
qrPrevious_.rmap(tiptf.qrPrevious_, addr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -257,64 +327,68 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const scalarField Tp(*this);
|
const scalarField Tp(*this);
|
||||||
scalarField hp(patch().size(), 0.0);
|
scalarField hp(patch().size(), 0);
|
||||||
|
|
||||||
scalarField Qr(Tp.size(), 0.0);
|
scalarField qr(Tp.size(), 0);
|
||||||
if (QrName_ != "none")
|
if (qrName_ != "none")
|
||||||
{
|
{
|
||||||
Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
|
qr =
|
||||||
|
qrRelaxation_
|
||||||
|
*patch().lookupPatchField<volScalarField, scalar>(qrName_)
|
||||||
|
+ (1 - qrRelaxation_)*qrPrevious_;
|
||||||
|
|
||||||
Qr = QrRelaxation_*Qr + (1.0 - QrRelaxation_)*QrPrevious_;
|
qrPrevious_ = qr;
|
||||||
QrPrevious_ = Qr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (mode_)
|
switch (mode_)
|
||||||
{
|
{
|
||||||
|
case fixedPower:
|
||||||
|
{
|
||||||
|
refGrad() = (Q_/gSum(patch().magSf()) + qr)/kappa(Tp);
|
||||||
|
refValue() = 0;
|
||||||
|
valueFraction() = 0;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case fixedHeatFlux:
|
case fixedHeatFlux:
|
||||||
{
|
{
|
||||||
refGrad() = (q_ + Qr)/kappa(Tp);
|
refGrad() = (q_ + qr)/kappa(Tp);
|
||||||
refValue() = 0.0;
|
refValue() = 0;
|
||||||
valueFraction() = 0.0;
|
valueFraction() = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case fixedHeatTransferCoeff:
|
case fixedHeatTransferCoeff:
|
||||||
{
|
{
|
||||||
scalar totalSolidRes = 0.0;
|
scalar totalSolidRes = 0;
|
||||||
if (thicknessLayers_.size() > 0)
|
if (thicknessLayers_.size())
|
||||||
{
|
{
|
||||||
forAll(thicknessLayers_, iLayer)
|
forAll(thicknessLayers_, iLayer)
|
||||||
{
|
{
|
||||||
const scalar l = thicknessLayers_[iLayer];
|
const scalar l = thicknessLayers_[iLayer];
|
||||||
if (kappaLayers_[iLayer] > 0.0)
|
if (kappaLayers_[iLayer] > 0)
|
||||||
{
|
{
|
||||||
totalSolidRes += l/kappaLayers_[iLayer];
|
totalSolidRes += l/kappaLayers_[iLayer];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
hp = 1.0/(1.0/h_ + totalSolidRes);
|
hp = 1/(1/h_ + totalSolidRes);
|
||||||
|
|
||||||
Qr /= Tp;
|
qr /= Tp;
|
||||||
refGrad() = 0.0;
|
refGrad() = 0;
|
||||||
refValue() = hp*Ta_/(hp - Qr);
|
refValue() = hp*Ta_/(hp - qr);
|
||||||
valueFraction() =
|
valueFraction() =
|
||||||
(hp - Qr)/((hp - Qr) + kappa(Tp)*patch().deltaCoeffs());
|
(hp - qr)/((hp - qr) + kappa(Tp)*patch().deltaCoeffs());
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Illegal heat flux mode " << operationModeNames[mode_]
|
|
||||||
<< exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mixedFvPatchScalarField::updateCoeffs();
|
mixedFvPatchScalarField::updateCoeffs();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());
|
const scalar Q = gSum(kappa(Tp)*patch().magSf()*snGrad());
|
||||||
|
|
||||||
Info<< patch().boundaryMesh().mesh().name() << ':'
|
Info<< patch().boundaryMesh().mesh().name() << ':'
|
||||||
<< patch().name() << ':'
|
<< patch().name() << ':'
|
||||||
@ -334,37 +408,55 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
|
|||||||
Ostream& os
|
Ostream& os
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
mixedFvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
temperatureCoupledBase::write(os);
|
|
||||||
|
|
||||||
QrPrevious_.writeEntry("QrPrevious", os);
|
os.writeKeyword("mode")
|
||||||
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
|
<< operationModeNames[mode_] << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("relaxation")<< QrRelaxation_
|
temperatureCoupledBase::write(os);
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
|
|
||||||
switch (mode_)
|
switch (mode_)
|
||||||
{
|
{
|
||||||
|
case fixedPower:
|
||||||
|
{
|
||||||
|
os.writeKeyword("Q")
|
||||||
|
<< Q_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
case fixedHeatFlux:
|
case fixedHeatFlux:
|
||||||
{
|
{
|
||||||
q_.writeEntry("q", os);
|
q_.writeEntry("q", os);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case fixedHeatTransferCoeff:
|
case fixedHeatTransferCoeff:
|
||||||
{
|
{
|
||||||
h_.writeEntry("h", os);
|
h_.writeEntry("h", os);
|
||||||
Ta_.writeEntry("Ta", os);
|
Ta_.writeEntry("Ta", os);
|
||||||
|
|
||||||
|
if (thicknessLayers_.size())
|
||||||
|
{
|
||||||
thicknessLayers_.writeEntry("thicknessLayers", os);
|
thicknessLayers_.writeEntry("thicknessLayers", os);
|
||||||
kappaLayers_.writeEntry("kappaLayers", os);
|
kappaLayers_.writeEntry("kappaLayers", os);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
}
|
||||||
|
|
||||||
|
os.writeKeyword("qr")<< qrName_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
if (qrName_ != "none")
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
qrPrevious_.writeEntry("qrPrevious", os);
|
||||||
<< "Illegal heat flux mode " << operationModeNames[mode_]
|
os.writeKeyword("qrRelaxation")
|
||||||
<< abort(FatalError);
|
<< qrRelaxation_ << token::END_STATEMENT << nl;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refValue().writeEntry("refValue", os);
|
||||||
|
refGrad().writeEntry("refGradient", os);
|
||||||
|
valueFraction().writeEntry("valueFraction", os);
|
||||||
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -28,37 +28,41 @@ Group
|
|||||||
grpThermoBoundaryConditions grpWallBoundaryConditions
|
grpThermoBoundaryConditions grpWallBoundaryConditions
|
||||||
|
|
||||||
Description
|
Description
|
||||||
This boundary condition supplies a heat flux condition for temperature
|
This boundary condition applies a heat flux condition to temperature
|
||||||
on an external wall. Optional thin thermal layer resistances can be
|
on an external wall in one of three modes:
|
||||||
specified through thicknessLayers and kappaLayers entries for the
|
|
||||||
fixed heat transfer coefficient mode.
|
|
||||||
|
|
||||||
The condition can operate in two modes:
|
- fixed power: supply Q
|
||||||
- fixed heat transfer coefficient: supply h and Ta
|
|
||||||
- fixed heat flux: supply q
|
- fixed heat flux: supply q
|
||||||
|
- fixed heat transfer coefficient: supply h and Ta
|
||||||
|
|
||||||
where:
|
where:
|
||||||
\vartable
|
\vartable
|
||||||
h | heat transfer coefficient [W/m^2/K]
|
Q | Power [W]
|
||||||
Ta | ambient temperature [K]
|
q | Heat flux [W/m^2]
|
||||||
q | heat flux [W/m^2]
|
h | Heat transfer coefficient [W/m^2/K]
|
||||||
|
Ta | Ambient temperature [K]
|
||||||
\endvartable
|
\endvartable
|
||||||
|
|
||||||
|
For heat transfer coefficient mode optional thin thermal layer resistances
|
||||||
|
can be specified through thicknessLayers and kappaLayers entries.
|
||||||
|
|
||||||
The thermal conductivity \c kappa can either be retrieved from various
|
The thermal conductivity \c kappa can either be retrieved from various
|
||||||
possible sources, as detailed in the class temperatureCoupledBase.
|
possible sources, as detailed in the class temperatureCoupledBase.
|
||||||
|
|
||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
q | heat flux [W/m^2] | yes* |
|
mode | 'power', 'flux' or 'coefficient' | yes |
|
||||||
Ta | ambient temperature [K] | yes* |
|
Q | Power [W] | for mode 'power' |
|
||||||
h | heat transfer coefficient [W/m^2/K] | yes*|
|
q | Heat flux [W/m^2] | for mode 'flux' |
|
||||||
thicknessLayers | list of thicknesses per layer [m] | yes |
|
h | Heat transfer coefficient [W/m^2/K] | for mode 'coefficent' |
|
||||||
kappaLayers | list of thermal conductivities per layer [W/m/K] | yes |
|
Ta | Ambient temperature [K] | for mode 'coefficient' |
|
||||||
Qr | name of the radiative field | no | no
|
thicknessLayers | Layer thicknesses [m] | no |
|
||||||
relaxation | relaxation factor for radiative field | no | 1
|
kappaLayers | Layer thermal conductivities [W/m/K] | no |
|
||||||
kappaMethod | inherited from temperatureCoupledBase | inherited |
|
qr | Name of the radiative field | no | none
|
||||||
kappa | inherited from temperatureCoupledBase | inherited |
|
qrRelaxation | Relaxation factor for radiative field | no | 1
|
||||||
|
kappaMethod | Inherited from temperatureCoupledBase | inherited |
|
||||||
|
kappa | Inherited from temperatureCoupledBase | inherited |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -66,24 +70,23 @@ Usage
|
|||||||
<patchName>
|
<patchName>
|
||||||
{
|
{
|
||||||
type externalWallHeatFluxTemperature;
|
type externalWallHeatFluxTemperature;
|
||||||
q uniform 1000;
|
|
||||||
|
mode coefficient;
|
||||||
|
|
||||||
Ta uniform 300.0;
|
Ta uniform 300.0;
|
||||||
h uniform 10.0;
|
h uniform 10.0;
|
||||||
thicknessLayers (0.1 0.2 0.3 0.4);
|
thicknessLayers (0.1 0.2 0.3 0.4);
|
||||||
kappaLayers (1 2 3 4);
|
kappaLayers (1 2 3 4);
|
||||||
value uniform 300.0;
|
|
||||||
Qr none;
|
|
||||||
relaxation 1;
|
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
kappa none;
|
|
||||||
|
value $internalField;
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
Note:
|
|
||||||
- Only supply \c h and \c Ta, or \c q in the dictionary (see above)
|
|
||||||
|
|
||||||
See also
|
See also
|
||||||
Foam::temperatureCoupledBase
|
Foam::temperatureCoupledBase
|
||||||
|
Foam::mixedFvPatchScalarField
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
externalWallHeatFluxTemperatureFvPatchScalarField.C
|
externalWallHeatFluxTemperatureFvPatchScalarField.C
|
||||||
@ -117,9 +120,9 @@ public:
|
|||||||
//- Operation mode enumeration
|
//- Operation mode enumeration
|
||||||
enum operationMode
|
enum operationMode
|
||||||
{
|
{
|
||||||
|
fixedPower,
|
||||||
fixedHeatFlux,
|
fixedHeatFlux,
|
||||||
fixedHeatTransferCoeff,
|
fixedHeatTransferCoeff
|
||||||
unknown
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static const NamedEnum<operationMode, 3> operationModeNames;
|
static const NamedEnum<operationMode, 3> operationModeNames;
|
||||||
@ -132,23 +135,26 @@ private:
|
|||||||
//- Operation mode
|
//- Operation mode
|
||||||
operationMode mode_;
|
operationMode mode_;
|
||||||
|
|
||||||
//- Heat flux / [W/m2]
|
//- Heat power [W]
|
||||||
|
scalar Q_;
|
||||||
|
|
||||||
|
//- Heat flux [W/m2]
|
||||||
scalarField q_;
|
scalarField q_;
|
||||||
|
|
||||||
//- Heat transfer coefficient / [W/m2K]
|
//- Heat transfer coefficient [W/m2K]
|
||||||
scalarField h_;
|
scalarField h_;
|
||||||
|
|
||||||
//- Ambient temperature / [K]
|
//- Ambient temperature [K]
|
||||||
scalarField Ta_;
|
scalarField Ta_;
|
||||||
|
|
||||||
//- Chache Qr for relaxation
|
//- Chache qr for relaxation
|
||||||
scalarField QrPrevious_;
|
scalarField qrPrevious_;
|
||||||
|
|
||||||
//- Relaxation for Qr
|
//- Relaxation for qr
|
||||||
scalar QrRelaxation_;
|
scalar qrRelaxation_;
|
||||||
|
|
||||||
//- Name of the radiative heat flux
|
//- Name of the radiative heat flux
|
||||||
const word QrName_;
|
const word qrName_;
|
||||||
|
|
||||||
//- Thickness of layers
|
//- Thickness of layers
|
||||||
scalarList thicknessLayers_;
|
scalarList thicknessLayers_;
|
||||||
|
|||||||
@ -1,262 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "turbulentHeatFluxTemperatureFvPatchScalarField.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "fvPatchFieldMapper.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
// declare specialization within 'Foam' namespace
|
|
||||||
template<>
|
|
||||||
const char* NamedEnum
|
|
||||||
<
|
|
||||||
Foam::compressible::
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType,
|
|
||||||
2
|
|
||||||
>::names[] =
|
|
||||||
{
|
|
||||||
"power",
|
|
||||||
"flux"
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
const NamedEnum
|
|
||||||
<
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType,
|
|
||||||
2
|
|
||||||
> turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
|
||||||
temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
|
|
||||||
heatSource_(hsPower),
|
|
||||||
q_(p.size(), 0.0),
|
|
||||||
QrName_("undefinedQr")
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
|
|
||||||
temperatureCoupledBase(patch(), ptf),
|
|
||||||
heatSource_(ptf.heatSource_),
|
|
||||||
q_(ptf.q_, mapper),
|
|
||||||
QrName_(ptf.QrName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
|
||||||
temperatureCoupledBase(patch(), dict),
|
|
||||||
heatSource_(heatSourceTypeNames_.read(dict.lookup("heatSource"))),
|
|
||||||
q_("q", dict, p.size()),
|
|
||||||
QrName_(dict.lookupOrDefault<word>("Qr", "none"))
|
|
||||||
{
|
|
||||||
if (dict.found("value") && dict.found("gradient"))
|
|
||||||
{
|
|
||||||
fvPatchField<scalar>::operator=(Field<scalar>("value", dict, p.size()));
|
|
||||||
gradient() = Field<scalar>("gradient", dict, p.size());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Still reading so cannot yet evaluate. Make up a value.
|
|
||||||
fvPatchField<scalar>::operator=(patchInternalField());
|
|
||||||
gradient() = 0.0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(thftpsf),
|
|
||||||
temperatureCoupledBase(patch(), thftpsf),
|
|
||||||
heatSource_(thftpsf.heatSource_),
|
|
||||||
q_(thftpsf.q_),
|
|
||||||
QrName_(thftpsf.QrName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField::
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf,
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
fixedGradientFvPatchScalarField(thftpsf, iF),
|
|
||||||
temperatureCoupledBase(patch(), thftpsf),
|
|
||||||
heatSource_(thftpsf.heatSource_),
|
|
||||||
q_(thftpsf.q_),
|
|
||||||
QrName_(thftpsf.QrName_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap
|
|
||||||
(
|
|
||||||
const fvPatchFieldMapper& m
|
|
||||||
)
|
|
||||||
{
|
|
||||||
fixedGradientFvPatchScalarField::autoMap(m);
|
|
||||||
q_.autoMap(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void turbulentHeatFluxTemperatureFvPatchScalarField::rmap
|
|
||||||
(
|
|
||||||
const fvPatchScalarField& ptf,
|
|
||||||
const labelList& addr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
fixedGradientFvPatchScalarField::rmap(ptf, addr);
|
|
||||||
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf =
|
|
||||||
refCast<const turbulentHeatFluxTemperatureFvPatchScalarField>
|
|
||||||
(
|
|
||||||
ptf
|
|
||||||
);
|
|
||||||
|
|
||||||
q_.rmap(thftptf.q_, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
|
||||||
{
|
|
||||||
if (updated())
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const scalarField& Tp = *this;
|
|
||||||
|
|
||||||
scalarField qr(this->size(), 0.0);
|
|
||||||
|
|
||||||
//- Qr is negative going into the domain
|
|
||||||
if (QrName_ != "none")
|
|
||||||
{
|
|
||||||
qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (heatSource_)
|
|
||||||
{
|
|
||||||
case hsPower:
|
|
||||||
{
|
|
||||||
const scalar Ap = gSum(patch().magSf());
|
|
||||||
gradient() = (q_/Ap + qr)/kappa(Tp);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case hsFlux:
|
|
||||||
{
|
|
||||||
gradient() = (q_ + qr)/kappa(Tp);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
|
||||||
{
|
|
||||||
FatalErrorInFunction
|
|
||||||
<< "Unknown heat source type. Valid types are: "
|
|
||||||
<< heatSourceTypeNames_ << nl << exit(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fixedGradientFvPatchScalarField::updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void turbulentHeatFluxTemperatureFvPatchScalarField::write
|
|
||||||
(
|
|
||||||
Ostream& os
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
fixedGradientFvPatchScalarField::write(os);
|
|
||||||
os.writeKeyword("heatSource") << heatSourceTypeNames_[heatSource_]
|
|
||||||
<< token::END_STATEMENT << nl;
|
|
||||||
temperatureCoupledBase::write(os);
|
|
||||||
q_.writeEntry("q", os);
|
|
||||||
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
|
|
||||||
writeEntry("value", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchTypeField
|
|
||||||
(
|
|
||||||
fvPatchScalarField,
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,231 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Class
|
|
||||||
Foam::compressible::turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
|
|
||||||
Description
|
|
||||||
Fixed heat boundary condition to specify temperature gradient. Input
|
|
||||||
heat source either specified in terms of an absolute power [W], or as a
|
|
||||||
flux [W/m^2].
|
|
||||||
|
|
||||||
The thermal conductivity \c kappa can either be retrieved from various
|
|
||||||
possible sources, as detailed in the class temperatureCoupledBase.
|
|
||||||
|
|
||||||
Usage
|
|
||||||
\table
|
|
||||||
Property | Description | Required | Default value
|
|
||||||
heatSource | 'power' [W] or 'flux' [W/m^2] | yes |
|
|
||||||
q | heat power or flux field | yes |
|
|
||||||
Qr | name of the radiative flux field | yes |
|
|
||||||
value | initial temperature value | no | calculated
|
|
||||||
gradient | initial gradient value | no | 0.0
|
|
||||||
kappaMethod | inherited from temperatureCoupledBase | inherited |
|
|
||||||
kappa | inherited from temperatureCoupledBase | inherited |
|
|
||||||
\endtable
|
|
||||||
|
|
||||||
Note: If needed, both 'value' and 'gradient' must be defined to be used.
|
|
||||||
|
|
||||||
Example usage:
|
|
||||||
\verbatim
|
|
||||||
hotWall
|
|
||||||
{
|
|
||||||
type compressible::turbulentHeatFluxTemperature;
|
|
||||||
heatSource flux;
|
|
||||||
q uniform 10;
|
|
||||||
kappaMethod fluidThermo;
|
|
||||||
kappa none;
|
|
||||||
Qr none;
|
|
||||||
}
|
|
||||||
\endverbatim
|
|
||||||
|
|
||||||
See also
|
|
||||||
Foam::temperatureCoupledBase
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef turbulentHeatFluxTemperatureFvPatchScalarFields_H
|
|
||||||
#define turbulentHeatFluxTemperatureFvPatchScalarFields_H
|
|
||||||
|
|
||||||
#include "fixedGradientFvPatchFields.H"
|
|
||||||
#include "temperatureCoupledBase.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
namespace compressible
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class turbulentHeatFluxTemperatureFvPatchScalarField Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
class turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
:
|
|
||||||
public fixedGradientFvPatchScalarField,
|
|
||||||
public temperatureCoupledBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
// Data types
|
|
||||||
|
|
||||||
//- Enumeration listing the possible hest source input modes
|
|
||||||
enum heatSourceType
|
|
||||||
{
|
|
||||||
hsPower,
|
|
||||||
hsFlux
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Heat source type names
|
|
||||||
static const NamedEnum<heatSourceType, 2> heatSourceTypeNames_;
|
|
||||||
|
|
||||||
//- Heat source type
|
|
||||||
heatSourceType heatSource_;
|
|
||||||
|
|
||||||
//- Heat power [W] or flux [W/m2]
|
|
||||||
scalarField q_;
|
|
||||||
|
|
||||||
//- Name of radiative in flux field
|
|
||||||
word QrName_;
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("compressible::turbulentHeatFluxTemperature");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given
|
|
||||||
// turbulentHeatFluxTemperatureFvPatchScalarField onto
|
|
||||||
// a new patch
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<scalar, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchScalarField> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new turbulentHeatFluxTemperatureFvPatchScalarField(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
const turbulentHeatFluxTemperatureFvPatchScalarField&,
|
|
||||||
const DimensionedField<scalar, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchScalarField> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchScalarField>
|
|
||||||
(
|
|
||||||
new turbulentHeatFluxTemperatureFvPatchScalarField
|
|
||||||
(
|
|
||||||
*this,
|
|
||||||
iF
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Mapping functions
|
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
|
||||||
virtual void autoMap(const fvPatchFieldMapper&);
|
|
||||||
|
|
||||||
//- Reverse map the given fvPatchField onto this fvPatchField
|
|
||||||
virtual void rmap
|
|
||||||
(
|
|
||||||
const fvPatchScalarField&,
|
|
||||||
const labelList&
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
|
||||||
virtual void updateCoeffs();
|
|
||||||
|
|
||||||
|
|
||||||
// I-O
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace compressible
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
Reference in New Issue
Block a user