Welcome, Guest
Username: Password: Remember me

TOPIC: Conditioned puntual source terms

Conditioned puntual source terms 9 years 8 months ago #15922

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Hello,

I would like to simulate a case where water is taked in a caption point and it is released in another downstream point after an industrial process of colling.

I think that it is need to use two source/sink points. The first point is a sink whose tracer outflow will conditionate the inflow tracer value in the downstream release point.

Is it possible to configure this kind of conditioned source/sink points in Telemac 3D?

Thank you for any help.

Best Regards

Taoan
The administrator has disabled public write access.

Conditioned puntual source terms 9 years 8 months ago #15931

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi
There is no difficulties to do that but you should adapt a fortran subroutine (I don't remember the name but it should be something like prosou).
In this subroutine, you could describe the discharge value (negative for the sink and positive for the source) and you could also give the concentration of the tracer at the source as a function of the concentration of the tracer at the sink node).
Did you check in the exemple if this application is not already implemented in a test case?

Regards
Christophe
The administrator has disabled public write access.

Conditioned puntual source terms 9 years 8 months ago #15940

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I had written detailed explanations but they apparently did not show up. The subroutines to include in your Fortran file are in fact two functions :

t3d_dsce and t3d_trsce, which give respectively the discharges and the tracers values at the sources. If you do not change them, they will take the constant values prescribed with the keywords:

WATER DISCHARGE OF SOURCES
VALUE OF THE TRACER AT THE SOURCES

You have in the arguments the source number I, the tracer number ITRAC, and also the time TIME, so you may want to put any formula based on these arguments. You can put your formula at the end of the functions, e.g.:

IF(I.EQ.1) THEN
T3D_DEBSCE=-50.D0
ELSEIF(I.EQ.2) THEN
T3D_DEBSEC=+50.D0
ENDIF

to take 50 m3/s at a point and release thelm at another point.

I hope this helps.

With best regards,

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

Conditioned puntual source terms 9 years 8 months ago #15957

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Hello c.coulet and Jean-Michel,

Thank you for the help.

I did not find any test case in telemac examples, but I think that the solution proposed by Jean-Michel can solve my problem.

I included the modified t3d_trsce function in my Fotran file and use this formula.

IF(I.EQ.2) THEN
T3D_TRSCE=TASCE(1,ITRAC)
ELSE
T3D_TRSCE = TASCE(I,ITRAC)
ENDIF

in this case I=1 for the sink point and I=2 for the release source point.

My model is not crashing, but the tracer concentration that I get in release point is not the computed concentration observed in the sink point.

I think that the concentration in my release point is the same prescribed by the keyword VALUE OF THE TRACER AT THE SOURCES for sink point in my steering file.

I don't know how to force the model to overwrite the VALUE OF THE TRACER AT THE SOURCES in the release point with tracer value computed near the sink point.

Am I right in prescribe values of 0.0 for both sink and source points with keyword VALUE OF THE TRACER AT THE SOURCES?

For me, does not make sense to prescribe tracer concentration for sink points, but I think that it is necessary to define some value in steering file.

I will appreciate any help with these questions.

Best regards,

Taoan
The administrator has disabled public write access.

Conditioned puntual source terms 9 years 8 months ago #15979

  • jmhervouet
  • jmhervouet's Avatar
Hello,

What you really want is something like:

IF(I.EQ.2) THEN
IF(ISCE(1).GT.0) THEN
! CASE WHERE SOURCE-SINK 1 IS IN SUBDOMAIN
! ADR(1) IS FOR TRACER 1, IT WOULD BE ADR(2) FOR TRACER 2.
! TA IS THE BLOCK OF TRACERS (WHAT IS A BLOCK IS EXPLAINED IN THE GUIDE FOR
! PROGRAMMING IN THE TELEMAC SYSTEM)
! ((KSCE(1)-1)*NPOIN2+ISCE(1)) IS THE GLOBAL ADDRESS OF SOURCE-SINK POINT 1
! AS ISCE(1) IS ITS 2D ADDRESS AND KSCE(1) ITS PLANE NUMBER
T3D_TRSCE=TA%ADR(1)%P%R((KSCE(1)-1)*NPOIN2+ISCE(1))
ELSE
! CASE WHERE SOURCE-SINK 1 IS NOT IN SUBDOMAIN
T3D_TRSCE=0.D0
ENDIF
! TAKING THE NON ZERO VALUE IN THE SUB-DOMAIN(S) THAT HAVE IT
! P_DMIN TAKES THE MINIMUM AMONG ALL PROCESSORS
! P_DMIN WILL GIVE IT IF NEGATIVE, OR WILL RETURN 0
! P_DMAX WILL GIVE IT IF POSITIVE, OR WILL RETURN 0
IF(NCSIZE.GT.1) T3D_TRSCE=P_DMIN(T3D_TRSCE)+P_DMAX(T3D_TRSCE)
ELSE
T3D_TRSCE = TASCE(I,ITRAC)
ENDIF

You will have to add KSCE, ISCE and NPOIN2 in the ONLY list of
USE DECLARATIONS_TELEMAC3D at the beginning of the function. If P_DMIN and P_DMAX not recognised, add also USE INTERFACE_PARALLEL.

I hope it works, not tested, but if you understand the explanations you will be able to correct and to adapt the implementation to other cases.

With best regards,

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

Conditioned puntual source terms 9 years 8 months ago #15988

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Thank you very much Jean-Michel!

Your solution is working fine!

I needed to add the variable TA and USE INTERFACE_PARALLEL in t3d_trsce subroutine

I also had to add the subroutine MODULE INTERFACE_PARALLEL in my Fortran file because Telemac was unable to find it directly in the system directory(??).

With best regards,

Taoan
The administrator has disabled public write access.

Conditioned puntual source terms 9 years 8 months ago #15989

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Yes, I forgot to mention TA. I'm glad you were able to have it working rapidly.

With best regards,

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

Conditioned puntual source terms 9 years 7 months ago #16396

  • taoan
  • taoan's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 52
  • Thank you received: 9
Dear Jean-Michel,

I am trying to setup conditioned sources in Telemac2D using trsce subroutine as we did with Telemac3D t3d_trsce subroutine

in Telemac3D t3d_trsce subroutine we use this formulation and it works fine

IF(I.EQ.2) THEN
IF(ISCE(1).GT.0) THEN
T3D_TRSCE=TA%ADR(1)%P%R((KSCE(1)-1)*NPOIN2+ISCE(1))
ELSE
! CASE WHERE SOURCE-SINK 1 IS NOT IN SUBDOMAIN
T3D_TRSCE=0.D0
ENDIF

in Telemac2D trsce subroutine I'm using this formulation, but it is not working

IF(I.EQ.2) THEN
IF(ISCE(1).GT.0) THEN
TRSCE=T%ADR(1)%P%R(NPOIN+ISCE(1))
ELSE
! CASE WHERE SOURCE-SINK 1 IS NOT IN SUBDOMAIN
TRSCE=0.D0
ENDIF

I think that I'm not assigning the corret names for Telemac2D variables

I will appreciate any help this problem.

Best regards,

Taoan
The administrator has disabled public write access.
Moderators: pham

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