Flownex has a pretty neat utility to capture geometry from a scale drawing and apply those inputs automatically to your flow network. In todays tip we’ll go over a simple example of how to implement this. We are using Flownex Version 18.104.22.16872
Adding a Scale Image
To apply a scaled image in our Flownex network we will want to navigate to the Scaled Drawings ribbon. Here we can click on Generate Scale Drawing and import our desired image. For this demo I’m using a waterblock idea I sketched up a long time ago to try to fix the overheating issue I was having with my Xbox 360.
Applying Dimensions to Network Components
We’ll notice that some dimensions are automatically associated with our new drawing. For instance, if we put some pipe components in to represent the flow paths we can see that the lengths are automatically updated. I know that these finned sections were about 90mm long so this checks out with what the scaled drawing is using.
We also have the option of associating dimensions with line segments we draw on the canvas. Since the cross-section of this flow path is rectangular perhaps a “duct” component would be better suited so that we can capitalize on the geometry association:
Other Useful Scale Tools
There are a few useful measurements we can do using the scale drawings utility that I didn’t highlight in this demo. Point measurements and Link Points can be extremely useful in a variety of scenarios; A couple of examples might be to define connection points on rotor cavities or elevations of connections to some type of container.
If your CAD is evolving we can swap out that image and then updating the measurements in our flow network is as simple as moving the components back into their correct places; Inputs update automatically!
The Flownex team has just released Flownex SE 8.12.8, also known as 2021- Update 1. This release added new components, additional flexibility, additional improvements to user-friendliness, and bug fixes. There is a lot to unpack, and the best way to know all the details is to dig into the Release Notes. If you don’t have time for that, below are the nine enhancements that PADT’s engineers feel are the most noteworthy.
Velocity Based PID controller in the Distributed Control System
The new velocity based PID controller calculates the change in output variables, rather than an output itself. This enables multiple controllers to control the same variable without causing spikes in the output.
Steady state operations are now part of DCS components
DCS components can propagate their inputs into the model before, during, or after a steady state solution has been computed. This allows the user to decide if the DCS component initializes the steady state solution, calculate values for each timestep during the solution, or after the steady state solution has been completed. Be default, before is used.
Component Selection now has a search feature
The same controls that are in Flownex’s “Find” dialog are now in the Component Selection dialog. Multiple filters and options are available to make it easy to select components in models.
Added humid air fluid functions to Material Scripts
Psychrometric fluid functions have been added to the Material Scripts to enable the calculation of mixture mass fractions for three input combinations:
Pressure, dry bulb temperature, and relative humidity
Pressure, dry bulb temperature, and wet bulb temperature
A new option to select between Conduction Shape Factors and Effective Area for the composite conductivity element
This one is pretty straightforward. A drop down in the Composite Conductivity dialog, under “Geometry”, lets the user specify which method they want for calculation conduction.
The installation verification tool now support several instances of Flownex in parallel
Users can now make sure that their installation is running parallel instances correctly with this new option. By default, it will run half the number of available logical processors, or the user can change the number in the tools user interface.
The Reactor Builder script has been greatly enhanced
User input has been combined to make multiple changes to the script that builds reactors. The enhancements are very specific to nuclear reactors and not only allow for more accurate models, but also a smoother process. If you use this feature, make sure you check the release notes.
Changes have been made to the runtime neutronics script
Another area that should excite (is that a pun?) those who model nuclear reactors are the user-driven changes to the script that models neutron behavior in reactors. These are fairly significant and a must-read for anyone who uses this feature.
Ability to select all components in a flow circuit on the drawing canvas
Users can now right-mouse-button on a component in their model and select all the components that are in the same flow circuit. Not only are they selected, but any common properties are shown in the properties grid.
And, much more
There were also a few bug fixes, especially in the flow solver components, so if you were dealing with an issue check the release notes or contact PADT to see if your problem has been resolved.
These were the changes that we think most users would be interested in knowing about. Check out the release notes to see all of them and, as always, don’t hesitate to reach out if you have any questions or don’t see something you need.
Scripts can be very powerful additions to our network building toolbox. But we don’t need to have a degree in computer science to use them! The quick script makes integrating scripts into our network quite simple. In this tip we’ll go over how to set up a quick script in Flownex version 22.214.171.12434
In this demo I’m going to model a small pipe that is horizontal and perpendicular to the flow of a much large duct. We’re going to use a script to utilize our own correlation for determining the convection heat transfer.
What I’d like to accomplish is to apply the Churchill-Bernstein correlation for cylinder in a cross-flow to calculated the Nusselt number and in turn the convection coefficient.
To build this network I’m just going to use a couple of pipe components and a composite heat transfer component. I’m assuming the cross-sectional area of the larger duct is not so impacted by the presence of the cross-pipe that we need to calculate any losses associated with it.
Quick scripts are located in the components pane near the bottom. To add a quick script we’ll simply drag and drop the script onto the canvas. Notice the inputs available for the quick script, we get to choose when it executes, and then we’ll notice that there are some example inputs and results. Since this script is going to be used to apply a correlation during the solve we’ll want this script to execute during steady state.
To edit the script we’ll need to double click on the quick script component. Then we’ll need to define our inputs and results. In this case we’ve got quite a few inputs and results to define.
The most challenging part, in my opinion, is simply getting the correct syntax for C#. Luckily there are a myriad of resources online for C# syntax which makes things a bit easier. In the below image I’ve added the mathematical operations to calculate Re_D and Nu_D using the Churchill and Bernstein correlation.
Connecting Script to Components
We’ll connect the script to our components using data transfer links. We’ll need to populate our script inputs with results from our network and then update the heat transfer input using the results from our script.
Once we’ve connected all of the data transfer links with the appropriate properties we ought to be able to solve!
Today’s tech tip will be short and sweet. We’re going to go over how to do a real-time plot in Flownex. In this example we’re using Flownex version 126.96.36.19934
Adding a Time Dependent Graph
For a time dependent graph we will choose the Line Graph under the Visualization library on the Components pane. We can drag and drop the variables we’d like to see plotted here. I’m going to look at the pump speed (rpm), the valve fraction open, and the mass flow through our network.
On the graph properties we’ll likely want multiple Y-axis enabled so that the changes are easily seen as a function of time.
To have our transient analysis solve in real-time we will need to go to the Solver Ribbon and click on Scheduler to access our transient settings. Here we can change the Running Speed to “Realtime”.
Now when we run our analysis we will get real-time response! This comes in super handy when building human machine interfaces in Flownex for testing operations, when we want to observe response of controls systems, or observing start-up/shut-down type scenarios.
It’s Friday and time for the 13th Tech tip! Today we are going to go over some simple parameter sheet tricks and best practices. Parameter sheets are incredibly useful for running many different design or operation analyses. Let’s go over how best to utilize their functionality. In this example we’re working in Flownex version 188.8.131.5234
Parameter Sheet Setup
Probably the most critical thing to know when working with Parameter Sheets in Flownex is to make our edits through the setup interface. This is where we define the connection between Flownex and the worksheet.
As we recall, adding either inputs or results to our parameter sheet is as simple as dragging and dropping them into the different columns.
Renaming Parameter Columns
We may find that we’d like a more descriptive name of an input or result parameter than simply “Pressure” or “Temperature”. We can rename the columns and this must be done via the parameter table setup. If we were to change the name in the worksheet it will be overwritten by the setup when the model is solved.
We may decide after creating a parameter table that we need to go back in and add a new column between existing input or result parameters. This should be done, again, through the setup. We will add our new parameter to the first open column and then move it within the setup.
*Important Note: Cell references in Excel are explicit in parameter sheets. If we are performing calculations in the parameter sheet using cell references and we rearrange columns these formulas will need to be updated.
Sizing Pumps and Manually Specifying a Pump Curve in Flownex
As a System Engineer you may not always already have equipment decided on for your particular network. Flownex makes it easy to start from scratch and will help determine the equipment necessary to meet the flow or process requirements. In today’s tip we’ll go over how to size a pump using the basic centrifugal pump component and how to manually enter pump curve data. We are using Flownex version 184.108.40.20634
Sizing a Pump
In our example scenario let us pretend we are sizing a pump for a cooling water circuit. We are tasked with finding a pump which will deliver water at a rate of 1 kg/s to the heat exchanger. We know our upstream and downstream boundary conditions as well as the heat added at the exchanger and the speed at which we will be operating the pump.
Choose the appropriate flow component
There are a few different pumps available in Flownex:
Basic Centrifugal Pump: Used when we do not have a pump chart available, particularly useful when sizing a pump.
Fan or Pump: Used when a pump chart is available for modeling either compressible or incompressible flows.
Positive Displacement Pump: Used for modeling rotary and reciprocating pumps where the fluid is incompressible, non-Newtonian, or a slurry.
Variable Speed Pump: Similar to the Fan or Pump but with the ability to interpolate between fan/pump curves for different speeds of rotation.
In this case we’d choose the Basic Centrifugal Pump. This is found in the component pane under Turbos and Pumps. Since we only know the RPM we can enter it in the inputs under Speed at BEP:
Recall we don’t know what the design of the pump will be. Since all we know is that the mass flow rate needs to be 1 kg/s we will check the box for fixed mass flow and then select to change design to target our desired flowrate.
Once we hit solve our pump design inputs will be populated such that our desired mass flow rate is achieved. We can cross-reference these values with available pumps to choose the appropriate component for our network!
Specifying a Pump Curve
If we already know which pump we are using, or perhaps are trying to decide between several available pumps, we may need to add these pump curves to Flownex. To add a pump curve we will navigate to the Charts and Lookup Tables pane > Project Database > Flow Solver > Turbos and Pumps. In this scenario we are looking at a single speed pump so we will right-click on Pump and Fan Charts and Add a Category.
We can name our category whatever is appropriate and then right-click on the newly created category to add our own pump chart.
To edit the newly created pump chart we can either double-click on it or right-click and select edit. Now we simply specify the Reference Density and then fill out the table with the relevant data points. To speed things along we can copy and paste a table of data points from excel or whatever source we get this curve from. Don’t forget to check your units!
How to use Flow Path Graphs and Increment Plots in Flownex
Flow Path Graphs and Increment Plots can be incredibly useful visualization tools to see how a simulation result varies as a function of length along the axial flow path and to see a higher fidelity result for a single flow component. Use these in Flownex to up your reporting game! In this demo we are using Flownex version 220.127.116.1134
Creating a Flow Path
A flow path is any continuous series of flow elements and can be created by clicking “Flow Paths” in the results ribbon. Once we’ve created our new flow path we define it by choosing our start and end nodes.
Another, simpler, method is to simply drag and drop the nodes onto the flow path start and end point:
If we have a branched network we can add an intermediate node or flow component to our flow path to ensure the correct path is captured in the graph:
Insert a Flow Path Graph
The Flow Path Graph is in the component pane under visualization > graphs. Once the graph is added to the canvas we simply need to drag and drop our newly created flow path onto the graph and choose the characteristic we are interested in plotting. We will need to drag and drop the flow path for each characteristic we would like plotted.
How to create Increment Plots
You may have noticed in the previous images that there were many data points on the graphs for each of our flow components. This is because we had each pipe modeled as 25 increments. When we add increments to our flow components Flownex will treat each component as if it were split up that number of increments – solving the conservation equations for each increment rather than once over the entire component. This is helpful when modeling long pipes, capturing pressure waves, or determining exactly where a phase change may happen. A good way to think about this is that it is essentially the same as refining a mesh in a typical finite element analysis.
There is another plot in Flownex we can use for a single flow component that has been incremented. The increment plot is located in the components pane under Visualization > Graphs > Increment Plots. If we were, for example, trying to plot the inside surface temperature of our first pipe in this example network we could use an increment plot to see what is going on.
To create an increment plot we simply drag and drop the plot onto the canvas. We can either selectively drag results from individual increments or multi-select many increments and drag the desired variable onto the graph. Note that since there is a tie of each increment parameter separately there may be some delay if we are multiselecting a very large number of increments.
We can use a Flow Path graph for a single component to avoid having to multi-select increments.
To create a graph on its own page instead of floating on the canvas go to the Project Explorer pane on the left side of the GUI, select Graphs, then right-click on the Graphs Folder and select Add Graph Page and choose your desired type of plot.
Happy Friday! In today’s tech tip we’ll introduce the rotating components library and demonstrate how to utilize the cavity drawing tool for rotor-stator cavities which can be a huge time-saver when building secondary flow networks. We are working with Flownex version 18.104.22.16834.
One common implementation of rotating components in Flownex that I see is for modeling secondary flow networks for gas turbines. These flow paths are also sometimes called secondary air systems. What this refers to is the flowpath separate from the primary flowpath (Secondary, get it?). This is flow used to cool equipment, shrouds, discs, vanes, and to provide buffering for the seals to the oil system.
Flownex has a whole library of rotating components that come in handy when building these secondary flow networks. These are well documented in the Flownex help manuals if you’d like to read up on technical specification, inputs, results, and theory.
A custom vortex is used when velocity profile is between that of a forced vortex and free vortex.
In a forced vortex the fluid moves similar to a solid body with constant angular velocity.
Free vortex swirl is calculated using mass flow rate average of the incoming swirl streams, swirl is constant over the radius; usually used for rotating fluid in an open cavity.
Used for modeling axial and radial straight and staggered seals.
Rotating Annular Gap
Used to model flow through an annulus with the inner or outer cylinder rotating.
Used for flow inside channels in rotating discs and blades.
Similar to a stationary nozzle where there is a discharge coefficient as a function of the inlet type.
Used when calculating swirl ratio from moment balance on the the rotor surfaces, bolt heads, and flows.
Used when calculating swirl ratio from moment balance on the the rotor and stator surfaces, bolt heads, and flows.
Cavity Drawing Tool
Now we get to the nitty gritty of todays tip; how to utilize the cavity drawing tool. When we use either a Rotor-Rotor component or a Rotor-Stator component there are two options for specifying the surface geometry. We can either model as pure radial disks, or as a complex surface specification.
We can use the complex surface specification option to model a rotor-stator cavity like in the cross-section below. When using this option we will need to get a cross-section like this from CAD or from a scaled technical schematic.
To specify this surface geometry we will click the radio button next to surface geometry and add our image to the project. For a refresher on adding an image to your project check out the blog post on adding a background image.
We will first need to specify our reference axial and radial coordinates. This is done by dragging the red and blue boxes to known locations on the cross section and entering in the values in our desired units.
Now that we have specified the reference measurements we can define our rotor and stator surface geometries. This can be done in the Rotor Surface Geometry ribbon and the Stator Surface Geometry ribbon. The mode in the top right of the GUI lets us know if we are adding points, moving points, or deleting points. To add points we will click and drag from the previous point.
You’ll notice the inner and outer radius fields are automatically updated. This can be a good way to sanity check against known measurements or against CAD. We will need to do the same thing for the stator surface geometry.
If there are rotor or stator bolts they may be added in their respective ribbons. The blue lines we see in these images represent the limits of the rotor or stator surface. If bolts are added we will need to click Bolt Details at the bottom of the window and add bolt geometry. The radius fraction is populated automatically and the other inputs will need to be updated as needed by the engineer.
If we need to model the cavity shroud this can be done in the shroud ribbon. In our demonstration today the shroud is included in the rotor and stator surface geometries. For this case we can de-select specify shroud width.
Next we must specify the gap width. To understand what the appropriate width to specify we must dive a little bit into the theory.
Flow regimes for rotor-stator cavity flow can be classified by the following image:
“G” being the gap width ratio (s/a where s is the gap width and a is the outer radius of the cavity) and Re is the Reynolds number for cavity flow. Essentially there are four regimes which are determined by the Reynolds number and gap ratio.
Flownex uses correlations from Haaser et. al (1987) and Daily and Nece (1960) to calculate the required moments produced by the rotor or stator on the fluid within the cavity. Haaser et al. is valid for Regime IV whereas Daily and Nece is valid for 0.0127<=s/a<=0.217 and 1000<=Re<=1e7. It is suggested to use Haaser when the flow is in Regime IV and Daily and Nece when the flow is within the other regions.
I hope I haven’t lost you.
So, for complex geometry (not just two flat surfaces) it is recommended to use the smallest gap width first and calculate the disc Reynolds number. Using the smallest gap width gives you the smallest gap width ratio which will lower the point at which your fluid is in the flow regimes graph above. Now check in what region you are. If your Reynolds number is high enough to be in region IV, and while using the smallest gap width your are still in region IV then it is safe to say that your entire flow will be valid when using Haaser. If this is true, you can then use the smallest gap width because the correlations of Haaser is not dependent on gap width. Using the minimum gap width essentially allows you to make sure that your entire flow is within regime IV. When you have used the smallest gap but see that your gap width ratio and/or Reynolds number leaves you in a different regime (I,II or III), we will then suggest that you calculate the moments using Daily and Nece.
To summarize, start with the smallest gap width and determine the Flow Regime:
If we are in region IV for the smallest gap width then we can leave the gap width as originally specified. If we were in any other region we should change our gap width to be an average:
Don’t forget to specify the correct correlation in the inputs for your rotor stator cavity as well. Big thanks to Leander Kleyn at Flownex for helping me understand the theory behind the gap width!
Discretization of the Cavity
Lastly, we need to assign the discretization of the model. This can be thought of as sort of refining the mesh of the cavity. We can specify more or less increments and can drag the increments around to be sure to capture changing geometry.
There you have it! A complex surface specification of a rotor-stator cavity using the cavity drawing tool in Flownex!
How to Setup an External Shared Database in Flownex
Hi Folks! Another short and simple tech tip this week; How to set up an external shared database in Flownex. When working as part of a team it makes sense to share resources. Once one person builds a custom component or defines a complex fluid we want to share that with everyone in our organization. Today I will show you how to create and maintain a shared database. For todays example we are working in Flownex version 22.214.171.12434
Creating the Database
Start by opening up Flownex – it can be a new project or any existing project. On the right side of the GUI we’ll want to navigate to the Components pane. At the top of the pane you’ll see a variety of buttons. Depending on your installation the buttons you see may be different than the ones in the visual below. To create a new database we’ll want to click the Create Database icon.
Then we’ll want to navigate to a shared network location and pick an appropriate folder that will be accessible to others in our organization. I would encourage keeping the directory name as short as possible (I.E. a top level location) so that there is no concern for a deep database hitting windows character limit.
Once we have chosen a location and clicked OK we will see our shared database in both the Components pane and in the Charts and Lookup Tables pane. We’ll need to right-click on the newly created shared database and create a New Library in which we will place our shared components. Creating multiple libraries can be useful when grouping similar components or to discretize between different groups in the organization which are using Flownex.
Adding components to an External Database
To add custom components to our external database we simply drag and drop them from our project database. If you want to learn how to create a custom compound component please reference our previous blog post on this topic here. Choosing “Copy” will create a copy of the component in the shared database, choosing “Move” will move the component to the shared database and any references to that component in the project will now reference the component from the external database.
Adding a fluid to an External Database
To add a custom fluid to our external database the process is very similar to the procedure for the custom compound component. The only difference is that we want to do this drag and drop action within the Charts and Lookup Tables pane instead of the Components pane. If you need a refresher on creating or importing custom fluids here is a blog post on that topic!
Connecting to an External Database
Once a user has created a shared database it is now possible for other users to connect to that database. the process of connecting to an external database is quite simple. On the Components pane we will again look at the buttons near the top. We will want to click the Connect Database icon and then navigate to the shared location of the external database. Once there we will find the database configuration file, .dbcfg. We should select this file and click OK. You are now connected to the shared database!
To lock an external database to avoid unintentional editing you can right-click on the database in Flownex and select “Lock Database”.
If you need to migrate the database to another location on your server you can copy the entirety of the folder and move it. Users will simply need to follow the same procedure of connecting to an external database the next time they open Flownex.
Special Note: If sending a network to someone external to your organization it is important to note that components or references from external databases will not be included by default. These components or charts will need to be copied to the project database and then the shared database will need to be disconnected before archiving the project for transfer. A second option would be to share the database itself.
Using Views to bridge networks across multiple pages
When building our networks it may be necessary to utilize multiple pages for a single network. This could be simply because our network is large and complex, or because it simply makes sense to keep certain branches or processes separate. In this tech tip we will show how to use “views” to continue networks across multiple pages. For this example we are using Flownex version 126.96.36.19934.
In Flownex the way that we continue networks across pages or even just jumping across portions of the same page is through the use of “views”. To create a view we right-click on the component we’d like to use as our bridge and select copy. Then navigate to where we’d like to continue our network and right-click, “paste view”.
Note that this is not really a “copy” of the previous node; it is another instance of the exact same node. I personally recommend using nodes for views over flow components so that they are less likely to be mistaken as separate components.
A couple of things to note regarding view components. First, you’ll notice the floating “V” to the left of the component. This indicates that the component is a view. It’s a good idea to leave this layer on – if for some reason you cannot see the “V” it can be turned on under the view ribbon:
Secondly, to find out where the views are located in your network the simplest way to jump between them is to right-click on an existing view and select the “views” option. Here you can navigate to any other views by simply clicking on them. Note that you are not limited to only two instances of a node (two views). There could be many instances across many pages.
Common uses of views could be to connect networks built by different engineers, connecting different subsystems that make up a larger network, or even capturing 3D network layouts by building a portion of the network in the x-y plane and using a view to connect to part of the network built in the z-y plane.
Occasionally glossed over, adding custom fluids is a fairly standard operation in Flownex that we don’t think about until it’s necessary. There are a couple of ways to do this which we’ll go over in today’s post. I am working in Flownex 188.8.131.5234.
Creating a mixed fluid
To create a mixed fluid we first need to create a folder for this fluid in our project database. This can be done in the charts and lookup tables pane by right clicking on “mixed fluids” and selecting “add category”. We can create our new fluid by right-clicking on the new folder and selecting “Add a new mixed fluid”. Note we can right-click and rename both the fluid itself and the containing folder.
To define our new mixed fluid we double-click on the new mixed fluid to open the editor. Here we can add the components of our mixed fluids.
Creating a new fluid from scratch
To create a fluid from scratch we repeat the same process of creating a folder and creating a new fluid as above with the exception being that we’d complete these steps under the “Pure Fluids” category. Once this is done we’ll need to double-click or right-click > edit our from scratch fluid and enter in the fluid properties. Note for many properties we can define the relationship with pressure and temperature as constant (non-dependent), table, equation, or script.
Importing a fluid
To import a fluid we will follow the same steps of creating the folder under pure fluids. Now instead of right-clicking and adding new we will right-click and select “import”. Then we simply navigate to our desired fluid file and click “Ok”.
In the window where you define your fluid you’ll notice the “Test” button. This feature can be utilized to test created fluids to confirm properties against known properties for given pressures and temperatures.
We can also copy and paste fluids from the master database into the project database to give us a good starting point for creating similar fluids (or extending properties to higher/lower temps/pressures).
The result layers in Flownex have evolved quite a bit over the last few iterations of the code. Although we might typically associate color-gradient results more with 3D CFD, it does have a place in 1D system modeling. Taking advantage of results layers in Flownex can give a very quick understanding of what is going on with our system, and, with a little customization, can be incredibly powerful as an addition to our design and analysis toolbelt. In this post I am using Flownex version 184.108.40.20634.
How to create a result layer
To create a custom result layer we must navigate to the results ribbon and select result layer setup.
First we want to right-click in the Result Layers window and add a new result layer.
There are two options to add the schema for our result layer. The first is to right-click on the Selected Result Layer Schemas and add either a specific or generic schema. The second, and my PREFERRED, method is to simply drag and drop results from components on the canvas into this window:
Note that I want to multi-select any component types which will be included in this result layer. This could be any flow components which share a common result such as “quality”. I also convert to generic because I want the result layer to apply to all pipes, not just the pipe I initially drag and drop the property from.
Defining the custom result layer
In this example I have a two-phase water network with a cold external temperature. I want to create a result layer to quickly see if the water is in the gas phase, liquid phase, or somewhere in-between. The problem I have been tasked with solving is ensuring that the water never condenses. I will need to determine where we may need to add additional heat flux to the network.
We can use the Quality result property to determine the phase of our fluid. Quality < 0 indicates fully liquid, quality between 0 and 1 indicates liquid/gas mixture, greater than 1 indicates fully vapor.
To make this work as intended I can set up a gradient with three increments going from -1 to 2. The idea being the lowest increment would encompass -1 to 0, middle increment would be 0 to 1, and the top increment would be 1 to 2. For the gradient mode I made sure to pick <-[MinValue, MaxValue]-> so that the max and min increments would extend past the specified range.
As we apply this to our network we can easily see that we do, in fact, have a phase change from gas at the inlet, to mixture in the second two component, to fully liquid near the outlet.
I may decide to add a heater to our outlet pipe and perhaps a thicker insulative layer to all three to attempt to keep the water in gas phase throughout the system.
Result layers can also be super handy when troubleshooting to quickly identify large pressure differentials, choking points, or other outlying fluid properties.
Compound components make it easy and efficient to reuse the same collection of components over and over throughout your models. In this post I’ll be going over the basics of making a user-friendly and aesthetically pleasing compound component. In this example I am working in Flownex Version 220.127.116.1134
How to create a compound component
To create a compound component we must first create a local library in the project database. This can be done by right-clicking on the project database in the components pane and select “New Library”.
We can name our new library and choose a picture if desired:
To create our compound component we just need to right-click on the new library and select “New Compound Item”
To build our compound component we’ll use the “edit” function on the compound component. In this example I am building a Lohm resistor component. It’s a good idea to test my component on a separate page to make sure scripts interact as expected and validate results against some given test cases.
Let’s make it functional!
To define the inputs and results we’d like to expose to the user we right-click on the new compound component in the library and select “component setup”.
To add inputs and results we need to navigate to the Compound Setup ribbon and then simply drag and drop inputs and results into the Selected Properties window. Note that we can even grab whole categories of inputs or results to save time!
Now those inputs and results will appear to the user when they add this compound component to their canvas!
Let’s make it pretty!
To make our component more aesthetically appealing let’s replace the boring default icon with one more representative of our Lohm Resistor. To do this we right-click on our compound component again and this time stay in the “Display Setup” tab. We can click the “Choose Picture” button to upload our own icon. To refresh on the image selector check out the blog post on adding a background image.
To correct the aspect ratio so that it shows up looking less squished on our canvas we want to change the settings back in the Compound Setup tab. I’ll change it to 133×34 so that it appears similar in scale to the standard flow components but correct in the aspect ratio.
Now when we place our compound component onto our canvas it should look great!
In the compound component setup there is a third ribbon called “Tooltips Setup”. This is where we can define what properties show up when we hover our mouse over the component.
Don’t forget we can save compound components in a “database” on a server so that they can be accessed by every Flownex user in your organization.
Building on last week’s global parameters example I’d like to show some tricks within the input sheet environment. These are really more so excel tricks – but the methodology within Flownex is slightly different. In this example I am working in Flownex Version 18.104.22.16834
Refresher on using Input Sheets
To create a new Input Sheet we will navigate to the project tab, then select “Excel Reports/Pages”, right-click on the Input Sheets folder, and select “New Input Sheet”
To add inputs to the sheet it’s as simple as dragging and dropping the inputs from the component into the desired cell in the Input Sheet.
Formatting our Input Sheet
I like to use color, shading, and border to specify which cells contain inputs so that if I pass the project off to a client or colleague it is immediately clear what variables they should be editing and which cells they shouldn’t change.
To modify the formatting we need to enter “workbook designer”. This is done by right-clicking on the input sheet and selecting “workbook designer”
All of the standard Excel-type formatting is available here, including adding graphs, images, etc. Typical operations are found in the format menu on the top ribbon.
A more advanced Excel operation I like to integrate into these types of input sheets is a drop-down where multiple inputs may be tied to a given condition. In the example below I set up a scenario for given ambient temperature for cold day, hot day, and nominal day.
In the workbook designer we will click “insert” > “worksheet” and build our list of environmental conditions. On the right we will set the associated temperatures.
Back on Sheet1 we will need to set up the data validation cell reference to this table. Select the cell where we want to add the dropdown and go to data > validation. We will choose list, and reference cells B2:B4 of Sheet2.
We will need to use VLOOKUP to associate the temp to another cell based on this dropdown. Where this becomes valuable is when we have many input variables tied to each of the dropdown selections.
In this example, since we’ve put the applicable temps a single column to the right the syntax for VLOOKUP will be “=VLOOKUP(B5,Sheet2!B2:C4,2,FALSE)”. After this is added it should behave as follows:
As I mentioned before, this trick becomes very powerful when you have many different environmental or operational inputs tied to a single “scenario” that you want to model in an individual run rather than in a parameter study.
All of these tricks can be applied to any of the excel-type sheets within Flownex. Remember to be careful with parameter tables as the inputs and results are tied to the columns instead of individual cells.