Well-to-separator production simulation and a DSL for PVT correlations
Work by a team member before SIMYL Research; the provenance is at the end of the entry.
Problem
A software startup for oil production engineering, of which the responsible member was part, needed to compute fluid properties as a function of pressure, volume and temperature (PVT) using the correlations published in the literature, each with its units, validity range and origin, and to use them in a simulator of production from the bottom of the well to the separator. Writing every correlation by hand in C++ was slow and prone to unit and range errors.
Intervention
- A domain-specific language (DSL) in Ruby to define each correlation declaratively: name, family, result unit, parameters with their units and ranges, synonyms, description of the source data, bibliographic reference and equation. A generator produces the C++ code from those definitions.
- A C++ library that evaluates the correlations with typed physical quantities: an incompatible unit or an out-of-range result is reported as an error, not as a silently wrong number. It includes correlation-tuning tools and a test suite.
- The units module was born in that project and kept evolving as an independent library,
uconv, now in C++20. - On that foundation, the backend for simulating production from the bottom of the well to the separator was built.
Recorded results
- 188 PVT correlations for oil, gas and water, organized in 35 families, defined in the DSL and published with their bibliographic references in
back-pvt, under the GPL-3.0 license. - The public history of
back-pvtruns from July 2016 to April 2018, with 1,282 commits by the responsible member and 65 by another person. - The units library is still maintained:
uconvhas history from March 2017 to 2026, with continuous integration.
Limits
The startup never had clients, so the simulator was not used in production with third parties; it worked in development and internal tests, and its specific components were not published. The figures in this entry are counts verifiable in the repositories, not business results.
Provenance
Prior work: Leandro Rabindranath León, a SIMYL Research team member, was the lead developer at a startup he was part of, until 2018. He designed the DSL, the library and the simulation backend. Another person contributed to the documentation. The code is published as free software in back-pvt and uconv.