Welcome, Guest
Username: Password: Remember me

TOPIC: Spatial and temporal varying boundary conditions

Spatial and temporal varying boundary conditions 13 years 6 months ago #747

  • Steve Renaud
  • Steve Renaud's Avatar
Hi all,

I'm looking for fortran subroutine that would help me to apply spatially and temporaly varying boundary conditions for Coastal circulation study. I can obtain from another model water level and velocities (U and V) at every nodes of my open ocean boundary (or segments of the boundary). I was thinking about finding a way to specify these values for every nodes of my boundary, but I'm not too familiar with Telemac's variables to build that Subroutine.

Has anyone would accept to share fortran files that could help me to build my subroutine.

Thanks
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 13 years 6 months ago #749

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 811
  • Thank you received: 217
Hello Steve,

Here is a quick solution:

First, you should format you input file like a LIQUID BOUNDARIES FILE, but with your own header, which I recommend you modify using say ETA(1372) ETA(772) ... where the numbers are your global node numbers (on your boundary), and also add the columns for the U and V in the same way. TELEMAC does not care which column comes first.

Your LIQUID BOUNDARIES FILE would look like:

# starts 21/09/2009 21:30 (time 0), ends 18/11/2009 00:00
# tidal elevations obtained from regional model r2d_Regional92-22sep18nov_v1p238L3ctd3.slf
#
T ETA(14257) ETA(14199) ETA(14206) ETA(14204) .... VIT(14257) VIT(14199) VIT(14206) .... NDU(14162) NDU(14273) NDU(14161) .... NDV(14162) NDV(14273) NDV(14161) NDV(14160) ....
s m m m .... m/s m/s m/s .... m/s m/s m/s .... m/s m/s m/s ....
0 0.1118927 0.1448822 0.13404846 .... -0.771434309 -0.615365748 -0.67209899 .... -0.50572884 -0.50745368 -0.51508558 .... -1.0022132 -0.95926291 -0.94195467 .... 0.90371764 -0.80580246 0.4948312

Note that the line for units is not used by TELEMAC and that the code ETA, or NDU or NDV are really your own. The file should be space delimited. You can setup this file in MS Excel for instance.
Note that the first column has to be your time in second (AT or TIME in TELEMAC)

Don't forget to add the keyword LIQUID BOUNDARIES FILE to your CAS file.

Second, in BORD (and it is the same for 3D users) you have a part that set the free surface level Z (similar for velocities) as follows:
Z = SL(IFRLIQ,NBOR(K))
HBOR(K) = MAX( 0.D0 , Z-ZF(NBOR(K)) )
H%R(NBOR(K))=HBOR(K)
You have to make sure that K is passed as argument, the global node number, so you can get its associated value from your LIQUID BOUNDARIES FILE in the Function SL( ). So in BORD, change Z = SL(IFRLIQ,NBOR(K)) into Z = SL(IFRLIQ,K)

Third, in the Function SL( ), you have to read the ETA(14199) for K = 14199 and return the value interpolated in time. To do this you can just call READ_FIC_FRLIQ, like it does by default, but change the FCT into what you require – as follows, for instance:

K = N
IF (NCSIZE.GT.1) K = MESH2D%KNOLG%I(N)
FCT(1:4)='ETA('
IF(K.LT.10) THEN
WRITE(FCT(5:5),FMT='(I1)') K
FCT(6:11)=') '
ELSEIF(K.LT.100) THEN
...
ELSEIF(K.LT.10000) THEN
...
ELSEIF(K.LT.100000) THEN
WRITE(FCT(5:9),FMT='(I5)') K
FCT(10:11)=') '

Note that thanks to K = MESH2D%KNOLG%I(N), this will also work in parallel.

Finally a few more modifications:
- Do comment the line DEJA=.TRUE. (in the IF(.NOT.DEJA) THEN…) in SL( )
- The FCT variable in SL( ) is CHARACTER*8 by default => make this the size you need, for instance CHARACTER*11 FCT
- You need to modify READ_FIC_FRLIQ, if the lines of your LIQUID BOUNDARIES FILE are too long, in particular
CHARACTER*3440 LIGNE instead of 144
(and track the 144 in the code, 3 places, to change it in 3440, for consistency)
And also the MAXVAR parameter:
INTEGER, PARAMETER :: MAXVAL=500 instead of 50
And also update the WHAT variable as follows:
CHARACTER*11 , INTENT(IN) :: WHAT
according to what you set in SL.

Please note that READ_FIC_FRLIQ is also used for velocities etc, and that if you modify WHAT, you will have to modify the FCT in SL( ) and VIT( ) etc.

Note also that for velocities, you have only an access to VIT( ) for the magnitude and that in BORD it set:
UBOR(K,1) = - XNEBOR(K) * VIT(NUMLIQ(K),NBOR(K))
VBOR(K,1) = - YNEBOR(K) * VIT(NUMLIQ(K),NBOR(K))
You can here create your own VITU( ) and VITV( ) to set UBOR and VBOR, where your VITU( ) and VITV( ) are essentially copies of VIT but modified to set either FCT = you VITU code ...

Obviously we would always be happy to provide you with more detailed support and advanced training if required outside this Forum.

Amicalement,

Sébastien.
The administrator has disabled public write access.
The following user(s) said Thank You: cranewoo

Re:Spatial and temporal varying boundary conditions 13 years 2 weeks ago #1379

  • Métivier
  • Métivier's Avatar
Hello Sébastien,

This explanation is great! I have a question about this methodology.

In the context of a problem for which only the water level (not in velocity) is imposed at a "liquid boundary", what should I do with the .bc2 file, which seems to be necessary to impose the boundary conditions to the .cas file (since the liquid boundary file has all the data needed)?

Thanks in advance,

Vincent
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 13 years 2 days ago #1435

  • Métivier
  • Métivier's Avatar
Hi,

After reading message #749 (previous message) on TELEMAC forum on the imposition of spatial and temporal varying boundary conditions, I followed the proposed methodology, but I get a problem with respect to the expression MESH2D%KNOLG%I(N).

Following the proposed methodology, I get error #6404 (ifort fortran compiler) stating that :

"This name does not have a name type, and must have an explicit type. [MESH2D]"

What should I do to avoid this error?

Thanks in advance

Vincent
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 13 years 2 days ago #1437

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3630
  • Thank you received: 1010
Hi Vincent

As i understand, the compilation error comes from the use of MESH2D%KNOLG%I(N) in the SL subroutine.
The message means that this variables is unknown for the compiler at this place.
I think you should add a USE BIEF in the beginning of this subroutine.

Regards
Christophe
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 13 years 2 days ago #1440

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I do not know in what subroutine you are but MESH2D exists only in Telemac-3D. If MESH2D is not available in your subroutine through arguments (it would then be declared as :
TYPE(BIEF_MESH) :: MESH2D
you can see it by adding at the beginning of your subroutine (after USE BIEF):

USE DECLARATIONS_TELEMAC3D, ONLY : MESH2D

If you are in Telemac-2D, then it is not MESH2D but probably MESH, and if not present you can add:

USE DECLARATIONS_TELEMAC3D, ONLY : MESH

With best regards,

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

Re:Spatial and temporal varying boundary conditions 13 years 2 days ago #1441

  • jmhervouet
  • jmhervouet's Avatar
Hum, for the example with Telemac-2D it is of course :

USE DECLARATIONS_TELEMAC2D, ONLY : MESH

JMH
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 12 years 10 months ago #1785

  • Métivier
  • Métivier's Avatar
Hi,

Using the proposed methodology, it is not very clear how, in BORD, the U and V velocities are read. Even though I tried to create additionnal functions in my FORTRAN file for U and V (which are read using READ_FIC_FRLIQ), it does not seem that BORD read it and I get a compilation error. It seems that only the magnitude is read since I am able to imposed normal velocity vector using VIT(but it is not the case that I want to study).

Just to be more clear, I did the following steps :

1. I have a proper Liquid Boundary File (with time, water level, velocity magnitude, U_BORD, V_BORD)
2. I created copies of VIT (which I called UBO and VBO) with proper modifications
3. I modified BORD in the following way :

UBOR(K,1) = UBO(NUMLIQ(K),K)
VBOR(K,1) = VBO(NUMLIQ(K),K)


It does not connect and I get a compilation error. (this name does not have type,
and must have explicit type)

I think I am close to what I should be but it does not work. Please note that I used UBO(NUMLIQ(K),K) instead of UBO(NUMLIQ(K),NBOR(K)) as it was proposed for SL

Can you help me on this.
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 12 years 10 months ago #1786

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3630
  • Thank you received: 1010
Hi
From the error message, i think you forgot to give the declaration of UBO and VBO at the beginning of bord.
You should add something like:
DOUBLE PRECISION, INTENT(INOUT) :: UBO(NPTFR2,2),VBO(NPTFR2,2)
regards
Christophe
The administrator has disabled public write access.

Re:Spatial and temporal varying boundary conditions 12 years 10 months ago #1787

  • Métivier
  • Métivier's Avatar
By adding,

DOUBLE PRECISION, INTENT(INOUT) :: UBO(NPTFR2,2),VBO(NPTFR2,2)

I get :

This array name is invalid in this context.

Is it because they are defined as function? I noticed that the function VIT is not declared at the beginning of BORD, as well as SL.

Thanks in advance,
The administrator has disabled public write access.
Moderators: pham

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