Page 368 - TransAT_Tutorial_Manual
P. 368

TransAT Tutorial Manual                                                   9.1. Water suction



               Part 1 is the preamble where all the variables used in the function are declared. In Part 2, the
               TransAT data required to get the time and compute the mass of water is accessed and processed.
               In Part 3, the data is processed locally on each processor.

               For update time mass to be functional, the inclusion of headers allowing access to parallel com-
               puting function (mpi.h header file) and to the TransAT data (cppinterface.h header file) must be
               included in mass output.cxx

               #include "cppinterface.h"
               #include "mpi.h"
               To compute the total mass of water in the domain, the mass of water in all the cells (product of
               volume fraction of water, density and cell volume) are added up. A loop over the whole set of
               cells is used to do so:

               // Loop over blocks
               for (int nb=0; nb < nblocks; nb++){
                    // Total number of cells in block
                    nijk = get_integer(nb,"nijk");
                    // Access to TransAT data arrays
                    set_pointer(nb, &kblk,          "kblk"         );
                    set_pointer(nb, &vol,           "cellvolume" );
                    set_pointer(nb, &Hembed,        "hembed"       );

                    // Loop over cells
                    for (int ii=0; ii < nijk; ii++) {
                       properties_initialize(nb, ii);
                       // Get water density
                       rho_water = properties_get("density",0);
                       // Get water volume fraction
                       alpha_water = properties_get("alpha",0);
                       // Increment local mass
                       local_water_mass += rho_water*alpha_water*kblk[ii]*Hembed[ii]*vol[ii];
                    }
               }

               On each processor, the mass of water from the set of blocks assinged to it is stored in the lo-
               cal water mass variable. local water mass is computed by adding the mass of water from each cell.

               For the compuation of local water mass, the multiplication by the internal cells marker, kblk, and
               the fluid-solid marker, Hembed, is done to strictly restrict the sum to the set of internal fluid cells.






                c 
Ascomp AG Switzerland                    358                                  Version 5.7
   363   364   365   366   367   368   369   370   371   372   373