[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TRNSYS-users] Initial value for outputs



Ghady,

You wrote "In order to add the initial value outputs in the Type 164 code, I prefer to create a new type and not modify the existed one in Trnsys Library. For that I created a new component using Trnsys 17. I had some difficulties because it’s not the same code writing from defining inputs, outputs and parameters to storage; I managed to copy the code line that I am interested in but the problem remains with the storage array.>

Unless you want to completely re-write a version 16 component in version 17 format (and you are certainly willing to attempt that if you'd like), I would suggest that you leave it in version 16 format and just change the output initialization line as I suggested earlier.  Find the lines:

!set initial output values
OUT(1:NO)=0.d0

and replace them with your initial values:
Out(1) =20.d0
Out(2) = 0.do
etc.

Jeff
---
Jeff Thornton President - TESS LLC 22 N. Carroll Street, Madison WI USA 53703 Office: (608) 274-2577 Fax: (608) 278-1475 www.tess-inc.com E-Mail: thornton@tess-inc.com

On 11/13/2017 7:35 am, Ghady Dib via TRNSYS-users wrote:

Hello,

 

In order to add the initial value outputs in the Type 164 code, I prefer to create a new type and not modify the existed one in Trnsys Library.

 

For that I created a new component using Trnsys 17. I had some difficulties because it’s not the same code writing from defining inputs, outputs and parameters to storage; I managed to copy the code line that I am interested in but the problem remains with the storage array.

 

In fact when I created the new component (from Trnsys), I didn’t notice any place where I can specify my number of storage (Which is equal to 2 in Type 164).

  

Do I set my storage number there:  ‘’Call SetNumberStoredVariables(0,0)’’; It’s not like the inputs and parameters where I defined their numbers them in Trnsys.

I have to include (in my new component ''type210'') the storage array in FOUR places just like in type 164a:

 

POST CONVERGENCE MANIPULAITIONS

        CALL getStorageVars(STORED,NS,INFO)

        STORED(1)=STORED(2)

        CALL setStorageVars(STORED,NS,INFO)

 

PERFORM FIRST CALL MANIPULATIONS

  CALL setStorageSize(NS,INFO)

 

PERFORM INITIAL TIMESTEP MANIPULATIONS

        STORED(1:NS) = N_INI       !NO. OF MOLES IN PREVIOUS TIME STEP

        CALL setStorageVars(STORED,NS,INFO)

 

UPDATE STORAGE

        STORED(2) = NGAS

        CALL setStorageVars(STORED,NS,INFO)

 

Are these nomenclatures work in the Type210 created by Trnsys 17? Or I have to include other nomenclatures ? such as getStaticArrayValue ? and for the others ?

 

 

Thank you in advance for your support.  

 
--


Ghady DIB

Doctorant

Laboratoire CETHIL UMR 5008 Groupe Energétique des Systèmes Thermiques et Frigorifiques (ESTF) Département Génie Energétique et Environnement INSA Lyon France

 

 

Tel:+ (33) 6 33 52 96 74

 
 

_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@lists.onebuilding.org
http://lists.onebuilding.org/listinfo.cgi/trnsys-users-onebuilding.org