Simple Scripting in Flownex

Categories:

Friday Flownex Tech Tips #15

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 8.12.7.4334

Example Problem

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.

1 horizonal pipe in duct

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.

2 churchill bernstein

Example Network

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.

3 network

Quick Script

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.

4 quick script component
5 quick script properties

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.

6 quick script editor

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.

7 quick script function

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.

8 data transfer link

Once we’ve connected all of the data transfer links with the appropriate properties we ought to be able to solve!

9 churchill bernstein script results

Get Your Ansys Products & Support from the Engineers who Contribute to this Blog.

Technical Expertise to Enable your Additive Manufacturing Success.

Share this post:

Upcoming Events

Jan 22
- Jan 25
, 2025
Arizona Photonics Days 2025
Feb 04
- Feb 06
, 2025
MD&M West 2025
Feb 04
- Feb 06
, 2025
2025 Transformative Vertical Flight
Mar 20
, 2025
Arizona Space Summit 2025
Apr 07
- Apr 10
, 2025
40th Space Symposium
Jun 09
- Jun 11
, 2025
TechConnect World 2025
Jun 16
- Jun 20
, 2025
Turbo Expo
Jul 11
, 2025
2025 Aerospace, Aviation, Defense and Manufacturing Conference

Search the PADT Site

Contact Us

Most of our customers receive their support over the phone or via email. Customers who are close by can also set up a face-to-face appointment with one of our engineers.

For most locations, simply contact us: