Welcome, Guest
Username: Password: Remember me

TOPIC: Initial condition FORTRAN program

Initial condition FORTRAN program 8 years 9 months ago #19749

  • gasha.sh
  • gasha.sh's Avatar
Dear all,
I simulate a dam-break effect with T2D.
I have a problem in defining initial condition in the downstream of my channel where a water depth of 45cm should be imposed.
I have two polygons for upstream and downstream of the gate. Upstream is a “dam” for which water depth in each node is calculating regarding to the minimum bed level of section. For downstream, I divided my nodes to two parts: 1) those inside the minor bed with H%R=0.45 and U%R =0.0; 2) those with no-water so H%R=0.0 and U%R =0.0.
In condin file I programmed this but I have the error: NO MODIFICATION OF BOTTOM.
Could anybody please help me ?

One more question: for program, which keyword is used for Free surface recognized by TELEMAC. For example for water depth : H%R.

Thanks a lot in advance,
Gashin
"cunnette_xyz.txt", attached to this message, is a text file in which the coordinates of nodes indicated (x,y,z).

C *****************
SUBROUTINE CONDIN
USE BIEF
USE DECLARATIONS_TELEMAC2D
IMPLICIT NONE
INTEGER LNG,LU, K, ITRAC,I,NSOM,J, NLINE, NDOWN
DOUBLE PRECISION, PARAMETER:: BATHY_RADIER_up= 29.84D0
DOUBLE PRECISION, PARAMETER:: DEPTH_up = 2.15D0
DOUBLE PRECISION:: A(5000), B(5000), C(5000)
DOUBLE PRECISION XPOLYD(14), YPOLYD(14)
COMMON/INFO/LNG,LU
DOUBLE PRECISION XPOLY(6), YPOLY(6),COTE_RADIER_up

Coordinates of upstream area of the gate:
NSOM = 6
XPOLY(1) = 602883.13
XPOLY(2) = 602886.15
XPOLY(3) = 602887.15
XPOLY(4) = 602905.46
XPOLY(5) = 602902.52
XPOLY(6) = 602884.13


YPOLY(1) = 128779.99
YPOLY(2) = 128780.80
YPOLY(3) = 128777.12
YPOLY(4) = 128741.21
YPOLY(5) = 128739.75
YPOLY(6) = 128775.96


AT = 0.D0
C
C
C
C INITIALISATION DES VITESSES : VITESSES NULLES
C
CALL OS( 'X=0 ' , X=U )
CALL OS( 'X=0 ' , X=V )
C
C
C INITIALISATION DE H , LA HAUTEUR D'EAU
C
IF(CDTINI(1:10).EQ.'COTE NULLE'.OR.
* CDTINI(1:14).EQ.'ZERO ELEVATION') THEN
CALL OS( 'X=C ' , H , H , H , 0.D0 )
CALL OS( 'X=X-Y ' , H , ZF , H , 0.D0 )
ELSEIF(CDTINI(1:14).EQ.'COTE CONSTANTE'.OR.
* CDTINI(1:18).EQ.'CONSTANT ELEVATION') THEN
CALL OS( 'X=C ' , H , H , H , COTINI )
CALL OS( 'X=X-Y ' , H , ZF , H , 0.D0 )
ELSEIF(CDTINI(1:13).EQ.'HAUTEUR NULLE'.OR.
* CDTINI(1:10).EQ.'ZERO DEPTH') THEN
CALL OS( 'X=C ' , H , H , H , 0.D0 )
ELSEIF(CDTINI(1:17).EQ.'HAUTEUR CONSTANTE'.OR.
* CDTINI(1:14).EQ.'CONSTANT DEPTH') THEN
CALL OS( 'X=C ' , H , H , H , HAUTIN )
ELSEIF(CDTINI(1:13).EQ.'PARTICULIERES'.OR.
* CDTINI(1:10).EQ.'PARTICULAR'.OR.
* CDTINI(1:07).EQ.'SPECIAL') THEN
C
COTE_RADIER_up = BATHY_RADIER_up + DEPTH_up

Coordinates of downstream area of the gate:
NDOWN = 14

XPOLYD(1) = 602883.13
XPOLYD(2) = 602886.15
XPOLYD(3) = 602864.47
XPOLYD(4) = 602837.90
XPOLYD(5) = 602821.91
XPOLYD(6) = 602649.77
XPOLYD(7) = 602634.35
XPOLYD(8) = 602345.08
XPOLYD(9) = 602326.07
XPOLYD(10) = 602619.31
XPOLYD(11) = 602638.33
XPOLYD(12) = 602811.64
XPOLYD(13) = 602831.52
XPOLYD(14) = 602857.16


YPOLYD(1) = 128779.99
YPOLYD(2) = 128780.80
YPOLYD(3) = 128867.74
YPOLYD(4) = 128936.74
YPOLYD(5) = 128953.95
YPOLYD(6) = 129105.43
YPOLYD(7) = 129143.43
YPOLYD(8) = 129713.38
YPOLYD(9) = 129708.26
YPOLYD(10) = 129136.41
YPOLYD(11) = 129094.72
YPOLYD(12) = 128941.16
YPOLYD(13) = 128931.09
YPOLYD(14) = 128865.81

DO 10 J=1,NPOIN
IF(INPOLY(X(J),Y(J),XPOLY,YPOLY,NSOM)) THEN
H%R(J)=MAX(0.D0,COTE_RADIER_up-ZF%R(J))
U%R(J)=0.0D0
ELSE
OPEN(unit = 1, FILE = "cunnette_xyz.txt")

READ (1, *) NLINE
READ (1, *) A(K), B(K), C(K)
IF(INPOLY(X(J),Y(J),XPOLYD,YPOLYD,NDOWN)) THEN
DO K=1,NLINE
H%R(K)=0.45D0
U%R(K)=0.D0
ENDDO
CLOSE (1)
CLOSE (2)
ELSE
H%R(K)=0.0D0
U%R(K)=0.0D0
ENDIF
ENDIF
write(lu,*) 'downstream ....',K,H%r(K)


10 CONTINUE….
.
.
.
Attachments:
The administrator has disabled public write access.

Initial condition FORTRAN program 8 years 9 months ago #19750

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi

This message "no modification of bottom" comes from corfon subroutine.
So it's not an error to have this message when you change only condin.

Nevertheles, I think it will be simpler to create an initial result file (with Kenue for example) and just use the computation continuation option of Telemac.

Regards
Christophe
The administrator has disabled public write access.

Initial condition FORTRAN program 8 years 9 months ago #19752

  • gasha.sh
  • gasha.sh's Avatar
Dear Christophe,
Thank you for response.
How can I use BK for create the initial result file?
Thanks in advance,
Gashin
The administrator has disabled public write access.

Initial condition FORTRAN program 8 years 9 months ago #19757

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
in the same way as you could manage bottom friction in BK, you could also create the variable Free Surface and give the initial value you want

This is well explain in the BK manual.

Regards
Christophe
The administrator has disabled public write access.

Initial condition FORTRAN program 8 years 9 months ago #19753

  • jmhervouet
  • jmhervouet's Avatar
Hello,

To answer the question in red, the free surface is not really a variable, it is built when necessary by the formula ZF%R(I)+H%R(I).

With best regards,

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

Initial condition FORTRAN program 8 years 9 months ago #19754

  • gasha.sh
  • gasha.sh's Avatar
Thanks dear Jean Michel,
Indeed I want to obtain H%R(I) from a fixed free surface. But I had to write such program. But I see that the text file (nodes inside the cunnette) is not opened from the point below. I'm not very expert in Fortran. I would appreciate if you help me.
OPEN(unit = 1, FILE = "cunnette_xyz.txt")

READ (1, *) NLINE
READ (1, *) A(K), B(K), C(K)
.
.
.

Regards,
Gashin
The administrator has disabled public write access.

Initial condition FORTRAN program 8 years 9 months ago #19756

  • jmhervouet
  • jmhervouet's Avatar
Hello,

There are two reasons:

1) unit 1 is taken by the geometry file (try unit 90 instead for example)

2) your file is not in the working directory where all the files are coppied, it remains in the original directory. So you have to go backwards in the path:

OPEN(unit =90, FILE = "../cunnette_xyz.txt",FORM='FORMATTED')
READ (90, *) NLINE
READ (90, *) A(K), B(K), C(K)


On Windows: FILE = "..\cunnette_xyz.txt",FORM='FORMATTED')


With best regards,

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

Initial condition FORTRAN program 8 years 9 months ago #19758

  • gasha.sh
  • gasha.sh's Avatar
Dear Jean Michel,
Many thanks for your kind consideration.

1) I changed to 90.
2) the txt file is in the same directory where .cas, .f, .cli, .slf are.

But I have the same problem. I wonder where is my error!!

Kind regards,
Gashin
The administrator has disabled public write access.

Initial condition FORTRAN program 8 years 9 months ago #19759

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Oh yes, the OPEN and the read of NLINE must be done once for all before loop 10, otherwise you open and read NLINE for every point.

Also put a:

PRINT*,'OPENING FILE' before the OPEN to know if you arrive there.


With best regards,

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

Initial condition FORTRAN program 8 years 9 months ago #19778

  • gasha.sh
  • gasha.sh's Avatar
Hello Dear Jean Michel,
I finally solved my prolem by imposing fixed water depth to a polygone composed of 450 points. Because the channel is very narrow.
Thanks again,
Gashin
The administrator has disabled public write access.
Moderators: pham

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