Welcome, Guest
Username: Password: Remember me

TOPIC: Subroutine SOURCE_TRAC; Decay depending on the tracers depth.

Subroutine SOURCE_TRAC; Decay depending on the tracers depth. 7 years 1 month ago #28042

  • louiseselmeus
  • louiseselmeus's Avatar
Hi, My name is Louise and at the moment I am doing my master thesis at Lund University where I am studying how degradation of bacteria can be modelled with help of TELEMAC. I am new to Telemac and really enjoy working with it. However have some thoughts concerning the subroutine SOURCE_TRAC. I want to run a simple decay where the decay is depending on which depth the tracer are at. However I do not understand how to programme this. The basis of my code can be seen below:

IF(NTRAC.GE.1) THEN
S0TA%ADR(1)%P%TYPR='Q'
S1TA%ADR(1)%P%TYPR='Q'
DO IPOIN3=1,NPOIN3
S0TA%ADR(1)%P%R(IPOIN3) = TA%ADR(1)%P%R(IPOIN3) *
& (K)
S1TA%ADR(1)%P%R(IPOIN3) =
& 0.D0
ENDDO
ENDIF

Where K is: depending on the depth z.

So I want to make the decay dependent on which depth the tracer is at for every point in the mesh and there wonder if someone has a suggestion or advice of how this can be done? Hope my question is not to confusing.

I am very greatful for your help and looking forward to work more with Telemac.

Best Wishes
Louise
The administrator has disabled public write access.

Subroutine SOURCE_TRAC; Decay depending on the tracers depth. 7 years 1 month ago #28057

  • riadh
  • riadh's Avatar
Hello Louise

In deed your question is confusing. I can't understand the final aim. However, all what you have written couldd work in a fortran point of view.
So try to run what you have written and you will see if it is what you need otherwise, you need only to adapt your decay law.

I hope that this helps.

kind regards
Riadh
The administrator has disabled public write access.

Subroutine SOURCE_TRAC; Decay depending on the tracers depth. 7 years 1 month ago #28061

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hello Louise!

I don't know if it is what you ask for but in case you want to know how to compute the depth of any 3D node you can instead loop on the 2D nodes first (bottom plane only, NPOIN2) and then on the vertical planes (NPLAN):

DO I2D=1,NPOIN2
DO IPLAN=1,NPLAN
I3D = I2D+NPOIN2*(IPLAN-1)
DEPTH = MAX(1.D-12,Z(I2D+NPOIN2*(NPLAN-1)) - Z(I3D))
!continue here
ENDDO
ENDDO

The value for I2D+NPOIN2*(NPLAN-1) is the surface node corresponding to the inital 2D node (bottom plane). So Z(I2D+NPOIN2*(NPLAN-1)) - Z(I3D) will give you the distance between the surface and the nodes located on the planes below along a same vertical. In can be useful to take the max of DEPTH and a very small value in order to avoid nil or any negative depth values which could trigger some mistakes if using a LOG law in your code...

Good luck!

Best regards
PL
The administrator has disabled public write access.
The following user(s) said Thank You: louiseselmeus

Subroutine SOURCE_TRAC; Decay depending on the tracers depth. 7 years 4 weeks ago #28072

  • louiseselmeus
  • louiseselmeus's Avatar
Hello!

Thank you so much!

Do you have any advice on how to print DEPTH in every timestep as a tracer?

Best Regards
Louise
The administrator has disabled public write access.

Subroutine SOURCE_TRAC; Decay depending on the tracers depth. 7 years 4 weeks ago #28073

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hello!

I don't really understand what do you mean by "printing as a tracer", but if you want to create a user variable which contains the depth value at every 3D node you can do it by using PRIVATE VARIABLES. Look for information in the manual.

Basically, you need to have:
NUMBER OF PRIVATE VARIABLES = 1 (or more...)
VARIABLES FOR 3D GRAPHIC OUTPUTS : 'PRIVE1' and all the other ones

and add the following line in the loop from my previous post:
PRIVE%ADR(1)%P%R(I3D) = DEPTH

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

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