Welcome, Guest
Username: Password: Remember me

TOPIC: wind telemac2d

wind telemac2d 11 years 9 months ago #7192

  • Flo64
  • Flo64's Avatar
Hi,

I want to force my model with a wind which changes in the time.
T U v
s m/s m/s
0 -0.889 1.263
10800 -1.770 -0.742
21600 -0.178 0.162
32400 -1.355 -0.982
43200 -0.989 -1.134
54000 0.597 -0.085
etc...

How can telemac2d see these variations? How can i set my steering file in order to read this wind file?

Thanks

Florian
The administrator has disabled public write access.

wind telemac2d 11 years 9 months ago #7194

  • jmhervouet
  • jmhervouet's Avatar
Hello,

You should take subroutine meteo.f from library telemac2d in your FORTRAN FILE and program it to read your file. In this subroutine the section IF(VENT) THEN... is OK but before you must read in your file the wind velocity FUAIR and FVAIR for the corresponding time AT. Beware that in the existing meteo.f all the lines are between IF(LT.EQ.0) THEN... ENDIF, so to have variations in time the section IF(VENT should be moved after this IF section. In the section IF(LT.EQ.0) you could read all times and velocities of your files in arrays so that after you just have to look in these arrays to find the corresponding time, e.g. by a dichotomy.

Your wind file can be declared as :

FORMATTED DATA FILE 1 = yourwindfile

or

FICHIER DE DONNEES FORMATE 1 = monfichierdevent

in which case to read in it you can read in logical unit :

T2D_FILES(T2DFO1)%LU, provided that after the USE BIEF in the subroutine you add :

USE DECLARATIONS_TELEMAC2D, ONLY : T2D_FILES,T2DFO1

for example you can declare an integer UL, do then

UL=T2D_FILES(T2DFO1)%LU

and a current line for reading your file will start with :

READ(UL,*) .....

All this assuming that you have a basic knowledge of Fortran. In all cases you can also have a look at the guide for programming in the Telemac system which is available on this website.

With best regards,

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

wind telemac2d 11 years 9 months ago #7202

  • Flo64
  • Flo64's Avatar
Jean Michel,

Thank you for your answer.

Could you see my fortan file and the subroutine meteo.f at the end in order to give me your opinion, please?

Thanks
Regards

Florian

File Attachment:

File Name: fort_juin.f
File Size: 34 KB
The administrator has disabled public write access.

wind telemac2d 11 years 9 months ago #7204

  • jmhervouet
  • jmhervouet's Avatar
Hello,

This is what you write:

DO I = 1,140
READ(UL,*) inputString
READ(inputString) AT,FUAIR,FVAIR
write (*,*) 't',AT,'u',FUAIR,'v',FVAIR
ENDDO

It could be as well:

DO I = 1,140
READ(UL,*) AT,FUAIR,FVAIR
write (*,*) 't',AT,'u',FUAIR,'v',FVAIR
ENDDO

but AT is the current time and you cannot change it, choose and declare another double precision name. If you have only 140 lines (beware that you must skip two comment lines, or remove them from the file) you can do this loop at every iteration, but then you should store two successive times, like AT1 and AT2, and stop and interpolate the FUAIR and FVAIR between these two times when you have AT1 < AT < AT2, so you probably need to declare also FUAIR1, FVAIR1, FUAIR2 and FVAIR2.

Regards,

JMH
The administrator has disabled public write access.

wind telemac2d 11 years 9 months ago #7206

  • Flo64
  • Flo64's Avatar
Thank you very much.

But, i don't really understand the method with the loop...
The administrator has disabled public write access.

wind telemac2d 11 years 9 months ago #7209

  • Flo64
  • Flo64's Avatar
Jean-Michel,

I try to make a loop:

READ (UL,*) TIME, FUAIR, FVAIR
DO I=1,END(UL)
IF (I.EQ.1) THEN
READ(UL) TIME1,FUAIR1, FVAIR1
ELSEIF (I.EQ.2) THEN
READ(UL) TIME2,FUAIR2, FVAIR2
etc etc..
ELSEIF (I.EQ.140) THEN
READ(UL) TIME140,FUAIR140, FVAIR140
ENDIF
ENDDO


This idea is good? Or it's totally false?

Regards

Florian
The administrator has disabled public write access.

wind telemac2d 11 years 9 months ago #7210

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Well Florian, actually we cannot give you through the forum a course on computer programming, you should really find someone to help you, e.g. your supervisor. I can tell you that if you have 140 lines in your file, you can write :

INTEGER UL
DOUBLE PRECISION TEMPS(140),UAIR(140),VAIR(140)

UL=T2D_FILES(T2DFO1)%LU

and then:

DO I=1,140
READ(UL,*) TEMP(I),UAIR(I),VAIR(I)
ENDDO

but then you are going to ask how to interpolate FUAIR and FVAIR at time AT don't you ? And I'm afraid I cannot always answer in a minute. So please try to find help around you and raise only problems that nobody can solve after reasonable efforts.

With best regards,

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

wind telemac2d 11 years 9 months ago #7211

  • Flo64
  • Flo64's Avatar
Jean Michel,

I write on the forum because nobody can help. But i understand your answer and i thank you for yours answers. I am sorry for my questions.

Regards
Florian
The administrator has disabled public write access.

wind telemac2d 11 years 9 months ago #7212

  • jmhervouet
  • jmhervouet's Avatar
Hello,

You're welcome anyway. Please post your wind file and I'll write an example subroutine meteo that will be used for next version in example 038_wind, it will be more useful than a constant wind, and I'll post this subroutine on the forum.

With best regards,

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

wind telemac2d 11 years 9 months ago #7213

  • jmhervouet
  • jmhervouet's Avatar
Hello everybody,

Here is attached an example of subroutine meteo.f for reading constant in space and variable in time wind velocities in a file, file with first two lines of comments also attached, meant to be used . This can be tested in test case 028_wind, where the two options 1 and 2 (see MY_OPTION in meteo.f) should give the same results.

Enjoy !

JMH
Attachments:
The administrator has disabled public write access.
Moderators: pham

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