Welcome, Guest
Username: Password: Remember me

TOPIC: Common wind definition in Tomawac-Telemac2D coupling?

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10388

  • jmhervouet
  • jmhervouet's Avatar
Hello,

According to what I read, you just fill the values of U and V for point number NPOIN and leave the others unchanged, so probably what you want to do is:

INTEGER I
DOUBLE PRECISION WIND1X,WIND1Y,WIND2X,WIND2Y

READ(NVEN,*,ERR=100,END=200) TV1,WIND1X,WIND1Y
READ(NVEN,*,ERR=100,END=200) TV2,WIND2X,WIND2Y

DO I=1,NPOIN
U1(I)=WIND1X
V1(I)=WIND1Y
U2(I)=WIND2X
V2(I)=WIND2Y
ENDDO

Regards,

JMH
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10405

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello JM,

Thank you very much for the help. I am starting to have a better understanding.

I have a new issue now. My winds file is something like that:
AT	WINDX	WINDY

0	0	0
250	-5	-10
500	-22.9	-16.1
1000	-22.9	-16.1
1500	-22.9	-16.1
2000	-22.9	-16.1
2500	-18.32	-12.88
3000	-12.824	-10.304
3500	-8.9768	-8.2432
4000	-6.28376	-6.59456
4500	-4.398632	-5.275648
5000	-3.0790424	-4.2205184
meteof. subroutine in telemac2d interpolates at every telemac2d timestep, whereas tomawac takes the wind as constant between timesteps in the wind file, i.e. the wind changes abruptly at every timestep in the wind file.

Is this what it is supposed to do? Should I code the interpolation in time in venuti.f?

Regards,
Costas
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10406

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Well, my understanding is that venuti returns two successive time steps of the file and the corresponding times, and then the subroutines calling venuti (see e.g. lecdoi) do the interpolation in time.

Regards,

Jean-Michel Hervouet
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10409

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
I have looked the relevant subroutines and it seems to me that LECDOI interpolates once at the beginning of the computation, LECDON does not interpolate and NOUDON interpolates once when it is called, i.e. when AT>TV2. In the computation timesteps between TV1 and TV2 in the winds file, the wind definition remains unchanged.

If this is correct there are two solutions:
  1. I interpolate the winds file manually
  2. I modify a tomawac subroutine to do it
In case of 2, what is the appropriate way? Increase the frequency NOUDON is called?

Regards,
Costas
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10411

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Well it seems to me that in NOUDON the interpolation is outside the test AT>TV2, so the interpolation would be always done, am I wrong ?
I am not a specialist of Tomawac so I would have to look more closely, but my current understanding is that :

LECDOI is for initialising time varying values (so interpolation)
LECDON is for initialising constant in time values (so no interpolation)
NOUDON interpolates

so it would be OK ?

Regards,

JMH
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10417

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Having noticed an inconsistency in the wind output, I did a more refined research and I found that in subroutine VENUTI it clearly says:
!note DURING THE FIRST PASS THE USER MUST IDENTIFY THE TIMES TV1 AND TV2
!+ WHICH SURROUND THE FIRST TIME STEP. NEXT, USING THE ARRAYS
!+ XRELV,YRELV,UR,VR OR DIRECTLY FROM THE WIND FILE, THE USER
!+ MAY HAVE TO INTERPOLATE THE TIDES READ FROM THE FILE INTO THE
!+ ARRAYS U1,V1 U2,V2.
!+
...
!+
!+ THE CODE WILL INTERPOLATE THE WIND AUTOMATICALLY BETWEEN THESE
!+ 2 TIME STEPS.
!+
!+ THE OTHER PASSES OCCUR WHEN A NEW RECORD IS REQUIRED (AT>TV2).
!+ IN THIS CASE TV2,U2,V2 ONLY ARE TO BE COMPUTED.
I therefore modified my code accordingly (together with a modification to read Wind Direction & Speed instead of wind vectors):
!+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
!
      INTEGER I
      DOUBLE PRECISION DIR1,SPEED1,DIR2,SPEED2,CNVR
!
!-----------------------------------------------------------------------
!
      CNVR=3.141592654D0/180.D0
!
      IF (AT.EQ.0) THEN
! 
!     JUMPING TWO LINES OF COMMENTS
        READ(NVEN,*,ERR=100,END=200)
        READ(NVEN,*,ERR=100,END=200)
!     READING THE FIRST TWO LINES OF DATA
        READ(NVEN,*,ERR=100,END=200) TV1,DIR1,SPEED1
        READ(NVEN,*,ERR=100,END=200) TV2,DIR2,SPEED2
!
        DO I=1,NPOIN
          U1(I)=SPEED1*SIN(DIR1*CNVR)
          V1(I)=SPEED1*COS(DIR1*CNVR)
          U2(I)=SPEED2*SIN(DIR2*CNVR)
          V2(I)=SPEED2*COS(DIR2*CNVR)
        ENDDO
      ELSE
        READ(NVEN,*,ERR=100,END=200) TV2,DIR2,SPEED2
        DO I=1,NPOIN
         U2(I)=SPEED2*SIN(DIR2*CNVR)
         V2(I)=SPEED2*COS(DIR2*CNVR)
        ENDDO
      ENDIF
!
      RETURN
!-----------------------------------------------------------------------
! 
100   CONTINUE
      WRITE(LU,*) ' '
      WRITE(LU,*) 'VENUTI'
      IF(LNG.EQ.1) WRITE(LU,*) 'ERREUR DANS LE FICHIER DE VENT'
      IF(LNG.EQ.2) WRITE(LU,*) 'ERROR IN THE WIND FILE'
      CALL PLANTE(1)
      STOP  
200   CONTINUE
      WRITE(LU,*) ' '
      WRITE(LU,*) 'VENUTI'
      IF(LNG.EQ.1) WRITE(LU,*) 'FIN PREMATUREE DU FICHIER DE VENT'
      IF(LNG.EQ.2) WRITE(LU,*) 'WIND FILE TOO SHORT'
      CALL PLANTE(1)
      STOP           
!-----------------------------------------------------------------------
      RETURN
      END
It now seems to give consistent wind input. I can now look into the issue regarding the interpolation between wind file timesteps.

Regards,
Costas

PS. I have noticed a small typographical error in venuti.f. It says
THE USER MAY HAVE TO INTERPOLATE THE TIDES
instead of
THE USER MAY HAVE TO INTERPOLATE THE WIND
You may want to correct that.
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10421

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Thanks for pointing out this, it will be corrected in the next version.

Regards,

JMH
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10432

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Just an update.

Modifying the NOUDON subroutine so as to bypass the condition that interpolation is carried out only when AT>TV2, does the trick. The wind definition can now be updated/interpolated at every tomawac timestep.

Regards,
Costas
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10435

  • jmhervouet
  • jmhervouet's Avatar
Hello Costas,

I at last understand the problem : the mechanism of TROUVE is wrong in your case, this is what prevents the interpolation, I have to think of another implementation, e.g. logical values saying if we are reading a file or calling venuti (like I did in the enclosed tentative correction, if OK I can put it in the next release or revision).

Thanks for your efforts,

Jean-Michel Hervouet
Attachments:
The administrator has disabled public write access.

Common wind definition in Tomawac-Telemac2D coupling? 11 years 2 months ago #10436

  • cyamin
  • cyamin's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 997
  • Thank you received: 234
Hello JM,

I used your modification to run my case and compared the results. The wind vectors in your case remain stationary until timestep# 55, at which time the vectors move abruptly and start to coincide with the results in my modification of NOUDON.
The timestep in my case is 5s, which means that the interpolation kicks in at time=250s, which is the second entry in my winds file. Thus, no interpolation is done between the first two entries.
Here is my winds file:

File Attachment:

File Name: h984e308.txt
File Size: 0 KB

I will test it thoroughly tomorrow morning.

Regards,
Costas
The administrator has disabled public write access.
Moderators: tfouquet

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.