Page 366 - TransAT_Tutorial_Manual
P. 366

TransAT Tutorial Manual                                                   9.1. Water suction



               User-defined function      User-defined functions will be called to compute the bulk temperature
               along with the Nusselt number and to generate output files with profiles of different variables. In
               this tutorial ready-made user-defined function will be used to compute and output the physical
               quantities of interest.

               User-defined functions should be defined in the User Defined Functions window. In this
               tutorial the ready-made user-defined function is available as a template. It can be opened by the
               following steps:


                   • Click    to create a new UDF

                   • Define a valid name in the first entry

                   • Select the template called mass output, which is located under Entry Point \ Every Time Step
                     type of template

                   • Click    to create the UDF

                   • Click    to view or edit the UDF

                   Finally, confirm that the UDF can be compiled by clicking     . The output of compilation
               will be shown in the text box in the bottom half of the window.


                   Once the simulation finishes running, the test output.dat data file containing different profiles
               will be generated.

                   The data from the data files can be loaded and plotted using softwares such as spreadsheet
               editor, gnuplot or Python for instance or simply opened with a text editor. In Figure 9.16 the
               mass of water in the domain is plotted over time. On that plot, one can see that the mass of
               water decreases linearly over time due to the suction by the pumps. The results obtained with
               TransAT match the expected analytical solution of mass over time (green line in Figure 9.6).


               Comments on the output generation

               In this example, the MPI Allreduce method was used to get the total mass of water in the domain.
               Taking the usercompile folder located in <TransAT Installation folder>/transatMB as a basis, the
               required modifications to get the mass over time are described below.

               For the generation of this output, UDF files mass output.h and mass output.cxx files are required.
               The MPI Allreduce method is used to sum the total mass of water in the domain over all proces-
               sors.






                c 
Ascomp AG Switzerland                    356                                  Version 5.7
   361   362   363   364   365   366   367   368   369   370   371