Welcome, Guest
Username: Password: Remember me

TOPIC: Problem with SOURCE_TELEMAC2D.f

Problem with SOURCE_TELEMAC2D.f 9 years 7 months ago #16589

  • OB
  • OB's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Hello,

I have a question regarding the use of SOURCE_TELEMAC2D. In fact, I would like to model several water and tracer sources with this subroutine.

I put as an attached document a test simulation with two sources. It does not succeed, and I have no creation of tracer.

To have my two sources functioning, I must add in my steering file the lines:
ABSCISSES DES SOURCES = 0;0
ORDONNEES DES SOURCES = 0;0
DEBITS DES SOURCES = 0;0
VALEURS DES TRACEURS DES SOURCES = 0;0

with the right number of sources. (I can write 0;0 or 10;10, it does not matter)

it seems that the line
NREJET = 2

in SOURCE_TELEMAC2D.f does not allow to model two sources.

How can I do to indicate directly the number of source in SOURCE_TELEMAC2D.f, without having to give it in the steering file?

PS : my simulation is given as an attached document,

Thank you very much, I'm using the version V7P0.

Olivier
Attachments:
The administrator has disabled public write access.

Problem with SOURCE_TELEMAC2D.f 9 years 7 months ago #16590

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi Olivier

In your case, the main problem is that the memory allocation was done according to the steering file and the number of values read in those lines.
To bypass this problem, I think you should modify the subroutine telemac2d.f in order to define the number of sources before the memory allocation

Hope this helps

Christophe
Christophe
The administrator has disabled public write access.

Problem with SOURCE_TELEMAC2D.f 9 years 7 months ago #16592

  • jmhervouet
  • jmhervouet's Avatar
Hello Olivier,

No, it is written like this, the number of values (of coordinates I think) given in the steering file determines the number of sources. Then the number of discharges, velocities, values of tracers, etc., are also parameters used to check the consistency of data. It is probably too late to give NREJET in source_telemac2d, because we can suppose that arrays are dimensioned before with NREJET. And I now see too late also that there is the same answer by Christophe...

Regards,

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

Problem with SOURCE_TELEMAC2D.f 9 years 7 months ago #16593

  • OB
  • OB's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Thank you very much Christophe and Jean-Michel.

In fact I'm working on the modelling of viruses in Camargue, and the viruses are injected in water by birds. So we use the numbers of birds observed in defined polygons,and in these polygons we add corresponding viruses with time.

So what I would like to do is :
- I have several polygons in my model, and for each polygone, I have the quantity of tracer (viruses) to add . So my idea was to use at each time step the subroutine SOURCE_TELEMAC2D, in which I "scan" all the nodes, and if they are in the polygone (using inpoly.f) I add the corresponding values DSCE and TSCE.



However, to do this, I have to be able to define :

NREJET=NPOIN


My code in SOURCE_TELEMAC2D.f would be something like :
NREJET=NPOIN
      DO L=1,NPOIN
      IF(INPOLY(MESH%X%R(L),MESH%Y%R(L),X_POLY,Y_POLY,NLIG_POLY)) THEN

            ISCE(L) = L
            XSCE(L) = MESH%X%R(L)
            YSCE(L) = MESH%Y%R(L)
            DSCE(L) = 1.D0
            TSCE(L,1) = 1000.D0 
            USCE(L) = 0.D0
            VSCE(L) = 0.D0
			
      ELSE

	    ISCE(L) = L
            XSCE(L) = MESH%X%R(L)
            YSCE(L) = MESH%Y%R(L)
            DSCE(L) = 0.D0
            TSCE(L,1) = 0.D0 
            USCE(L) = 0.D0
            VSCE(L) = 0.D0
	  
	
      ENDIF
      ENDDO

I don't know if I have the good approach...

Would you do like this to add at each time step quantity of tracers in areas defined by polygones?

I don't know if I'm clear...

Olivier
The administrator has disabled public write access.

Problem with SOURCE_TELEMAC2D.f 9 years 7 months ago #16594

  • jmhervouet
  • jmhervouet's Avatar
Hello,

This is simply horrible! Why don't you just add tracers where you want, at the end of the time step for example. Knowing the volume around every point, which is VOLU2D, it is not very difficult to know how much tracer you add at every point, something like tracer*volu2d*depth. Then it will trigger an error of mass but you know why and you can even compute it to check.

Regards,

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

Problem with SOURCE_TELEMAC2D.f 9 years 7 months ago #16596

  • OB
  • OB's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
Thank you very much Jean-Michel,

Yes, my approach was really wrong

I will do as you say,

Thank you again!

Regards,

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

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