© 2024 Jasper van Baten, AmsterCHEM

Example 2: co-current heat exchanger

This example is much like the counter-current heat exchanger example 1. As opposed to the counter-current heat-exchanger, for which all equations are written explicitly, the co-current heat exchanger requires an iterative solution. For this, the Excel Solver Add-in is used.

A cold and hot stream are entering, and a cold and hot stream are leaving the model. The maximum heat duty is given by the temperature for which the heat duty to cool down the cold stream and heat up the hot stream are equal. This temperature must be solved for.

The example will be set up in the COCO simulator, using one of the example thermodynamic property packages.

Step 1: Setting up the flowsheet

First we need to set up a flowsheet. Start the COFE flowsheeting environment. Choose Configure from the Flowsheet menu. On the Property packs page, click Add. Select TEA (CAPE-OPEN 1.1), click OK. Select the package C1_C2 (EOS), click OK. When asked to set this package for the default material, click yes. Close the flowsheet configuration dialog. We have now set up our thermo system.

Step 2: Insert the Excel Unit Operation, and configure the streams

Insert an Excel unit operation: click the Insert Unit Operation button on the toolbar. Select the Excel Unit Operation, click OK. Position the unit operation in the flowsheet using the mouse. Right click the unit operation, click Rename. Enter "My Heat Exchanger", click OK.

Inserting the unit operation

Now, double click the unit operation, click Edit. Excel will open, showing the default, empty, unit operation definition. Go to the feeds worksheet. Change the default feed name in A3 to "Cold inlet". Add another feed in A4 by typing "Hot inlet". Then go to the products page. Change the default product name in A3 to "Cold outlet". Add a second product in A4 by typing "Hot outlet". Close Excel.

The Ports tab on the unit operation dialog will now show our newly created feeds and products:

Ports tab in COFE

Now, double click the unit operation, click Edit. Excel will open, showing the default, empty, unit operation definition. Go to the feeds worksheet. Change the default feed name in A3 to "Cold inlet". Add another feed in A4 by typing "Hot inlet", or by clicking the Add Feed Add Feed button on the Unit Operation ribbon.

Inserting the unit operation

Then go to the products worksheet. Change the default product name in A3 to "Cold outlet". Add a second product in A4 by typing "Hot outlet", or by clicking the Add Product Add Product button on the Unit Operation ribbon. Close Excel.

The Ports tab on the unit operation dialog will now show our newly created feeds and products:

Ports tab in COFE

Step 3: Setting up and connecting the streams

Change the icon of the unit operation to resemble a heat exchanger. Right-click on the unit operation, choose "Select Unit Icon" from the icon menu. In the "Heaters and Coolers" section, select heat_exchanger_3. Click OK.

Define the cold feed. Insert a stream in the COFE flowsheet. Right click the stream, rename to "Cold feed". Connect the product side of the stream to the unit operation. Select "Cold inlet" when asked which port to connect it to. Insert a second stream, name it "Hot feed". Connect it to the unit operation. As there is only one feed port left, you are not asked anymore which port to connect it to. Select the unit operation. Click the Edit Streams button on the toolbar. For the cold feed, enter 1e5 Pa, 300 K, 0.5 mole fraction Methane and a flow of 100 mol/s. For the hot feed, enter 1e5 Pa, 800 K, 0.1 mole fraction Methane, and a flow of 200 mol/s:

Define feed properties

Close the stream dialog. Insert another stream. Rename it to "Cold product" and connect it to the "Cold outlet" port. Insert a 4th stream, rename it to "Hot product" and connect it to the unit operation:

Connected streams

The Ports tab when you double click the unit operation will now show which streams are connected to which port:

Ports tab in COFE

Step 4: Setting up the Excel model equations

On the Edit tab when you double-click the unit operation, click "Edit". Excel will open. Notice how the feeds worksheet now shows the compounds, as well as the feed properties:

Connected streams

The products page shows the compounds as well, but no properties. It is our task to define the product properties.

Let's set up the calculations. Go to the calculations worksheet. Enter the following column headers: T/[K] in B1, f/[mol/s] in C1, h/[j/mol] in D1 and H/[j/s] in E1. In A2, enter =feeds!A3. In B2, enter =feeds!B3. In C2, enter =feeds!E3. In D2, enter =feeds!D3. In E2, enter =C2*D2. Then copy A2:E2 to A3:E3:

Initial setup

Next, the heat required to cool down the hot stream and heat up the cold stream to the same temperature is calculated. The temperature for which these heats are the same, is the limiting temperature.

In A6, enter limiting temperature. In B6, enter 500; this will be our very first initial guess. In A7, enter Cold outlet limit. In B7, enter =B6. In C7, enter =C2. To calculate the heat of the inlet stream at these conditions, place the cursor in D7, and click Overall Property Overall Property on the Unit Operation ribbon. For Composition, click the Pick Pick button, and select composition in the feeds workheet, at feeds!$F$3:$G$3. Click OK. Leave the default "temperature" and "pressure" as the equilibrium conditions. For the value of temperature, click the Pick Pick button, and select B7. Click OK. For the value of pressure, click the Pick Pick button, and select pressure in the feeds workheet, at feeds!$C$3. Click OK. The overall property to calculate is "enthalpy", select it, and click OK:

Insert Enthalpy

Now, D7 reads: =capeOverallProperty("enthalpy","temperature",$B$7,"pressure",feeds!$C$3,feeds!$F$3:$G$3).

Copy E3 to E7 for the total enthalpy.

On to the hot stream. Enter Hot outlet limit in A8. In B8, enter =B6. In C8, enter =C3.

Follow the same procedure as outlined above for the calculation of enthalpy in D8, using the hot stream composition and pressure: =capeOverallProperty("enthalpy","temperature",$B$8,"pressure",feeds!$C$4,feeds!$F$4:$G$4).

Copy E7 to E8 for the total enthalpy:

Enthalpy calculations

In A10, enter Heat duty cold. In E10, enter =E7-E2. In A11, enter Heat duty hot. In E11, enter =E3-E8 (notice that this has the opposite sign). In A12, enter Difference, and in E12, enter =E10-E11. The limiting temperature is that for which the value in E12 is zero.

To calculate the limiting temperature, we will use the Excel solver. At this point, make sure that the Excel solver is available.

Select Solver from the Data ribbon. Set the target cell to E12, and choose equal to a value of zero. In "By changing cells", select B6 (this is the limiting temperature we are solving for):

Setting up the solver

When clicking OK, the model solves, and we see the limiting temperature. Keep the solver solution.

The current solution is only valid at the current feed conditions. The solver must run this scenario each time the unit operation is calculated. Go to a suitable cell to store the solver model, e.g. cell H7. Click the Define Solver Scenario Solver Scenario button on the Unit Operation ribbon. Call the solver scenario TemperatureLimit and click OK:

Solver scenario definition

The solver scenario itself is now defined in cells H7 and below. To clarify, put Solver Scenario in H6.

In addition, the name TemperatureLimit identifies the saved solver scenario range, and this name is added to the control worksheet in the Solver Model section.

Now the heat transferred for the limiting case is known, and will be calculated each time the unit operation itself is calculated. The limiting case heat transfer will be in cells E10 and E11 on the calculations worksheet (these cells will contain the same values at a successful solution).

Step 5: Adding a parameter

An efficiency parameters is created that relates the actual amount of heat transfered to the limiting case. Click on the Add Input Parameter Add Input Parameter button on the Unit Operation ribbon. For the parameter name, specify Efficiency. Enter an initial value of 1, a minimum value 0 and maximum value of 1. This parameter is dimensionless, so do not enter any units of measure. In "Value Range Name" enter "efficiency"; after that this name can be used in Excel formulas:

Go back to the calculations worksheet and calculate the actual amount of heat transferred. In A14, enter "Efficiency". In E14, enter =efficiency. In A15, enter Heat transferred. In E15, enter =E10*E14.

Step 6: Defining the product streams

Define the values of our product streams. For each product composition and flow rate must be specified, plus 2 out of 3 of pressure, temperature and enthalpy.

Pressure, composition and flow can be copied from the feeds. Go to the products worksheet, and in C3 enter =feeds!C3. Now copy C3 to C3:G4. This also copied enthalpy, which must be modified to take into account the heat exchange. D3 now says =feeds!D3, but we need to change this to =feeds!D3+calculations!E15/E3. Similarly, change D4 to =feeds!D4-calculations!E15/E4.

Step 7: Run and verify

The model set up is now complete. Close Excel. The parameter that was added is now shown at the Edit tab of the unit operation dialog:

Parameter table

Close the Edit dialog, and hit Run. The unit is now solved, and the products are defined.

The stream dialog shows that the cold and hot streams exit with the same temperature:

Stream dialog

If you set the cold feed to 500 mol/s, we notice that the resulting temperature is colder:

Stream dialog

If you double click the unit operation, and on the Edit tab change the efficiency value to 0.95, you see that the output streams no longer have the same temperature, as we are not transferring the heat calculated as the limit anymore:

Stream dialog

Step 8: Initial guess

The value that is in B6 after the last solution, will remain in B6 for the next time the unit operation is calculated. So by default, the initial guess results from the last run. This may in many cases be efficient and convenient, but in some cases this might cause convergence trouble.

For the current problem, a reasonable initial guess can be constructed. Under the assumption that the molar heat capacities of the holt and cold stream are nearly independent of temperature, and under the additional assumption that they are reasonably close to each other, the limiting temperature is the mass-flow weighed avarage of the hot and cold stream temperatures.

In the calculations worksheet, at cell A5, type Temperature guess. In B5, type our guess value of =B2+(B3-B2)*C3/(C2+C3).

In order to tell the Excel unit operation which values to copy as initial guess, a name must be defined for the initial guess range, and for the range it needs to be copied to prior to invoking the solver. You can either delete the existing solver scenario, and recreate it specying initial guess source and target ranges directly in the Define Solver Scenario dialog, or manually add them:

Step 8a: Delete and re-create initial scenario

Perform the following steps: Two additional named ranges, TemperatureLimitInitGuessSource and TemperatureLimitInitGuessTarget, are now defined and added to the control worksheet.

Step 8b: Manually adding the initial guess

Define name

For either scenario, each time the unit operation is calculated, the initial guess will be used as specified.

Example inputs

To run the example, you must have COCO Simulator installed. Then, click on the example2.fsd file.

INDEX
add-In
aggregation state
available properties
capeCompoundConstant
capePropertyUnit
capeFlash
capeFlashedFeed
capeOverallFeedProperty
capeOverallProperty
capePDependentProperty
capeSinglePhaseProperty
capeCompoundNames
compound names
unit of measure
capeStateOfAggregation
capeTDependentProperty
capeTwoPhaseProperty
capeUnitOperationName
compound constants
control sheet
defined phases
Disclaimer
equilibrium calculations
examples
Excel solver
Export Model
feeds
flash calculations
getting started
Import Model
input parameters
Loading and storing models
macros
output parameters
overall properties
parameters
ports
pressure dependent properties
products
property calculations
quick reference
reports
requirements
run-time error
security
single phase properties
solver
state of aggregation
streams
temperature dependent properties
thermodynamic equilibrium calculations
thermodynamic property calculations
two-phase properties
unit operation name
Update links
validation
VBA
welcome
CONTENT
 Introduction
 Ports and streams
 Parameters
 Function reference
 The control sheet
 Using the Excel solver
 Using Macros
 Loading and storing models
 Persistence in AspenPlus
 Examples
 Example 1: counter current heat exchanger
 Example 2: co-current heat exchanger
 Disclaimer