Output data managment

 
 

Extracting data

In order to be able to exploit data I have edited fortran code that permit to extract data at a location for any time or inversly at  any location for a given time. The present version can only treat  SimName_#.TXV file with 2 components (i.e. 18 columns). it will be easy to the user to modify the code for more components.
This program order the variables in columns. This type of file is viewable with a plotter like xmgr.
    Sometimes TACITE does an automatic refinement of the mesh. The number of cells may also be different of user's specification. Read at the end of the SimName_#.REP file the number of effective cells.

Time-Space dependant variables : Structure of the SimName_#.TXV file

*International system untit
 
 
Time
(0<T<Tk)
Abscice
(0<X<XN)
Flow patern
Slug fraction
Pressure
Temperature
Gas volumetric fraction
Liquid volumetric fraction
Superficial gas velocity
Superficial liquid velocity
Gas mass flow rate
Liquid mass flow rate
Mass flow rate of comp 1
Mass fraction of comp 1 in gas
Mass fraction of comp 1 in liquid
 Mass flow rate of comp i
..........
 Mass fraction of comp i in gas
.............
Mass fraction of comp i in gas 
............
 .......
 Mass fraction of comp n in gas
0
 X1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 0
 ...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 0
 XN
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 ...
... 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 Tk
X1 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 Tk
 ...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 Tk
 XN
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

Code source


To compile the source code type :

f77 -c - O3  source_code_name.f
f77 -o source_code_name.o     exec_name
 

Source :

 program extractxmgr

         IMPLICIT DOUBLE PRECISION (a-h,o-z)
         character*25 namef
         character*40 namout
         parameter(nvar=18,maxt=100,maxs=300)
c     nvar=number of var, maxt/maxs number of time steps or locations
         dimension don(maxs,maxt,nvar)
 
 
 
 

      write(*,1) 'Verifier les bornes des tableaux
     &            pour eviter segmentation fault'
      write(*,*) 'entrer le nom du fichier de resultat : nom_#.TXV'
      read(*,1) namef
1     format(a)

      write(*,*) 'entrer le nombre d''images'
      read(*,*) nima
 
      write(*,*) 'entrer le nombre de sections'
      read(*,*) nsec
      nsec=nsec+2
10      write(*,*) 'type de fichier: 1->G(x0,t)   2->G(x,t0)'
      read(*,*) ichoix

 
      if(ichoix.eq.1) then
      write(*,*) 'section #?:'
      read(*,*) nosec
      call Gx0t(namef,namout,nosec,nsec,nima,maxs,maxt,nvar,don)
      else if(ichoix.eq.2) then
            write(*,*) 'image?'
            read(*,*) ima0
      call Gxt0(namef,namout,ima0,nsec,nima,nvar,maxt,maxs,don)
           else
           goto 10
      end if
      write(*,*) 'CORRESPONDANCE DES COLONNES :'
      write(*,*) '1  -> time'
      write(*,*) '2  -> position'
      write(*,*) '3  -> flow patern'
      write(*,*) '4  -> slug fraction'
      write(*,*) '5  -> pressure'
      write(*,*) '6  -> temperature'
      write(*,*) '7  -> gas volumetric fraction'
      write(*,*) '8  -> oil volumetric fraction'
      write(*,*) '9  -> gas superficial velocity'
      write(*,*) '10 -> oil superficial velocity'
      write(*,*) '11 -> gas mass flow rate'
      write(*,*) '12 -> oil mass flow rate'
      write(*,*) '13 -> mass flow rate of component 1'
      write(*,*) '14 -> mass flow rate of component 2'
      write(*,*) '15 -> mass fraction of component 1 in gaz'
      write(*,*) '16 -> mass fraction of component 2 in gaz'
      write(*,*) '17 -> mass fraction of component 1 in oil'
      write(*,*) '18 -> mass fraction of component 2 in oil'
      stop
      end
c---------------------------------------------------------------------------
      subroutine Gx0t(namef,namout,nosec,nsec,nima,maxs,maxt,nvar,
     &                don)
 
      IMPLICIT DOUBLE PRECISION (a-h,o-z)
 
 
         dimension don(maxs,maxt,nvar)
         character*25 namef
         character*40 namout
 
 

      write(*,*) ' entrer le nom du fichier de sortie'
      read(*,1) namout
1     format(a)
      open(2,file=namef, status='unknown')
      rewind 2
      do k=1,nima
        do i=1,nsec
        read(2,*) don(i,k,1),don(i,k,2),don(i,k,3),don(i,k,4),
     &            don(i,k,5),don(i,k,6),don(i,k,7),don(i,k,8),
     &            don(i,k,9),don(i,k,10),don(i,k,11),don(i,k,12),
     &            don(i,k,13),don(i,k,14),don(i,k,15),don(i,k,16),
     &            don(i,k,17),don(i,k,18)
        end do
      end do
 
      close(2)
 

      write(*,*) 'ENREGISTRE LES DONNEES DANS :',namout
      open(3,file=namout,status='unknown')
      i=nosec
      do k=1,nima
      write(3,5)  don(i,k,1),don(i,k,2),don(i,k,3),don(i,k,4),
     &            don(i,k,5),don(i,k,6),don(i,k,7),don(i,k,8),
     &            don(i,k,9),don(i,k,10),don(i,k,11),don(i,k,12),
     &            don(i,k,13),don(i,k,14),don(i,k,15),don(i,k,16),
     &            don(i,k,17),don(i,k,18)
      end do
5     format(1x,18(e15.10,1x))
      close(3)
 
      return
      end
 
c-----------------------------------------------------------------
      subroutine Gxt0(namef,namout,ima0,nsec,nima,nvar,maxt,maxs,
     &                don)
      IMPLICIT DOUBLE PRECISION (a-h,o-z)
 

         dimension don(maxs,maxt,nvar)
         character*25 namef
         character*40 namout
 
 
      write(*,*) ' entrer le nom du fichier de sortie'
      read(*,1) namout
1     format(a)
      open(2,file=namef, status='unknown')
      rewind 2
      do k=1,nima
        do i=1,nsec
        read(2,*) don(i,k,1),don(i,k,2),don(i,k,3),don(i,k,4),
     &            don(i,k,5),don(i,k,6),don(i,k,7),don(i,k,8),
     &            don(i,k,9),don(i,k,10),don(i,k,11),don(i,k,12),
     &            don(i,k,13),don(i,k,14),don(i,k,15),don(i,k,16),
     &            don(i,k,17),don(i,k,18)
        end do
      end do
      close(2)
 
 

      write(*,*) 'ENREGISTRE LES DONNEES DANS :',namout
      open(3,file=namout,status='unknown')
      k=ima0
      do i=1,nsec
       write(3,5) don(i,k,1),don(i,k,2),don(i,k,3),don(i,k,4),
     &            don(i,k,5),don(i,k,6),don(i,k,7),don(i,k,8),
     &            don(i,k,9),don(i,k,10),don(i,k,11),don(i,k,12),
     &            don(i,k,13),don(i,k,14),don(i,k,15),don(i,k,16),
     &            don(i,k,17),don(i,k,18)
      end do
5     format(1x,18(e15.10,1x))
      close(3)
 
      return
      end
 
 

TOP