×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Fortran subroutine - global variable

Fortran subroutine - global variable

Fortran subroutine - global variable

(OP)
Hi everybody,

I have made a heat source to model laser welding with the dflux subroutine and I would like to know, if it's possible to define some global variables.
What I am trying to accomplish is to adapt my heat source if for example any point of the model reach a defined temperature. Is that possible?

Thanks in advance!

RE: Fortran subroutine - global variable

You should be able to hard code your limiting value into your Dflux routine.

RE: Fortran subroutine - global variable

I am not too familiar with user defined subroutines but I think Depvar's are global (in the sense of the material anyway). Maybe that is what you need to define, then have your subroutine grab them when needed.

HTH

RE: Fortran subroutine - global variable

(OP)
Hey, I am glad to read some ideas:
To vumat721: your solution could work if I am able to get the temperature of a determined node. In this case, I would able to define the behaviour of the routine with the limiting value, in my case the temperature of the node (hard coded).

To DanStro: I didn't know of the existence of Depvar, I have to look at the documentation but sounds promising. I will give it a try too.

Thank you very much for the Ideas, let's see what comes next :P

RE: Fortran subroutine - global variable

Depvar is used to specify number of state variables (statev) within a material subroutine (i.e UMAT, VUMAT, etc). I don't believe that DFLUX lets you have these kinds of state variables.

DFLUX gives you the temperature at the integration point. Perhaps you want to use UTEMP instead of DFLUX?

RE: Fortran subroutine - global variable

(OP)
Hi vumat,

I finally found the way to accomplish that. In fact, it's possible to define global variables within a subroutine. I don't tried yet but I think you can exchange variables between subroutines with this "global variables" as well.

The solution was to read a Fortran Manual, also, in my example:
*USER SUBROUTINES
    SUBROUTINE DFLUX(FLUX,SOL,KSTEP,KINC,TIME,NOEL,NPT,COORDS,
    1 JLTYP,TEMP,PRESS,SNAME)
C
    INCLUDE 'ABA_PARAM.INC'
C
    DIMENSION COORDS(3),FLUX(2),TIME(2)
    CHARACTER*80 SNAME
    
    parameter (BoilingPoint = 2792)

    
    real maxTemp,depth
    COMMON /Control/maxTemp,depth

C###########################################
C Coordinates
C###########################################
        x=COORDS(1)
        y=COORDS(3)
        z=COORDS(2)
C  Coordinate conversion
        r = sqrt(x ** 2 + y ** 2)

C Variable to store the temperature of the element. It will be used
C to check the max temperature of the Model.
      tempmaxtemp = SOL
      
C If Statement to calc the max temperature in the Model
      if(tempmaxtemp.ge.maxTemp)maxTemp=tempmaxtemp
...
---------------------------------------------------------
The variable maxTemp don't lose the value, also, global variable. With this method, I can know the max temperature of my Model.

Anyway, thanks for the help!

RE: Fortran subroutine - global variable

Sounds good. I know Abaqus used to warn about using common blocks with subroutines. I don't remember the details, but maybe it's only an issue if you do a multi-cpu job? It looks like you can use "UEXTERNALDB" if you ever run into a problem with the common block not working as expected.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources