42 template<
class sol
idType>
51 mixedFvPatchScalarField(
p, iF),
53 baffleActivated_(
true),
58 qrPrevious_(
p.size()),
60 qrName_(
"undefined-qr")
64 template<
class sol
idType>
75 mixedFvPatchScalarField(ptf,
p, iF, mapper),
77 baffleActivated_(ptf.baffleActivated_),
78 thickness_(ptf.thickness_, mapper),
80 solidDict_(ptf.solidDict_),
81 solidPtr_(ptf.solidPtr_),
82 qrPrevious_(ptf.qrPrevious_, mapper),
83 qrRelaxation_(ptf.qrRelaxation_),
88 template<
class sol
idType>
98 mixedFvPatchScalarField(
p, iF),
100 baffleActivated_(
dict.lookupOrDefault(
"baffleActivated",
true)),
105 qrPrevious_(
p.size(),
Zero),
108 dict.lookupOrDefaultCompat(
"qrRelaxation", {{
"relaxation", 1712}}, 1)
129 if (
dict.
found(
"refValue") && baffleActivated_)
141 valueFraction() = 0.0;
147 template<
class sol
idType>
148 thermalBaffle1DFvPatchScalarField<solidType>::
149 thermalBaffle1DFvPatchScalarField
155 mixedFvPatchScalarField(ptf),
157 baffleActivated_(ptf.baffleActivated_),
158 thickness_(ptf.thickness_),
160 solidDict_(ptf.solidDict_),
161 solidPtr_(ptf.solidPtr_),
162 qrPrevious_(ptf.qrPrevious_),
163 qrRelaxation_(ptf.qrRelaxation_),
168 template<
class sol
idType>
177 mixedFvPatchScalarField(ptf, iF),
179 baffleActivated_(ptf.baffleActivated_),
180 thickness_(ptf.thickness_),
182 solidDict_(ptf.solidDict_),
183 solidPtr_(ptf.solidPtr_),
184 qrPrevious_(ptf.qrPrevious_),
185 qrRelaxation_(ptf.qrRelaxation_),
192 template<
class sol
idType>
197 const label nbrPatchi = samplePolyPatch().index();
199 return (patchi < nbrPatchi);
203 template<
class sol
idType>
204 const solidType& thermalBaffle1DFvPatchScalarField<solidType>::solid()
const
208 if (solidPtr_.empty())
210 solidPtr_.reset(
new solidType(solidDict_));
216 const fvPatch& nbrPatch =
217 patch().boundaryMesh()[samplePolyPatch().index()];
219 const thermalBaffle1DFvPatchScalarField& nbrField =
220 refCast<const thermalBaffle1DFvPatchScalarField>
222 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
225 return nbrField.solid();
230 template<
class sol
idType>
231 tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::
232 baffleThickness()
const
236 if (thickness_.size() !=
patch().size())
239 <<
"Field thickness has not been specified"
240 " for patch " << this->
patch().name()
250 const fvPatch& nbrPatch =
251 patch().boundaryMesh()[samplePolyPatch().index()];
252 const thermalBaffle1DFvPatchScalarField& nbrField =
253 refCast<const thermalBaffle1DFvPatchScalarField>
255 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
258 tmp<scalarField> tthickness
263 mapDist.distribute(thickness);
269 template<
class sol
idType>
270 tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs()
const
280 const fvPatch& nbrPatch =
281 patch().boundaryMesh()[samplePolyPatch().index()];
283 const thermalBaffle1DFvPatchScalarField& nbrField =
284 refCast<const thermalBaffle1DFvPatchScalarField>
286 nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
289 tmp<scalarField> tqs(
new scalarField(nbrField.qs()));
291 mapDist.distribute(qs);
297 template<
class sol
idType>
298 void thermalBaffle1DFvPatchScalarField<solidType>::autoMap
305 mixedFvPatchScalarField::autoMap(m);
309 thickness_.autoMap(m);
315 template<
class sol
idType>
322 mixedFvPatchScalarField::rmap(ptf, addr);
325 refCast<const thermalBaffle1DFvPatchScalarField>(ptf);
329 thickness_.rmap(tiptf.thickness_, addr);
330 qs_.rmap(tiptf.qs_, addr);
335 template<
class sol
idType>
351 const label nbrPatchi = samplePolyPatch().index();
353 if (baffleActivated_)
355 const fvPatch& nbrPatch =
patch().boundaryMesh()[nbrPatchi];
358 db().template lookupObject<compressible::turbulenceModel>
367 patch().template lookupPatchField<volScalarField, scalar>(TName_);
372 if (qrName_ !=
"none")
374 qr =
patch().template lookupPatchField<volScalarField, scalar>
377 qr = qrRelaxation_*qr + (1.0 - qrRelaxation_)*qrPrevious_;
387 turbModel.transport().T().boundaryField()[nbrPatchi];
394 kappas[i] = solid().kappa(0.0, (Tp[i] + nbrTp[i])/2.0);
403 refValue() = (KDeltaSolid*nbrTp + qs()/2.0)/
alpha;
408 Info<<
patch().boundaryMesh().mesh().name() <<
':'
409 <<
patch().name() <<
':'
410 << this->internalField().name() <<
" <- "
411 << nbrPatch.
name() <<
':'
412 << this->internalField().name() <<
" :"
414 <<
" walltemperature "
415 <<
" min:" <<
gMin(*
this)
416 <<
" max:" <<
gMax(*
this)
425 mixedFvPatchScalarField::updateCoeffs();
428 template<
class sol
idType>
436 baffleThickness()().writeEntry(
"thickness", os);
437 qs()().writeEntry(
"qs", os);
441 qrPrevious_.writeEntry(
"qrPrevious", os);