Welcome, Guest
Username: Password: Remember me

TOPIC: Modify boundary properties in PROSOU and CORFON

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31960

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Hello,

In the frame of a TELEMAC2D-TOMAWAC coupling calculation I would very much like to zero radiation forces FXWAVE and FYWAVE on the boundary points, which may be done in PROSOU.f.
I have tried the following (part between '---') but it does not seem to work out neither in scalar nor parallel modes:

(in PROSOU.f)
! ...
!       ADDS INTO FU AND FV
!
        IF(INCLUS(COUPLING,'TOMAWAC')) THEN
          IF(IELMU.NE.IELM1) THEN
            CALL CHGDIS(FXWAVE,IELM1,IELMU,MESH)
            CALL CHGDIS(FYWAVE,IELM1,IELMU,MESH)
          ENDIF
! ----   
          do K=1,MESH%NPTFR		    
	    N=MESH%NBOR%I(K)
	    IF(NCSIZE.GT.1) N=MESH%KNOLG%I(N)
	    FXWAVE%R(N)=0.D0
            FYWAVE%R(N)=0.D0		    
          enddo
! ----
        ENDIF
        CALL OS('X=X+Y   ',X=FU,Y=FXWAVE)
        CALL OS('X=X+Y   ',X=FV,Y=FYWAVE)
!
      ENDIF	
! ...	  

The code runs fine but the results don't give 0 along the boundary for FX and FY. Do you know what is wrong here? How to do that otherwise?

Alternatively, I would like to modify the bottom topography along the boundaries. In CORFON.f, however, this looks difficult as NBOR is not an input argument. Do you know how to implement this in an easy way?

Thank you in advance.
Best regards,
JBS.
The administrator has disabled public write access.

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31961

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Sorry, I forgot to mention that the boundary conditions must be modified on the LIQUID boundary only.
The administrator has disabled public write access.

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31967

  • Leballeur
  • Leballeur's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 434
  • Thank you received: 163
Hi Jean-Baptiste,

It should work, the few lines you've written seem to be right.
If it doesn't work, it should mean that you're running the code in offline coupling mode, isn't it?
The test
IF(INCLUS(COUPLING,'TOMAWAC'))
is true only for inline coupling mode.
So, I think you just have to move your DO loop outside the IF test.

To add a test on liquid boundary points only, you can introduce the LIHBOR array for instance (from the declarations_telemac2d module), in the same way that in bord.f for example:
IF(LIHBOR%I(K).EQ.KENT) THEN...

To use NBOR in corfon subroutine, you can reach it by the bief_mesh object: MESH%NBOR%I
Be aware that there is also a tom_corfon.f subroutine for Tomawac bathymetry.

I hope it helps.

Regards,
Laurent
The administrator has disabled public write access.

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31977

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Thank you Laurent.

Ok for the inclusion of LIHBOR.

You confirmed my coding but for zeroring FXY, but I have a question. The FXWAVE%R array apparently refers to the subdomain (a part of the mesh), not the full domain array, and therefore this would make more sense to set:

! ----   
          DO K=1,MESH%NPTFR		    
            N=MESH%NBOR%I(K)
            IF(LIHBOR%I(K).EQ.KENT) THEN
              FXWAVE%R(N)=0.D0
              FYWAVE%R(N)=0.D0		    
	    ENDIF
          ENDDO
! ----

so that N here refers to the "local" node number associated with the "local" boundary node K (do you have some aspirine...). Is that correct?

Both ways are not working unfortunately. I am still having non-zero (10^-8...) FXY values along the boundary in the results file. I consider bidirectional coupling so INCLUS(COUPLING,'TOMAWAC') should be True.

Is that possible that FXWAVE and FYWAVE are stored in the results file before PROSOU is called?
(If so, the results file for FXY is wrong but the induced currents should be right)

Thank you!
JB.
The administrator has disabled public write access.

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31978

  • Leballeur
  • Leballeur's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 434
  • Thank you received: 163
Hi Jean-Baptiste,

Yes, I think you're right: FXWAVE refers to a subdomain and your modification for the local node number seems to be correct.

You can't see your 0 values on the boundaries because you're looking at Tomawac results and you're modifying the FX/FY variables into Telemac2D (ie after Tomawac iteration). To see the effects of your modifications, you need to output the FX/FY thanks to private arrays. You can do it at the end of prosou, as follow:
PRIVE%ADR(1)%P%R=FXWAVE%R
PRIVE%ADR(2)%P%R=FYWAVE%R

I hope it helps.

Regards,
Laurent
The administrator has disabled public write access.

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31988

  • JBS
  • JBS's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Thank you received: 3
Yes, you're totally right!

So now, it might be more convenient to modify FXWAVE and FYWAVE straight inside WAC.f (FX_WAC, FY_WAC) rather than PROSOU.f. Therefore, the following should work:

! ----   
          USE DECLARATIONS_TELEMAC2D, ONLY: LIHBOR
...
(after CALL RADIAT(...))

          DO K=1,NPTFR		    
            IF(LIHBOR(K).EQ.KENT) THEN
              FX_WAC(NBOR(K))=0.D0
              FY_WAC(NBOR(K))=0.D0		    
	    ENDIF
          ENDDO
! ----

or should I use the MESH%... formalism again? (it is unclear it is required)

Thank you again, Laurent,
JB.
The administrator has disabled public write access.

Modify boundary properties in PROSOU and CORFON 6 years 1 week ago #31990

  • Leballeur
  • Leballeur's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 434
  • Thank you received: 163
Hi,

No, I think you don't need to use MESH.
Be aware that, in this way, you're using the boundary conditions types of telemac2d which can differ from the one of tomawac (depending on your case). If suited, you can directly use LIFBOR (boundary conditions types for tomawac).

2 remarks:
- I think it's LIHBOR%I and FX_WAVE%R
- I think that your changes may be overwritten inside dump2d.f subroutine (writing out the results). Maybe your modifications should be introduced in this subroutine instead or in both, I don't really know, I let you test.

Regards,
Laurent
The administrator has disabled public write access.
Moderators: pham

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