thermalBaffle1DFvPatchScalarField: Changed name of source heat flux Qs -> qs for consistency

Qs is used for total heat source (W) and qs is used for heat flux (W/m^2)

Backward compatibility is provided.
This commit is contained in:
Henry Weller
2021-09-23 14:13:26 +01:00
parent fdb118878b
commit e627c7e98f
2 changed files with 27 additions and 23 deletions

View File

@ -50,7 +50,7 @@ thermalBaffle1DFvPatchScalarField
TName_("T"), TName_("T"),
baffleActivated_(true), baffleActivated_(true),
thickness_(p.size()), thickness_(p.size()),
Qs_(p.size()), qs_(p.size()),
solidDict_(), solidDict_(),
solidPtr_(nullptr), solidPtr_(nullptr),
qrPrevious_(p.size()), qrPrevious_(p.size()),
@ -73,7 +73,7 @@ thermalBaffle1DFvPatchScalarField
TName_("T"), TName_("T"),
baffleActivated_(dict.lookupOrDefault<bool>("baffleActivated", true)), baffleActivated_(dict.lookupOrDefault<bool>("baffleActivated", true)),
thickness_(), thickness_(),
Qs_(p.size(), 0), qs_(p.size(), 0),
solidDict_(dict), solidDict_(dict),
solidPtr_(), solidPtr_(),
qrPrevious_(p.size(), 0.0), qrPrevious_(p.size(), 0.0),
@ -87,9 +87,13 @@ thermalBaffle1DFvPatchScalarField
thickness_ = scalarField("thickness", dict, p.size()); thickness_ = scalarField("thickness", dict, p.size());
} }
if (dict.found("Qs")) if (dict.found("qs"))
{ {
Qs_ = scalarField("Qs", dict, p.size()); qs_ = scalarField("qs", dict, p.size());
}
else if (dict.found("Qs"))
{
qs_ = scalarField("Qs", dict, p.size());
} }
if (dict.found("qrPrevious")) if (dict.found("qrPrevious"))
@ -129,7 +133,7 @@ thermalBaffle1DFvPatchScalarField
TName_(ptf.TName_), TName_(ptf.TName_),
baffleActivated_(ptf.baffleActivated_), baffleActivated_(ptf.baffleActivated_),
thickness_(mapper(ptf.thickness_)), thickness_(mapper(ptf.thickness_)),
Qs_(mapper(ptf.Qs_)), qs_(mapper(ptf.qs_)),
solidDict_(ptf.solidDict_), solidDict_(ptf.solidDict_),
solidPtr_(ptf.solidPtr_), solidPtr_(ptf.solidPtr_),
qrPrevious_(mapper(ptf.qrPrevious_)), qrPrevious_(mapper(ptf.qrPrevious_)),
@ -151,7 +155,7 @@ thermalBaffle1DFvPatchScalarField
TName_(ptf.TName_), TName_(ptf.TName_),
baffleActivated_(ptf.baffleActivated_), baffleActivated_(ptf.baffleActivated_),
thickness_(ptf.thickness_), thickness_(ptf.thickness_),
Qs_(ptf.Qs_), qs_(ptf.qs_),
solidDict_(ptf.solidDict_), solidDict_(ptf.solidDict_),
solidPtr_(ptf.solidPtr_), solidPtr_(ptf.solidPtr_),
qrPrevious_(ptf.qrPrevious_), qrPrevious_(ptf.qrPrevious_),
@ -242,11 +246,11 @@ baffleThickness() const
template<class solidType> template<class solidType>
tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::Qs() const tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs() const
{ {
if (this->owner()) if (this->owner())
{ {
return Qs_; return qs_;
} }
else else
{ {
@ -261,10 +265,10 @@ tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::Qs() const
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_) nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
); );
tmp<scalarField> tQs(new scalarField(nbrField.Qs())); tmp<scalarField> tqs(new scalarField(nbrField.qs()));
scalarField& Qs = tQs.ref(); scalarField& qs = tqs.ref();
mapDist.distribute(Qs); mapDist.distribute(qs);
return tQs; return tqs;
} }
} }
@ -282,7 +286,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::autoMap
if (this->owner()) if (this->owner())
{ {
m(thickness_, thickness_); m(thickness_, thickness_);
m(Qs_, Qs_); m(qs_, qs_);
} }
} }
@ -302,7 +306,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::rmap
if (this->owner()) if (this->owner())
{ {
thickness_.rmap(tiptf.thickness_, addr); thickness_.rmap(tiptf.thickness_, addr);
Qs_.rmap(tiptf.Qs_, addr); qs_.rmap(tiptf.qs_, addr);
} }
} }
@ -381,7 +385,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
valueFraction() = alpha/(alpha + myKDelta); valueFraction() = alpha/(alpha + myKDelta);
refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/alpha; refValue() = (KDeltaSolid*nbrTp + qs()/2.0)/alpha;
if (debug) if (debug)
{ {
@ -415,7 +419,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::write(Ostream& os) const
if (this->owner()) if (this->owner())
{ {
writeEntry(os, "thickness", baffleThickness()()); writeEntry(os, "thickness", baffleThickness()());
writeEntry(os, "Qs", Qs()()); writeEntry(os, "qs", qs()());
solid().write(os); solid().write(os);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -43,8 +43,8 @@ Usage
samplePatch <slavePatchName>; samplePatch <slavePatchName>;
thickness uniform 0.005; // thickness [m] thickness uniform 0.005; // Thickness [m]
Qs uniform 100; // heat flux [W/m^2] qs uniform 100; // Source heat flux [W/m^2]
qr none; qr none;
qrRelaxation 1; qrRelaxation 1;
@ -124,8 +124,8 @@ class thermalBaffle1DFvPatchScalarField
//- Baffle thickness [m] //- Baffle thickness [m]
mutable scalarField thickness_; mutable scalarField thickness_;
//- Superficial heat source [W/m^2] //- Source heat flux [W/m^2]
mutable scalarField Qs_; mutable scalarField qs_;
//- Solid dictionary //- Solid dictionary
dictionary solidDict_; dictionary solidDict_;
@ -148,8 +148,8 @@ class thermalBaffle1DFvPatchScalarField
//- Return const solid thermo //- Return const solid thermo
const solidType& solid() const; const solidType& solid() const;
//- Return Qs from master //- Return source heat flux from master
tmp<scalarField> Qs() const; tmp<scalarField> qs() const;
//- Return thickness from master //- Return thickness from master
tmp<scalarField> baffleThickness() const; tmp<scalarField> baffleThickness() const;