壁面熱流束の計算2016年12月5日 | |
はじめに壁面熱流束の計算について。 使用バージョンOpenFOAM 4.x (blueCFD) 壁面熱流束の計算計算結果からの計算計算結果から壁面熱流束の計算をするには、ユーティリティ wallHeatFlux を使う。 $ wallHeatFlux -latestTime マルチリージョンの場合は、オプション "-region" でリージョンを指定する。 計算中のモニタリング計算中に壁面熱流束をモニターすることを考える。chtMultiRegionSimpleFoam のチュートリアルケースの multiRegionHeaterRadiation を用いる。function object をつぎのように設定する。 system/controlDict
libs
(
"libradiationModels.so"
"libutilityFunctionObjects.so"
);
functions
{
wallHeatFlux
{
type coded;
redirectType wallHeatFlux;
region topAir;
codeInclude
#{
#include "basicThermo.H"
#include "turbulentFluidThermoModel.H"
#include "wallFvPatch.H"
#};
codeOptions
#{
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
-I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude
#};
codeLibs
#{
-lfluidThermophysicalModels \
-lcompressibleTurbulenceModels
#};
codeExecute
#{
const basicThermo& thermo =
mesh().lookupObject<basicThermo>("thermophysicalProperties");
const compressible::turbulenceModel& turbulence =
mesh().lookupObject<compressible::turbulenceModel>
(
"turbulenceProperties"
);
const volScalarField& h = thermo.he();
const volScalarField& Qr = mesh().lookupObject<volScalarField>("Qr");
surfaceScalarField heatFlux
(
fvc::interpolate
(
turbulence.alphaEff()
)*fvc::snGrad(h)
);
const surfaceScalarField::Boundary& patchHeatFlux =
heatFlux.boundaryField();
const volScalarField::Boundary& patchRadHeatFlux =
Qr.boundaryField();
const surfaceScalarField::Boundary& magSf =
mesh().magSf().boundaryField();
Info<< "\nWall heat fluxes [W]" << endl;
forAll(patchHeatFlux, patchi)
{
if (isA<wallFvPatch>(mesh().boundary()[patchi]))
{
scalar convFlux = gSum(magSf[patchi]*patchHeatFlux[patchi]);
scalar radFlux = -gSum(magSf[patchi]*patchRadHeatFlux[patchi]);
Info<< mesh().boundary()[patchi].name() << endl
<< " convective: " << convFlux << endl
<< " radiative: " << radFlux << endl
<< " total: " << convFlux + radFlux << endl;
}
}
Info<< endl;
#};
codeEnd $codeExecute;
writeControl timeStep;
writeInterval 1;
}
}
※OpenFOAM 1606+ の場合、"const surfaceScalarField::Boundary" などは "const surfaceScalarField::GeometricBoundaryField" などである。また、"codeExecute" は "code" である。 計算結果はつぎのようになる。
Time = 2000
...
Wall heat fluxes [W]
maxY
convective: 0
radiative: -4.400696
total: -4.400696
minZ
convective: 0
radiative: 0.1066685
total: 0.1066685
maxZ
convective: 0
radiative: 0.09958978
total: 0.09958978
topAir_to_rightSolid
convective: 5.668642
radiative: 1.842654
total: 7.511296
topAir_to_heater
convective: 1.823996
radiative: 0.6258261
total: 2.449823
topAir_to_leftSolid
convective: 7.328826
radiative: 1.960402
total: 9.289228
wallHeatFlux を用いた場合はつぎのようになる。
$ wallHeatFlux -region topAir -latestTime
...
Wall heat fluxes [W]
maxY
convective: 0
radiative: -4.400696
total: -4.400696
minZ
convective: 0
radiative: 0.1066684
total: 0.1066684
maxZ
convective: 0
radiative: 0.09958978
total: 0.09958978
topAir_to_rightSolid
convective: 5.668642
radiative: 1.842654
total: 7.511296
topAir_to_heater
convective: 1.823996
radiative: 0.6258261
total: 2.449822
topAir_to_leftSolid
convective: 7.328826
radiative: 1.960403
total: 9.289228
※ただし、writeInterval が 300 で Time = 2000 が保存されていなかったので、writeInterval を 200 に変更した。 古い | |
| PENGUINITIS | |