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!
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
RE: Fortran subroutine - global variable
HTH
RE: Fortran subroutine - global variable
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
DFLUX gives you the temperature at the integration point. Perhaps you want to use UTEMP instead of DFLUX?
RE: Fortran subroutine - global variable
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