22#include "turbulentHeatFluxTemperatureFvPatchScalarField.H"
23#include "addToRunTimeSelectionTable.H"
24#include "fvPatchFieldMapper.H"
25#include "turbulentTransportModel.H"
27#include "IncompressibleTurbulenceModel.H"
39turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType,
55namespace incompressible
62turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType,
64 > turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_;
69turbulentHeatFluxTemperatureFvPatchScalarField::
70turbulentHeatFluxTemperatureFvPatchScalarField
73 const DimensionedField<scalar, volMesh>& iF
76 fixedGradientFvPatchScalarField(p, iF),
79 alphaEffName_(
"undefinedAlphaEff")
83turbulentHeatFluxTemperatureFvPatchScalarField::
84turbulentHeatFluxTemperatureFvPatchScalarField
86 const turbulentHeatFluxTemperatureFvPatchScalarField& ptf,
88 const DimensionedField<scalar, volMesh>& iF,
89 const fvPatchFieldMapper& mapper
92 fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
93 heatSource_(ptf.heatSource_),
95 alphaEffName_(ptf.alphaEffName_)
99turbulentHeatFluxTemperatureFvPatchScalarField::
100turbulentHeatFluxTemperatureFvPatchScalarField
103 const DimensionedField<scalar, volMesh>& iF,
104 const dictionary& dict
107 fixedGradientFvPatchScalarField(p, iF),
108 heatSource_(heatSourceTypeNames_.read(dict.lookup(
"heatSource"))),
109 q_(
"q", dict, p.size()),
110 alphaEffName_(dict.lookup(
"alphaEff"))
112 if (dict.found(
"value") && dict.found(
"gradient"))
114 fvPatchField<scalar>::operator=(Field<scalar>(
"value", dict, p.size()));
115 gradient() = Field<scalar>(
"gradient", dict, p.size());
119 fvPatchField<scalar>::operator=(patchInternalField());
125turbulentHeatFluxTemperatureFvPatchScalarField::
126turbulentHeatFluxTemperatureFvPatchScalarField
128 const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf
131 fixedGradientFvPatchScalarField(thftpsf),
132 heatSource_(thftpsf.heatSource_),
134 alphaEffName_(thftpsf.alphaEffName_)
138turbulentHeatFluxTemperatureFvPatchScalarField::
139turbulentHeatFluxTemperatureFvPatchScalarField
141 const turbulentHeatFluxTemperatureFvPatchScalarField& thftpsf,
142 const DimensionedField<scalar, volMesh>& iF
145 fixedGradientFvPatchScalarField(thftpsf, iF),
146 heatSource_(thftpsf.heatSource_),
148 alphaEffName_(thftpsf.alphaEffName_)
154void turbulentHeatFluxTemperatureFvPatchScalarField::autoMap
156 const fvPatchFieldMapper& m
159 scalarField::autoMap(m);
164void turbulentHeatFluxTemperatureFvPatchScalarField::rmap
166 const fvPatchScalarField& ptf,
167 const labelList& addr
170 fixedGradientFvPatchScalarField::rmap(ptf, addr);
171 const turbulentHeatFluxTemperatureFvPatchScalarField& thftptf =
172 refCast<const turbulentHeatFluxTemperatureFvPatchScalarField>
176 q_.rmap(thftptf.q_, addr);
180void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
187 const scalarField& alphaEffp =
188 patch().lookupPatchField<volScalarField, scalar>(alphaEffName_);
190 const IOdictionary& transportProperties =
191 db().lookupObject<IOdictionary>(
"transportProperties");
192 const scalar rhoCp0(readScalar(transportProperties.lookup(
"rhoCp0")));
198 const scalar Ap = gSum(patch().magSf());
199 gradient() = q_ / (Ap * rhoCp0 * alphaEffp);
205 gradient() = q_ / (rhoCp0 * alphaEffp);
213 "turbulentHeatFluxTemperatureFvPatchScalarField"
216 "const DimensionedField<scalar, volMesh>&, "
219 ) <<
"Unknown heat source type. Valid types are: "
220 << heatSourceTypeNames_ << nl << exit(FatalError);
224 fixedGradientFvPatchScalarField::updateCoeffs();
228void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os)
const
230 fixedGradientFvPatchScalarField::write(os);
231 os.writeKeyword(
"heatSource") << heatSourceTypeNames_[heatSource_]
232 << token::END_STATEMENT << nl;
233 q_.writeEntry(
"q", os);
234 os.writeKeyword(
"alphaEff") << alphaEffName_ << token::END_STATEMENT << nl;
235 writeEntry(
"value", os);
244 turbulentHeatFluxTemperatureFvPatchScalarField