You are on page 1of 12
What is an INTRAN file? What is an INTRAN file? ‘The next step in modeling a system is to create a file that describes a particular operating scenario for the pipdline system. This includes defining the control logic of the system, scheduling events, and determining what kind of simulations are to be performed. In SPS, thisinformation is defined in a filecalled the INTRAN file. This fileis an ASCII file that is both created and edited by you. This section shows how to use the INTRAN file to define what kind of simulation isto be performed, define control logic, and schedule events based on time or other events. This section also demonstrates how to start up the simulation program, TRANS, and correct some common mistakes. For afull definition of the commands, see the Help and Reference. To create the INTRAN file, any standard text editor can be used. The filename for the INTRAN file should end with the suffix INTRAN (i.e. acmeiintran). The character sequence /* is still used to ‘comment out the rest of aline. One additional requirement is that all letters must bein UPPERCASE. Defining general information in the INTRAN file Presented below are short discussions of some of the general directives commonly usad in the INTRAN file. These commands control the type of simulation TRANS performs and how it handles the data. BEGIN The very first line of every INTRAN file must contain this line. While this line can be used to ity some time related parameters and the error tolerance for the calculations, it is common to use the form "BEGIN 0", which normally starts the simulation from the RESTRT file (whichis generated by PREPR). The simulation end time is also specified with the BEGIN statement. TRENDLIST This command is used to specify which types of data should be recorded to the REVIEW file. A value is written for each variable specified for each time step taken. This enables the historical trend of these values to be plotted interactively in TRANS or TPORT, or to be viewed later by using GRAFR. SHARE This command enables the use of shared memory, which is required to run TPORT. By default, the same information that was specified by the TRENDLIST directive is written to shared memory, but this can be changed. INTERACTIVE file://C:\Documents and Settings\user\Local Settings\Temp\~hh8145.htm. 2008-5-4 What is an INTRAN file? This command causes TRANS to run in its interactive mode. This allows you to change the state of different elements (such as opening or closing a valve) and view the results as a dynamic plot or report. SPSis aways run interactively on Windows. LINE.FILL This command allows the placement of fluid batches within the pipeline to be specified at startup. ARCHIVE This command takes a snapshot of the state of the system so that it may be reloaded into the simulation at alater time. LOAD.STATUS This directive reloads a snapshot of the state of the system created by the ARCHIVE command. The simulation time can also be reset using this command (i.e. LOAD.STATUS, TIME=0). The default isto go to the time the ARCHIVE was saved. PRINT This command is used to schedule the printing of user-defined reports and text displays to the OUTTRN file or a separate file. Prints to the OUTTRN file are appended to the file. Prints toa ‘separate file overwrite the previous print. Example: INTRAN genera information To be zbleto run asimulation, you begin to build an INTRAN file. The following shows some of the general commandsat the start of this file: BEGIN 0, + BEGIN.TIME = 0, + ERROR.TOLER = 2 + END.TIME = 1440 rp /* ACMEINTRAN rp /* GENERAL INFORMATION TRENDLIST * SHARE file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? INTERACTIVE MSWIN, ARCHIVE STEADY, TIME=60 /* LOAD.STATUS STEADY /* INITIAL FLUID IN THE LINE r LINE-FILL RED_MC.TL1 MC.TL2, + FLUID OIL1 OIL3 OIL4 OIL2, + VOLUME 3.10 11.0 5.00 20.0 To statt, you place the required BEGIN command at the very first line in the file, which is the one esoentidl element of every INTRAN file. In the BEGIN command, you sat the beginning time, the ending time, and the error tolerance for the simulation. Next, you set the TRENDLIST command to keep track of all device values thal can be plotted as.a function of time. Also, the SHARE command is placed in the ile to allow you to run TPORT during a simulation. Finally, the INTERACTIVE command is set to tall TRANS to run the simulation interactively. This should be enough to get the ‘modal up and running for a basic simulation. Looking at the file, however, you decide to add a few more commends. The first thing you do is to set up a automatic ARCHIVE of the system after one hour12 hours, which is longer than you: ‘expect the system to take to reach steady state. Once the first simulation has been run past 12 hours and the simulation is completed, you can comment out the ARCHIVE command and uncomment the LOAD.STATUS command, so thet subsaquent simulations start immediately at a steady state condition called STEADY. You dso use LINE.FILL to specify where the different batches of cil ‘appear in the pipeline. Scheduling events SPS allows events (such as the opening or closing of a valve) to be scheduled for specific times or at ‘specific intervals. In the non-interactive mode, this allows the simulation to be run without any user intervention. In the interactive mode, this allows repaitive or scheduled events to be initiated by TRANS and dlows you to focus on other aspects of the simulation, such as reacting to different Situations or observing the results. Each of the commands in the list below can be issued to tae place immediately or scheduled to take lave at a specified time. To schedule them to take place af a specific time, the following format is used: command device, TIME=time where command is the command, device is he pipeline component being acted upon, and time is the time at which the command is to be issued. If these commands appear in the INTRAN file by themselves without a scheduled time, they are executed on the first time step. These commands can file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? also be issued during an interactive TRANS session, which are discussed in the next section. Prior to discussing the commands, a discussion of the peek and poke attributes that are defined for specific devicesis in order. Each device has.a series of attributes from 1 to 4 charactersin length that refersto a physical parameter or aca culated value. Some of these parameters may be edited (poked) and some may only be viewed (peeked). To use these attributes with one of the commands below, you use the following format devicenemecattribute ‘These attributes are usually abbreviations of the parameters and a complete definition can be found in the Peek and Poke Keywords section of the Help and Reference. OPEN or CLOSE ‘These commands are used to open or close block valves. These commands have no effect on check valves or control valves. START or STOP ‘These commands ere used primarily to start or stop a compressor or pump. POKE This command is used to change the value of certain device parameters during the simulation. Every time the POKE commend is issued, the time step of the simulation drops to the minimum time step allowed. The show window for each device shows which parameters are pokable by placing a green box beside the parameter name. SUBMIT.SEQUENCE This comnmiand is uséd to execute a command sequence previously defined by a DEFINE.SEQUENCE command. This command also allows val ues to be passed to the command sequence. (The DEFINE. SEQUENCE command is defined in the next list.) Another command that can be used to schedule events is the RAMP command, shown below. This commands, however, is only available for use in the INTRAN file. RAMP This command is used to enter a time-varying value for any device parameters that are pokeeble (i.e. those for which the POKE command works). The value of the variable can either be defined by a table (valuevs time) or by an equation. Example: INTRAN scheduled events ‘Since thisis your first simulation, you want to try out some of the different scheduled commands. (One easy way of doing this is to start and stop a pump that requires its associated valves to be opened and closed, From looking at your INPREP file, you decide to use pump RED.P1, which is file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? associated with the block valves RED.P1.BV and RED.P1.BV. In the INPREP file, the pump was set to stat up immediately and the block valves were set to be initially open. The following lines in the INTRAN file cause the pump to shut down and the valves to close once the simulation has been unning for two hours. STOP RED.P1, TIME=120 CLOSE RED,P1.SUC, TIME=121 CLOSE RED.P1.DIS, TIME=121 A similar set of commands could be used to start the pump up again at two and a half hours into the simulation: OPEN RED.P1.SUC, TIME=150 START RED.P1, TIME=151 OPEN RED.P1.DIS, TIME=151 To test the poke command, you decide to uset to change the pressure setpoint of the control valve RED.REG at the Redmond pumping station. Initially, it was set to 1000 psi, but you want to change that to 800 psi at three hours into the simulation. Here is whet that commend would look like: POKE RED.REG:SPs = 800, TIME=180 One other commend that you want to try is the RAMP directive. To simulate atemporary decrease in the supply pressure from tank one at Redmond, you could use the RAMP directive this way: RAMP RED.T1:SP = 20 10 10 20 + TIME = 1510540570, You ramp the nominal flow rate so that you do not need to worry about flow sign convention. The ‘sign convention is set by the External definition. This RAMP function alters the pressure for that tank according to the following schedule: Pressure: 20 10 1020 Time: 1510540 570 Another way to implement the RAMP function is to set it equal to an expression. For example, you could make the pressure of tank two at Redmond mimic the pressure of tank one by the following ‘statement: RAMP RED.T2:SP = RED.T1:P+ Specifying control logic file://C:\Documents and Settings\user\Local Settings\Temp\~hh8145.htm 2008-5-4 What is an INTRAN file? To mimic the automatic control used in pipaline systems, SPS provides the capability to define and use |ogical statements to contro! the devices in the model. Three of the commands that allow this to be done are described below. DEFINE This command is used to create a user-defined variable that can be equal to a number, an equation, or text string. The value of a defined variableis changeable. However, if the defined variable is an equation, then changing it to a number permanently overrides the equation. This command can be used in the INPREP or INTRAN files or interactively. DEFINE.SEQUENCE This command is used to define anew command consisting of a sequence of other commands. The new commend must be defined in the INTRAN file and can be issued interactively in TRANS or TPORT by using the SUBMIT.SEQUENCE command. DEFINE.FUNCTION This command is used to set up a schedule (supplies/deliveries that are sawtooth in character, controller set point changes, etc.) which may be used for multiple devices. A RAMP command must, beincluded in the INTRAN file to invoke the function name. WHENEVER This command is used to monitor a value or status and take some action when it reaches a certain level or state. The condition being monitored is evaluated at every time step and the command is issued every time the condition is found to be true. Example: INTRAN contro! logic In the previous example, you scheduled the stopping and starting of pump one at Redmond. If this was an event that was going to be issued more than once or twice, it makes sense to simplify it to reduce the amount of user input required. This can be done by using the DEFINE.SEQUENCE command to define two command sequences START_PUMP1 and STOP_PUMP1. Here are what these definitions might look like: DEFINE.SEQUNCE START_PUMP1{ OPEN RED.P1.SUC WAIT 1.0 ‘START RED.P1 OPEN RED-P1.DIS} DEFINE.SEQUENCE STOP_PUMP1{ STOPRED.P1 WAIT 1.0 file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? CLOSE RED.P1.SUC CLOSE RED.P1.DIS} ‘The WAIT command in these statements causes a delay of one-minute simulation time before continuing with the sequence of commands. To use these sequences to stop and start the pup within the INTRAN file, you would use the SUBMIT.SEQUENCE commands as follows: SUBMIT.SEQUENCE STOP_PUMP1, TIME = 120 ‘SUBMIT.SEQUENCE START_PUMP1, TIME = 150 From an economic perspective, you also decide it would be nice to know how much power is required at any point in time during the simulation. To keep track of this, you create a defined variable that is the sum of the power usd by the two pumps: DEFINE PUMP_POWER = RED.P1:PWR + RED.P2:PWR To test out the WHENEVER commend, you decide to simulate the presence of some pump control logic thet causes the Pump 1 at Redmond to stop whenever the suction pressure drops below 100 psi: WHENEVER (RED.P1:P-<=100 & RED.P1:ST = "RUNNING") { SUBMIT.SEQUENCE STOP_PUMP1} The sample INTRAN file is shown below: BEGIN 0, +BEGIN.TIME = 0, + ERROR.TOLER =2 +END.TIME = 1440 P= /* ACMEINTRAN r /* GENERAL INFORMATION TRENDLIST * ‘SHARE INTERACTIVE MSWIN ARCHIVE STEADY, TIME=60 /* LOAD.STATUS STEADY file//CADocuments and Settings\user\Local Settings\Temp\~hh8145.htm 2008-5-4 What is an INTRAN file? /* INITIAL FLUID IN THE LINE r LINE-FILL RED_MC.TL1 MC.TL2, + FLUID OIL1 OIL3 OIL4 OIL2, + VOLUME 3.10 11.0 5.00 20.0 /* CONTROL LOGIC r RAMP RED.T1:SP = 350 300 300 350 + TIME = 1510540570 RAMP RED.T2:SP = RED.T1:SP DEFINE.SEQUNCE START_PUMP1{ OPEN RED.P1.SUC WAIT 1.0 START RED.P1 OPEN RED.P1.DIS} DEFINE.SEQUENCE STOP PUMP1{ STOP RED.P1 WAIT 1.0 CLOSE RED.P1.SUC CLOSE RED.P1.DIS} DEFINE PUMP_POWER = RED.P1:PWR + RED.P2:PWR WHENEVER (RED.P1:P-<= 100 & RED.P1:ST = "RUNNING") { SUBMIT.SEQUENCE STOP_PUMP1} /* SCHEDULED EVENTS r SUBMIT.SEQUENCE START_PUMP1, TIME = 120 SUBMIT.SEQUENCE STOP_PUMP1, TIME = 150 POKE RED.REG:SP+ = 800, TIME=180 file//CADocuments and Settings\user\Local Settings\Temp\~hh8145.htm 2008-5-4 What is an INTRAN file? Processing INTRAN Once the INTRAN file has been written, the next step is to attempt to useiit to run TRANS. Again, TRANS performs the transient simulations of the pipaline system. It requires both the binary RESTRT file (created by PREPR) and the INTRAN file (created by you). TRANS produces an OUTTRN file. The INTRAN file displays different warning messages printed while processing the scenario to aid in troubleshooting the simulation, ‘Three additional files that may be created during a TRANS simulation are the REVIEW file, the REPLAY file, and the archive file (ARK). Recall that only the information specified by the TRENDLIST command is contained in the REVIEW file. In order to use the REPLAY fileto rerun a ‘simulation, rename the created REPLAY file to .intran. Then rerun TRANS. The ARCHIVE file, generated by the ARCHIVE command, can be reloaded into TRANS to restore the archived state, Running TRANS To run the simulation, open the SPS startup window as described in the previous section (unless it is already running). Select the case name, and click the TRANS button to start the simulation. If you had a properly configured INTRAN file, you should see the TRANS window appear on the soreen within a short time. If you do not see this, itis likely thet your INTRAN file had a syntax error of some sort, and you should look at the OUTTRN fileto try to find these errors. If you see running TRANSis taking time steps. You can pause the simulation by selecting Simulation and then Pause. Example: Running a simulation with TRANS After finishing the INTRAN file for your first simulation, you click the TRANS button on the SPS start up screen. After a short time, the main TRANS window appears on the screen momentarily and then disappears. The next saction discusses correcting common errors. Troubleshooting TRANS Correcting errorsin an INTRAN fileis often more difficult than with an INPREP file. Thisis because of the flexibility of TRANS, which leads to difficulty in generating descriptive error messages. Also, certain modeling problems in the INPREP file that were not caught by PREPR can cause problems during the simulation. In the examples below, each of these problems are discussed in the order in which they appear in the file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? Page 10 of 12 OUTTRN file. As with correcting the errorsin INPREP files, it is often a good idea to make the obvious corrections and then re-run TRANS to see if any of the errors disappear. If the syntax looks fine, then there may be a modeling problem. Review the syntax using the Help and Reference. Example: Correcting the INTRAN file Aspreviously mentioned, the main TRANS window appears on the screen momentarily and then disappears. This usually means that your INTRAN file had some errors so you take a look at the OUTTRN file that was generated. You see the following messages INTRAN file: 3 +ERRORTOLER=2 4 + END.TIME = 1440 Error: Syntax problem. Error parsing an expression See line 3 of your intran file, Warning: Evaluation failure. Error, directive BEGIN, keyword ERROR. TOLERANCE Expression evaluation failed. In the Help and Reference, you look at the syntax of the ERROR TOLER line of the BEGIN command, You realize that you need to insert a comma at the end of theline. You rerun the INTRAN file and TRANS window disappears again. In the OUTTRN file you notice the foll owing error messages: 26 DEFINE.SEQUNCE START_PUMP1{ OPEN RED.P1.SUC Error: Syntax problem. Expecting TRANS DIRECTIVE but found DEFINE.SEQUNCE 27 WAIT 1.0 Error: Syntax problem in the INTRAN file, directive WAIT, line 27. Only valid in command lists WAIT Error: Syntax problem. Expecting TRANS DIRECTIVE but found 1.0 28 START RED.P1 29° OPEN RED.P1.DIS} file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? Page 11 of 12 Error: Syntax problem in the INTRAN file, directive} , line 29. Only valid in command lists} The very first message indicates that TRANS does not seem to ul directive. This because the commend is misspelled. Adding an DEFINE.SEQUNCE should fix the problem. Also, it appears that the other error messages might be ‘elated to that one, so you decide to wait until you run TRANS again to seeif these "errors" disappear. The correcied line should be: DEFINE.SEQUENCE START_PUMP1{ OPEN RED.P1.SUC (Once again you run TRANS and this time it appears thet everything works fine. After correcting all the errors that had messages printed out to the OUTTRN file, you end up with the following file: BEGIN 0, + BEGIN.TIME = 0, + ERROR.TOLER = 2, +END.TIME = 1440 rp /* ACMEINTRAN rh /* GENERAL INFORMATION TRENDLIST * ‘SHARE INTERACTIVE MSWIN, ARCHIVE STEADY, TIME=60 /* LOAD.STATUS STEADY /* INITIAL FLUID IN THE LINE r LINE-FILL RED_MC.TL1 MC.TL2, +FLUID OIL1 OIL3OIL4 OIL2, + VOLUME 3.10 11.0 5.00 20.0 /* CONTROL LOGIC file://C:\Documents and Settings\user\Local Settings\Tenp\~hh8145.htm 2008-5-4 What is an INTRAN file? rf RAMP RED.T1:SP = 350 300 300 350 + TIME = 1510540570 RAMP RED.T2:SP = RED.T1:SP DEFINE.SEQUENCE START_PUMP1{ OPEN RED.P1.SUC WAIT 1.0 ‘START RED.P1 OPEN RED.P1.DIS} DEFINE.SEQUENCE STOP _PUMP1{ STOP RED.P1 WAIT 1.0 CLOSE RED.P1.SUC CLOSE RED.P1.DIS} DEFINE PUMP_POWER = RED.P1:PWR + RED.P2:PWR WHENEVER (RED.P1:P-<= 100 & RED.P1:ST = "RUNNING") { SUBMIT.SEQUENCE STOP_PUMP1} /* SCHEDULED EVENTS I SUBMIT.SEQUENCE START_PUMP1, TIME = 120 ‘SUBMIT.SEQUENCE STOP_PUMP1, TIME = 150 POKE RED.REG:SP+ = 800, TIME=180. file//CADocuments and Settings\user\Local Settings\Temp\~hh8145.htm Page 12 of 12 2008-5-4

You might also like