Welcome, Guest
Username: Password: Remember me

TOPIC: Tracer advection activation (ICONVF) in T2D v7p2

Tracer advection activation (ICONVF) in T2D v7p2 7 years 5 months ago #26681

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Hello,

I am modelling the dispersion of two tracers in a flow with TELEMAC2D v7p2(r0). Tracer n°1 must be advected but Tracer n°2 must not. I have therefore selected:

SCHEMA POUR LA CONVECTION DES TRACEURS = 14;0

I have set 0 for the second tracer as it is a possible option according to the dico (see 'telemac2d.dico' in the source files for key 'ICONVFT'). Now I am given the following error at the execution:

CVDFTR : OPTION DE CONVECTION INCONNUE :            0

So I deduce this 0 advection option for ICONVFT has not been implemented yet in CVDFTR, contrary to what the dico says, which is a pity.

Do you have any suggestion to make it work anyway?

Thank you for your help,
JBS.
The administrator has disabled public write access.

Tracer advection activation (ICONVF) in T2D v7p2 7 years 5 months ago #26723

  • riadh
  • riadh's Avatar
Hello

Yes the dico is misleanding with option 0. This should be corrected for next release.
The solution for your case is a bit complicated but should encourage Telemac developper to find easier solution since this case can happen for several cases of Waqtel.
The difficulty comes from the fact that tracers are managed through big structures and the option for convecting or not is applied on all the set of tracer not on each one.
In order to desactivate advection of tracer you can rather use the keyword
ADVECTION OF TRACERS = False.
But with this option you will desactivate advection for all tracer.

A tentative solution can be :
1- put telemac2d.F in your fortran user folder
2- in the loop do itrac=1,ntrac (line 2498), you can add the lines
IF (ITRAC.EQ.2)THEN ! for tracer #2
CONVV(3)=.FALSE.
ELSE
CONVV(3)=.TRUE.
ENDIF

Ideally, variable convv(3) should be changed to an array with a size of ntrac.
I hope that this helps

with my kind regards

Riadh
The administrator has disabled public write access.

Tracer advection activation (ICONVF) in T2D v7p2 7 years 5 months ago #26736

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Hello Riadh,

Thank you for your reply.
Your tentative solution look sound and simple. I have just tried it but for some reason this gave me NaN values. Here is the part of code I modified in telemac2d.F (v7p2r0) around line 2340:

!=======================================================================
!     ADVECTION-DIFFUSION OF TRACERS
!=======================================================================
!
      DO ITRAC=1,NTRAC
!
        if (ITRAC.eq.2) then
          CONVV(3)=.FALSE.
        else
          CONVV(3)=.TRUE.
        endif
! ...

Is it what you suggested? (the line number is not the one you said but I think this is what was meant)
For all tracers the advection scheme is N distributive (14). It seems the code doesn't like it when CONVV(3) changes during the calculation. Do you know the reason why? This might be in CVDFTR.f but not clear...

I could eventually get my simulation be re-using a (heavy) trick JM Hervouet gave me for v6p3 (which basically consists in zeroing the advection field). I can give it later if we can't make this simple solution above successful.

Thanks,
JBS.
The administrator has disabled public write access.

Tracer advection activation (ICONVF) in T2D v7p2 7 years 5 months ago #26738

  • riadh
  • riadh's Avatar
Hello JBS

This could be not working with distributive schemes (N and PSI), because source terms are handled in the advection step. For remaining schemes, mainly chacteristics, source terms are tackled with the diffusion step. Thus, is you do not mind to use characteristics, you can change the scheme et see if my solution will work or not.
On the other hand, if your old solution works well, I will be interested by recuperate it in order to see the possibility to integrate it in an easier way.

with my best regards

Riadh
The administrator has disabled public write access.

Tracer advection activation (ICONVF) in T2D v7p2 7 years 5 months ago #26742

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Aaah Ok. Indeed, it seems it is now working when setting the characteristics' option, that is:

SCHEMA POUR LA CONVECTION DES TRACEURS = 14;1

I do not mind using characteristics because it should not be running in the case of Tracer 2 anyway. And the distributive scheme 14 can still be attributed to Tracer 1 independently. Both solutions (yours and mine) are giving identical results so it is fine.

In next post I put the alternative method - which is a little more tedious.

Thank you again Riadh, and I hope this will be sorted out in next releases.
JBS.
The administrator has disabled public write access.

Tracer advection activation (ICONVF) in T2D v7p2 7 years 5 months ago #26743

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Another possible solution is to re-use a trick Jean-Michel Hervouet suggested for version v6p3, which seems to work out for v7p2 also. This also requires a modification of the file 'telemac2d.F', but a heavier one than the one you suggested above. Diffusion (VISC) here is also deactivated for tracer 2, be careful! I give it here below.

The idea is to create a work array (pipo1) filled with zeros and substituting it into the advection field arrays in the calling of CVFTR. But the case SOLSYS=1 or SOLSYS=2 must be distinguished. Be also careful with the YAFLODEL key.

(in 'telemac2d.F', same lines)
!=======================================================================
!     ADVECTION-DIFFUSION OF TRACERS
!=======================================================================
!
!-----------------------------------------------------------------------
!     Ajout pour la désactivation de la convection des traceurs
!     (mise a zero du tableau pipo1)
!
      CALL OS('X=0     ',X=pipo1)
!
!-----------------------------------------------------------------------
!
      DO ITRAC=1,NTRAC
!
!  CALLS THE STANDARD DIFFUSER. (CV1 IS THE SECOND MEMBER)
!
      INFOGT=INFOGR.AND.ENTET
!     HTILD: WORKING ARRAY WHERE HPROP IS RE-COMPUTED
!             (SAME ARRAY STRUCTURE)
!
!     LIMTRA REPLACED BY A COPY (IT MAY BE CHANGED BY THE ADVECTION SCHEME)
!
      DO I=1,NPTFR
        IT1%I(I)=LIMTRA%I(I)
      ENDDO
!
      IF(DEBUG.GT.0) WRITE(LU,*) 'CALLING CVDFTR SOLSYS=',SOLSYS
      IF(SOLSYS.EQ.1) THEN
!
!-----------------------------------------------------------------------
!     Mise à zero de la convection/diffusion du traceur 2
!
      if (ITRAC.eq.2) then
       CALL CVDFTR(T%ADR(ITRAC)%P,TTILD%ADR(ITRAC)%P,TN%ADR(ITRAC)%P,
     &            TSCEXP%ADR(ITRAC)%P,
     &            DIFT,ICONVFT(ITRAC),CONVV(3),H,HN,HPROP,TETAC,
     &            pipo1,pipo1,DM1,ZCONV,SOLSYS,
     &            pipo1,VISC_S,TEXP%ADR(ITRAC)%P,SMH,YASMH,
     &            TIMP%ADR(ITRAC)%P,YASMI(ITRAC),AM1,AM2,ZF,
     &            TBOR%ADR(ITRAC)%P,ATBOR%ADR(ITRAC)%P,
     &            BTBOR%ADR(ITRAC)%P,IT1,MASKTR,MESH,W1,TB,
     &            T1,T2,T3,T4,T5,T6,T7,T10,TE1,TE2,TE3,
     &            KDIR,KDDL,KENT,
     &            DT,ENTET,TETAT,AGGLOT,INFOGT,BILMAS,OPTADV_TR(ITRAC),
     &            ISOUSI,LT,NIT,OPDTRA,OPTBAN,
     &            MSK,MASKEL,MASKPT,MBOR,S,MASSOU(ITRAC),
     &            OPTSOU,SLVTRA(ITRAC),FLBOR,VOLU2D,V2DPAR,UNSV2D,
     &            2,FLBORTRA,
     &            FLULIM,YAFLULIM,DIRFLU,RAIN,PLUIE,TRAIN(ITRAC),
     &            FLODEL,.FALSE.,MAXADV,TB2,NCO_DIST,NSP_DIST)
      else
       CALL CVDFTR(T%ADR(ITRAC)%P,TTILD%ADR(ITRAC)%P,TN%ADR(ITRAC)%P,
     &            TSCEXP%ADR(ITRAC)%P,
     &            DIFT,ICONVFT(ITRAC),CONVV(3),H,HN,HPROP,TETAC,
     &            UCONV,VCONV,DM1,ZCONV,SOLSYS,
     &            VISCT%ADR(ITRAC)%P,VISC_S,TEXP%ADR(ITRAC)%P,SMH,YASMH,
     &            TIMP%ADR(ITRAC)%P,YASMI(ITRAC),AM1,AM2,ZF,
     &            TBOR%ADR(ITRAC)%P,ATBOR%ADR(ITRAC)%P,
     &            BTBOR%ADR(ITRAC)%P,IT1,MASKTR,MESH,W1,TB,
     &            T1,T2,T3,T4,T5,T6,T7,T10,TE1,TE2,TE3,
     &            KDIR,KDDL,KENT,
     &            DT,ENTET,TETAT,AGGLOT,INFOGT,BILMAS,OPTADV_TR(ITRAC),
     &            ISOUSI,LT,NIT,OPDTRA,OPTBAN,
     &            MSK,MASKEL,MASKPT,MBOR,S,MASSOU(ITRAC),
     &            OPTSOU,SLVTRA(ITRAC),FLBOR,VOLU2D,V2DPAR,UNSV2D,
     &            2,FLBORTRA,
     &            FLULIM,YAFLULIM,DIRFLU,RAIN,PLUIE,TRAIN(ITRAC),
     &            FLODEL,.FALSE.,MAXADV,TB2,NCO_DIST,NSP_DIST)
      endif
!
      ELSE
!
      if (ITRAC.eq.2) then      
       CALL CVDFTR(T%ADR(ITRAC)%P,TTILD%ADR(ITRAC)%P,TN%ADR(ITRAC)%P,
     &            TSCEXP%ADR(ITRAC)%P,
     &            DIFT,ICONVFT(ITRAC),CONVV(3),H,HN,HPROP,TETAC,
     &            pipo1,pipo1,pipo1,pipo1,1,
     &            pipo1,VISC_S,TEXP%ADR(ITRAC)%P,SMH,YASMH,
     &            TIMP%ADR(ITRAC)%P,YASMI(ITRAC),AM1,AM2,ZF,
     &            TBOR%ADR(ITRAC)%P,ATBOR%ADR(ITRAC)%P,
     &            BTBOR%ADR(ITRAC)%P,IT1,MASKTR,MESH,W1,TB,
     &            T1,T2,T3,T4,T5,T6,T7,T10,TE1,TE2,TE3,
     &            KDIR,KDDL,KENT,
     &            DT,ENTET,TETAT,AGGLOT,INFOGT,BILMAS,OPTADV_TR(ITRAC),
     &            ISOUSI,LT,NIT,OPDTRA,OPTBAN,
     &            MSK,MASKEL,MASKPT,MBOR,S,MASSOU(ITRAC),
     &            OPTSOU,SLVTRA(ITRAC),FLBOR,VOLU2D,V2DPAR,UNSV2D,
     &            2,FLBORTRA,
     &            FLULIM,YAFLULIM,DIRFLU,RAIN,PLUIE,TRAIN(ITRAC),
     &            FLODEL,.FALSE.,MAXADV,TB2,NCO_DIST,NSP_DIST)
      else
       CALL CVDFTR(T%ADR(ITRAC)%P,TTILD%ADR(ITRAC)%P,TN%ADR(ITRAC)%P,
     &            TSCEXP%ADR(ITRAC)%P,
     &            DIFT,ICONVFT(ITRAC),CONVV(3),H,HN,HPROP,TETAC,
     &            UDEL,VDEL,DM1,ZCONV,SOLSYS,
     &            VISCT%ADR(ITRAC)%P,VISC_S,TEXP%ADR(ITRAC)%P,SMH,YASMH,
     &            TIMP%ADR(ITRAC)%P,YASMI(ITRAC),AM1,AM2,ZF,
     &            TBOR%ADR(ITRAC)%P,ATBOR%ADR(ITRAC)%P,
     &            BTBOR%ADR(ITRAC)%P,IT1,MASKTR,MESH,W1,TB,
     &            T1,T2,T3,T4,T5,T6,T7,T10,TE1,TE2,TE3,
     &            KDIR,KDDL,KENT,
     &            DT,ENTET,TETAT,AGGLOT,INFOGT,BILMAS,OPTADV_TR(ITRAC),
     &            ISOUSI,LT,NIT,OPDTRA,OPTBAN,
     &            MSK,MASKEL,MASKPT,MBOR,S,MASSOU(ITRAC),
     &            OPTSOU,SLVTRA(ITRAC),FLBOR,VOLU2D,V2DPAR,UNSV2D,
     &            2,FLBORTRA,
     &            FLULIM,YAFLULIM,DIRFLU,RAIN,PLUIE,TRAIN(ITRAC),
     &            FLODEL,YAFLODEL,MAXADV,TB2,NCO_DIST,NSP_DIST)
      endif
      ENDIF

with work array 'pipo1' which has been defined at the top of the file as:

TYPE(BIEF_OBJ), TARGET :: pipo1

and later:

CALL BIEF_ALLVEC(1,pipo1,'PIPO1 ',IELMU,1,1,MESH)

Best regards,
JBS.
The administrator has disabled public write access.
The following user(s) said Thank You: riadh
Moderators: pham

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