Welcome Navigation Approach Daemons TEST-Codes
(This page assumes that you have read  some of the Daemons pages already.)


Tutorial>TEST-Code


                     EXERCISE-1
A rigid container of volume 1 m3 contains ammonia at 100 kPa and 90% quality. If 200 kJ of heat is transferred to the tank, determine the final pressure. 

What-if scenario:    (a) How would the answer change if the amount of heat transfer were 400 kJ?



With this simple example, the use of TEST-Code will be illustrated. No matter how complex a problem is, the procedure remains identical.
 

 

#  Test>Daemons>Systems>Closed>
#                               Process>Generic>Uniform>PhaseChangeFluid;


  States    { 
     State-1:  Ammonia(NH3);
     Given:       { p1= 100.0 kPa;   x1= 90.0 %;   Vel1= 0.0 m/s;   z1= 0.0 m;   Vol1= 1.0 m^3;   }

     State-2:  Ammonia(NH3);
     Given:       { Vel2= 0.0 m/s;   z2= 0.0 m;   Vol2= "Vol1" m^3;   }
    }

  Analysis    {
     Process-A:  b-State =  State-1;  f-State =  State-2;
     Given: { Q= 200.0 kJ;   W_O= 0.0 kJ;   T_B= 25.0 deg-C;   }
    }




 
Step 1.1: Launch the appropriate process daemon.
 
 
 
 

Step 1.2: Copy the TEST-Code to the I/O panel.
 
 

 

Solution Using TEST-Code

The step-step-by step procedure to solve this problem visually has been discussed in the Tutorial>Daemons> ClosedProcess>Applications page. The final pressure in the first part was determined to be 135 kPa. Let us see how the TEST-Code shown above reproduces that solution.

On the primary window launch the process daemon with PhaseChange as the working fluid. The daemon header contains the complete path, compare it with the one given on the TEST-Code. 

To copy the code, you select the block of code by dragging the mouse, then use Ctrl_C to copy, move the mouse to the I/O panel, click inside the textbox and press Ctrl_V to paste. At the end of this operation the I/O panel should look as in Fig. 1. 
 



 
Fig. 1  Image of the I/O panel after the TEST-Code has been pasted.

 
Step 1.3: Load the code.
 

 

Now click the load button. The TEST-Code is parsed and the parsing messages are displayed on a floating window (Fig. 2). The parser looks for the 'States' keyword, checks for balance in the starting and ending braces, and starts reading the individual states. If error is encountered at any step, appropriate error message is generated.
Fig. 2  Image of the Loading Message Window.

 
Step 1.4: TEST-Code and Parametric Study.
 

 

The loading process simply places all the given variables in the appropriate places. To calculate the rest of the variables, click the Super-Calculate button. The resulting solution is identical to the visual solution discussed in the Daemons page. get, if you  age. The image of State-2 is reproduced in Fig. 3 and the final pressurecan be seen to be 135 kPa

Super-Calculate also generates the TEST-Code on the I/O panel. This allows one to quickly change a parameter on the TEST-Code, Load and Super-Calculate to update all calculations. Calculations, thus, can be repeated without leaving the I/O panel.


Material Classification
Fig. 3  Image of State-2 after the Super-Calculate operation.

 
Saving the TEST-Code.
Any time the Super-Calculate button is pressed, the TEST-Code for the visual solution is generated on the I/O panel in addition to detailed output, spreadsheet friendly property table etc.. To save the solution all you need to do is to copy the TEST-Code to any word processor (such as Notepad) and save it as a text file.

Welcome Navigation Approach Daemons TEST-Codes

Copyright 1998-2003: Subrata Bhattacharjee