effectivenessTable Class Reference

A heat exchanger model where heat exchange is calculated via an effectiveness table. More...

Inheritance diagram for effectivenessTable:
Collaboration diagram for effectivenessTable:

Public Member Functions

 TypeName ("effectivenessTable")
 Runtime type information. More...
 
 effectivenessTable (const fvMesh &mesh, const word &name, const dictionary &coeffs)
 Construct from components. More...
 
 effectivenessTable (const effectivenessTable &)=delete
 No copy construct. More...
 
void operator= (const effectivenessTable &)=delete
 No copy assignment. More...
 
virtual ~effectivenessTable ()=default
 Destructor. More...
 
virtual void initialise ()
 Initialise data members of the model. More...
 
virtual tmp< scalarFieldenergyDensity (const labelList &cells)
 Return energy density per unit length [J/m3/m]. More...
 
virtual bool read (const dictionary &dict)
 Read top-level dictionary. More...
 
virtual void write (const bool log)
 Write data to stream and files. More...
 
- Public Member Functions inherited from heatExchangerModel
 TypeName ("heatExchangerModel")
 Runtime type information. More...
 
 declareRunTimeSelectionTable (autoPtr, heatExchangerModel, dictionary,(const fvMesh &mesh, const word &name, const dictionary &coeffs),(mesh, name, coeffs))
 
 heatExchangerModel (const fvMesh &mesh, const word &name, const dictionary &coeffs)
 Construct from components. More...
 
 heatExchangerModel (const heatExchangerModel &)=delete
 No copy construct. More...
 
void operator= (const heatExchangerModel &)=delete
 No copy assignment. More...
 
virtual ~heatExchangerModel ()=default
 Destructor. More...
 
virtual const wordU () const
 Return const reference to the name of velocity field. More...
 
- Public Member Functions inherited from writeFile
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true)
 Construct from objectRegistry, prefix, fileName. More...
 
 writeFile (const objectRegistry &obr, const fileName &prefix, const word &name, const dictionary &dict, const bool writeToFile=true)
 Construct from objectRegistry, prefix, fileName and read options from dictionary. More...
 
 writeFile (const writeFile &wf)
 Construct copy. More...
 
virtual ~writeFile ()=default
 Destructor. More...
 
virtual OFstreamfile ()
 Return access to the file (if only 1) More...
 
virtual bool writeToFile () const
 Flag to allow writing to file. More...
 
virtual bool canWriteToFile () const
 Flag to allow writing to the file. More...
 
virtual bool canResetFile () const
 Flag to allow resetting the file. More...
 
virtual bool canWriteHeader () const
 Flag to allow writing the header. More...
 
virtual label charWidth () const
 Return width of character stream output. More...
 
virtual void writeCommented (Ostream &os, const string &str) const
 Write a commented string to stream. More...
 
virtual void writeTabbed (Ostream &os, const string &str) const
 Write a tabbed string to stream. More...
 
virtual void writeHeader (Ostream &os, const string &str) const
 Write a commented header to stream. More...
 
virtual void writeCurrentTime (Ostream &os) const
 Write the current time to stream. More...
 
virtual void writeBreak (Ostream &os) const
 Write a break marker to the stream. More...
 
template<class Type >
void writeHeaderValue (Ostream &os, const string &property, const Type &value) const
 Write a (commented) header property and value pair. More...
 
template<class Type >
void writeValue (Ostream &os, const Type &val) const
 Write a given value to stream with the space delimiter. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from heatExchangerModel
static autoPtr< heatExchangerModelNew (const fvMesh &mesh, const word &name, const dictionary &coeffs)
 Return a reference to the selected heat exchanger model. More...
 
- Static Public Attributes inherited from writeFile
static label addChars = 8
 Additional characters for writing. More...
 
- Protected Member Functions inherited from writeFile
void initStream (Ostream &os) const
 Initialise the output stream for writing. More...
 
fileName baseFileDir () const
 Return the base directory for output. More...
 
fileName baseTimeDir () const
 Return the base directory for the current time value. More...
 
fileName filePath (const fileName &fName) const
 Return the full path for the supplied file name. More...
 
virtual autoPtr< OFstreamnewFile (const fileName &fName) const
 Return autoPtr to a new file using file name. More...
 
virtual autoPtr< OFstreamnewFileAtTime (const word &name, scalar timeValue) const
 Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamnewFileAtStartTime (const word &name) const
 Return autoPtr to a new file using the simulation start time. More...
 
virtual void resetFile (const word &name)
 Reset internal file pointer to new file with new name. More...
 
Omanip< int > valueWidth (const label offset=0) const
 Return the value width when writing to stream with optional offset. More...
 
void operator= (const writeFile &)=delete
 No copy assignment. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name, scalar timeValue) const
 Deprecated(2022-09) Return autoPtr to a new file for a given time. More...
 
virtual autoPtr< OFstreamcreateFile (const word &name) const
 Deprecated(2022-09) Return autoPtr to a new file using the simulation start time. More...
 
- Protected Attributes inherited from heatExchangerModel
const fvMeshmesh_
 Reference to the mesh. More...
 
const dictionarycoeffs_
 Dictionary containing coefficients specific to the chosen model. More...
 
const wordname_
 Reference to the name of the fvOption source. More...
 
word UName_
 Name of operand velocity field. More...
 
word TName_
 Name of operand temperature field. More...
 
word phiName_
 Name of operand flux field. More...
 
word faceZoneName_
 Name of the faceZone at the heat exchanger inlet. More...
 
labelList faceId_
 Local list of face IDs. More...
 
labelList facePatchId_
 Local list of patch IDs per face. More...
 
labelList faceSign_
 List of +1/-1 representing face flip map (1 use as is, -1 negate) More...
 
- Protected Attributes inherited from writeFile
const objectRegistryfileObr_
 Reference to the region objectRegistry. More...
 
const fileName prefix_
 Prefix. More...
 
word fileName_
 Name of file. More...
 
autoPtr< OFstreamfilePtr_
 File pointer. More...
 
label writePrecision_
 Write precision. More...
 
bool writeToFile_
 Flag to enable/disable writing to file. More...
 
bool updateHeader_
 Flag to update the header, e.g. on mesh changes. Default is true. More...
 
bool writtenHeader_
 Flag to identify whether the header has been written. More...
 
bool useUserTime_
 Flag to use the specified user time, e.g. CA deg instead of seconds. Default = true. More...
 
scalar startTime_
 Start time value. More...
 

Detailed Description

A heat exchanger model where heat exchange is calculated via an effectiveness table.

The total heat exchange source is given by:

\[ Q_t = e(\phi, \dot{m}_2) (T_2 - T_1) \phi C_p \]

where:

$ Q_t $ = Total heat exchange source [J/s]
$ e(\phi,\dot{m}_2) $ = Effectivenes table [-]
$ \phi $ = Net mass flux entering heat exchanger [kg/s]
$ \dot{m}_2 $ = Secondary flow mass flow rate [kg/s]
$ T_1 $ = Primary flow inlet temperature [K]
$ T_2 $ = Secondary flow inlet temperature [K]
$ C_p $ = Primary flow specific heat capacity [J/kg/K]

The distribution inside the heat exchanger is given by:

\[ Q_c = \frac{V_c |U_c| (T_c - T_{ref})}{\sum(V_c |U_c| (T_c - T_{ref}))} \]

where:

$ Q_c $ = Source for cell
$ V_c $ = Volume of the cell [m^3]
$ U_c $ = Local cell velocity [m/s]
$ T_c $ = Local cell temperature [K]
$ T_{ref} $ = Min or max(T) in cell zone depending on the sign of Qt [K]
Usage
Minimal example by using constant/fvOptions:
<name>
{
    // Inherited entries
    ...

    // Mandatory entries
    model                    effectivenessTable;
    secondaryMassFlowRate    <scalar>;
    secondaryInletT          <scalar>;
    file                     "<word>";
    outOfBounds              <word>;

    // Conditional optional entries

        // when the total heat exchange is calculated with primary inlet T
        primaryInletT           <scalar>;

        // when the total heat exchange is calculated with a given target
        targetQdot              <scalar>;
        targetQdotCalcInterval  <label>;
        targetQdotRelax         <scalar>;

        // when secondary outlet temperature is requested
        secondaryCp             <Function1<scalar>>;
}

where the entries mean:

Property Description Type Reqd Deflt
model Model name:effectivenessTable word yes -
secondaryMassFlowRate Secondary flow mass rate [kg/s] scalar yes -
secondaryInletT Secondary flow inlet temperature [K] scalar yes -
file 2D effectiveness table = function of primary and secondary mass flow rates [kg/s] file yes -
primaryInletT Primary flow temperature at the heat exchanger inlet scalar no -
targetQdot Target heat rejection scalar no -
targetQdotCalcInterval Target heat rejection calculation interval label no -
targetQdotRelax Target heat rejection temperature under-relaxation coefficient scalar no -
secondaryCp Secondary flow specific heat capacity Function1<scalar> no -

The inherited entries are elaborated in:

The effectiveness table is described in terms of the primary and secondary mass flow rates. For example, the table:

                           secondary MFR
                       |  0.1   0.2   0.3
                  -----+-----------------
                  0.02 |   A     B     C
     primary MFR  0.04 |   D     E     F
                  0.06 |   G     H     I

is specified by the following:

        (
            (
                0.02
                (
                    (0.1    A)
                    (0.2    B)
                    (0.3    C)
                )
            )
            (
                0.04
                (
                    (0.1    D)
                    (0.2    E)
                    (0.3    F)
                )
            )
            (
                0.06
                (
                    (0.1    G)
                    (0.2    H)
                    (0.3    I)
                )
            )
        );
Note
  • Primary flow indicates the CFD flow region and secondary flow the non-CFD-model region.
  • The table with name file should have the same units as the secondary mass flow rate and kg/s for phi.
  • faceZone is the faces at the inlet of the cellZone, it needs to be created with flip map flags. It is used to integrate the net mass flow rate into the heat exchanger.
  • primaryInletT sets the primary inlet temperature. If not set, the flux-averaged temperature is used.
Source files

Definition at line 312 of file effectivenessTable.H.

Constructor & Destructor Documentation

◆ effectivenessTable() [1/2]

effectivenessTable ( const fvMesh mesh,
const word name,
const dictionary coeffs 
)

Construct from components.

Definition at line 70 of file effectivenessTable.C.

◆ effectivenessTable() [2/2]

effectivenessTable ( const effectivenessTable )
delete

No copy construct.

◆ ~effectivenessTable()

virtual ~effectivenessTable ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "effectivenessTable"  )

Runtime type information.

◆ operator=()

void operator= ( const effectivenessTable )
delete

No copy assignment.

◆ initialise()

void initialise ( )
virtual

Initialise data members of the model.

Reimplemented from heatExchangerModel.

Definition at line 107 of file effectivenessTable.C.

References heatExchangerModel::initialise().

Here is the call graph for this function:

◆ energyDensity()

Foam::tmp< Foam::scalarField > energyDensity ( const labelList cells)
virtual

◆ read()

bool read ( const dictionary dict)
virtual

Read top-level dictionary.

Implements heatExchangerModel.

Definition at line 225 of file effectivenessTable.C.

References Foam::decrIndent(), dict, Foam::endl(), Foam::incrIndent(), Foam::indent(), Foam::Info, Foam::nl, Foam::blockMeshTools::read(), and Foam::type().

Here is the call graph for this function:

◆ write()

void write ( const bool  log)
virtual

Write data to stream and files.

Implements heatExchangerModel.

Definition at line 285 of file effectivenessTable.C.

References Foam::decrIndent(), Foam::endl(), Foam::incrIndent(), Foam::indent(), Foam::Info, Foam::log(), UPstream::master(), Foam::nl, os(), Foam::tab, and Foam::type().

Here is the call graph for this function:

The documentation for this class was generated from the following files: