Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: About how to change the formula for the keyword 'DENSITY LAW'

About how to change the formula for the keyword 'DENSITY LAW' 10 months 2 weeks ago #43881

  • Xinjie Zhang
  • Xinjie Zhang's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 50
  • Thank you received: 2
Hi everyone!
I have recently encountered some thorny problems, that is, when I change the DENSITY LAW value from 3 to 5, the tracer pressure is too high. Although temperature and salinity can affect the density of water body, they usually do not have a great impact, but the calculation results I have obtained are abnormal. On the one hand, I think the reading of temperature and salinity may be wrong; on the other hand, the underlying formula does not meet my needs. I have searched many files, including telemac3d.F et.al in the SOURCE folder, but still failed to find it. Therefore, I come to ask for your help, that is, how to find and change the formula pointed by the keyword DENSITY LAW=3, I hope someone can give me some help.
The expression is not good. If you have any questions about the above issues, I hope you can contact me. Hope to get a reply!
Attachments:
The administrator has disabled public write access.

About how to change the formula for the keyword 'DENSITY LAW' 10 months 2 weeks ago #43888

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello,

The formulae to compute Delta rho / rho_0 are implemented in drsurr.f file (name = combo of shorts + French: dr over r).
Moving from law 3 (= temperature + salinity + sediments) to law 5 (every tracer is passive, e.g. no influence of temperature, salinity and sediments for hydrodynamics) is not without effect.

What do you mean by "tracer pressure"?
Do you model sediments in your simulation? Have you also tried option 0?
Next time, if you want to investigate where a keyword is used in the source files, use the MNEMO of the dico file which should be the name of the variable try to find this name in the source files (e.g. in Linux with command grep).

I am curious to read what you could suggest as a good expression.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: Xinjie Zhang

About how to change the formula for the keyword 'DENSITY LAW' 10 months 2 weeks ago #43889

  • Xinjie Zhang
  • Xinjie Zhang's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 50
  • Thank you received: 2
Hi Chi-Tuan
Thank you very much for your advice, haha. By "good expression" I mean I am not very good at using English. Thanks again for your advice! Best regard to you.
Xinjie Zhang
The administrator has disabled public write access.

About how to change the formula for the keyword 'DENSITY LAW' 10 months 2 weeks ago #43915

  • Xinjie Zhang
  • Xinjie Zhang's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 50
  • Thank you received: 2
Hi all!
First of all, I am very grateful to the Chi-Tuan for giving me some good advice, but now I have a lot of confusion.
According to THE subroutine drsurr,DELTAR=(Rho-Rho0)/RHO0, where RHO is WATER DENSITY and RHO0 is AVERAGE WATER DENSITY IN THE DOMAIN, I know that RHO is a pointer variable after understanding. It doesn't seem to be directly defined and output in a file, so my first question is is RHO an array variable? Secondly, the project I want to use is DENLAW=3. When I check its calculation formula, I find that the reference tracer parameter is Y=TA%ADR(IND_T)%P. TA%ADR(1)%P%R(J) is more like an element of TA%ADR(IND_S)%P than TA%ADR(1)%P%R(J) in the subroutine USER_CONDI3D_TRAC, so is the RHO calculated as a node or as a PLANE or in other ways? What should I do if I want to calculate the density of nodes?
The last thing I want to conclude is, I now have a temperature and salinity and sediment concentration that is changing in time and space, how do I get a density field that is changing in time? Can this be done with telemac software?
Look forward to hearing from you all!
Xinjie Zhang
The administrator has disabled public write access.

About how to change the formula for the keyword 'DENSITY LAW' 10 months 1 week ago #43960

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Xinjie,

RHO stores the density but most of the time is useless in TELEMAC-3D as what is used to solve the equations is Delta rho / rho. That is why the key subroutine is DRSURR.

What do you mean by "is is RHO an array variable?"?

Be careful, USER_CONDI3D_TRAC is a user subroutine, defined by user, not standard TELEMAC-3D. The numbering of tracer (1 in USER_CONDI3D_TRAC) should be consistent with the numbering defined in NAMES OF TRACERS. IND_T and IND_S are generic number of tracers for temperature and salinity defined from your steering files.

If you exactly want to know how RHO is defined, have a look at how it is allocated in POINT_TELEMAC3D subroutine:
      CALL BIEF_ALLVEC(1, RHO   , 'RHO   ', IELM3,  1, 1,MESH3D)

In short, that means RHO is defined at every node of the 3D mesh.

When calling DRSURR subroutine from TELEMAC3D subroutine, density is computed in RHO, you only need to use it if you want.

What do you mean by "how do I get a density field that is changing in time". If you do not use DENSITY LAW = 5, density varies most of the time if the tracers are active.

My last remark is, as a rule of this forum: DO NOT CROSS-POST THE SAME QUESTION TO MULTIPLE PLACES !!! It will be the best way I will not answer you next times for sure.

See opentelemac.org/index.php/kunena/21-tele...cted-results-emerged

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: Xinjie Zhang

About how to change the formula for the keyword 'DENSITY LAW' 10 months 1 week ago #43963

  • Xinjie Zhang
  • Xinjie Zhang's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 50
  • Thank you received: 2
Hello Chi-Tuan,
I am sorry that I did not understand the relevant rules of the forum in advance and did something against the rules. On the one hand, I am really desperate. In real life, none of my teachers and friends have learned TELEMAC, this forum is almost the only way for me to learn TELEMAC. I am grateful to everyone who answers me here, and I should uphold the rules of the forum community and apologize again for my inappropriate behavior. Please delete my latest post if you can. What's more, thank you very much for your reply.
Xinjie Zhang
The administrator has disabled public write access.

About how to change the formula for the keyword 'DENSITY LAW' 6 months 3 weeks ago #44680

  • crojas
  • crojas's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 1
Hi Chi-Tuan,

if Density Law 5 does not compute density with temperature, density, and/or sediments, what it does do? does assume a constant value given on the steering file? I can only assume is the AVERAGE WATER DENSITY with a default value of 1025. Am I correct?

Also, what is the difference between options 0 and 5? I was reading the drsurr.f file and I notice that they are together on a conditional IF:
      ELSEIF(DENLAW.EQ.0.OR.DENLAW.EQ.5) THEN
        CALL OS('X=0     ',X=DELTAR)
        CALL OS('X=C     ',X=RHO,C=RHO0)

I'm interested in this since I have a model with sediments and it's working fine with density law 2. However, I want to compute the density using salinity alone and having sediments as a passive tracer. Is this possible?
If you could help me it would be great since I'm not clear after reading neither the Fortran file nor the manual.

Thanks,
Cristian
The administrator has disabled public write access.

About how to change the formula for the keyword 'DENSITY LAW' 6 months 3 weeks ago #44682

  • pham
  • pham's Avatar
  • OFFLINE
  • Administrator
  • Posts: 1559
  • Thank you received: 602
Hello Cristian,

DENSITY LAW = 5 means every tracer is passive: density is not dependent on tracers and is constant, equal to the value given by AVERAGE WATER DENSITY if needed to be used (by AED2 e.g.). But in the equations solved by TELEMAC-3D, only Delta rho/rho_0 is of interest and the value of the density is not used usually.

The difference between options 0 and 5 is the dependence on sediment or not to compute Delta rho/rho_0, do not forget the other test IF (DENLAW.NE.5) THEN which is important to discriminate the 2 choices.

If you want to compute the density using salinity without sediment (or sediment as a passive tracer), comment or delete the following lines (with the test IF(DENLAW.NE.5)), e.g. in your Fortran file:
      IF (DENLAW.NE.5) THEN
        IF(NSUSP_TEL.GT.0) THEN
          DO ITRAC = IND_SED,IND_SED+NSUSP_TEL-1
            ISUSP=ITRAC-IND_SED+1
            ICLA=NUM_ISUSP_ICLA(ISUSP)
            CALL OS('X=X+CY  ',X=DELTAR,Y=TA%ADR(ITRAC)%P,
     &               C=(XMVS0(ICLA)-RHO0)/(RHO0*XMVS0(ICLA)))
          ENDDO
        ELSEIF(S3D_SEDI) THEN
          IF(S3D_MIXTE) THEN
            CALL OS('X=X+CY  ',X=DELTAR,Y=TA%ADR(NTRAC-1)%P,
     &                         C=(S3D_RHOS-RHO0)/(RHO0*S3D_RHOS))
            CALL OS('X=X+CY  ',X=DELTAR,Y=TA%ADR(NTRAC)%P,
     &                         C=(S3D_RHOS-RHO0)/(RHO0*S3D_RHOS))
          ELSE
            CALL OS('X=X+CY  ',X=DELTAR,Y=TA%ADR(NTRAC)%P,
     &                         C=(S3D_RHOS-RHO0)/(RHO0*S3D_RHOS))
          ENDIF
        ENDIF
      ENDIF

I thought the TELEMAC-3D user manual and TELEMAC-3D reference manual were clear enough. If you have suggestions to improve, do not hesitate to give them.

Hope this helps,

Chi-Tuan
The administrator has disabled public write access.
The following user(s) said Thank You: crojas

About how to change the formula for the keyword 'DENSITY LAW' 6 months 3 weeks ago #44692

  • crojas
  • crojas's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 1
Hi Chi-Tuan,

You're right, the manual is clear enough but I did not understand correctly.
And thanks for the suggestion to calculate the density with sediments as a passive tracer. I'll try it.

Best,
Cristian
The administrator has disabled public write access.

About how to change the formula for the keyword 'DENSITY LAW' 6 months 3 weeks ago #44693

  • crojas
  • crojas's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 37
  • Thank you received: 1
It's possible to tell Telemac to use a different drsurr.f file?

I'm working on a cluster and I don't have permission to modify these files.

It's possible to use the methodology described here?

This is, copying the new drsurr.f file into the current simulation folder and modify the steering file indicating the keyword FORTRAN FILE to point to this new file?

I've done this in the past with another file but I'm not sure if it's possible with any Fortran file, especially with those related to the sources of Telemac.

Thanks in advance,
Cristian
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: pham

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