43 template<
class sol
idType>
52 mixedFvPatchScalarField(
p, iF),
54 baffleActivated_(
true),
59 qrPrevious_(
p.size()),
61 qrName_(
"undefined-qr")
65 template<
class sol
idType>
76 mixedFvPatchScalarField(ptf,
p, iF, mapper),
78 baffleActivated_(ptf.baffleActivated_),
79 thickness_(ptf.thickness_, mapper),
81 solidDict_(ptf.solidDict_),
82 solidPtr_(ptf.solidPtr_),
83 qrPrevious_(ptf.qrPrevious_, mapper),
84 qrRelaxation_(ptf.qrRelaxation_),
89 template<
class sol
idType>
99 mixedFvPatchScalarField(
p, iF),
101 baffleActivated_(
dict.getOrDefault(
"baffleActivated", true)),
106 qrPrevious_(
p.size(),
Zero),
109 dict.getOrDefaultCompat(
"qrRelaxation", {{
"relaxation", 1712}}, 1)
111 qrName_(
dict.getOrDefault<word>(
"qr",
"none"))
115 if (
dict.found(
"thickness"))
120 if (
dict.found(
"qs"))
125 if (
dict.found(
"qrPrevious"))
130 if (
dict.found(
"refValue") && baffleActivated_)
142 valueFraction() = 0.0;
148 template<
class sol
idType>
156 mixedFvPatchScalarField(ptf),
158 baffleActivated_(ptf.baffleActivated_),
159 thickness_(ptf.thickness_),
161 solidDict_(ptf.solidDict_),
162 solidPtr_(ptf.solidPtr_),
163 qrPrevious_(ptf.qrPrevious_),
164 qrRelaxation_(ptf.qrRelaxation_),
169 template<
class sol
idType>
178 mixedFvPatchScalarField(ptf, iF),
180 baffleActivated_(ptf.baffleActivated_),
181 thickness_(ptf.thickness_),
183 solidDict_(ptf.solidDict_),
184 solidPtr_(ptf.solidPtr_),
185 qrPrevious_(ptf.qrPrevious_),
186 qrRelaxation_(ptf.qrRelaxation_),
193 template<
class sol
idType>
194 bool thermalBaffle1DFvPatchScalarField<solidType>::owner()
const
196 const label patchi =
patch().index();
198 const label nbrPatchi = samplePolyPatch().index();
200 return (patchi < nbrPatchi);
204 template<
class sol
idType>
205 const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid()
const
211 solidPtr_.reset(
new solidType(solidDict_));
217 const fvPatch& nbrPatch =
218 patch().boundaryMesh()[samplePolyPatch().index()];
220 const thermalBaffle1DFvPatchScalarField& nbrField =
221 refCast<const thermalBaffle1DFvPatchScalarField>
223 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
226 return nbrField.solid();
231 template<
class sol
idType>
232 tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::
233 baffleThickness()
const
237 if (thickness_.size() !=
patch().size())
240 <<
"Field thickness has not been specified"
241 " for patch " << this->
patch().name()
251 const fvPatch& nbrPatch =
252 patch().boundaryMesh()[samplePolyPatch().index()];
253 const thermalBaffle1DFvPatchScalarField& nbrField =
254 refCast<const thermalBaffle1DFvPatchScalarField>
256 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
259 tmp<scalarField> tthickness
264 mapDist.distribute(thickness);
270 template<
class sol
idType>
271 tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs()
const
281 const fvPatch& nbrPatch =
282 patch().boundaryMesh()[samplePolyPatch().index()];
284 const thermalBaffle1DFvPatchScalarField& nbrField =
285 refCast<const thermalBaffle1DFvPatchScalarField>
287 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
290 tmp<scalarField> tqs(
new scalarField(nbrField.qs()));
292 mapDist.distribute(qs);
298 template<
class sol
idType>
306 mixedFvPatchScalarField::autoMap(m);
310 thickness_.autoMap(m);
316 template<
class sol
idType>
323 mixedFvPatchScalarField::rmap(ptf, addr);
325 const thermalBaffle1DFvPatchScalarField& tiptf =
326 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
330 thickness_.rmap(tiptf.thickness_, addr);
331 qs_.rmap(tiptf.qs_, addr);
336 template<
class sol
idType>
350 const label patchi =
patch().index();
352 const label nbrPatchi = samplePolyPatch().index();
354 if (baffleActivated_)
356 const fvPatch& nbrPatch =
patch().boundaryMesh()[nbrPatchi];
359 db().template lookupObject<compressible::turbulenceModel>
365 const scalarField kappaw(turbModel.kappaEff(patchi));
368 patch().template lookupPatchField<volScalarField, scalar>(TName_);
373 if (qrName_ !=
"none")
375 qr =
patch().template lookupPatchField<volScalarField, scalar>
378 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
382 tmp<scalarField> Ti = patchInternalField();
388 turbModel.transport().
T().boundaryField()[nbrPatchi];
389 mapDist.distribute(nbrTp);
395 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
404 refValue() = (KDeltaSolid*nbrTp + qs()/2.0)/
alpha;
409 Info<<
patch().boundaryMesh().mesh().name() <<
':'
410 <<
patch().name() <<
':'
411 << this->internalField().name() <<
" <- "
412 << nbrPatch.name() <<
':'
413 << this->internalField().name() <<
" :"
415 <<
" walltemperature "
416 <<
" min:" <<
gMin(*
this)
417 <<
" max:" <<
gMax(*
this)
426 mixedFvPatchScalarField::updateCoeffs();
429 template<
class sol
idType>
437 baffleThickness()().writeEntry(
"thickness",
os);
438 qs()().writeEntry(
"qs",
os);
442 qrPrevious_.writeEntry(
"qrPrevious",
os);
443 os.writeEntry(
"qr", qrName_);
444 os.writeEntry(
"qrRelaxation", qrRelaxation_);