mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Extended the effectiveness heat exchanger source to enable target
heat rejection The new optional entry targetQdot can be used to specify a target heat rejection. This is additionally controlled using the targetQdotCalcInterval and targetQdotRelax entries which default to values of 5 and 0.5, respectively.
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -142,6 +142,10 @@ Foam::fv::effectivenessHeatExchangerSource::effectivenessHeatExchangerSource
|
|||||||
secondaryInletT_(0),
|
secondaryInletT_(0),
|
||||||
primaryInletT_(0),
|
primaryInletT_(0),
|
||||||
userPrimaryInletT_(false),
|
userPrimaryInletT_(false),
|
||||||
|
targetQdotActive_(false),
|
||||||
|
targetQdot_(0),
|
||||||
|
targetQdotCalcInterval_(5),
|
||||||
|
targetQdotRelax_(0.5),
|
||||||
eTable_(),
|
eTable_(),
|
||||||
UName_("U"),
|
UName_("U"),
|
||||||
TName_("T"),
|
TName_("T"),
|
||||||
@ -225,48 +229,52 @@ void Foam::fv::effectivenessHeatExchangerSource::addSup
|
|||||||
reduce(CpfMean, sumOp<scalar>());
|
reduce(CpfMean, sumOp<scalar>());
|
||||||
reduce(sumPhi, sumOp<scalar>());
|
reduce(sumPhi, sumOp<scalar>());
|
||||||
reduce(sumMagPhi, sumOp<scalar>());
|
reduce(sumMagPhi, sumOp<scalar>());
|
||||||
reduce(primaryInletTfMean, sumOp<scalar>());
|
|
||||||
|
|
||||||
primaryInletTfMean /= sumMagPhi + ROOTVSMALL;
|
|
||||||
CpfMean /= sumMagPhi + ROOTVSMALL;
|
CpfMean /= sumMagPhi + ROOTVSMALL;
|
||||||
|
|
||||||
scalar primaryInletT = primaryInletT_;
|
scalar primaryInletT = primaryInletT_;
|
||||||
if (!userPrimaryInletT_)
|
if (!userPrimaryInletT_)
|
||||||
{
|
{
|
||||||
primaryInletT = primaryInletTfMean;
|
reduce(primaryInletTfMean, sumOp<scalar>());
|
||||||
|
primaryInletT = primaryInletTfMean/(sumMagPhi + ROOTVSMALL);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar Qt =
|
const scalar alpha =
|
||||||
eTable_()(mag(sumPhi), secondaryMassFlowRate_)
|
eTable_()(mag(sumPhi), secondaryMassFlowRate_)
|
||||||
*(secondaryInletT_ - primaryInletT)
|
|
||||||
*CpfMean*mag(sumPhi);
|
*CpfMean*mag(sumPhi);
|
||||||
|
|
||||||
|
const scalar Qt = alpha*(secondaryInletT_ - primaryInletT);
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
targetQdotActive_
|
||||||
|
&& (mesh_.time().timeIndex() % targetQdotCalcInterval_ == 0)
|
||||||
|
)
|
||||||
|
{
|
||||||
|
scalar dT = (targetQdot_ - Qt)/(alpha + ROOTVSMALL);
|
||||||
|
secondaryInletT_ += targetQdotRelax_*dT;
|
||||||
|
}
|
||||||
|
|
||||||
const scalarField TCells(T, cells_);
|
const scalarField TCells(T, cells_);
|
||||||
scalar Tref = 0;
|
scalar Tref = 0;
|
||||||
|
scalarField deltaTCells(cells_.size(), 0);
|
||||||
if (Qt > 0)
|
if (Qt > 0)
|
||||||
{
|
{
|
||||||
Tref = max(TCells);
|
Tref = gMax(TCells);
|
||||||
reduce(Tref, maxOp<scalar>());
|
forAll(deltaTCells, i)
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Tref = min(TCells);
|
|
||||||
reduce(Tref, minOp<scalar>());
|
|
||||||
}
|
|
||||||
|
|
||||||
scalarField deltaTCells(cells_.size(), 0);
|
|
||||||
forAll(deltaTCells, i)
|
|
||||||
{
|
|
||||||
if (Qt > 0)
|
|
||||||
{
|
{
|
||||||
deltaTCells[i] = max(Tref - TCells[i], 0.0);
|
deltaTCells[i] = max(Tref - TCells[i], 0.0);
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Tref = gMin(TCells);
|
||||||
|
forAll(deltaTCells, i)
|
||||||
{
|
{
|
||||||
deltaTCells[i] = max(TCells[i] - Tref, 0.0);
|
deltaTCells[i] = max(TCells[i] - Tref, 0.0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
|
const volVectorField& U = mesh_.lookupObject<volVectorField>(UName_);
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
scalar sumWeight = 0;
|
scalar sumWeight = 0;
|
||||||
@ -293,6 +301,7 @@ void Foam::fv::effectivenessHeatExchangerSource::addSup
|
|||||||
Info<< type() << ": " << name() << nl << incrIndent
|
Info<< type() << ": " << name() << nl << incrIndent
|
||||||
<< indent << "Net mass flux [Kg/s] : " << sumPhi << nl
|
<< indent << "Net mass flux [Kg/s] : " << sumPhi << nl
|
||||||
<< indent << "Total energy exchange [W] : " << Qt << nl
|
<< indent << "Total energy exchange [W] : " << Qt << nl
|
||||||
|
<< indent << "Secondary inlet T [K] : " << secondaryInletT_ << nl
|
||||||
<< indent << "Tref [K] : " << Tref << nl
|
<< indent << "Tref [K] : " << Tref << nl
|
||||||
<< indent << "Effectiveness : "
|
<< indent << "Effectiveness : "
|
||||||
<< eTable_()(mag(sumPhi), secondaryMassFlowRate_) << decrIndent
|
<< eTable_()(mag(sumPhi), secondaryMassFlowRate_) << decrIndent
|
||||||
@ -314,7 +323,7 @@ bool Foam::fv::effectivenessHeatExchangerSource::read(const dictionary& dict)
|
|||||||
|
|
||||||
if (coeffs_.readIfPresent("primaryInletT", primaryInletT_))
|
if (coeffs_.readIfPresent("primaryInletT", primaryInletT_))
|
||||||
{
|
{
|
||||||
Info<< type() << " " << this->name() << ": "
|
Info<< type() << " " << this->name() << ": " << indent << nl
|
||||||
<< "employing user-specified primary flow inlet temperature: "
|
<< "employing user-specified primary flow inlet temperature: "
|
||||||
<< primaryInletT_ << endl;
|
<< primaryInletT_ << endl;
|
||||||
|
|
||||||
@ -322,11 +331,33 @@ bool Foam::fv::effectivenessHeatExchangerSource::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Info<< type() << " " << this->name() << ": "
|
Info<< type() << " " << this->name() << ": " << indent << nl
|
||||||
<< "employing flux-weighted primary flow inlet temperature"
|
<< "employing flux-weighted primary flow inlet temperature"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (coeffs_.readIfPresent("targetQdot", targetQdot_))
|
||||||
|
{
|
||||||
|
targetQdotActive_ = true;
|
||||||
|
Info<< indent << "employing target heat rejection of "
|
||||||
|
<< targetQdot_ << nl;
|
||||||
|
|
||||||
|
coeffs_.readIfPresent
|
||||||
|
(
|
||||||
|
"targetQdotCalcInterval",
|
||||||
|
targetQdotCalcInterval_
|
||||||
|
);
|
||||||
|
|
||||||
|
Info<< indent << "updating secondary inlet temperature every "
|
||||||
|
<< targetQdotCalcInterval_ << " iterations" << nl;
|
||||||
|
|
||||||
|
coeffs_.readIfPresent("targetQdotRelax", targetQdotRelax_);
|
||||||
|
|
||||||
|
Info<< indent << "temperature relaxation: "
|
||||||
|
<< targetQdotRelax_ << endl;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -28,8 +28,8 @@ Group
|
|||||||
grpFvOptionsSources
|
grpFvOptionsSources
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Heat exchanger source model, in which the heat exchanger is defined as a
|
Heat exchanger source model, in which the heat exchanger is defined as an
|
||||||
selection of cells.
|
energy source using a selection of cells.
|
||||||
|
|
||||||
The total heat exchange source is given by:
|
The total heat exchange source is given by:
|
||||||
\f[
|
\f[
|
||||||
@ -75,13 +75,21 @@ Usage
|
|||||||
|
|
||||||
secondaryMassFlowRate 1.0;
|
secondaryMassFlowRate 1.0;
|
||||||
secondaryInletT 336;
|
secondaryInletT 336;
|
||||||
// primaryInletT 293; // Constrain to this T if present
|
|
||||||
faceZone facesZoneInletOriented;
|
faceZone facesZoneInletOriented;
|
||||||
outOfBounds clamp;
|
outOfBounds clamp;
|
||||||
file "effTable";
|
file "effTable";
|
||||||
|
|
||||||
|
// Optional
|
||||||
|
// primaryInletT 293;
|
||||||
|
// targetQdot 1500;
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
|
Optional entries:
|
||||||
|
- \c primaryInletT : sets the primary inlet temperature. If not set, the
|
||||||
|
flux-averaged temperature is used.
|
||||||
|
- \c targetQdot : target heat rejection
|
||||||
|
|
||||||
The effectiveness table is described in terms of the primary and secondary
|
The effectiveness table is described in terms of the primary and secondary
|
||||||
mass flow rates. For example, the table:
|
mass flow rates. For example, the table:
|
||||||
|
|
||||||
@ -95,7 +103,7 @@ Usage
|
|||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
|
|
||||||
Is specified by the following:
|
is specified by the following:
|
||||||
|
|
||||||
\verbatim
|
\verbatim
|
||||||
(
|
(
|
||||||
@ -121,9 +129,9 @@ Usage
|
|||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
Note
|
Note
|
||||||
- the table with name "file" should have the same units as the
|
- the table with name \c file should have the same units as the
|
||||||
secondary mass flow rate and kg/s for phi
|
secondary mass flow rate and kg/s for phi
|
||||||
- faceZone is the faces at the inlet of the cellzone, it needs to be
|
- \c faceZone is the faces at the inlet of the \c cellzone, it needs to be
|
||||||
created with flip map flags. It is used to integrate the net mass flow
|
created with flip map flags. It is used to integrate the net mass flow
|
||||||
rate into the heat exchanger
|
rate into the heat exchanger
|
||||||
|
|
||||||
@ -133,8 +141,8 @@ SourceFiles
|
|||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef effectivenessHeatExchangerSource_H
|
#ifndef fv_effectivenessHeatExchangerSource_H
|
||||||
#define effectivenessHeatExchangerSource_H
|
#define fv_effectivenessHeatExchangerSource_H
|
||||||
|
|
||||||
#include "cellSetOption.H"
|
#include "cellSetOption.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
@ -172,6 +180,18 @@ protected:
|
|||||||
//- Flag to use a user-specified primary inlet temperature
|
//- Flag to use a user-specified primary inlet temperature
|
||||||
bool userPrimaryInletT_;
|
bool userPrimaryInletT_;
|
||||||
|
|
||||||
|
//- Flag to use target heat rejection
|
||||||
|
bool targetQdotActive_;
|
||||||
|
|
||||||
|
//- Target heat rejection
|
||||||
|
scalar targetQdot_;
|
||||||
|
|
||||||
|
//- Target heat rejection calculation interval
|
||||||
|
label targetQdotCalcInterval_;
|
||||||
|
|
||||||
|
//- Target heat rejection temperature under-relaxation coefficient
|
||||||
|
scalar targetQdotRelax_;
|
||||||
|
|
||||||
//- 2D look up table efficiency = function of primary and secondary
|
//- 2D look up table efficiency = function of primary and secondary
|
||||||
// mass flow rates [kg/s]
|
// mass flow rates [kg/s]
|
||||||
autoPtr<interpolation2DTable<scalar>> eTable_;
|
autoPtr<interpolation2DTable<scalar>> eTable_;
|
||||||
@ -214,7 +234,7 @@ private:
|
|||||||
//- Initialise heat exchanger source model
|
//- Initialise heat exchanger source model
|
||||||
void initialise();
|
void initialise();
|
||||||
|
|
||||||
//- Calculate total area of faceZone accross processors
|
//- Calculate total area of faceZone across processors
|
||||||
void calculateTotalArea(scalar& area);
|
void calculateTotalArea(scalar& area);
|
||||||
|
|
||||||
|
|
||||||
@ -237,8 +257,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~effectivenessHeatExchangerSource()
|
virtual ~effectivenessHeatExchangerSource() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
Reference in New Issue
Block a user