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

Join PADT and the global Ansys user community for this year’s online conference.

Multiple Tracks | Every Physics & Every Industry

Hear from Ansys Leadership | Presentations from Customers on How They Use Ansys

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

May 29
, 2025
Applying Digital Engineering across Space Mission Analysis and Design: Payload - Webinar
Jun 03
, 2025
Experience Stratasys Truck Tour - Denver Colorado
Jun 03
, 2025
Accelerate Electronics Thermal Workflows with Ansys Discovery and Ansys Icepak - Webinar
Jun 03
, 2025
Smart Manufacturing and Operations Enabled by Simulation - Webinar
Jun 04
, 2025
Composites & Structural Optimization Updates in Ansys 2025 R1 - Webinar
Jun 05
, 2025
Using Digital Engineering for a Structural, Thermal, and Optical Performance Workflow - Webinar
Jun 09
- Jun 11
, 2025
TechConnect World 2025
Jun 12
, 2025
Design and Test: Critical Links for Mission Success - Webinar
Jun 17
, 2025
Ansys Virtual Workshop - Fatigue & Durability Workflows with Ansys Mechanical & nCode
Jun 18
, 2025
Fluent CPU - UI & UX Updates in Ansys 2025 R1 - Webinar
Jun 16
- Jun 20
, 2025
Turbo Expo
Jun 24
, 2025
Cardiovascular Digital Twins: From Bench to Bedside - Webinar
Jun 25
, 2025
E-Mobility and Clean Energy Summit
Jul 02
, 2025
Electric Machine & Consumer Electronics Updates in Ansys 2025 R1 - Webinar
Jul 11
, 2025
2025 Aerospace, Aviation, Defense and Manufacturing Conference
Jul 16
, 2025
HFSS Updates in Ansys 2025 R1 - Webinar
Jul 16
- Jul 17
, 2025
Ansys Simulation World 2025
Aug 10
- Aug 13
, 2025
SmallSat 2025

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: