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

Re: [TRNSYS-users] "Average value over time step" in TRNSYS Types




David,

Thanks for replying.

My component models a thermal storage and uses an explicit finite difference method to solve the model equation for the temperature T. I do indeed need T from the end of the last timestep to solve the eqation for T at the end of the current time step, and I use "getStorageVars()" and "setStorageVars()" to save and retrieve T between time steps. My question was really about which value of T I should use as output from this component, to be received as inputs by the other components. Would it be correct to use an average of T at the end of the previous time step n-1 and T at the end of the current time step n, simply computed by (T_n-1 + T_n)/2?

Kind regards,
Knut Erik  


From: David Bradley <bradley@tess-inc.com>
To: knut.erik.enerstvedt@niva.no
Cc: trnsys-users@engr.wisc.edu
Date: 08/26/2009 12:54 AM
Subject: Re: [TRNSYS-users] "Average value over time step" in TRNSYS Types





Knut Erik,
Sorry for the delay in getting back to you. Since almost all of the outputs that TRNSYS deals with are averages over the timestep, the input values that are passed to your components are the averages at the previous timestep and so your component doesn't really have to compute what those values are. If your component has some capacitance (thermal or electrical storage) to it then you do need to get what the value of certain inputs at the end of the last timestep were in order to calculate what the outputs at the end of the current timestep are. One typical way of handling the job of keeping track of those is to use the "getStorageVars()" and "setStorageVars()" subroutines. If you have to call the Differential Equation subroutine from within your Type, it will return the average and final value for the time step. You can then store that final value and use it as the initial value for the next time step.
Kind regards,
David


knut.erik.enerstvedt@niva.no wrote:
Hello TRNSYS users,
 
As I understand, TRNSYS outputs are averaged values over a time step, meaning that the output value of T at timestep n is an average of T between n-1 and n. When creating a new Type, would it be correct of me to have T_output(n) = (T(n) + T(n-1))/2, where T(n) is the newly computed value in the current iteration and time step and T(n-1) is the converged value from the previous time step? If not, how is this average normally computed in TRNSYS Types?
 
Best regards,
Knut Erik Enerstvedt



------------------------------------------------------------------------------------------------------

Meld deg på vårt nyhetsbrev på
www.niva.no




_______________________________________________
TRNSYS-users mailing list
TRNSYS-users@cae.wisc.edu
https://www-old.cae.wisc.edu/mailman/listinfo/trnsys-users
 


--
***********************************************************************
Thermal Energy System Specialists (TESS), LLC
David BRADLEY                      22 N. Carroll Street - Suite 370
Partner                            Madison, WI 53703
                                  USA
P: +1.608.274.2577
F: +1.608.278.1475
E-mail:
bradley@tess-inc.com
Web Pages:  
http://www.tess-inc.com    and      http://www.trnsys.com

***********************************************************************



------------------------------------------------------------------------------------------------------------
Meld deg på vårt nyhetsbrev på
www.niva.no