Download presentation
1
Creating a User-Defined Condenser in THERMOFLEX
Thermoflow Inc. Creating a User-Defined Condenser in THERMOFLEX 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.
2
Introduction Thermoflow Inc. 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.
3
Imagine the following scenario….
Thermoflow Inc. 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.
4
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.
5
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.
6
Choose a name for your component here.
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.
7
Choose the dimensions of the icon on the sheet.
Thermoflow Inc. Choose the dimensions of the icon on the sheet. 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.
8
Thermoflow Inc. Stream name: Inlet Steam Stream type: Water/Steam Mass flow: propagates through component Conjugate node: Outlet Condensate Pressure: set by component Priority: high priority pressure dictator Stream name: Outlet CW Stream type: Water/Steam Mass flow: propagates through component Conjugate node: Inlet CW Pressure: propagates through component Stream name: Outlet Condensate Stream type: Water/Steam Mass flow: propagates through component Conjugate node: Inlet Steam Pressure: set by component Priority: high priority pressure dictator Stream name: Inlet CW Stream type: Water/Steam Mass flow: propagates through component Conjugate node: Outlet CW Pressure: propagates through component
9
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.
10
Isolated Outputs are results that your component calculates.
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.
11
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.
12
The Calculation Workbook
Thermoflow Inc. 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.
13
Structure of an Excel Calculation Workbook
Thermoflow Inc. 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. Interrelated Inputs Interrelated Outputs Isolated Inputs Isolated Outputs Global 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.
14
The anatomy of a UDC calculation workbook:
Isolated and interrelated inputs and outputs. Isolated Outputs Isolated Inputs Interrelated Outputs Interrelated Inputs
15
Structure of an Excel Calculation Workbook
Thermoflow Inc. 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. Node #1 Node #2 Node #3 Node #4 In 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.
16
The anatomy of a UDC calculation workbook:
Four sets of node data are highlighted, with a standard format. Node #1 Node #4 Node #2 Node #3
17
The format of node data in Calculation workbook:
Actual flow dictator flag for current model. 0 = network determines flow -1 = inlet node dictates outlet node flow +1 = outlet node dictates inlet node flow 2 = component determines flow directly 1 = the node is an outlet 0 = the node is empty -1 = the node is an inlet Thermoflow Inc. Node Fluid Type: 1 = Gas/Air, 2 = Water/Steam, 3 = Fuel, 4 = Refrigerant, 6 = Brine, 7 = Heat Transfer Fluid Component definition for flow dictator flag. 0 = network determines flow 1 = 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 pressure 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. Component definition for pressure dictator flag. 0 = network determines pressure 1 = pressure propagates to/from a pair of inlet/outlet nodes 2 = component determines pressure directly 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. 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
18
Calculation model Thermoflow Inc. To model the condenser we will maintain two spreadsheets: The TF Data Transfer sheet which interacts with THERMOFLEX. 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.
19
Enthalpy of Saturated Liquid
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: Function A (listed as fn_A): Where: 𝑃 𝑐𝑜𝑛𝑑 is in psia 𝐻 𝑓 𝐵𝑇𝑈 𝑙𝑏 = ln 𝑃 𝑐𝑜𝑛𝑑
20
Relationship between condenser pressure and duty
Thermoflow Inc. To model this relationship we first produce quadratic fits relating pressure and duty at each cooling water temperature. 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 0.0047 1.3981 90 0.0069 1.5987
21
Relationship between condenser pressure and duty
Thermoflow Inc. 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: A = A1*Tcw2 + A2*Tcw + A3 B = B1*Tcw2 + B2*Tcw + B3 C = C1*Tcw2 + C2*Tcw + C3
22
Relationship between condenser pressure and duty
Thermoflow Inc. Combining these elements, we produce a single equation that represents condenser pressure as a function of condenser duty and cooling water inlet temperature: Function B (listed as fn_B): Where: 𝑇 𝑐𝑤 is in degrees Fahrenheit 𝑄 𝑐𝑜𝑛𝑑 is in MMBTU per hour 𝑃𝑟𝑒𝑠𝑠𝑢𝑟𝑒 𝑖𝑛 𝐻𝑔 = − 1∗10 −7 𝑇 𝑐𝑤 ∗10 −5 𝑇 𝑐𝑤 − 𝑄 𝑐𝑜𝑛𝑑 ∗10 −5 𝑇 𝑐𝑤 2 − 𝑇 𝑐𝑤 𝑄 𝑐𝑜𝑛𝑑 + − 𝑇 𝑐𝑤 𝑇 𝑐𝑤 −4.1971
23
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. Different sheet
24
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.
25
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
26
Condenser Surface Area is 17,868 ft2 according to vendor, so this is entered directly into the output field.
27
Additionally, we calculate the pressure drop on the cooling-water side as a function of cooling water mass flow, based on the following relationship: ∆𝑃= 𝑃 𝑟𝑒𝑓 𝑚 𝑐𝑤 𝑚 𝑟𝑒𝑓 2 Formula entered for cooling water side pressure drop: =6.67*(P26/1870)*(P26/1870)
28
With the condenser duty solved for, we calculate the states of the outlet streams.
Formula entered for CW outlet enthalpy: =P27+(L27-N27)*L26/R26 Or, the sum of the inlet enthalpy plus the change in enthalpy. Formula entered for Outlet Condensate enthalpy: =Sheet3!A14 Grabbed from other sheet.
29
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 CW outlet pressure: =P24-H5 Formula entered for Inlet and Outlet Condensate pressures: =Sheet3!A13
30
Close Excel and return to THERMOFLEX to model the component.
31
Thermoflow Inc. After changing the calculation workbook in Excel, be sure to update the workbook by selecting this option.
32
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.
33
Using your UDC in models
Thermoflow Inc. Now we can use the user-defined condenser in a THERMOFLEX model.
34
Thermoflow Inc. Choose My Components in the icon navigator to access your new condenser.
35
Thermoflow Inc. Here is the component in the context of a simple model, with inlet sources and sinks, in Edit Inputs mode.
36
Thermoflow Inc. After computing, we find the model shows the isolated outputs on the component’s output view to the left.
37
Thermoflow Inc. This is a model showing the User-Defined Condenser connected to a steam turbine in off-design mode.
38
Thermoflow Inc. Likewise, the model produces outlet conditions based on the cooling water temperature, and inlet states and mass flows.
39
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.
40
Questions? Thermoflow Inc. Contact us at if you have any questions about the user defined component.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.