Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Multiple open boundaries definition

Multiple open boundaries definition 4 years 3 months ago #36517

  • rosparsw
  • rosparsw's Avatar
Hello,

I am building a coastal model with four boundaries :
  • The south boundary is an inflow coming from a river : "prescribed Q"
  • The west, north and east boundaries represent the open ocean : "prescribed H and UV"

In fact, I am trying to split the ocean boundaries in 3 because I want to also input a general current coming from the West in direction of the East.

I checked in the .cli file and there are the four boundaries cleary defined in the following order :
  • Offshore_South (1309 - 11290)
  • Offshore_East (11317 - 11337)
  • Comoe (11661 - 11667)
  • (not shown on the sreen capture)
  • Offshore_West (1190 - 1193)

boundaries_topic_screen.png


So, in the steering files, i should have (in addition to everything else) :
PRESCRIBED VELOCITIES = 0;-0.2;0;0.2
PRESCRIBED FLOWRATES = 0;0;106;0
OPTION FOR TIDAL BOUNDARY CONDITIONS = 1;1;0;1

I also used : OPTION FOR LIQUID BOUNDARIES : 2


But, when I try to run the simulation, TELEMAC stops and tells me that there's only 2 liquid boundaries.

So, I am wondering if someone already faced the same issue or could please help me on that one.


Regards.

William
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36518

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello William,

A liquid boundary is bounded by solid boundaries. If you do not have solid segments, that means you have single liquid boundary not several.
In your example, you have a liquid/open boundary with your maritime boundary (west, south and east) + another one with your river, so you have 2 liquid boundaries. I think the listing file writes the bounds of theses boundaries with a serial computation.

If you want to know how it is computed, you can read the FRONT2 subroutine available in the $HOMETEL/sources/utils/bief directory.

To implement your constant circulation, I would suggest you to include tidal_model_t2d subroutine in the FORTRAN FILE and change the implementation at the end to add it where you want.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36520

  • rosparsw
  • rosparsw's Avatar
Ok, I see what you mean, thanks for your answer.

However, I'm not sure to understand how to use the tidal_model_t2d subroutine.

I didn' talked about it in my first post but I am already using the TPXO database to simulate the tide on the ocean's liquid boundary and I would like to add an additional velocity (which would represnt the global current circulation) only on the West and East boundaries.

Do you know if it's possible to implement it thanks to subroutine or anything else ?

William
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36521

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
William,

If you read the TIDAL_MODEL_T2D subroutine, you can see a call to BORD_TIDE_TPXO in which the tidal boundary conditions will be computed.

At the end, you can read the loop:
      DO K=1,NPTFR
        IFRLIQ=NUMLIQ%I(K)
!       TEST ON NUMTIDE PROBABLY NO LONGER USEFUL
        IF(NUMTIDE%I(K).GT.0.AND.IFRLIQ.GT.0) THEN
          IF(BND_TIDE(IFRLIQ).GT.0) THEN
!           POSSIBLE SMOOTHING AT THE BEGINNING
!           IF(AT.LT.1800.D0) THEN
!             UBTIDE%R(K) = UBTIDE%R(K)*(AT/1800.D0)
!             VBTIDE%R(K) = VBTIDE%R(K)*(AT/1800.D0)
!           ENDIF
            IF(LIUBOR%I(K).EQ.KENTU) THEN
              UBOR%R(K) = UBTIDE%R(K)
              VBOR%R(K) = VBTIDE%R(K)
              U%R(MESH%NBOR%I(K)) = UBOR%R(K)
              V%R(MESH%NBOR%I(K)) = VBOR%R(K)
            ENDIF
            IF(LIHBOR%I(K).EQ.KENT) THEN
              HBOR%R(K) = HBTIDE%R(K)
              H%R(MESH%NBOR%I(K)) = HBOR%R(K)
            ENDIF
          ENDIF
        ENDIF
      ENDDO

You can add the 0.2 m/s current in the part of the code below, by adding this contribution to UBTIDE%R(K) when needed.
            IF(LIUBOR%I(K).EQ.KENTU) THEN
              UBOR%R(K) = UBTIDE%R(K)
              VBOR%R(K) = VBTIDE%R(K)
              U%R(MESH%NBOR%I(K)) = UBOR%R(K)
              V%R(MESH%NBOR%I(K)) = VBOR%R(K)
            ENDIF

You can use the BOUNDARY_COLOUR array to mark the boundary nodes where you want to apply your +0.2 m/s or -0.2 m/s extra velocity.
You can have a look at user_corfon subroutine in one of the TELEMAC-2D tide example to copy/paste.
BOUNDARY_COLOUR%I(N) gives you the number of the boundary nodes in the BOUNDARY CONDITIONS FILE before partitioning. In sequential mode, it gives you N, the number of the line in the BC file. In parallel mode, it gives you the one if not partitionned, so you can still use this information in parallel.
In your case, as you know the limits of your lateral boundaries, these could be the limits to a test for BOUNDARY%I(N) if N varies from 1 to the number of BC nodes and some nodes numbers you know.
In the CORFON subroutine, you sweep the number of boundary nodes with index N, do a test for I=BOUNDARY_COLOUR%I(N) and if you are between 2 limits, you apply a modification of the bottom elevation for boundary node N.
And if you look at the geo_tide.cli BC file, you can see that 250 and 339 are the limits of the open boundary of this model.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36525

  • rosparsw
  • rosparsw's Avatar
First, thanks a lot, I would not have been able to grasp with all this code alone .

I think I managed to code something thanks to your advices but I'm not sure it's correct, could you give it a quick look ?

This is a piece of the tidal_model_t2d's code which I modified. The test to apply the +0,2 or -0,2 is inspired from the 2d tide example's user_corfon file.
My two boundaries on which I want to apply the modification are "Frontière Ouest" (West boundary) and "Frontière Est" (East boundary).

DO K=1,NPTFR
        IFRLIQ=NUMLIQ%I(K)
!       TEST ON NUMTIDE PROBABLY NO LONGER USEFUL
        IF(NUMTIDE%I(K).GT.0.AND.IFRLIQ.GT.0) THEN
          IF(BND_TIDE(IFRLIQ).GT.0) THEN
!           POSSIBLE SMOOTHING AT THE BEGINNING
!           IF(AT.LT.1800.D0) THEN
!             UBTIDE%R(K) = UBTIDE%R(K)*(AT/1800.D0)
!             VBTIDE%R(K) = VBTIDE%R(K)*(AT/1800.D0)
!           ENDIF
			
!			Lignes de code ci-dessous, utilisées pour implémenter le courant de circulation générale

!			Frontière Ouest
			FIRST_1 = 1643
			LAST_1 = 1662
			
!			Frontière Est	
			FIRST_2 = 32
			LAST_2 = 51
			DO N=1,MESH%NPTFR
				I=BOUNDARY_COLOUR%I(N)
!				On fait entrer la circulation du courant par la frontière Ouest
				IF(I.GE.FIRST_1.AND.I.LE.LAST_1) THEN
					IF(LIUBOR%I(K).EQ.KENTU) THEN
						UBOR%R(K) = UBTIDE%R(K)+0.2
						VBOR%R(K) = VBTIDE%R(K)
						U%R(MESH%NBOR%I(K)) = UBOR%R(K)
						V%R(MESH%NBOR%I(K)) = VBOR%R(K)
					ENDIF
!				On fait sortir la circulation du courant par la frontière Est
				ELSEIF(I.GE.FIRST_2.AND.I.LE.LAST_2) THEN
					IF(LIUBOR%I(K).EQ.KENTU) THEN
						UBOR%R(K) = UBTIDE%R(K)-0.2
						VBOR%R(K) = VBTIDE%R(K)
						U%R(MESH%NBOR%I(K)) = UBOR%R(K)
						V%R(MESH%NBOR%I(K)) = VBOR%R(K)
					ENDIF
!				Pour le reste des noeuds on applique la condition de marée classique
				ELSE THEN
					UBOR%R(K) = UBTIDE%R(K)
					VBOR%R(K) = VBTIDE%R(K)
					U%R(MESH%NBOR%I(K)) = UBOR%R(K)
					V%R(MESH%NBOR%I(K)) = VBOR%R(K)
				ENDIF
			ENDDO
            IF(LIHBOR%I(K).EQ.KENT) THEN
              HBOR%R(K) = HBTIDE%R(K)
              H%R(MESH%NBOR%I(K)) = HBOR%R(K)
            ENDIF
          ENDIF
        ENDIF
      ENDDO
!



Regards.

William
Attachments:
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36526

  • rosparsw
  • rosparsw's Avatar
Quick edit, I modified my code as follows :

DO K=1,NPTFR
        IFRLIQ=NUMLIQ%I(K)
!       TEST ON NUMTIDE PROBABLY NO LONGER USEFUL
        IF(NUMTIDE%I(K).GT.0.AND.IFRLIQ.GT.0) THEN
          IF(BND_TIDE(IFRLIQ).GT.0) THEN
!           POSSIBLE SMOOTHING AT THE BEGINNING
!           IF(AT.LT.1800.D0) THEN
!             UBTIDE%R(K) = UBTIDE%R(K)*(AT/1800.D0)
!             VBTIDE%R(K) = VBTIDE%R(K)*(AT/1800.D0)
!           ENDIF
			
!			Lignes de code ci-dessous, utilisées pour implémenter le courant de circulation générale

!			Frontière Ouest (à repérer sur le fichier .cli)
		    FIRST_1 = 1643
		    LAST_1 = 1662
			
!			Frontière Est (à repérer sur le fichier .cli)	
		    FIRST_2 = 32
		    LAST_2 = 51
		    I=BOUNDARY_COLOUR%I(N)
!			  On fait entrer la circulation du courant par la frontière Ouest
		    IF(I.GE.FIRST_1.AND.I.LE.LAST_1) THEN
		      IF(LIUBOR%I(K).EQ.KENTU) THEN
			    UBOR%R(K) = UBTIDE%R(K)+0.2 ! Ajouter la valeur du courant à cet endroit
			    VBOR%R(K) = VBTIDE%R(K)
			    U%R(MESH%NBOR%I(K)) = UBOR%R(K)
			    V%R(MESH%NBOR%I(K)) = VBOR%R(K)
			  ENDIF
!			  On fait sortir la circulation du courant par la frontière Est
		    ELSEIF(I.GE.FIRST_2.AND.I.LE.LAST_2) THEN
		      IF(LIUBOR%I(K).EQ.KENTU) THEN
			    UBOR%R(K) = UBTIDE%R(K)-0.2 ! Ajouter la valeur du courant à cet endroit
			    VBOR%R(K) = VBTIDE%R(K)
			    U%R(MESH%NBOR%I(K)) = UBOR%R(K)
			    V%R(MESH%NBOR%I(K)) = VBOR%R(K)
			  ENDIF
!				Pour le reste des noeuds on applique la condition de marée classique
		    ELSE
			  UBOR%R(K) = UBTIDE%R(K)
			  VBOR%R(K) = VBTIDE%R(K)
			  U%R(MESH%NBOR%I(K)) = UBOR%R(K)
			  V%R(MESH%NBOR%I(K)) = VBOR%R(K)
		    ENDIF
            IF(LIHBOR%I(K).EQ.KENT) THEN
              HBOR%R(K) = HBTIDE%R(K)
              H%R(MESH%NBOR%I(K)) = HBOR%R(K)
            ENDIF
		  ENDIF
	    ENDIF
      ENDDO
Attachments:
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36528

  • rosparsw
  • rosparsw's Avatar
I'm replying again to myself because I managed to correct some little errors in the code and now it's working as I wanted.

Thanks again for the help !


William
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36530

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello William,

Good news if you have succeeded in implementing what you want.

Anyway, a few comments about your implementation:
- ban tabulations and accents in your FORTRAN FILE or steering files, even in comments. It will prevent from some errors in the future if not already,
- use suffixe D0 or D-3 e.g. to tell you deal with double precision, not single precision 0.2 -> 0.2D0 or 2.D-1,
- you can be a little bit more efficient, defining your constants outside the loop. I can also suggest you a factorisation of your implementation (see enclosed file),
- is your general circulation supposed to go from west to east? It is because you use 2 different signs depending on the boundary where the node is located.

Hope this helps,

Chi-Tuan
Attachments:
The administrator has disabled public write access.
The following user(s) said Thank You: rosparsw

Multiple open boundaries definition 4 years 3 months ago #36534

  • rosparsw
  • rosparsw's Avatar
Thanks again, the code looks better and way more efficient !

The general circulation is indeed going from west to east and i noticed that i made a mistake with the signs buth thanks for the advice.

You've been truly helpfull with my issue.

Regards

William
The administrator has disabled public write access.

Multiple open boundaries definition 4 years 3 months ago #36546

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello William,

Thinking of your general circulation, I wonder why you dit not prescribe it even on your southern open boundary.
Moreover, the algorithm would even be easier (add 0.2D0 for every boundary node with prescribed velocities).

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

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