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

TOPIC: Initialization of tracers along the water column

Initialization of tracers along the water column 12 years 5 months ago #4716

  • pprodano
  • pprodano's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 55
Hello,

I am modeling thermal discharge into a stratified fresh water lake, and want to capture the fact that deeper water will initially be colder than surface water. I wish to initialize a Telemac3d simulation with tracer concentrations that vary along the water column.

It is my understanding that condim.f initializes tracers with the following piece of code:
!     INITIALISES TRACERS
!
      IF(NTRAC.GT.0) THEN
        DO I=1,NTRAC
          CALL OS( 'X=C     ', X=TA%ADR(I)%P, C=TRAC0(I))
        ENDDO
      ENDIF

Can someone offer a simple suggestion regarding how to modify the above code to capture initial stratification? I have limited data on the stratification profiles, and will likely have to assume a vertical temperature distribution based on initial water depth.

Has anyone done something similar with Telemac3d? If so, how? Any suggestions/comments would be most appreciated.

Thanks,

Pat
The administrator has disabled public write access.

Re: Initialization of tracers along the water column 12 years 5 months ago #4717

  • sebourban
  • sebourban's Avatar
  • OFFLINE
  • Administrator
  • Principal Scientist
  • Posts: 814
  • Thank you received: 219
Hello,

Something like this should do:
!     TRACERS INITIALIZATION
!
      IF(NTRAC.GT.0) THEN
        DO I=1,NTRAC
           CALL OS( 'X=C     ', X=TA%ADR(I)%P, C=TRAC0(I))
           IF( ITRAC.EQ.1 ) THEN       ! ITRAC=1: is your tracer
             DO IPLAN = 1,NPLAN
               IF( IPLAN.GE.3 ) THEN   ! IPLAN=1: bed, IPLAN=NPLAN: surface
                 DO JPOIN = 1,NPOIN2
                   TA%ADR(1)%P%R((IPLAN-1)*NPOIN2+JPOIN) = 20
                 ENDDO
               ELSE
                 DO JPOIN = 1,NPOIN2
                   TA%ADR(1)%P%R((IPLAN-1)*NPOIN2+JPOIN) = 10
                 ENDDO
               ENDIF
            ENDDO
         ENDIF
        ENDDO
      ENDIF

Hope this helps.

Sébatsien
The administrator has disabled public write access.

Re: Initialization of tracers along the water column 12 years 5 months ago #4723

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Thanks Sébastien. I have just a microscopic remark: I would prefer that you write 10.D0 and 20.D0 for the tracer, to be clear about the fact that we expect double precision here (10 and 20 are OK here as the compiler will translate but in a list of arguments for a subroutine this would be forbidden).

Regards,

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

Re: Initialization of tracers along the water column 12 years 3 months ago #5288

  • pprodano
  • pprodano's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 96
  • Thank you received: 55
Hello,

Thank you very much for providing the above code (I was only able to use it last week). Everything worked perfectly.

There is a small addition I wish to implement in the above source code for tracer initialization. I want to apply the stratification only when the bottom elevation is greater than a specified value. I understand that I need to add an if statement that says if the bottom elevation is greater than, say 100 m, initialize with stratification, otherwise no stratification. This way if I have shallow depths, no stratification will be present.

If I try something like:
IF (Z > 100) THEN
...
END IF

the compiler complains. I probably don't have the right variable name for the bottom elevation. Can someone help? (I appologize for my very limited Telemac programming knowledge).

Thanks in advance,

Pat
The administrator has disabled public write access.

Re: Initialization of tracers along the water column 12 years 3 months ago #5289

  • jmhervouet
  • jmhervouet's Avatar
Hello,

If you are in condim, the bottom topography of point I is in ZF%R(I). I is in 2D numbering, in the 3D numbering the first points are the bottom. The bottom of point I is also MESH3D%Z%R(I), but here this Z will give the elevation of all 3D points, e.g. MESH3D%Z%R(I+NPOIN2) is the elevation of the first plane above point I.

Regards,

JMH
The administrator has disabled public write access.

Initialization of tracers along the water column 10 years 2 months ago #14259

  • Gaeta
  • Gaeta's Avatar
Thanks for your example: it is very useful but the model doesn't run.
Actually, by using Tel3d v6p3, which are the keywords I should change to read the initial conditions for the tracer in the subroutine conlim?

Thanks in advance for your help

G
The administrator has disabled public write access.

Initialization of tracers along the water column 10 years 2 months ago #14260

  • jmhervouet
  • jmhervouet's Avatar
Hello,

This may be another reason, because subroutine CONDIM is always called at the beginning of a computation. Maybe details on what happens, or your Fortran file with subroutine CONDIM would help going further.

With best regards,

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

Initialization of tracers along the water column 10 years 2 months ago #14261

  • Gaeta
  • Gaeta's Avatar
Thanks for your help. Here is the .f file.
It seems that the initial tracer value should be defined also if I'd like to defined values in the fortran file.

G
Attachments:
The administrator has disabled public write access.

Initialization of tracers along the water column 10 years 2 months ago #14262

  • jmhervouet
  • jmhervouet's Avatar
Yes, TRAC0(I) corresponds to keyword INITIAL VALUES OF TRACERS, 0. by default
You should also write 10.D0 and 20.D0 instead of 10D0 and 20D0 but it probably works also.

REgards,

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

Initialization of tracers along the water column 10 years 2 months ago #14268

  • Gaeta
  • Gaeta's Avatar
Sorry, jmhervouet.
I couldn't understand what I should change in my keywords.
"Initial values for tracers " are mandatory in the cas file (attached).
Thanks in advance, and sorry.. I'm quite new in manipulating fortran file for tel3d... :unsure:

G
Attachments:
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.