[TRNSYS-users] Sharing some informtion - (simple example and Some hints to creat new component via simulation studio)
Mehdi Shahrestani
mahdishahrestani at yahoo.com
Mon Jul 12 11:18:05 PDT 2010
Hello everybody
I was trying to follow the trnsys guide line to create the new components in
simulation studio. I faced problems in compiling the exported fortran
skeleton. Regarding to trnsys instruction "creating new component" in page
1-65 of the manual "Getting started"; I was looking for right place to add
the equation in the fortran skeleton. After search and asking trnsys users I
have got it and I think every beginner in trnsys would face the same.
I hope it helps.
Simple example: Generation of a new component via simulation studio
Generation of the component which is able to evaluate this equation:
Opt = inp + par
Input: inp
Output: opt
Parameter: par
1. First we have to follow the instruction of "creating new component"
which has been mentioned in page 1-65 of trnsys manual "Getting started".
2. This instruction should be followed up to the end of exporting the
new component to fortran.
3. When the fortran Skelton is coming up in CVF 6.6B the desired
equation should be written along with some modifications.
4. in page 1-68 of transys instruction "Getting started" it has been
mentioned the desired equation has to be replaced with question marks " ? "
in the fortran skeleton but there is no sign of question mark in trnsys 17
and CVF6.6B
5. For this simple example we have to add our desired equation just
after this comment "! Perform All of the Calculations Here to Set the
Outputs from the Model Based on the Input". We have to write opt=inp+par
6. Moreover, when the output is calling we have to put our output
instead of default value which already is 0.
Call SetOutputValue(1, 0) ! opt Call
SetOutputValue(1, opt)
7. Finally in declaration part of the script "!Trnsys Declarations" we
have to define the output by writing this script "DOUBLE PRECISION opt"
8. Now the new component would be successfully compiled.
Finally as attached you can find two fortran program as references:
1- The automatically exported fortran script in CVF6.6b from simulation
studio without modification which could not be compiled
2- Modified script which could be compiled (the modifications are
highlighted)
Thanks to David Bradley, Stefan Thiemann and Jaime Gonzalez Rodriguez for
their replies.
Regards
Mehdi Shahrestani
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100712/158477f5/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 111 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100712/158477f5/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Type211 after modification.doc
Type: application/msword
Size: 44032 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100712/158477f5/attachment.doc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Type211 before modification.doc
Type: application/msword
Size: 44032 bytes
Desc: not available
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20100712/158477f5/attachment-0001.doc>
More information about the TRNSYS-users
mailing list