Welcome, Guest
Username: Password: Remember me

TOPIC: stratification+steep real bathymetry problem

stratification+steep real bathymetry problem 10 years 7 months ago #12546

  • 716469
  • 716469's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 303
  • Thank you received: 6
Thanks a mil Christophe, will do so.

Kind Regards!

violet
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 7 months ago #12595

  • 716469
  • 716469's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 303
  • Thank you received: 6
Dear Christophe,

I hope you are doing well. I have tried to program the tracers vertical profile in TRA_PROF_Z to have a stratified flow at boundary, but failed. I am still new to Fortran but somehow managed to do easier coding before. I am trying to use the code similar to below but I get some errors.

IF(ITRAC.NE.NTRAC.OR..NOT.SEDI) THEN
DO ITRAC=1,NTRAC
! CALL OS('X=C ',X=TA%ADR(ITRAC)%P,C=TRAC0(ITRAC))
DO I=1,NPOIN2
DO IPLAN=1,NPLAN
J=I+((IPLAN-1)*NPOIN2)
IF(IPLAN.GT.8) THEN
TRA_PROF_Z(1)=1.D0
TRA_PROF_Z(2)=25.D0
ELSE
TRA_PROF_Z(1)=4.34D0
TRA_PROF_Z(2)=35.D0
ENDIF
ENDDO
ENDDO
ENDDO
ENDIF

I think my problem is on following lines: TRA_PROF_Z(1)=1.D0 and TRA_PROF_Z(2)=25.D0 as I am not sure how exactly to code TRA_PRO_Z. I am trying to create two layers at open boundary with following tracers values: layer 1 - temp 4.34 and salinity 35; and layer 2 - temp 1 and salinity 25. I could not find any similar cases and there is not example on how to do it in this subroutine. Could you please put me into right direction if you are aware of any similar examples I can look at. Thanks a mil.

Kind Regards!

Violet
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 7 months ago #12596

  • c.coulet
  • c.coulet's Avatar
  • OFFLINE
  • Moderator
  • Posts: 3722
  • Thank you received: 1031
Hi Violet
Tra_prof_z is a function which return a value (and not a vector).
On arguments, you could find:
I : the number of the liquid boundary (you probably have only 1 liquid boundary so no specific treatment linked to this value)
IPOIN2 : the global number of point considered on the boundary. It allow you to manage a vertical profile which vary in space (probably not necessary for you at least for the moment)
TIME and LT : For managing a time varying vertical profile
IPLAN: the plan number considered. You have to use it to affect the right value of tracer
ENTET: no interest
IOPT: linked to the option chose in your sterring file. You have to modify the right part according to this value
ITRAC : the tracer number considered. You have to use it to affect the value

This function is called for every point on a liquid boundary, for each plane and for each tracer.
So you just have to make some tests:
  • on ITRAC to select if you should return the value of temperature or salinity
  • on IPLAN to select le value of each tracer according to the layer
The other options are here for more complex situation

Hope this helps
Christophe
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 7 months ago #12760

  • 716469
  • 716469's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 303
  • Thank you received: 6
Hi Christophe,

Thank you again for your explanation in terms of how to use TRA_PROF_Z subroutine in order to prescribe the various tracers at open boundary. I have tried to follow your advice but obviously I am doing something wrong, as values I try to prescribe are not picked. So far I have come up with below code which probably contains errors but they are not obvious to me as I am still new to Frotran. To keep it simple, I have decided to start with one tracer only, temperature in this case, but to have two stratified layers at open boundary. In total I have 10 layers, and temperature value at open boundary from layer 1 to 8 is 4.34C, and from layer 9to 10 is just 1C. I managed to write a vertical tracers profile in domain without any problems, but when it comes to open boundary, I am stack. Here is my code below. Could you please point out where is my mistake if you do not mind, as I have spent some time on it experimenting without any success. Thanks a mil.

IF(ITRAC.NE.NTRAC.OR..NOT.SEDI) THEN
DO IPLAN=1,NPLAN
IF(IPLAN.GT.8) THEN
TRA_PROF_Z=1.0D0
ELSE
TRA_PROF_Z=4.34DO
ENDIF
ENDIF


Kind Regards!

Violet
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 7 months ago #12763

  • jmhervouet
  • jmhervouet's Avatar
Hello,

What about the keyword : TRACERS VERTICAL PROFILES, which must be set to 0 to have a user-defined vertical profile ? Could it be this ? And you consequently have to program your profile in the section IF(IOPT.EQ.0) THEN... in function tra_prof_z.

With best regards,

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

stratification+steep real bathymetry problem 10 years 7 months ago #12764

  • 716469
  • 716469's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 303
  • Thank you received: 6
Dear Jean-Michel,

Thank you for your reply. Yes, the TRACERS VERTICAL PROFILES are already set up to 0 in steering file, and I have made below changes in fortran subroutine as per below. I think my problem is that I do not know how to write the loop correctly, that is why it is no working. Here what I have for vertical tracers profiles:

IF(IOPT.EG.0) THEN
IF(ITRAC.NE.NTRAC.OR..NOT.SEDI) THEN
DO IPLAN=1,NPLAN
IF(IPLAN.GT.8) THEN
TRA_PROF_Z=1.0D0
ELSE
TRA_PROF_Z=4.34DO
ENDIF
ENDIF

After running this code, I still get the one value temperature coming into domain, instead of two layering. See the picture attached. I also attach my steering and fortan files, just in case. Thanks in advance.

Kind Regards!

Violeta
Attachments:
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 6 months ago #12773

  • jmhervouet
  • jmhervouet's Avatar
Hello,

Yes, it seems that we have a problem in subroutine bord3d in your case. With TRACERS VELOCITY PROFILES equal to 0, you get IPROF=0 at line 429 of bord3d.f, then the case IPROF=0 is not treated (only cases 2 and 3 are treated). So the line 432 IF(IPROF.EQ.2) should be changed into IF(IPROF.EQ.2.OR.IPROF.EQ.0) because in function TRA_PROF_Z you have decided to put directly the value and not a profile, i.e. a multiplication factor (like in case IPROF=3).

HOWEVER, the program should stop and say "UNKNOWN OPTION FOR THE TRACERS VERTICAL PROFILES" and it does not, so probably you do not have IPROF = 0 for this boundary. This keyword should be given for every liquid boundary, maybe you gave only one value.

To sum up, the solution is probably :

To give TRACERS VELOCITY PROFILES = ...;...;...; for all liquid boundaries. 0 to get the profile and 1 for the others.

To change line 432 of bord3d as indicated above. If it works I'll change bord3d for further versions, with the decision that in case of user profile the real value is given, not the profile.

With best regards,

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

stratification+steep real bathymetry problem 10 years 6 months ago #12776

  • 716469
  • 716469's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 303
  • Thank you received: 6
Thank you very much Jean-Michel. I will do so and let you know if it solves the problem.

Kind Regards!

Violeta
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 6 months ago #12838

  • 716469
  • 716469's Avatar
  • OFFLINE
  • Expert Boarder
  • Posts: 303
  • Thank you received: 6
Dear Jean-Michel,

Thank you again for your comments on Tracer Vertical Profiles. I changed the line in bord3d.f subroutine from IF(IPROF.EQ.2.OR.IPROF.EQ.3) to IF(IPROF.EQ.2.OR.IPROF.EQ.0) and set up in steering file TRACERS VERTICAL PROFILE=0;1, as I have one liquid boundary only. Unfortunately it did not work. I probably made a mistake in coding in TRA_PROF_Z subroutine for Vertical Tracer Profile, as I have IPLAN deactivated, if it is activated it gives me an error - Loop variable 'iplan' cannot be INTENT(IN). So looks like it does not DO actually.

IF(IOPT.EQ.0) THEN
IF(ITRAC.NE.NTRAC.OR..NOT.SEDI) THEN
! DO IPLAN=1,NPLAN
IF(IPLAN.GT.8) THEN
TRA_PROF_Z=1.D0
ELSE
TRA_PROF_Z=4.34D0
ENDIF
ENDIF
I attached some graphical results of full length cross section of domain at 0 step and at the end of run, and it can be seen that on the right side of the domain (open boundary) there is intrusion of 0C temperature and no temperature layering as I wish. Please advise what else I can do to make it working. Thanks a mil.

Kind Regards!

Violeta
Attachments:
The administrator has disabled public write access.

stratification+steep real bathymetry problem 10 years 6 months ago #12839

  • jmhervouet
  • jmhervouet's Avatar
Hello,

I would need to have all your case to look at it. IPLAN is an argument of TRA_PROF_Z, so you do not have to loop on it (TRA_PROF_Z is called for every IPLAN). However I do not see the corrected bord3d.f in your Fortran file.
If you have only 1 liquid boundary TRACERS VERTICAL PROFILE=0 is correct.

Regards,

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

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