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

Categories

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

Technical Expertise to Enable your Additive Manufacturing Success.

PADT’s Pulse Newsletter

Keep up to date on what is going on at PADT by subscribing to our newsletter.


By submitting this form, you are consenting to receive marketing emails from: . You can revoke your consent to receive emails at any time by using the SafeUnsubscribe® link, found at the bottom of every email. Emails are serviced by Constant Contact

Share this post:

Upcoming Events

03/28/2024

SAF Blue Carpet Event

03/28/2024

2024 Arizona Space Summit

04/03/2024

Low Frequency Updates in Ansys 2024 R1 - Webinar

04/03/2024

Venture Madness Conference Reception + Expo

04/03/2024

Stratasys F3300: Game Changing Throughput - Webinar

04/08/2024

39th Space Symposium

04/09/2024

39th Space Symposium

04/10/2024

Discovery Updates in Ansys 2024 R1 - Webinar

04/10/2024

39th Space Symposium

04/11/2024

39th Space Symposium

04/22/2024

Experience Stratasys Truck Tour: Houston, TX

04/24/2024

Structures Updates in Ansys 2024 R1 (2)

04/24/2024

Experience Stratasys Truck Tour: Houston, TX

05/07/2024

Experience Stratasys Truck Tour: Albuquerque, NM

05/08/2024

Fluent Materials Processing Updates in Ansys 2024 R1 - Webinar

05/09/2024

Experience Stratasys Truck Tour: Los Alamos, NM

05/14/2024

Simulation World 2024

05/15/2024

Simulation World 2024

05/16/2024

Simulation World 2024

05/22/2024

Optics Updates in Ansys 2024 R1 - Webinar

06/12/2024

Connect Updates in Ansys 2024 R1 - Webinar

06/26/2024

Structures Updates in Ansys 2024 R1 (3) - Webinar

06/27/2024

E-Mobility and Clean Energy Summit

07/10/2024

Fluids Updates in Ansys 2024 R1 - Webinar

08/05/2024

2024 CEO Leadership Retreat

10/23/2024

PADT30 | Nerdtoberfest 2024

Search in 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: