Arguments and common blocks
Calling convention
subroutine userf (itab, idep, vdep, chara,
+ gg,t,c,q,qd,r,time,dt,it,
+ nocon,maxno,iconv,dtp,tf)
C
C Arguments
C
real gg(*), t(*), c(*), q(*), qd(*), r(*)
real time, dt, dtp, tf, vdep
integer it, nocon, maxno, iconv(*), itab, idep
character*7 name
C
C Common block variables
C
real tdmax, prtflg, params(8000), grav, gv(3), tabs, rgas
real pstd, tstd, sigma
integer irun, ir(1), maxn1, maxn2
C
C Common block definitions
C
common/tdmax/tdmax
common/prtflg/prtflg
common/irun/irun,ir
common/maxnoq/maxn1,maxn2
common/params/params
common/grav/grav,gv,tabs,rgas,pstd,tstd,sigma
..
return
end
Argument definitions
C
C(i)
is the capacitance of internal element i. Temperatures of elements with C(i)
< 0
are not computed with the normal heat balance equations. MCV elements and sink elements are assigned C(i)
< 0
.
CHARA
is the name assigned to the table with a DESCRIP card.
Using names allows for flexibility in table numbering.
You can develop code for multiple correlations and then use the name to determine which one is required in a particular call.
DT
is the current integration time step for transient runs.
DTP
is the printout time increment for transient runs.
GG
GG(j)
is the current value of the resistance j, i.e. the inverse of the conductance J
.
If J
is a radiative conductance, GG(j)
is the inverse of its current linearized value, i.e. the temperature difference between its elements divided by the heat flow through it.
GRAV
is the magnitude of the acceleration of gravity.
GV
GV(i)
is the component of the unit gravity vector in direction i, expressed in global coordinates.
ICONV(j)
is the real element number of internal element K
.
TMG assigns an internal number for each element, and the real element numbers are stored in array ICONV
.
The internal element number K of real element j may be obtained with the function K
= KCONV(j)
.
IDEP
is the conductance number of element number associated with the dependent variable VDEP
.
It is the number of the conductance or element that will be affected by the code.
IRUN
is the current run number (e.g. 1
, 2
, etc.)
IR
IR(irun)
is the parameter to be set if you wish to perform run number IRUN
, for IRUN
> 1
. For more information. see Multiple Runs Example. IR(irun)
should be set to the desired Card 2b - Analyzer Control Card – Optional. For more information, see the Thermal Solver Reference Manual PDF.
GRADNT
parameter value: 0
for steady state runs, or –2
, –3
, –4
, or –5
for transient runs.
IT
is the current iteration counter value.
ITAB
is the number of the table that points to the user written subroutine.
This is the number of one of the tables that the user routine replaces.
MAXN1
is the number of non–hydraulic elements (cannot be changed).
MAXN2
is the number of hydraulic elements (cannot be changed).
MAXNO
is the number of elements (cannot be changed). MAXNO = MAXN1 + MAXN2
.
NOCON
is the number of conductances (cannot be changed).
PARAMS
General-purpose common block for analyzer parameters.
PARAMS(249)
is the largest Card 9 DESCRIP Card ID number.
PARAMS(291)
is the maximum element number in the model.
PARAMS(292)
is the maximum node number in the model.
PRTFLG
PRTFLG
is the print flag, = 0
(OFF
) or = 1
(ON
).
If PRTFLG
is set to 1
when KODE
= 2
, TMG prints the parameters specified on the Card 9 - PRINT Analyzer Printout Codes - Optional for the current iteration or time step.
PSTD
is the standard pressure from Card 9 - HYDENV Hydraulic Element Environment Definition Card - Optional.
Q
Q(j)
is the heat load to internal element K.
At each iteration or time step, Q(j)
is re-initialized. Thus, if you wish to change its value permanently, you have to change it every time USER1
is entered with KODE
= 1
.
QD(K)
QD(j)
is the fraction of phase–change element K
in its higher temperature phase. K
is an internal element number.
R(J)
R(j)
is the conductance parameter of conductance J.
R(j)
is not altered during the run, except for temperature-dependent radiative conductances.
The value of R(j)
for a linear conductance is the inverse of its initial conductance, i.e. R(J)
is a resistance.
R(j)
is the (area * emissivity * gray body view factor *Stefan–Boltzmann’s constant
) value for a radiative conductance. For Oppenheim’s Method (Card 9 - PARAM Parameter Card - Optional parameter OPPENHEIM) the gray body view factor between an element and its surface element is considered to be 1/(1–emissivity)
. For more information, see the Thermal Solver Reference Manual PDF.
If you wish to change the value of a radiative coupling in a user-written subroutine, (e.g. because the emissivity is temperature dependent), you should change the value of both R(j)
and GG(j)
.
R(j)
is the inverse of the Card 6e - Thermal Coupling Request Card – Optional
A(N1) * HN1,
i.e. projected area * multiplier value. For more information, see the Thermal Solver Reference Manual PDF.RGAS
is the Universal Gas Constant.
SIGMA
is the Stefan–Boltzmann’s Constant specified on Card 2a - Program Control Card – Required. For more information, see the Thermal Solver Reference Manual PDF.
T
T(j)
is the temperature of the internal element j
, for internal element numbers ≤ MAXN1 + MAXN2
.
T(j)
is the total pressure value of internal element j
for internal element numbers > MAXN1 + MAXN2
.
The contents of the T array are as follows:
From | To | Description |
---|---|---|
T(1)
|
T(MAXN1)
|
Temperatures of non-hydraulic elements |
T(MAXN1 +1) |
T(MAXN1 + MAXN2) |
Temperatures of hydraulic elements |
T(MAXN1 +MAXN2 +1) |
T(MAXN1 + 2MAXN2) |
Total pressure values of the hydraulic elements |
The total pressure and temperatures of the hydraulic element j differ by the increment
MAXN2
, i.e. the temperature stored in
T(j)
, and its total pressure is stored in
T(j+MAXN2)
Both ICONV(j)
and ICONV(j + MAXN2)
represent the element’s real element number.
TABS
is the absolute value of the absolute zero temperature(e.g. 273
). TMG assumes that the model zero is never below absolute zero.
TDMAX
is the current value of the maximum temperature difference of any element between the current iteration and the previous one for steady-state runs.
If TDMAX
is set to 0
with KODE
= 2
for steady state runs, the run is forced to terminate.
TIME
is the current time value for transient runs.
TF
TF
is the final time of a transient run.
TF
is the maximum number of iterations for a steady state run.
If TF
is set to 0
, the run is forced to terminate.
TSTD
is the standard temperature for fluid properties.
VDEP
is the value set by the code.
It will be assigned to the physical property (i.e. heat input, conductance etc.), defined as the dependent variable on the INTERP
card, of element IDEP
.