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

Re: [EnergyPlus_Support] Aggregating hourly output variables





Hi Chris,

Plenty of free tutorials on SQL out there, including interactive ones (search for "SQL interactive tutorial" in a search engine, plenty of results).

I suggest you download a SQL browser so you can explore(=view) the content of the SQL file generated by E+ AND try your queries. I personally use https://sqlitebrowser.org/ since it works nicely and it is cross-platform (I use all three major ones, windows, mac, unix, so I appreciate consistency)


For your thing, it's just about 1) Filtering the rows you do want to keep (be as specific as possible to avoid surprises), and 2) doing a groupby

Here's the basic query:

SELECT Month, Day, Hour,
      SUM(Value) as 'Total OA Mass Flow Rate' From ReportVariableWithTime

WHERE EnvironmentPeriodIndex = 3
  AND Name = 'Air System Outdoor Air Mass Flow Rate'
  AND ReportingFrequency = 'Hourly'
  AND Units='kg/s'
GROUP BY Month, Day, Hour
ORDER BY Month, Day, Hour



Here I specify EnvironmentPeriodIndex = 3 because I have run the simulation for two design days, and I do not want to count the design day flows (without it on 7/21 it would sum my annual sim + summer design day)
Name is self explanatory
I Specify reportingFrequency='Hourly' to ensure that I also do not any potential same variables I may have requested at a different timestep (eg: 'Timestep')
I specify Units='kg/s', but you could not do it since there isn't a variable with the same name and different units

Result







Now, if you want to get fancier, you can generate a timestamp on the fly...


SELECT strftime('%Y-%m-%d %H:%M', '2005-'|| substr('0'||Month, -2) ||
      '-' || substr('0'||Day, -2) ||' '|| substr('0'||Hour, -2) ||
      ':'||  substr('0'||Minute, -2))
      AS 'Timestamp',
      SUM(Value) as 'Total OA Mass Flow Rate' From ReportVariableWithTime

WHERE EnvironmentPeriodIndex = 3
  AND Name = 'Air System Outdoor Air Mass Flow Rate'
  AND ReportingFrequency = 'Hourly'
  AND Units='kg/s'
GROUP BY Timestamp
ORDER BY Timestamp




I hope this helps!

Best,
Julien


--
Julien Marrec, EBCP, BPI MFBA
Owner at EffiBEM
T: +33 6 95 14 42 13

LinkedIn (en) | (fr) :

2018-05-25 19:25 GMT+02:00 'Jones, Christopher' christopher.r.jones@xxxxxxx [EnergyPlus_Support] <EnergyPlus_Support@xxxxxxxxxxxxxxx>:
 

I am hoping to generate a report of total outdoor air inlet on an hourly basis. I have the very large .csv and could simply use Excel to total all the outdoor air inlet mass flows for the many systems in the model. But I am hoping to learn about SQLite for this sort of task. Is there a recommended tutorial for SQLite?

 

 

 

 

 

Christopher R Jones, P.Eng.

T+ 1 416-644-0252

 

 





NOTICE: This communication and any attachments ("this message") may contain information which is privileged, confidential, proprietary or otherwise subject to restricted disclosure under applicable law. This message is for the sole use of the intended recipient(s). Any unauthorized use, disclosure, viewing, copying, alteration, dissemination or distribution of, or reliance on, this message is strictly prohibited.. If you have received this message in error, or you are not an authorized or intended recipient, please notify the sender immediately by replying to this message, delete this message and all copies from your e-mail system and destroy any printed copies. You are receiving this communication because you are listed as a current WSP contact. Should you have any questions regarding WSP's electronic communications policy, please consult our Anti-Spam Commitment at www.wsp.com/casl. For any concern or if you believe you should not be receiving this message, please forward this message to caslcompliance@xxxxxxx so that we can promptly address your request. Note that not all messages sent by WSP qualify as commercial electronic messages.

AVIS : Ce message, incluant tout fichier l'accompagnant (« le message »), peut contenir des renseignements ou de l'information privilégiés, confidentiels, propriétaires ou à divulgation restreinte en vertu de la loi. Ce message est destiné à l'usage exclusif du/des destinataire(s) voulu(s). Toute utilisation non permise, divulgation, lecture, reproduction, modification, diffusion ou distribution est interdite. Si vous avez reçu ce message par erreur, ou que vous n'êtes pas un destinataire autorisé ou voulu, veuillez en aviser l'expéditeur immédiatement et détruire le message et toute copie électronique ou imprimée. Vous recevez cette communication car vous faites partie des contacts de WSP. Si vous avez des questions concernant la politique de communications électroniques de WSP, veuillez consulter notre Engagement anti-pourriel au www.wsp.com/lcap. Pour toute question ou si vous croyez que vous ne devriez pas recevoir ce message, prière de le transférer au conformitelcap@xxxxxxx afin que nous puissions rapidement traiter votre demande. Notez que ce ne sont pas tous les messages transmis par WSP qui constituent des messages electroniques commerciaux.



-LAEmHhHzdJzBlTWfa4Hgs7pbKl




__._,_.___

Posted by: Julien Marrec <julien.marrec@xxxxxxxxx>


EnergyPlus support is found at:
http://energyplus.helpserve.com or send a message to energyplus-support@xxxxxxxx

The EnergyPlus web site is found at:
http://www.energyplus.net/

The group web site is:
http://groups..yahoo.com/group/EnergyPlus_Support/

Attachments are currently allowed but be mindful that not everyone has a high speed connection.  Limit attachments to small files.

EnergyPlus Documentation is searchable.  Open EPlusMainMenu.pdf under the Documentation link and press the &quot;search&quot; button.




Visit Your Group
Yahoo! Groups
PrivacyUnsubscribeTerms of Use

__,_._,___