Use of customed TRNSYS components?

5 posts / 0 new
Last post
emiliano casati
Use of customed TRNSYS components?

good morning,
among the "simulator options" there's the "TRNSYS Executable and Input Deck", which "You can use to use custom TRNSYS components with SAM". This is very interesting for me, but I was wondering if further support is provided since on the manual there's nothing about this option!

Thanks in advance


Paul Gilman

Dear Emiliano,

I'm sorry I did not answer this part of your earlier question. I was waiting for a response from a colleague.

One option to investigate alternative plant control strategies would be to use the Thermal Storage Dispatch Control schedule on Thermal Storage page, which would allow you to alter the control strategy based on time of day and whether or not the sun is shining.

If this approach is too limited, and you have a copy of TRNSYS (and the time to program your own control strategy), you could try modifying the controller source code in FORTRAN. For the concentrating solar power (CSP) models, you can find a list of the source code files and their location in the Help system overview topics. For example, for the physical trough model, see Physical Trough Overview.

In theory, you should be able to make modifications to the FORTRAN source code files and compile the modified code in TRNSYS into a new executable to use with SAM in place of the default one. You could also use a different deck file to change the structure of the inputs of the TRNSYS model. The Exchange Variables page in SAM has ten "System Variables" that you can use to store values in the SAM user interface to interact with your custom decks.

However, at the moment, the TRNSYS source code files we distribute with SAM will not compile in TRNSYS because they require a piece of proprietary code that we are not allowed to distribute. We are working to resolve this issue and will hopefully have a solution soon.

Best regards,

emiliano casati

Dear Dr. Gilman, thanks a lot for your reply!
I see working on the FORTRAN is not practically feasible at the moment (it does not compile indeed..)! I'll follow for further (possible) scenarios...

At the moment I'm therefore trying with the SamUL scripting, which might allow some flexibility for automatic manipulation and interaction with SAM. Also on this I notice the manual is not very reach yet, so I believe I'll have to bother on the forum!

Have a nice day

Emiliano Casati


If we have TRNSYS, will it be possible now to write our own new codes/modify existing SAM FORTRAN codes, include them along with SAM's codes and compile?


Paul Gilman

Dear Sultan,

In SAM 2014.11.24, we stopped using TRNSYS as the simulation engine for any performance models. SAM 2014.1.14 and earlier versions still rely on TRNSYS for the CSP models, so, if you are a TRNSYS user, you can develop custom decks to work with SAM.

Best regards,

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer