Showing posts with label TELEMAC3D. Show all posts
Showing posts with label TELEMAC3D. Show all posts

Friday, December 30, 2011

Telemac Benchmark Test

I recently took an old desktop machine of mine and installed GeekoCFD which is an openSuse based distribution with a number of open-source CFD tools including OpenFOAM. I then downloaded and compiled TELEMAC v6p1. Since I last compiled TELEMAC, there is a new Python-based method which does not require Perl. The installation instructions can be found here and are fairly complete. My compilation only used the scalar version of Telemac and not the parallel version. I will be attempting to compile a parallel version in the near future.

I then ran a Telemac3d case to compare the Linux version against my Windows version. My windows machine is a laptop with an Intel Core i3-350M processor (dual core running at 2.26 GHz) with 4 GB of DDR3 memory running 64 bit Windows 7. It was also compiled using the Intel Fortran compiler. My old desktop is  running openSuse 11.4 with the KDE desktop (very nice!). It has an Intel Core2 Duo E4500 running at 2.2 GHz and 1 GB of DDR memory. I ran a Telemac3D case and it took 2hrs and 32 minutes on my old desktop and 1 hour on my laptop.

Interesting the difference in the run time difference, as both machines are running dual core processors at nearly the same clock speed - however the newer i3 must be more optimized. The other large difference is that the Linux only has 1GB of memory and also is using the gFortran compiler.

My next experiment will be to try using Amazon EC2 and sign out a high CPU server, with the eventual goal of being able to cluster a number of instances in the cloud. 

Wednesday, August 24, 2011

Specifying the Velocities at the Boundaries

Often it is necessary to specify the velocity direction for the boundary condition using PRESCRIBED VELOCITIES=2. Below is an example showing the velocity component for flow in a 45 degree direction.


4 5 5 0.0 0.625 0.625 0.0 4 0.0 0.0 0.0 429 1
4 5 5 0.0 0.625 0.625 0.0 4 0.0 0.0 0.0 643 2
4 5 5 0.0 0.625 0.625 0.0 4 0.0 0.0 0.0 857 3
4 5 5 0.0 0.625 0.625 0.0 4 0.0 0.0 0.0 1071 4
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1072 5
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1073 6
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1074 7
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1075 8
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1076 9
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1077 10
2 2 2 0.0 0.0 0.0 0.0 2 0.0 0.0 0.0 1078 11

5 4 4 0.0 0.625 0.625 0.0 4 0.0 0.0 0.0 1284 217
5 4 4 0.0 0.625 0.625 0.0 4 0.0 0.0 0.0 1070 218


LIHBOR, LIUBOR, LIVBOR, HBOR, UBOR, VBOR, AUBOR, LITBOR, TBOR
ATBOR, BTBOR, N, K



LIHBOR, LIUBOR, LIVBOR, and LITBOR are the boundary type codes for each of
the variables


For most of our work the first three values will be

2 2 2  Solid boundary.
4 5 5  Free H, prescribed Q
5 4 4  Prescribed H, free velocities.



HBOR (real) represents the prescribed depth if LIHBOR = 5.
UBOR (real) represents the prescribed velocity U if LIUBOR = 6.
VBOR (real) represents the prescribed velocity V if LIVBOR = 6.

However if PRESCRIBED VELOCITIES=2,  In the case of a prescribed flowrate, then UBOR and VBOR are multiplied by a constant in order to reach the prescribed flowrate.




Section 4.2.2/4.2.3 of the Telemac2D manual provides additional information.




Compiling TELEMAC System v6p1

With the latest release of Telemac v6p1, I decided it was time to figure out how to compile it from the source code. Checked out a copy from Subversion (http://svn.opentelemac.org/svn/opentelemac/) from /tags/v6p1 to my local Telemac folder. Note that I already have a version of Telemac running and am running the Intel Fortran compiler.


  1. Add the following to the PATH User variable: C:\Telemac\v6p1\bin
  2. Create the following User Variable: SYSTELCFG with value: C:\Telemac\v6p1\config
  3. Under C:\Telemac\v6p1\config, I made a copy of systel-all.ini and renamed it to systel.ini. 
  4. In the systel.ini file I set the following parameters: PROJECT=C:\Telemac\v6p1, HOSTTYPE=wintel32s, PERLPATH=C:\Telemac\perl\bin, PERL5LIB=C:\Telemac\perl\lib.
  5. Ran cfgmak from C:\Telemac\v6p1\bin
  6. Opened the command window from my Intel Fortran Compiler. Navigate to C:\Telemac\v6p1\bin and run MAKEALL90. This should compile all of the libraries. Did not no anything special such as to compile parallel sources. 
  7. Once I finished compiling I found that I needed to edit the runtel.pl located in the same directory as in the previous step. Find the line: $command=join "","./", "delete_",$PARA,$WORKING,$fileToDelete; and remove the ./  .

Friday, June 24, 2011

Programming the Initial Conditions in Telemac

The current project that I am working in involves looking at the vertical velocity profiles along a dune. By default Telemac3D creates equally spaced vertical layers from your model. This is not really desirable as  one generally wants a greater density of vertical layers near the bottom where the velocity profile changes rapidly and fewer near the free surface to save computational time. Telemac3D does allow you to specify the vertical profiles however you must do so programmatically - by creating a princi.f file and writing your own CONDMIN subroutine to initialize the initial conditions. After playing around with this I found a good example of the princi.f file with the examples and was able to modify it as required.

TELEMAC 3D uses a sigma transformation for the z or vertical access which means that at each point on the mesh z* = z/Zmax. This means that we specify our height from the bottom using values between 0 and 1.

!-----------------------------------------------------------------------
!
!     INITIALISATION OF ZSTAR, VERTICAL COORDINATE
!     IN SIGMA TRANSFORMATION
!
!     CASE WITHOUT REFERENCE PLANE
!     ----------------------------
!
!         ONE MUST HAVE :
!
!            * ZSTAR%R(1)     = 0.D0 ( BOTTOM PLANE )
!            * ZSTAR%R(NPLAN) = 1.D0 ( FREE SURFACE PLANE )
!
!         AND FOR ALL I BETWEEN 1 AND NPLAN-1
!
!            * ZSTAR%R(I) < ZSTAR%R(I+1)
!
!     CASE WITH REFERENCE PLANE
!     -------------------------
!
!         ONE MUST HAVE :
!
!            * ZSTAR%R(1)      = -1.D0 ( BOTTOM PLANE )
!            * ZSTAR%R(NPLINT) =  0.D0 ( REFERENCE PLANE )
!            * ZSTAR%R(NPLAN)  =  1.D0 ( FREE SURFACE PLANE )
!
!         AND FOR ALL I BETWEEN 1 AND NPLAN-1
!
!            * ZSTAR%R(I) < ZSTAR%R(I+1)
!
!     STANDARD IS: EVENLY SPACED PLANES
!
!     IF NO REFERENCE PLANE : NPLINT = 1
!
!     TRANSF IS KEY-WORD "MESH TRANSFORMATION"


 WRITE(lu,*) 'TRANSF IS KEY-WORD "MESH TRANSFORMATION"'
!
      IF(TRANSF.EQ.2) THEN
        WRITE(LU,*)
        IF(LNG.EQ.1) THEN
          WRITE(LU,*) 'AVEC TRANSFORMATION DU MAILLAGE = 2'
          WRITE(LU,*) 'DONNER DANS CONDIM LES VALEURS DE ZSTAR'
        ENDIF
        IF(LNG.EQ.2) THEN
          WRITE(LU,*) 'WITH MESH TRANSFORMATION = 2'
          WRITE(LU,*) 'GIVE THE VALUES OF ZSTAR IN CONDIM'
        ENDIF
        WRITE(LU,*)
!       CALL PLANTE(1)
!        STOP
!       EXAMPLE WITH 3 PLANES     
        ZSTAR%R(1)=0.D0
        ZSTAR%R(2)=0.01D0
        ZSTAR%R(3)=0.03D0 
        ZSTAR%R(4)=0.05D0
        ZSTAR%R(5)=0.07D0
        ZSTAR%R(6)=0.09D0
        ZSTAR%R(7)=0.11D0
        ZSTAR%R(8)=0.13D0 
        ZSTAR%R(9)=0.15D0
        ZSTAR%R(10)=0.25D0
        ZSTAR%R(11)=0.368D0
        ZSTAR%R(12)=0.5D0
        ZSTAR%R(13)=0.75D0
        ZSTAR%R(14)=1.D0
      ELSEIF(TRANSF.EQ.3) THEN
        IF(NPLINT.GE.2) THEN
          DO IPLAN = 1,NPLINT-1
            ZSTAR%R(IPLAN) = DBLE(IPLAN-NPLINT)/DBLE(NPLINT-1)
          ENDDO
        ENDIF
        DO IPLAN = NPLINT,NPLAN
          ZSTAR%R(IPLAN) = DBLE(IPLAN-NPLINT)/DBLE(NPLAN-NPLINT)
        ENDDO
      ELSEIF(TRANSF.EQ.4) THEN
        WRITE(LU,*)
        IF(LNG.EQ.1) THEN
          WRITE(LU,*) 'AVEC TRANSFORMATION DU MAILLAGE = 4'
          WRITE(LU,*) 'DONNER DANS CONDIM LES VALEURS DE ZSTAR'
          WRITE(LU,*) 'COTES REELLES SOOUHAITEES DES PLANS'
        ENDIF
        IF(LNG.EQ.2) THEN
          WRITE(LU,*) 'WITH MESH TRANSFORMATION = 4'
          WRITE(LU,*) 'GIVE THE VALUES OF ZSTAR IN CONDIM'
          WRITE(LU,*) 'REAL ELEVATION OF PLANES'
        ENDIF
        WRITE(LU,*)
        CALL PLANTE(1)
        STOP
!        EXAMPLE WITH 4 PLANES        
!        ZSTAR%R(1)=-10.D0
!        ZSTAR%R(2)=-9.D0
!        ZSTAR%R(3)=-8.D0
!        ZSTAR%R(4)=-7.D0
      ELSE
!       SIGMA TRANSFORMATION AND OTHER CASES
        DO IPLAN = 1,NPLAN
          ZSTAR%R(IPLAN) = DBLE(IPLAN-1)/DBLE(NPLAN-1)
        ENDDO
      ENDIF