WAQTEL Degradation

Hello

I think there is a bug in running the Degradation option of WAQTEL in telemac3d

I can successfully run it in telemac2d but in telemac3d it gives the following error. I tried different models all of which are okay in 2d but same error in 3d.

  • FONSTR (BIEF): ATTENTION, THE BOTTOM RESULTS

             FROM DEPTH AND SURFACE ELEVATION
    
             FOUND IN THE GEOMETRY FILE
    

STRCHE (BIEF): NO MODIFICATION OF FRICTION

NUMBER OF LIQUID BOUNDARIES: 0

CONDIM: DYNAMIC PRESSURE INITIALISED TO ZERO

     HYDROSTATIC PRESSURE INITIALISED TO ZERO.

================================================================================

ITERATION 0 TIME 0 D 0 H 0 MN 0.0000 S ( 0.0000 S)

================================================================================


            MASS BALANCE                             

            MASS BALANCE                             

INITIAL MASS OF WATER IN THE DOMAIN : 4999.9999999999991

USING STREAMLINE VERSION 7.3 FOR CHARACTERISTICS[/sub][/sub]

TELEMAC3D COUPLED WITH: [name removed]

CPSTVC : COPY OF HPROP FORBIDDEN ON S1TA1 BECAUSE ITS STATUS IS 1

PLANTE: PROGRAM STOPPED AFTER AN ERROR

The example that can be used is in the WAQTEL examples of the waq3d_o2 directory.

I modified the waq3d_o2 example for v8p0r0 to implement water quality process 17 (Degradation as opposed to the o2 process) I include the cas steering files, the other files required are in the waq3d_o2 directory. I did the same for the 2d version and it ran without error.

Appreciate any insight as to the possible remedy

[name removed]

t3d_waq3d_o2.cas (2.97 KB)
o2_waq_steer.cas (3.9 KB)

My fix to this problem for the 3D version is to take out the HPROP as this is necessary only for 2D and should not be in the 3D code see as follows

changes to the source_waq.F code

!

!-----------------------------------------------------------------------

!

! DEGRADATION LAW

!

  IF( 17*INT(WAQPROCESS/17).EQ.WAQPROCESS ) THEN

!

    DO J = 1,NWAQ_DEGRA

      ITRAC = RANK_DEGRA(J)

      IF(LOITRAC(ITRAC).EQ.1) THEN

!*

! [name removed] for Exponential Decay July 2019 Start

       IF(DIMM.EQ.2)THEN

        CALL OS('X=X+CY  ',X=TIMP%ADR(ITRAC)%P,

 &        Y=HPROP,C=-2.3D0/COEF1TRAC(ITRAC)/3600.D0)

       ELSEIF(DIMM.EQ.3)THEN

        CALL OS('X=X+C   ',X=TIMP%ADR(ITRAC)%P,

 &        C=2.3D0/COEF1TRAC(ITRAC)/3600.D0)

       ENDIF

! [name removed] for Exponential Decay July 2019 finish*

!

      ELSEIF(LOITRAC(ITRAC).GT.1) THEN

        WRITE(LU,21) LOITRAC(ITRAC),ITRAC

21 FORMAT(1X,‘LOITRAC ‘,[name removed],’ FOR TRACER ‘,I4,’ NOT YET PROGRAMMED’)

        CALL PLANTE(1)

        STOP

      ENDIF

!

      IF(DIMM.EQ.2)THEN

! YASMI(ITRAC) = .TRUE.

      ELSEIF(DIMM.EQ.3)THEN

        TIMP%ADR(ITRAC)%P%TYPR='Q'

      ENDIF

!

    ENDDO

    FOUND = .TRUE.

!

  ENDIF

!

!-----------------------------------------------------------------------

[name removed]

1 Like

Hello [name removed],

Your fix sounds good. Thanks for it and to have seen the bug.

[name removed]

Hello [name removed],

I’m trying to fix the same problem with telemac 3D using a modified fortran file following your instructions with same example [name removed] but I got this error.

================================================================================

ITERATION 0 TIME 0 D 0 H 0 MN 0.0000 S ( 0.0000 S)

================================================================================


            MASS BALANCE

            MASS BALANCE

INITIAL MASS OF WATER IN THE DOMAIN : 5000.0000000000000STOP 1

USING STREAMLINE VERSION 7.3 FOR CHARACTERISTICS

TELEMAC3D COUPLED WITH: [name removed]

OVD (BIEF) : UNKNOWN OPERATION: X=X+C

PLANTE: PROGRAM STOPPED AFTER AN ERROR

RETURNING EXIT CODE: 2


runcode::main:

:

|runCode: Fail to run

|C:\Users\zoi\Desktop\waq3d_o2\t3d_waq3d_o2.cas_2019-08-19-22h34min55s\out_source_waq.exe

|~~~~~~~~~~~~~~~~~~

|STOP 1

|~~~~~~~~~~~~~~~~~~

I attached my simulation files for checking

waq3d_o2.zip (118 KB)

Could you give some orientaion on how to fix this, or share some fortran file that I can compare with mine?

Any help will be very appreciated.

With best regards,

Taoan

Hi

As Indicated, the error commes from the formula you entered.

You probably forgot some space at the end.

there should be 8 characters between quotes in each formula

hope this helps

1 Like

Hello [name removed],

Thank you for your help, the code is working! I’m very amateur about fortran rules B)

However I have some doubts about [name removed] code that would like to understand.

[name removed] explained that the solution was to take out the HPROP, but I noted other changes on code that I indicate on attached picture. I does not understant why ‘X+C’ instead ‘X+CY’ and why the sign of term 2.3D0 changed to positive for 3D condition.

With best regards,

Taoan

The changes are related to the vertical discretization.

In 2D, there is no vertical discretization so we need to use the water height

In 3D, the resolution is done on every node (including on the vertical)

Regards

1 Like

I agree it appears to be counter intuitive that the sign should be different in the 3d case from the 2-d case but the result produced is correct for 3d (I think I checked the 2d case as correct also but cant remember), so it may be down to difference in formulation between the 2d and 3d cases.

[name removed]

1 Like

Yes [name removed], I checked the code on a 3d “closed box” experiment and it is working correctly. Thank you for the solution!

With best regards,

Taoan

1 Like

Hello [name removed],

I’m advancing in my tracer decay simulation with telemac3d, and now I’m testing to apply time varying wind, but I got this error.

*OPENING FILES FOR WAQTEL

DEALLOCATING AND REALLOCATING %R OF PATMOS 427 1 1

INBIEF (BIEF): NOT A VECTOR MACHINE (ACCORDING TO YOUR DATA)

STRCHE (BIEF): NO MODIFICATION OF FRICTION

NUMBER OF LIQUID BOUNDARIES: 0

CONDIM: DYNAMIC PRESSURE INITIALISED TO ZERO

     HYDROSTATIC PRESSURE INITIALISED TO ZERO.

==================================

INTERPMETEO2.f :

BEGINNING OF READING OF INPUT FILE

==================================

At line 131 of file C:\opentelemac-mascaret\v8p0\sources\telemac2d\interpmeteo2.f (unit = 8, file = ‘D:\PROJETO-MODELAGEM-PLUMA-ILHA-DE-MARE\MODELO-TELEMAC\bacia-teste-wind-decay\bacia-decay-wind.cas_2019-09-06-09h58min19s\T3ATMA’)

Fortran runtime error: End of file*

I noted that the problem occurs when I use decay and wind simultaneously. The model works if I run only wind or only tracer decay.

I attached my simulation files to checking.

bacia-teste-wind-decay.zip (105 KB)

Any help will be very appreciated.

With best regards,

Taoan

Hello [name removed],

It is a bug. Your ASCII ATMOSPHERIC DATA FILE is read twice, for the wind, and also for meteo data for the WAQTEL processes (but not used for DEGRADATION LAW). The problem is that the expected format for this file is not the same between only reading wind and reading meteo data for heat exchange e.g.

In your case, you can use the enclosed FORTRAN file which invert 2 treatments of this file in the METEO subroutine. Be careful that it is not generic but specific to your case.

Hope this helps,

[name removed]

meteo.f (11 KB)

2 Likes

Thank you [name removed], it is working fine!

[name removed]