Category Archives: C++

Calculating the liquid density at saturation

This is the full source code required to calculate with LIBPF the liquid density at saturation for an equimolar mixture of ethane and propane at pressures between 1 and 30 atm: /** @file Qsatliqrho.cc @brief Calculate the density of a … Continue reading

Posted in C++, Howtos | Leave a comment

Effect of initial estimates for KLLs on the convergence of liquid-liquid equilibrium calculations

The initial estimates for the KLLs (equilibrium factors) have a big influence on the convergence behavior of liquid-liquid equilibrium calculations. To highlight this effect, let’s try out something with LIBPF. We choose the system H2O / 2-ethyl-1-hexanol. Experimental measurements for … Continue reading

Posted in C++, Chemeng, Uncategorized | Tagged , | Leave a comment

Running your own kernel from the LIBPF user interface on OS X

During model development, you rapidly produce new versions of the calculation kernel (the command-line executable version of your models). The easiest thing to do to try them out is to run them from the LIBPF user interface. Here is a … Continue reading

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

Debugging LIBPF applications with gdb

GNU debugger (gdb) is the standard command-line debugger on many Unix-like systems for troubleshooting C++ programs. To prepare for debugging your application, compile it with debugging symbols enabled; for example assuming you want to debug Qpepper and use bjam to … Continue reading

Posted in C++, Howtos | Leave a comment

Modeling a pipe with a large pressure drop

The Pipe model is a concentrated parameter model for pipes. The correlations it uses are applicable only for small pressure drops, i.e. less than 10% of the absolute inlet pressure. If the calculated pressure drop is larger than that, you’ll … Continue reading

Posted in C++, Chemeng | Leave a comment

Where is the SQL database plugin for ODBC (qsqlodbc.dll) in Qt 5.6 ?

It looks like the SQL database plugin for ODBC (qsqlodbc.dll) is missing from the standard Qt 5.6 installer for Windows you download from http://www.qt.io/download-open-source. You’d expect to find it in C:\Qt\Qt5.6.0\5.6\msvc2015_64\plugins\sqldrivers\ where the sqlite, mysql and postgresql ones are found, … Continue reading

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

HOWTO make verbosity level accessible for users

LIBPF’s  4 diagnostic levels allow the model developer to fine-tune the verbosity at a global, compilation, unit, function and class instance level. Of these, two (verbosityGlobal and verbosityInstance) are also available at run-time, but normally not for the model user. … Continue reading

Posted in C++, Chemeng, Howtos | Tagged | Leave a comment

Qt Data Visualization preview

In the Qt Roadmap for 2016 they say “In addition, Qt 5.7 includes a lot of modules that have been previously available only with the commercially licensed Qt: … Qt Data Visualization – Versatile set of chart types for 3D … Continue reading

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

Automatic generation of C++ code for process models – 3 of 3

Here we are at the last installment of this series of posts on automatic code generation, which started out as a journey to make the workflow for coding process models in C++ with the LIBPF™ library easier and less boring. … Continue reading

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

Automatic generation of C++ code for process models – 2 of 3

In this part two of the series of three posts we will leverage the techniques discussed in part one (command-line C++ code generation from the JSON representation of process models with the jinja2 template engine) to make the code generation … Continue reading

Posted in C++, Chemeng, Howtos | Tagged | Leave a comment