next up previous contents
Next: Przykłady obliczeń przepływowych Up: Postrprocesor Previous: Izolinie   Spis treści

Wizualizacja wyników przy pomocy komercyjnych postprocesorów

W przypadku bardziej złożonej obróbki graficznej danych mozna się posłużyć wizualizacją siatki i danych za pomocą komercyjnych pakietów typu AVS, Visual3, Teplot, czy choćby Matlab. Do konwersji plików binarnych z parametrami siatki i pliku param.dat z danymi obliczeniowymi służy program conv3.for umieszczony w katalogu głównym. Program ten konwertuje pliki binarne na jeden plik tekstowy 4tcp.dat o następującej strukturze
 TITLE=test
 VARIABLES=X Y RHO U V P T O2 CH4 CO H2O CO2 NO N2 
 ZONE  I=          2    J=          3
         0.5333328247        0.7500000000        0.7010362744       -4.8572359085       -7.6789484024   102644.6562500000      294.4268493652        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
         0.5333328247        2.2500000000        0.7062381506       -6.7766666412       -5.7626185417   103734.1562500000      295.3603515625        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
         0.5333328247        3.7500000000        0.7092037797       -8.1765041351       -3.6118993759   104355.7578125000      295.8877258301        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
         0.5333328247        5.2500000000        0.7096362710       -8.5774745941       -2.0370771885   104445.6562500000      295.9621276855        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
         0.5333328247        6.7500000000        0.7071704865       -7.7889852524       -0.7694606185   103927.6328125000      295.5210876465        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
         0.5333328247        6.7500000000        0.7071704865       -7.7889852524       -0.7694606185   103927.6328125000      295.5210876465        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
 ZONE  I=          2    J=           4
        16.5714263916        0.7500000000        2.7000212669      -33.5300140381      534.3692626953   120502.4843750000      130.7836303711        0.0999934897        0.1000521109        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7999544144
        16.5714263916        2.2500000000        2.6614990234      -52.5159683228      534.1157226563   118180.6250000000      130.1176605225        0.0999893025        0.1000856310        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7999250889
        16.5714263916        3.7500000000        2.5719659328      -73.7016677856      533.9909057617   112023.7421875000      127.6263656616        0.0999788716        0.1001690701        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7998520732
        16.5714263916        5.2500000000        2.5014321804      -96.1671295166      530.3952636719   107875.2890625000      126.3545455933        0.0999597907        0.1003217325        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7997184992
        16.5714263916        6.7500000000        2.5180239677     -106.8449935913      518.5246582031   108898.6406250000      126.6977691650        0.0999339595        0.1005283147        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7995377183
        16.5714263916        8.2500000000        2.7244575024     -103.9543991089      489.0945434570   118637.5000000000      127.2457199097        0.0993766636        0.1049867123        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7956366539
        16.5714263916        9.7500000000        2.9426624775      -97.0454483032      432.9674682617   139374.9531250000      134.2607116699        0.0926110670        0.1591114700        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7482774258
        16.5714263916       11.2500000000        2.6556673050      -97.6055679321      348.0468750000   161381.5312500000      153.5889282227        0.0651307255        0.3789541721        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.5559151173
Pierwsza linijka pliku i4tcp.dat to nagłowek, druga nadaje etykiety (nazwy) zmiennych. Trzecia linijka informuje nas o parametrach pierwszego bloku, dalej są wartości liczbowe zmiennych ( $ x,y,\rho,u,v,p,T,...$). Linjka z ZONE I= J= to rozpoczęcie kolejnego bloku itp. Poniżej podano tabulogram programu conv3
******************************************************
C	Conversion program 
C 	convert mesh and data from Multiflower format to block structure format
C	sample of data
c TITLE=test
c VARIABLES=X Y RHO U V P T O2 CH4 CO H2O CO2 NO N2 
c ZONE  I=          2    J=          3
c         0.5333328247        0.7500000000        0.7010362744       -4.8572359085       -7.6789484024   102644.6562500000      294.4268493652        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
c         0.5333328247        2.2500000000        0.7062381506       -6.7766666412       -5.7626185417   103734.1562500000      295.3603515625        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
c         0.5333328247        3.7500000000        0.7092037797       -8.1765041351       -3.6118993759   104355.7578125000      295.8877258301        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
c         0.5333328247        5.2500000000        0.7096362710       -8.5774745941       -2.0370771885   104445.6562500000      295.9621276855        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
c         0.5333328247        6.7500000000        0.7071704865       -7.7889852524       -0.7694606185   103927.6328125000      295.5210876465        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
c         0.5333328247        6.7500000000        0.7071704865       -7.7889852524       -0.7694606185   103927.6328125000      295.5210876465        0.0000000000        0.8999999762        0.0000000001        0.0000000001        0.0000000001        0.0000000001        0.1000000238
c ZONE  I=          2    J=           4
c        16.5714263916        0.7500000000        2.7000212669      -33.5300140381      534.3692626953   120502.4843750000      130.7836303711        0.0999934897        0.1000521109        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7999544144
c        16.5714263916        2.2500000000        2.6614990234      -52.5159683228      534.1157226563   118180.6250000000      130.1176605225        0.0999893025        0.1000856310        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7999250889
c        16.5714263916        3.7500000000        2.5719659328      -73.7016677856      533.9909057617   112023.7421875000      127.6263656616        0.0999788716        0.1001690701        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7998520732
c        16.5714263916        5.2500000000        2.5014321804      -96.1671295166      530.3952636719   107875.2890625000      126.3545455933        0.0999597907        0.1003217325        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7997184992
c        16.5714263916        6.7500000000        2.5180239677     -106.8449935913      518.5246582031   108898.6406250000      126.6977691650        0.0999339595        0.1005283147        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7995377183
c        16.5714263916        8.2500000000        2.7244575024     -103.9543991089      489.0945434570   118637.5000000000      127.2457199097        0.0993766636        0.1049867123        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7956366539
c        16.5714263916        9.7500000000        2.9426624775      -97.0454483032      432.9674682617   139374.9531250000      134.2607116699        0.0926110670        0.1591114700        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.7482774258
c        16.5714263916       11.2500000000        2.6556673050      -97.6055679321      348.0468750000   161381.5312500000      153.5889282227        0.0651307255        0.3789541721        0.0000000000        0.0000000000        0.0000000000        0.0000000000        0.5559151173
c      end of sample
*********************************************************
**********	copyright by Tomasz Ochrymiuk ***********


c	include 'size.inc'
        INTERFACE TO INTEGER*2 FUNCTION GETCH [C]
        END
c        INCLUDE 'FGRAPH.FI'
c        PROGRAM ISOLINE
c        INCLUDE 'FGRAPH.FD'
        CHARACTER STR*80
        integer nx[allocatable](:),ny[allocatable](:)
        integer bound[allocatable](:,:,:)
        character fdir*8,fdirv*8,fdirvv*8
        INTEGER*2 DUMMY,GETCH,IC1,IC2,IXPG,IYPG,IX1,IX2,IY1,IY2
        INTEGER*2 XZAP,YZAP
        integer ijbaz_a[allocatable](:)
        INTEGER inumb,side_bound
        REAL VALIS(500),XP(6),YP(6)
        real xd[allocatable](:)
        real yd[allocatable](:)
        REAL XSRED,YSRED
        real gran[allocatable](:)
        INTEGER*4 IFLSIZ
        integer*2 spos
        character*1 bl,bt,br,bb
*   %%%% Vector q (Global)
        real R_[allocatable](:)
        real U_[allocatable](:)
        real V_[allocatable](:)
        real P_[allocatable](:)
        real C_(10000,10)
        character*12 ffname(1:10)

        REAL XW[ALLOCATABLE](:,:),YW[ALLOCATABLE](:,:)
        REAL AMSC[ALLOCATABLE](:,:),AMS[ALLOCATABLE](:,:)
        REAL X[ALLOCATABLE](:,:),Y[ALLOCATABLE](:,:)
        REAL XT[ALLOCATABLE](:),YT[ALLOCATABLE](:)
        Real Cpoint[ALLOCATABLE](:)
        real Kbaz(19)
        real Rbaz(19)
        integer*2 chole,cwall,cinlet,cexit        !

        COMMON /PAGE/XPG,YPG,XRG,YRG,XSD1,YSD1
        common/Kbaz/Kbaz,/Rbaz/Rbaz
        common/gam2/gam,gamm,gamp,gammo,gampo,gamo,gampg,     ! 
     +        gammg,gammgp,gamgm
        common/rgaz/rgaz
        common/ikomp/ikomp
        
        DATA chole  /  0 /
        DATA cwall  / 15 /
        DATA cinlet /  9 /
        DATA cexit  / 12 /
        DATA ct     / 14 /
        icol=1

        open(4,file='main.dir',access='direct',form='formatted',recl=8)
        read(4,'(2I2)',rec=1) it
        read(4,'(A8)',rec=it+1) fdir
        close(4)
        open(4,file=fdir//'\main.dir',access='direct',form='formatted',
     $          recl=8)
        read(4,'(2I2)',rec=1) it
        read(4,'(A8)',rec=it+1) fdirv
        close(4)
        open(4,file=fdir//'\'//fdirv//'\main.dir',access='direct',
     $          form='formatted',recl=8)
        read(4,'(2I2)',rec=1) it
        read(4,'(A8)',rec=it+1) fdirvv
        close(4)
        open(27,file=fdir//'\'//fdirv//'\'//fdirvv//'\undim.dat',
     $   status='old')
        read(27,*) akrit,rkrit
        close(27)
        open(33,file=fdir//'\nareas_m.dat',status='unknown')
        read(33,*) narea  
        close(33)
        allocate(nx(narea),ny(narea),ijbaz_a(narea))
        open(20,file=fdir//'\'//fdirv//'\'//fdirvv//'\ncomp.dat',
     $   status='old')
        read(20,*) nkomp
        close(20)
        ikomp=nkomp-1
        allocate(Cpoint(ikomp+1))
        open(22,file=fdir//'\'//fdirv//'\'//fdirvv//'\mixer.dat',
     $  status='old')
        Read(22,'(a11)') str
        DO WHILE (str(1:11).ne.'[Substance]')
          Read(22,'(a11)') str
          write(*,*)'xxxx=',str
        enddo
        do i=1,ikomp+1
          read(22,'(A30)') str
          read(str(2:3),'(I2)') j
          read(str(26:30),'(F6.5)') Kbaz(j)
          read(str(19:25),'(F7.2)') Rbaz(j)
        enddo
        close(22)
        open(20,file=fdir//'\'//fdirv//'\dim.dat',
     $  status='old',access='direct',recl=8)
        do ii=1,narea
          read(20,rec=ii) nx(ii),ny(ii)
        enddo
        close(20)
        IJBAZ_A(1)=0
        if(narea.ge.2) then
          do ia=2,narea
            IJBAZ_A(ia)=IJBAZ_A(ia-1)+nx(ia-1)*ny(ia-1)
          enddo
        endif

        npoints=0
        do ii=1,narea
         npoints=npoints+(nx(ii)+1)*(ny(ii)+1)
        enddo
        allocate(bound(narea,4,2))
        irbound=narea*4*2*4
        open(44,file=fdir//'\bounds.dat',access='direct',recl=irbound)
        read(44,rec=1)(((bound(i1,i2,i3),i1=1,narea),i2=1,4),i3=1,2)
        close(44)
        ijbaz=0
        xmax=-1e+10
        xmin=1e+10
        ymax=-1e+10
        ymin=1e+10
        ffname(1)='g1.dat'
        ffname(2)='4tcp.dat'
        ffname(3)='g3.dat'
        open(unit=1,file=ffname(1),form='formatted')  
        open(unit=3,file=ffname(3),form='formatted')  
        write(1,*)'TITLE=test'
        write(1,*)'VARIABLES=X Y'
        write(3,*)'TITLE=test'
        write(3,*)'VARIABLES=X Y'
        DO IA=1,NAREA
          naz=nx(ia)
          nar=ny(ia)
          mc=nar
          nc=naz
          ng=nc+1
          mg=mc+1
          open(30,file=fdir//'\'//fdirv//'\'//'grid_x.dat',
     $         status='old',form='unformatted',access='direct',
     $         recl=4)
          open(40,file=fdir//'\'//fdirv//'\'//'grid_y.dat',
     $         status='old',form='unformatted',access='direct',
     $         recl=4)
     	  		
     	  write(1,*)'ZONE  I=',mg,'    J=',ng
     	  allocate(x(ng,mg),y(ng,mg))
          do i=1,ng
            do j=1,mg
              ic=(i-1)*(ny(ia)+1)+j+ijbaz
              read(30,rec=ic) x111
              read(40,rec=ic) y111
              write(1,111) x111,y111	
              x(i,j)=x111
              y(i,j)=y111
            enddo
          enddo
111      format (1X,2F20.10)
113      format (1X,2F20.10)         



          ijbaz=ijbaz+ng*mg
          
          write(3,*)'ZONE  I=',mg-1,'    J=',ng-1
          do i=1,ng-1
            do j=1,mg-1
              x22=(x(i+1,j)+x(i,j))*0.5
             y22=(y(i,j+1)+y(i,j))*0.5
              write(3,113)x22,y22
            enddo
          enddo
        
        deallocate(x,y)
          
        enddo
        

        open(unit=2,file=ffname(2),form='formatted')  
        write(2,*)'TITLE=test'
        write(2,*)'VARIABLES=X Y RHO U V P T O2 CH4 CO H2O CO2 NO N2 '
c           C_CO2 C_N2'	

        irecl=16+ikomp*4
        open(22,file=fdir//'\'//fdirv//'\'//fdirvv//'\param.dat',
     $   status='unknown',share='denynone',
     $          form='unformatted',access='direct',recl=irecl)
          irec=1
          ijbaz=0
          ijbazs=0
          
          do ia=1,narea
                naz=nx(ia)
          	nar=ny(ia)
          	mc=nar
          	nc=naz
          	ng=nc+1
          	mg=mc+1
          allocate(x(ng,mg),y(ng,mg))
          do i=1,ng
            do j=1,mg
              ic=(i-1)*(ny(ia)+1)+j+ijbazs
              read(30,rec=ic) x111
              read(40,rec=ic) y111
              x(i,j)=x111
              y(i,j)=y111
            enddo
          enddo
          ijbazs=ijbazs+ng*mg
          
          write(2,*)'ZONE  I=',ny(ia),'    J=',nx(ia)
            do i=1,nx(ia)
              do j=1,ny(ia)
                ij=(i-1)*ny(ia)+j+ijbaz
                
                x22=(x(i+1,j)+x(i,j))*0.5
                y22=(y(i,j+1)+y(i,j))*0.5
                
             read(22,rec=ij) r,u,v,p,
     $                        (c_(ij,ic),ic=1,ikomp)
          Gam=0.
          Rgaz=0.
          Csym=0.
         
          do k=1,ikomp+1
          
            Gam=Gam+Kbaz(k)*C_(ij,k)
            Rgaz=Rgaz+Rbaz(k)*C_(ij,k)
            Csym=Csym+C_(ij,k)
          enddo
          
         Gam=Gam+Kbaz(nkomp)*(1.-Csym)
         Rgaz=Rgaz+Rbaz(nkomp)*(1.-Csym)
         ccc=1.-Csym
	 T=(p/r)/Rgaz
     		write(2,112)x22,y22, r,u,v,p,T,
     $              (c_(ij,ic),ic=1,ikomp),ccc

              enddo
            enddo
            deallocate(x,y)
            ijbaz=ijbaz+nx(ia)*ny(ia)
            
          enddo
112      format (1X,16F20.10)
          
          close(1)
          close(3)
          close(22)
          close(2)
          close(40)
          close(30)
        write(*,*)
        write(*,*) 'Done'

		end



Tomasz Ochrymiuk 2000-07-07