Modeling a Simple Flow in a Pipe


  1. Introduce you to the basics of running a flow simulation.
  2. Show you how to find information on the predicted flow.
  3. Introduce one hand calculation necessary for checking flows in piping.


Before starting your first exercise, you need to make some decisions about how you are going to organize your work. You need to store results on your UDrive in a way that lets you find them again easily. The method of running simulations used here drops files in directories that don’t have meaningful names. I recommend that you create a directory named “470” in your personal space. Immediately below that create directories labeled “Exercises” and “Homework”. Under “Exercises” create one subdirectory for each one that we do in class. I’ll leave the naming convention to you. The subdirectory for this exercise could be named “Exercise-1”, 1”, or some variation on that theme.

Problem Definition

A 10 meter section of circular pipe consists of 5 meters that are 0.25 meters in diameter, followed by an abrupt expansion to a 0.353553 meter diameter for the remainder of the section (flow area doubles). Water flows into the test section at 20 m/s, at a temperature of 300K. The pressure at the exit is 2.0x105 Pa. What is the pressure difference between the inlet and outlet of the pipe at steady state flow?


The program that we will use to solve this problem (and a lot of its relatives) does not actually solve the steady state form of the flow equations. It was designed to look at transient scenarios, and obtains a steady state solution by running a transient long enough in time. We’ll check to see if we’ve approached steady state later in the exercise.

The power plant simulations in this class will be driven by the Symbolic Nuclear Analysis Package (SNAP). The flow and heat transfer equations in our simulations will be solved by the “TRAC/RELAP Advanced Computational Engine” (TRACE). Before using TRACE in any computer session, you’ve got to start something called the “Calculation Server.” Click the Start button on your computer, and select the Programs menu. Run the mouse cursor down the list of programs until you find “SNAP”. Select “Configuration Tool” from the SNAP sub-menu.

If a message box appears saying "Attempting to connect to calculation server", click the associated Cancel button.  In the configuration tool select the “Calculation Server” tab.  Near the bottom of the window, make certain that the drop-down menu box labeled "Code" says TRACE.  When TRACE is selected in that box, click the line above describing the location and arguments for the executable, and finally click the “Start Server” button at the bottom of the window. Make a note of the path listed in the “Working Directory” box. That is where you will find all subdirectories containing results of calculations. You can close this window if you would like.

To start the exercise, copy the file at this link to the subdirectory that you’ve just created for this exercise. It should appear with the file name “expansionL.inp”. Open the file with jEdit (found either from the Programs Menu or as a “jE” icon on the screen). What you see in the editor is one of several ways to pass initial and boundary conditions to TRACE. As you become more experienced, you may find that jEdit is the quickest way to review or make very minor changes to your problem specification. For now, viewing this input file should give you some appreciation for the relative ease of the approach to input construction that we use in Exercise 2.

To run the calculation select the “Plugins” menu, then “Snap”, and finally “Submit Calculation”. A “Submit Calculation” window will appear. Click the “Submit” button, then make a note of the Run Identifier in the message window (or leave the message open while you check the job status.

To check results of the calculation, you can select the "Status Calculations" item seen just below "Submit Calculation in the previous image. As an alternative, you can return to your Programs menu, and in the SNAP sub-menu, select “Job Status”. In the left pane of the Job Status window, click any “+” boxes that appear to get to a display of your results in the right pane.

Look at the status column. For this short calculation, it should say “Complete”. Click on the box containing the Run Identifier for the job that you just completed. In my example there are two runs listed. At this point you should just have one job listed. More will appear as you run more TRACE jobs. When you’ve finished working with the results of a job, or copied its results to another location, you can remove it by selecting “Delete” from the tools menu.

Now we’re going to use the tools menu to look at results from the simulation. Click the “View Output” item, then click “Output file”.

In the next window, click “Points of Interest”. In the “Points of Interest” menu select “Major Edits, then click on the last line that appears (contains “trac large edit”).

The second line that you see should start with the phrase “problem time is”. Note that the problem was run for a 10 second transient. The time required for fluid to flow from the inlet to outlet is:

This means that over 13 transit times have passed since the start of the transient, and you would expect the solution to be well settled. You can do a quick check on steady state from information now in front of you. Look for the phrase “outer-iteration number is”. It should be followed by the number one. This means that the solution to the flow equations was found immediately. Now look for the phrase “with fr.error of”. This is the maximum ratio of pressure change to total pressure during the last iteration of the time step. You should see a very small number. In this case the number is small enough that it probably results from round-off error in the computer’s arithmetic.

To get the best idea of the pressure change associated with the expansion compare the pressure just before the expansion to that in the second cell beyond the expansion. The slight variation in pressure from cell 6 to cell 7, is related to some subtleties in the numerical method that you don’t need to know. The slight variation from cell 1 to 2 is related to a boundary condition issue that we will explore in a later exercise.

For constant density flows, pressure changes across flow area changes or pipe bends are normally analyzed in terms of a modified Bernoulli Equation. Let a subscript “c” denote quantities at the area change or pipe bend, subscript “u” denote conditions upstream of the change, and subscript “d” denote conditions downstream of the change. The modified Bernoulli Equation is:


Tables are available giving expressions for the loss coefficient k for various geometries, and TRACE incorporates some of these as optional loss terms in the momentum equation.

At this point this exercise transitions to a short homework problem, in which you are asked to locate some loss coefficients and check the TRACE results.

Other Lectures

Back to 470 Home Page

Created and Maintained by John Mahaffy : ©2003