creating a user-defined condenser in thermoflex thermoflow inc. thermoflow, thermoflex, and the...
TRANSCRIPT
Creating a User-Defined Condenser in
THERMOFLEX
Thermoflow Inc.
Thermoflow, THERMOFLEX, and the Thermoflow logo are registered trademarks of Thermoflow Inc. Any unauthorized use or reproduction of these trademarks, written or symbolic, is strictly prohibited.
Introduction
• THERMOFLEX contains 300 components. These can be used to cover virtually any application.• However, in case the need arises, the framework exists to create your
own THERMOFLEX component.
Thermoflow Inc.
Imagine the following scenario….
• You wish to model a vendor’s condenser in THERMOFLEX.• The vendor has supplied you
with performance curves, relating condenser pressure to condenser duty at six different cooling water inlet temperatures.
0 50 100 150 2000.000
0.500
1.000
1.500
2.000
2.500
3.000
3.500
4.000
4.500
5.000
Condenser Performance Curves
Temp@ 65°F
Polynomial (Temp@ 65°F)
Temp@ 70°F
Polynomial (Temp@ 70°F)
Temp@ 75°F
Polynomial (Temp@ 75°F)
Temp@ 80°F
Polynomial (Temp@ 80°F)
Temp@ 85°F
Polynomial (Temp@ 85°F)
Temp@ 90°F
Polynomial (Temp@ 90°F)
Condenser Duty, MMBTU/hr
Cond
ense
r Pre
ssur
e, in
ches
Hg
Thermoflow Inc.
Thermoflow Inc.
To edit User-Defined Components, start THERMOFLEX and select this menu item. The User-Defined Component option will be enabled in any of THERMOFLEX’s modes of operation. However, the user must have the UDC program enabled on their key. Otherwise this selection will be grayed out at all times.
Thermoflow Inc.
These tabs allow you to navigate the User-Defined Component creation process. We will start with Icon & Connections, then address Isolated Inputs and Isolated Outputs.
Thermoflow Inc.
Choose a name for your component here.
Right-click on this gray area to select a custom visage for your component. Picture must be in .WMF format.
Thermoflow Inc.
Right-click on the node slots where you wish to create a node, and select Add Inlet Stream or Add Outlet Stream. We will put inlets on the green nodes and outlets on the orange nodes.
Choose the dimensions of the icon on the sheet.
Thermoflow Inc.
Stream name: Inlet CWStream type: Water/SteamMass flow: propagates through componentConjugate node: Outlet CWPressure: propagates through componentConjugate node: Outlet CW
Stream name: Outlet CWStream type: Water/SteamMass flow: propagates through componentConjugate node: Inlet CWPressure: propagates through componentConjugate node: Inlet CW
Stream name: Outlet CondensateStream type: Water/SteamMass flow: propagates through componentConjugate node: Inlet SteamPressure: set by componentPriority: high priority pressure dictator
Stream name: Inlet SteamStream type: Water/SteamMass flow: propagates through componentConjugate node: Outlet CondensatePressure: set by componentPriority: high priority pressure dictator
Thermoflow Inc.
Choose the number of isolated inputs here.
Isolated Inputs are component parameters that you will set in Edit Inputs mode. Each input has an associated set of units which you will select.Enter a name for the input in the Input column. Select a default numerical value for the parameter in the Value column. Right click on the Units Selection column to choose the units the parameter is measured in.
We choose:• Water Head to Condensate Outlet, to calculate pressure rise on condensing side that
is due to hydrostatic pressure.• Working/Out of Service, a switch to take the condenser off-line for maintenance.
Thermoflow Inc.
Choose the number of isolated outputs here.
Isolated Outputs are results that your component calculates.Enter a name for the output in the Output column. Select a default numerical value for the parameter in the Value column. Right click on the Units Selection column to choose the units the parameter is measured in.
We choose:• Condenser Duty.• Condenser Surface Area, which was provided to us by the vendor.• Cooling Water Side Pressure Drop, which we calculate from vendor’s reference value
scaled with the square of CW flow rate.
Thermoflow Inc.
You may embed the calculations for your component in either an Excel workbook or in an executable. We will demonstrate how to do it using Excel.
Click here to create an Excel workbook containing the code for the condenser.
The Calculation Workbook
• When you create a THERMOFLEX calculation workbook, it contains a sheet called TF Data Transfer that interacts with the model. Data in this sheet is organized in a standard format.
Thermoflow Inc.
Structure of an Excel Calculation Workbook• Based on your definitions when you defined your icon, THERMOFLEX
will populate the first 8 columns of the active worksheet with the following information:
• There will be a column with the name of the parameter, and a column containing its default value.
Thermoflow Inc.
Interrelated Inputs Interrelated Outputs Isolated Inputs Isolated OutputsGlobal inputs passed from TFX to the component. Examples are ambient conditions and grid frequency. Do not change these values.
Outputs from your component which are passed to and used by the rest of the TFX model. These are in addition to any stream parameters determined by the component and passed to the TFX network via its nodes.
Inputs specific to your component.
Outputs from your component to display on its own outputs, but not passed to the rest of the TFX model.
The anatomy of a UDC calculation workbook:Isolated and interrelated inputs and outputs.
Interrelated Inputs
Interrelated Outputs
Isolated Inputs
Isolated Outputs
Structure of an Excel Calculation Workbook• Additionally, the TF data transfer sheet will automatically create a pair of
columns for each node, with the first column of this pair showing the stream descriptors, and the second column showing corresponding numerical values.
• You may have up to 40 nodes for your component. Excel has columns for all 40 and will hide the empty ones you do not use.
Thermoflow Inc.
Node #1 Node #2 Node #3 Node #4In our model, this is the Steam Inlet.
In our model, this is the Condensate Outlet.
In our model, this is the CW Inlet.
In our model, this is the CW Outlet.
The cells underneath each node describe its conditions and behavior.
Node #4
Node #2
Node #1
Node #3
The anatomy of a UDC calculation workbook:Four sets of node data are highlighted, with a standard format.
1 = the node is an outlet0 = the node is empty-1 = the node is an inlet
Node Fluid Type:1 = Gas/Air, 2 = Water/Steam, 3 = Fuel,4 = Refrigerant, 6 = Brine, 7 = Heat Transfer Fluid
Actual flow dictator flag for current model.0 = network determines flow-1 = inlet node dictates outlet node flow+1 = outlet node dictates inlet node flow2 = component determines flow directly
Component definition for flow dictator flag.0 = network determines flow1 = flow propagates to/from a pair of inlet/outlet nodes 2 = component determines flow directly
Actual pressure dictator flag for current model.0 = network determines pressure-1 = inlet node dictates outlet node pressure+1 = outlet node dictates inlet node pressure2 = component determines pressure directly
Component definition for pressure dictator flag.0 = network determines pressure1 = pressure propagates to/from a pair of inlet/outlet nodes 2 = component determines pressure directly
Node to which current node’s flow propagates if Component Definition for Flow Dictator Flag is 1.
Flow priority between 1 and 100 if component determines flow. Lower is higher priority.
Node to which current node’s pressure propagates if Component Definition for Pressure Dictator Flag is 1.
Pressure priority between 1 and 100 if component determines pressure. Lower is higher priority.
Thermodynamic properties at node
The format of node data in Calculation workbook:This is a breakdown of the cells that represent a node in the worksheet. This is Node #3 in our workbook.
Thermoflow Inc.
Calculation model
To model the condenser we will maintain two spreadsheets:1. The TF Data Transfer sheet which interacts with THERMOFLEX.2. Separate calculation sheet which takes stream data, determines the
condenser pressure, and returns it to the TF Data Transfer sheet. To solve for condenser pressure we will also need to define two relationships:
Enthalpy of Saturated Liquid as a function of pressure.Mathematical expression for the vendor-supplied curves which relate
condenser pressure to duty and inlet CW temperature.
Thermoflow Inc.
We derived a curve fit via Excel for enthalpy of saturated water as a function of pressure within the range of parameters of interest:
Enthalpy of Saturated Liquid
0.25 1.25 2.25 3.25 4.25 5.25 6.25 7.250
20
40
60
80
100
120
140
160
Enthalpy of Saturated Liquid vs. Pressure
Pressure (psia)
Enth
alpy
(BTU
/lb)
Thermoflow Inc.
Function A (listed as fn_A):
Where:• is in psia
𝐻 𝑓 (𝐵𝑇𝑈𝑙𝑏 )=37.372 ln 𝑃𝑐𝑜𝑛𝑑+71.355
Relationship betweencondenser pressure and duty
To model this relationship we first produce quadratic fits relating pressure and duty at each cooling water temperature.
0 50 100 150 2000.000
0.500
1.000
1.500
2.000
2.500
3.000
3.500
4.000
4.500
5.000
Condenser Performance Curves
Temp@ 65°F
Polynomial (Temp@ 65°F)
Temp@ 70°F
Polynomial (Temp@ 70°F)
Temp@ 75°F
Polynomial (Temp@ 75°F)
Temp@ 80°F
Polynomial (Temp@ 80°F)
Temp@ 85°F
Polynomial (Temp@ 85°F)
Temp@ 90°F
Polynomial (Temp@ 90°F)
Condenser Duty, MMBTU/hr
Cond
ense
r Pre
ssur
e, in
ches
Hg
Thermoflow Inc.
Pcond= A*Qcond2 + B*Qcond + C
Where the constants equal…
CW Temp A B C
65 1.00E-05 0.007 0.4962
70 2.00E-05 0.0056 0.7463
75 4.00E-05 0.004 0.9959
80 5.00E-05 0.0029 1.1971
85 5.00E-05 0.0047 1.3981
90 4.00E-05 0.0069 1.5987
Relationship betweencondenser pressure and duty
We find that the coefficients in our five quadratic fits (the lines shown to the left) can be approximated as a function of inlet cooling water temperature, as follows:
0 50 100 150 2000.000
0.500
1.000
1.500
2.000
2.500
3.000
3.500
4.000
4.500
5.000
Condenser Performance Curves
Temp@ 65°F
Polynomial (Temp@ 65°F)
Temp@ 70°F
Polynomial (Temp@ 70°F)
Temp@ 75°F
Polynomial (Temp@ 75°F)
Temp@ 80°F
Polynomial (Temp@ 80°F)
Temp@ 85°F
Polynomial (Temp@ 85°F)
Temp@ 90°F
Polynomial (Temp@ 90°F)
Condenser Duty, MMBTU/hr
Cond
ense
r Pre
ssur
e, in
ches
Hg
Thermoflow Inc.
A = A1*Tcw2 + A2*Tcw + A3
B = B1*Tcw2 + B2*Tcw + B3
C = C1*Tcw2 + C2*Tcw + C3
Relationship betweencondenser pressure and dutyCombining these elements, we produce a single equation that represents condenser pressure as a function of condenser duty and cooling water inlet temperature:
Thermoflow Inc.
Function B (listed as fn_B):
Where:• is in degrees Fahrenheit• is in MMBTU per hour
𝑃𝑟𝑒𝑠𝑠𝑢𝑟𝑒 (𝑖𝑛𝐻𝑔 )=[−1∗10− 7𝑇𝑐𝑤2+2∗10−5𝑇 𝑐𝑤− .0008 ]𝑄𝑐𝑜𝑛𝑑
2+[2∗10− 5𝑇 𝑐𝑤2− .0035𝑇 𝑐𝑤+.141 ]𝑄𝑐𝑜𝑛𝑑+[− .0003𝑇 𝑐𝑤
2+.0927𝑇 𝑐𝑤−4.1971 ]
Different sheet
To solve for condenser pressure, we use an iterative approach embedded in a different Excel sheet. Starting with an assumed pressure, we first find the duty from the inlet steam enthalpy (imposed by the TFX network) and exit condensate enthalpy (which we calculate from saturation pressure), then we enter the vendor’s curves (which we expressed as an equation) with this duty and find the corresponding pressure, then repeat. This converges quickly as shown below. We repeat this correction five times, to ensure convergence. .
Where…
• Fn_A is the function for the enthalpy of saturated liquid (derived from NIST data).
• Fn_B is the function for condenser pressure as a function of duty that we received from the vendor.
These values are the taken from the node data in the TF Data Transfer sheet. Because our relationship between cooling water inlet temperature, pressure, and duty is valid for temperatures from 65°F to 90°F, we insert a logical statement that cuts this value off at 65 if too low or 90 if too high.
With the condenser pressure and duty determined on the other sheet, the TF Data Transfer sheet extracts their values. IF statements tests to determine if condenser is online.
Condenser duty: grabbed from other sheet=IF(F5=1, Sheet3!A12*0.0036, 0)Condenser pressure: grabbed from
other sheet=Sheet3!A13/2.032
Condenser Surface Area is 17,868 ft2 according to vendor, so this is entered directly into the output field.
Additionally, we calculate the pressure drop on the cooling-water side as a function of cooling water mass flow, based on the following relationship:
Formula entered for cooling water side pressure drop:=6.67*(P26/1870)*(P26/1870)
∆ 𝑃=𝑃𝑟𝑒𝑓 (𝑚𝑐𝑤
𝑚𝑟𝑒𝑓)2
With the condenser duty solved for, we calculate the states of the outlet streams.
Formula entered for Outlet Condensate enthalpy:=Sheet3!A14Grabbed from other sheet.
Formula entered for CW outlet enthalpy:=P27+(L27-N27)*L26/R26Or, the sum of the inlet enthalpy plus the change in enthalpy.
To fully specify the outlet states we indicate the pressures of the outlet streams based on the physical information provided, and define the inlet steam pressure.
Formula entered for Inlet and Outlet Condensate pressures:=Sheet3!A13
Formula entered for CW outlet pressure:=P24-H5
Close Excel and return to THERMOFLEX to model the component.
Thermoflow Inc.
After changing the calculation workbook in Excel, be sure to update the workbook by selecting this option.
Thermoflow Inc.
When you are done defining your component, save it as a .myc file in the C:\TFLOW24\MyComponents directory to start using it.
Using your UDC in models
• Now we can use the user-defined condenser in a THERMOFLEX model.
Thermoflow Inc.
Thermoflow Inc.
Choose My Components in the icon navigator to access your new condenser.
Thermoflow Inc.
Here is the component in the context of a simple model, with inlet sources and sinks, in Edit Inputs mode.
Thermoflow Inc.
After computing, we find the model shows the isolated outputs on the component’s output view to the left.
Thermoflow Inc.
This is a model showing the User-Defined Condenser connected to a steam turbine in off-design mode.
Thermoflow Inc.
Likewise, the model produces outlet conditions based on the cooling water temperature, and inlet states and mass flows.
Thermoflow Inc.
Alternative Component Modeling Approach: Instead of using Excel, a user can embed the component calculation in an .exe, provided the calculation routine stores data in appropriately named structures. Contact us if you would like further information about this process.
Questions?
• Contact us at [email protected] if you have any questions about the user defined component.
Thermoflow Inc.