<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
Dear Fernando,<br>
It is inefficient to recalculate the characteristic parameters at
every iteration (as is done in the component) because if you only have
one instance in the input file, then there is no need to recalculate
those values at each time step. You need only read the parameters once
and then calculate those lines between the ENDIF and line 60 once. If
those lines were brought inside the ENDIF then you would also want to
copy the lines up to the section between <br>
<br>
!initialize storage variables<br>
RHOD=-1.<br>
EFFD=0.<br>
TALN=TAU_ALPHA(NG,EFFD,XKL,RI,ALF,RHOD)<br>
stored(1) = RHOD<br>
stored(2) = TALN<br>
CALL setStorageVars(NStorage,stored,INFO)<br>
<br>
and <br>
<br>
!set the outputs to 0<br>
OUT(1) = XIN(1) <br>
OUT(2:NO) = 0.d0 !zero remaining outputs<br>
RETURN 1 !the first timestep is for initialization -
exit.<br>
<br>
as well because if there is only one instance of Type74, and if the
ENDIF had been moved down to line 60 then those lines would never be
executed because INFO(1) would always equal IUNIT. If you have an input
file that is giving you results that you don't understand and you have
tracked it to Type74, please feel free to send it to me. You may be
right that there is a problem although I do not see one from looking at
the structure of the code in there.<br>
Kind regards,<br>
David<br>
<br>
Fernando Domínguez Muñoz wrote:
<blockquote cite="mid05062720543022_12B24F@ccuma.sci.uma.es" type="cite">
<pre wrap="">Dear David,
the (INFO(1).NE.IUNIT) check is right. The problem comes from the end
point of the IF statement:
c IF(INFO(1).NE.IUNIT) THEN
!recall the UNIT and TYPE number
IUNIT = INFO(1)
ITYPE = INFO(2)
!read parameter values
NS = JFIX(PAR(1)+0.1)
XNS = DBLE(NS)
..........
..........
RI = PAR(12)
XKL = PAR(13)
c ENDIF <---------- THIS
C RETRIEVE STORED VARIABLES
CALL getStorageVars(NStorage,stored,INFO)
I think that the end point of this loop must be the line number 60,
where the program starts reading the inputs. But, the characteristic
parameters of the unit are re-calculated on every interation, and
consequently its values turn incorrect.
Best regards
Fernando.
</pre>
<blockquote type="cite">
<pre wrap="">Dear Fernando,
The line
IF(INFO(1).NE.IUNIT) THEN
is correct. The point of the line is to handle the case in which there
is more than one instance of Type74 in the simulation. The variable
INFO(1) is always the current instance's UNIT number (specified in the
input file). At each time that the Type is called, the value of INFO(1)
is stored as a local variable. In this way, if ever INFO(1) and IUNIT do
not have the same value, then it can only be because a different
instance of the component has been simulated. If a different instance
has been simulated, then the component's parameters should be reread and
reset to local variables.
In December 2004, a bug fix was made in that component. If your version
does not have the comment:
C 12/02/2004 - JWT - Fixed an error with storing variables and added
the first call to Tau_Alpha
in the "Revision History" near the top of the file Type74.for then you
should contact your distributor to get the latest version.
Kind regards,
David
Fernando Domínguez Muñoz wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Dear all,
I think I have found a bug in TYPE74 (parabolic concentrator solar
collector).
Where says (Line 207):
IF(INFO(1).NE.IUNIT) THEN
Should said:
IF(INFO(1).NE.IUNIT) GO TO 60
Best regards.
Fernando Domínguez Muñoz
University of Málaga (Spain)
_______________________________________________
TRNSYS-users mailing list
<a class="moz-txt-link-abbreviated"
href="mailto:TRNSYS-users@engr.wisc.edu">TRNSYS-users@engr.wisc.edu</a>
<a class="moz-txt-link-freetext"
href="https://www.cae.wisc.edu/mailman/listinfo/trnsys-users">https://www.cae.wisc.edu/mailman/listinfo/trnsys-users</a>
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->_______________________________________________
TRNSYS-users mailing list
<a class="moz-txt-link-abbreviated"
href="mailto:TRNSYS-users@engr.wisc.edu">TRNSYS-users@engr.wisc.edu</a>
<a class="moz-txt-link-freetext"
href="https://www.cae.wisc.edu/mailman/listinfo/trnsys-users">https://www.cae.wisc.edu/mailman/listinfo/trnsys-users</a>
</pre>
</blockquote>
</body>
</html>