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

knut.erik.enerstvedt at niva.no knut.erik.enerstvedt at niva.no
Mon Aug 31 05:03:35 PDT 2009


Jeff,

Thank you for answering my question.

If I solve the model equation for the time  t(i-1/2), would this be a 
correct approach to find Tavg? I can then solve for both Tavg and Tf, and 
use Tf as Ti in the next time step. Is this how it's done in the 
standard/TESS TRNSYS components?

Best regards,
Knut Erik 




From:
"Jeff Thornton" <thornton at tess-inc.com>
To:
knut.erik.enerstvedt at niva.no, bradley at tess-inc.com
Cc:
trnsys-users at engr.wisc.edu
Date:
08/26/2009 05:30 PM
Subject:
Re: [TRNSYS-users] "Average value over time step" in TRNSYS Types



<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? >

No - it's not technically correct to use the average value of the initial
and final temperatures as the average over the timestep as your thermal
storage model considers the mass.  You'll need to solve the resulting
differential equations for not only the final temperature at the end of
timestep (which is based on the initial temperature) but also for the
average value over the timestep.  Your proposed solution assumes the model
behaves linearly from Ti to Tf where the real solution most likely follows
an exponential profile.  The TRNSYS manual does provide the solution for
the average temperature of a differential equation of the form:

dT/dt = aT+b

If this is not the form of your solution then you'll have to take your
solution for Tf and integrate it from t(i-1) to t(i) in order to solve for
the average temperature over the timestep.  Failure to solve for the
average temperature correctly will lead to an energy balance problem in
your simulation.

Jeff


Jeff Thornton
President - TESS, LLC

22 North Carroll Street - Suite 370
Madison WI 53703 USA

Phone: 608-274-2577
Fax: 608-278-1475
E-mail: thornton at tess-inc.com
Web: www.tess-inc.com




------------------------------------------------------------------------------------------------------------
Meld deg på vårt nyhetsbrev på www.niva.no
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.onebuilding.org/pipermail/trnsys-users-onebuilding.org/attachments/20090831/38276a05/attachment-0005.htm>


More information about the TRNSYS-users mailing list