[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [TRNSYS-users] creating a new component
> I'm going to creat new component which will be called by Trnsys just once during the whole simulation. this component is not function of time nor weather data, it will calculate some information to be parameter to other components. my qustions are:
Unfortunately, what you are proposing probably isn't the best approach. If you have your component calculate some values, they will have to be passed out of that component as outputs. Since parameters are time independent values, they are calculated once, very early in the simulation, and are not updated - even if the value changes. There are ways to work around this, you can change the parameters to inputs or even have the new component called first in the input file and the values set as outputs at the very first call INFO(7)= -1.
Can you just simply use equations to calculate these values without writing a type?
> 1- Is it possible to write a component in TRnsys without inputs (NI=0) or I should include input even if they are not function of time (constants).
There are many components that do not have inputs - check Type 14 for an example of one.
> 2- In this component shall I put INFO(9) = 0
Yes
> 3- How about INFO(10) shall I put it Info(10)=0 and do I need to call set storageSize() in such case
> ( in fact, i'm a little bit confused about using storage functions)
Set Info(10) to zero and you'll be fine. There is a nice template for writing new TRNSYS types. I can send it to you if you are interested. I also think its posted on TRNSYS.com. The other option is to start your new component from the studio and have it write the template file for you (Export as FORTRAN).
We're making big changes in TRNSYS 17 to make it much easier to write your own component models - for exactly this reason. The user shouldn;t have to learn about INFO(7) and TYPECK etc.
Jeff
****************************************************************
Jeff W. Thornton
President - Thermal Energy System Specialists
2916 Marketplace Drive - Suite 104
Madison WI 53719
(608) 274-2577