25 const word objFuncName,
26 const word objFuncPart,
27 const dictionary& objFuncDict)
37 #ifdef CompressibleFlow
38 thermo_(const_cast<fluidThermo&>(
daModel.getThermo())),
43 mesh.time().timeName(),
46 IOobject::AUTO_WRITE),
48 dimensionedScalar(
"wallHeatFlux", dimensionSet(1, 0, -3, 0, 0, 0, 0), 0.0),
51 #ifdef IncompressibleFlow
56 mesh.time().timeName(),
59 IOobject::AUTO_WRITE),
61 dimensionedScalar(
"wallHeatFlux", dimensionSet(1, -2, 1, 1, 0, 0, 0), 0.0),
68 mesh.time().timeName(),
71 IOobject::AUTO_WRITE),
73 dimensionedScalar(
"wallHeatFlux", dimensionSet(1, -2, 1, 1, 0, 0, 0), 0.0),
82 #ifdef CompressibleFlow
94 #ifdef IncompressibleFlow
105 IOdictionary transportProperties(
107 "transportProperties",
108 mesh.time().constant(),
116 Cp_ = readScalar(transportProperties.lookup(
"Cp"));
121 IOdictionary transportProperties(
123 "transportProperties",
124 mesh.time().constant(),
132 k_ = readScalar(transportProperties.lookup(
"k"));
139 const labelList& objFuncFaceSources,
140 const labelList& objFuncCellSources,
141 scalarList& objFuncFaceValues,
142 scalarList& objFuncCellValues,
143 scalar& objFuncValue)
169 forAll(objFuncFaceSources, idxI)
171 const label& objFuncFaceI = objFuncFaceSources[idxI];
181 forAll(objFuncFaceValues, idxI)
183 objFuncFaceValues[idxI] = 0.0;
188 volScalarField::Boundary& wallHeatFluxBf =
wallHeatFlux_.boundaryFieldRef();
190 #ifdef IncompressibleFlow
192 const objectRegistry& db =
mesh_.thisDb();
193 const volScalarField&
T = db.lookupObject<volScalarField>(
"T");
195 const volScalarField::Boundary& TBf =
T.boundaryField();
196 const volScalarField::Boundary& alphaEffBf =
alphaEff.boundaryField();
197 forAll(wallHeatFluxBf, patchI)
199 if (!wallHeatFluxBf[patchI].coupled())
201 wallHeatFluxBf[patchI] =
Cp_ * alphaEffBf[patchI] * TBf[patchI].snGrad();
206 #ifdef CompressibleFlow
208 volScalarField&
he = thermo_.he();
209 const volScalarField::Boundary& heBf =
he.boundaryField();
211 const volScalarField::Boundary& alphaEffBf =
alphaEff.boundaryField();
212 forAll(wallHeatFluxBf, patchI)
214 if (!wallHeatFluxBf[patchI].coupled())
216 wallHeatFluxBf[patchI] = alphaEffBf[patchI] * heBf[patchI].snGrad();
223 const objectRegistry& db =
mesh_.thisDb();
224 const volScalarField&
T = db.lookupObject<volScalarField>(
"T");
225 const volScalarField::Boundary& TBf =
T.boundaryField();
226 forAll(wallHeatFluxBf, patchI)
228 if (!wallHeatFluxBf[patchI].coupled())
230 wallHeatFluxBf[patchI] =
k_ * TBf[patchI].snGrad();
236 forAll(objFuncFaceSources, idxI)
238 const label& objFuncFaceI = objFuncFaceSources[idxI];
243 scalar area =
mesh_.magSf().boundaryField()[patchI][faceI];
244 objFuncFaceValues[idxI] =
scale_ * wallHeatFluxBf[patchI][faceI] * area /
areaSum_;
246 objFuncValue += objFuncFaceValues[idxI];
250 reduce(objFuncValue, sumOp<scalar>());