Category Archives: C++

Howto output XLSX files from C++

The title of this post should really be: Howto output Office Open XML (OpenXML) spreadsheet files from native C++ with as little hassle and unwanted dependencies as possible. We will not discuss the many other options available, both commercial and … Continue reading

Posted in C++, Howtos | Leave a comment

Detecting non-ASCII characters in a text file

Our internal coding standard for C++ source files dictates that 7-bit US-ASCII should be used for file encoding. This decision is based on the fact that the current C++ standard (2003) limits characters that can be used in variable and … Continue reading

Posted in C++, Howtos | Leave a comment

Step-by-step guide: adding new files to a LIBPF project

Reference documentation is great, but often boring to read and not helpful to solve specific problems that arise in day-to-day use. To tackle these, a step-by-step guide can be helpful. Here is one such step-by-step guide for adding a new … Continue reading

Posted in C++, Howtos, Uncategorized | Leave a comment

Testing UI with UI scripting: getting hooq to work

We do need to test User Interfaces (UI) developed with Nokia Qt using UI scripting. There is squish of course and other commercial products but we also like to give a try to open source alternatives if available. One is … Continue reading

Posted in C++, Howtos, UI | 1 Comment

UIPF compiles under Qt 5

The User Interface for Process Flowsheeting (UIPF) compiles under the almost-alpha Qt 5 (tested under Debian sid): just build Qt 5 from Git, then apply the tips. Highlights: Change the uipf.pro file adding this (we don’t use QtDeclarative): greaterThan(QT_MAJOR_VERSION, 4) … Continue reading

Posted in C++, UI | Leave a comment

A robust expression for the Log Mean Temperature Difference (LMTD)

The Log Mean Temperature Difference (LMTD) is a deceivingly simple expression to compute the average driving force in heat transfer: LMTD = (ΔT1 – ΔT2) / log(ΔT1 / ΔT2); The ΔT1 and ΔT2 are the temperature approaches, as in this … Continue reading

Posted in C++, Chemeng | Leave a comment

How to produce a Txy isothermal VLE diagram with LIBPF ?

Instantiate components: components.addcomp(new purecomps::water); // 0 components.addcomp(new purecomps::EthyleneGlycol("MEG")); // 1 components.addcomp(new purecomps::DiethyleneGlycol("DEG")); // 2 components.addcomp(new purecomps::TriethyleneGlycol("TEG")); // 3 Instantiate and setup the stream object: StreamNrtl1LiquidVapor s; s.S("flowoption") = "Nw"; s.S("flashoption") = "PA"; s.Q("P") = Value(101325.0, "Pa"); s.Q("Tphase.w", "H2O") = Zero; … Continue reading

Posted in C++, Chemeng | Leave a comment

LIBPF builds with clang++

Clang++ is a new generation C++ compiler, based on a complete redesign. According to the reports it can not yet match compilation and execution time of the more mature competitors (g++, msvc, intel…), but it is growing up really quickly: … Continue reading

Posted in C++ | Leave a comment