Appendix: tabulated_data Utility
The tabulated_data utility generates tabulated equation-of-state data, and
when the selected source supports it, tabulated viscosity and conductivity
data. The output is an EoSTables/<table_name>/ directory that can be used by
tabular-EoS cases.
Use this utility when a species in a real-fluid or tabular-EoS case should use
property tables instead of an analytic ideal-gas or real-fluid equation of
state. Most users should start with refprop mode, which can use CoolProp’s
HEOS backend without a REFPROP installation, or an installed REFPROP backend
when that is available. The utility can also:
sample a pure species from a Cantera mechanism;
import an existing pressure-temperature
fitTablecontaining density and enthalpy when no CoolProp/REFPROP or Cantera source is available.
Note: Do not use this utility for the cavitation-NIST .liq, .vap, and
.sat table workflow. That workflow uses cav_tab_tool.
Basic workflow:
Choose a source mode. For most pure fluids, use
refpropmode with--backend HEOSor--backend REFPROP.Generate one table directory per tabulated species.
Place the resulting
EoSTables/directory in the directory containingcase.varsor in the run directory used to launch Stream.Set each tabulated species in the
.mdlfile toeos=Table(name="<table_name>").Load and select the tabular-EoS runtime path in
case.vars.
Quick Stream Setup
For a generic tabulated-EoS case, generate one table per tabulated species and
make the table name match the eos=Table(name="...") name used in the
chemistry model file. Explicit --table_name values make this easier to
read and maintain.
For example, to prepare helium and nitrogen tables for HeN2.mdl:
tabulated_data refprop --backend HEOS --fluid Helium --table_name He \
--pmin 1.0e5 --pmax 2.0e6 --tmin 20 --tmax 400 \
--update_mdl HeN2.mdl --mdl_species He
tabulated_data refprop --backend HEOS --fluid Nitrogen --table_name N2 \
--pmin 1.0e5 --pmax 2.0e6 --tmin 20 --tmax 400 \
--update_mdl HeN2.mdl --mdl_species N2
The --update_mdl and --mdl_species options are optional, but they are
the least error-prone way to keep the generated table name and the .mdl
species entry synchronized.
Then check that your run control file (*.vars) contains the tabular-EoS setup:
loadModule: tabularEoS
eos_type: fluid
chemistry_model: HeN2
transport_model: tabularEoS
and that HeN2.mdl references the generated table names:
species = {
He: <..., eos=Table(name="He"), ...> ;
N2: <..., eos=Table(name="N2"), ...> ;
} ;
Keep the generated EoSTables/ directory in the directory containing
case.vars or in the run directory used to launch Stream.
Do not load realFluid at the same time as tabularEoS for this workflow.
The tabularEoS module already registers the real-fluid EOS implementation.
For the generic loadModule: tabularEoS workflow, the same runtime module
also owns the optional tabular viscosity and conductivity readers selected by
transport_model: tabularEoS. This is an implementation detail of the current
runtime module: in this context, “tabular transport” means viscosity and thermal
conductivity only. Use a source mode that writes those two tables, such as
refprop or cantera without --no_transport. The fit_table source
imports density and enthalpy from the input file; by default it writes EoS
correction tables only. Use --constant_viscosity and
--constant_conductivity for constant transport tables, or
--fit_transport_from_table when the input file also contains appended
viscosity and conductivity grids. Use refprop/cantera for
source-derived viscosity and conductivity.
Species diffusion coefficients are not part of the supported EoSTables
format, and adding extra diffusion files to the table directory will not make
Stream read them. Species diffusion is controlled by diffusion_model. For
the common transport_model: tabularEoS setup, either leave
diffusion_model at default or set diffusion_model: laminarSchmidt
explicitly; both routes use tabulated laminar viscosity with
laminarSchmidtNumber. Use other diffusion_model values only when the
case is intentionally using separate diffusion-data sources, such as
diffusion_model: chemkin with Chemkin-format transport data.
Some upstream documentation describes this as mixing tabular transport with
transportDB. In Stream, this is a file-level fallback inside
transport_model: tabularEoS, not a different transport_model setting. If
a chemistry model contains both eos=Table(name="...") species and ordinary
non-table species, the tabularEoS transport reader uses EoSTables viscosity
and conductivity for the table species and searches the run-directory
transport/ folder for transportDB-style *_vis.dat and *_con.dat
files for the non-table species. It still does not read diffusion coefficients
from EoSTables.
Compared to the transportDB workflow:
tabularEoSusesEoSTables/<table_name>/and per-specieseos=Table(name="...")entries in the.mdlfile.transportDBuses atransport/folder and does not requireeos=Table(...)in the.mdlfile.transport_model: tabularEoSreplaces the active viscosity/conductivity model in the generic workflow. Keep this setting when using table species. For non-table species in the same model, the tabularEoS reader can use local transportDB-styletransport/*_vis.datandtransport/*_con.datfiles.Species diffusion still follows
diffusion_model; withdiffusion_model: defaultthis falls back tolaminarSchmidtand does not read diffusion-coefficient files fromEoSTables.transport_model: modulein flamelet or other module-driven cases is a separate mechanism and should not be confused with generictransport_model: tabularEoS.
What The Utility Produces
For a given source mode and set of options, the utility writes:
EoSTables/<table_name>/
The directory always contains:
info.desc(table metadata and file references)omega.fitEoS correction surfaces:
kd-tree format:
densityCorrect_*.kd,energyCorrect_*.kdfixed-table format, when requested:
densityCorrect_*.fixedTable,energyCorrect_*.fixedTable
Depending on source mode and flags, the directory can also contain:
viscosity_*.kdconductivity_*.kdentropy_*.kdTlimitHi.fitTlimitLo.fit
Generated tables are only appropriate over the pressure and temperature range
sampled by the command. Choose --pmin, --pmax, --tmin, and
--tmax so they cover the expected states in the simulation.
Mode |
Use When |
Generated By Default |
Optional Or Not Generated |
|---|---|---|---|
|
You want pure-fluid properties from CoolProp |
EoS corrections, viscosity, conductivity, |
|
|
You have a Cantera YAML mechanism and want a pure-species table. |
EoS corrections, viscosity, conductivity, and |
|
|
Advanced import path for an existing |
EoS corrections and |
|
Invocation
General CLI form:
tabulated_data [--log_level {DEBUG,INFO,WARNING,ERROR}] {refprop,cantera,fit_table} ...
Source modes:
Mode |
Use When |
Can Generate |
First Command Shape |
|---|---|---|---|
|
You want pure-fluid data from CoolProp |
EoS corrections; viscosity/conductivity unless |
|
|
You have a Cantera YAML mechanism and want a pure-species table. |
EoS corrections; viscosity/conductivity unless |
|
|
You already have a |
EoS corrections. Add constant transport flags or
|
|
Dependencies are listed under Dependencies And Troubleshooting.
Required Inputs By Mode
Mode |
Required Inputs |
Notes |
|---|---|---|
|
|
Requires CoolProp Python package. Backend defaults to |
|
|
Requires Python Cantera package. |
|
|
Pressure/temperature bounds are optional and default to fit file limits. |
Examples
CoolProp HEOS pure-fluid table:
tabulated_data refprop --backend HEOS --fluid Water \
--pmin 1.0e5 --pmax 2.0e7 --tmin 280 --tmax 600 \
--liquid_bias --output_mode kd
Cantera species tabulation:
tabulated_data cantera mechanism.yaml --species O2 \
--pmin 1.0e5 --pmax 5.0e6 --tmin 250 --tmax 3000 \
--table_name O2_table --output_mode both --info_mode kd
Common Flags
These options are available for all source modes unless noted otherwise.
Flag |
Default |
Description |
|---|---|---|
|
|
Root output directory. |
|
|
Write kd files, fixed tables, or both. |
|
|
When |
|
mode-dependent |
|
|
|
Constant omega value when |
|
none |
Existing fit file to copy when |
|
|
Interval count for generated omega fit. |
|
none |
Optional explicit high-T limit fit file to copy as |
|
none |
Optional explicit low-T limit fit file to copy as |
|
none |
Optional existing |
|
none |
Species entry inside |
|
|
Base grid depth in each axis (cells = \(2^{depth}\)). |
|
none |
Explicit pressure/temperature cell counts; overrides depth for that axis. |
|
off |
Enables adaptive depth selection within specified min/max depths. |
|
|
Minimum adaptive depths. |
|
|
Adaptive mean relative error target. |
|
|
Adaptive max relative error target. |
|
|
Small floor in adaptive relative error denominator. |
|
|
Maximum adaptive refinement iterations. |
|
|
Pressure axis scaling for fitting grid. |
|
|
Temperature axis scaling for fitting grid. |
|
mode-dependent |
Baseline correction model ( |
|
|
Baseline coefficients used when |
Notes:
--adaptive_gridcannot be combined with--num_por--num_t.kdoutput requires power-of-two pressure and temperature cell counts. The depth options produce power-of-two counts automatically. If you use--num_por--num_twith--output_mode kdorboth, choose values such as16,32, or64.fixedoutput requires the default logarithmic pressure and temperature axes. Do not combine--output_mode fixedorbothwith--linear_por--linear_t.--omega_mode autorequires the source adapter to provide omega fit data. This is currently provided by therefpropsource path.--mdl_speciesis required when--update_mdlis used.
refprop Mode
Purpose: sample pure-fluid properties with CoolProp backends and generate
tabulated outputs. Use --backend HEOS for the built-in CoolProp backend.
Use --backend REFPROP only when REFPROP is installed and available to
CoolProp.
Additional flags:
Flag |
Default |
Description |
|---|---|---|
|
required |
Fluid name (for example |
|
|
CoolProp backend prefix. |
|
auto-generated |
Output table directory name. The default includes backend, fluid,
sampling mode, and baseline mode, for example |
|
required |
Pressure bounds [Pa]. |
|
required |
Temperature bounds [K]. |
|
off |
Skip viscosity/conductivity table generation. |
|
off |
Also write entropy table. |
|
off |
Bias sampling toward liquid side near saturation. |
|
off |
Bias sampling toward vapor side near saturation. |
|
mode-dependent |
Custom bias multiplier for saturation pressure mapping. |
|
off |
Forces bias factor to 1.0. |
|
|
Reference temperature [K] used with the reference enthalpy/entropy options. |
|
|
Reference pressure [Pa] used with the reference enthalpy/entropy options. |
|
none |
Target molar enthalpy [J/kmol] at the reference state, matching |
|
none |
Target molar entropy [J/(kmol K)] at the reference state, matching
|
|
auto on |
Enable or disable generated |
|
|
Interval count for generated T-limit fits. |
refprop-specific behavior:
--baseline_mode autois available in this mode and is the default.--liquid_biasand--vapor_biasare mutually exclusive.The reference enthalpy and entropy options are only needed when a tabulated REFPROP/CoolProp species participates in reactions with species whose thermodynamic references come from the chemistry model file. Provide
--reference_enthalpyand--reference_entropytogether. The utility converts those molar reference values to mass-specific offsets and applies them before writingenergyCorrectand optionalentropytables.Default
--omega_modein this mode isauto.Pass an explicit
--table_namewhen you want a short stable.mdlreference such aseos=Table(name="N2").For
--backend REFPROP, make the REFPROP installation visible to CoolProp. On Linux this is typically done by settingCOOLPROP_REFPROP_ROOTto the directory containinglibrefprop.so,FLUIDS/, andMIXTURES/before runningtabulated_data.
cantera Mode
Purpose: sample a pure species from a Cantera mechanism and produce tabulated correction fields.
Additional flags:
Flag |
Default |
Description |
|---|---|---|
|
required |
Cantera YAML mechanism path. |
|
none |
Optional phase name in mechanism. |
|
required |
Species name to tabulate as pure fluid. |
|
species name |
Output table directory name. |
|
required |
Pressure bounds [Pa]. |
|
required |
Temperature bounds [K]. |
|
off |
Skip viscosity/conductivity table generation. |
|
off |
Also write entropy table. |
Baseline behavior:
Default
--baseline_mode idealcomputes baseline terms from sampled Cantera state.
fit_table Mode
Purpose: ingest fitTable input and generate EoS correction table outputs.
This mode is useful when property data already exists as a pressure-temperature
grid of density and enthalpy, but no Cantera or REFPROP/CoolProp source is
available for the species. The input file itself is an EoS import path only.
When the generic Stream tabularEoS module also needs transport tables, either
provide --constant_viscosity and --constant_conductivity or append
viscosity and conductivity grids to the input file and pass
--fit_transport_from_table. The generated viscosity and conductivity
kd files are written into the same EoSTables table directory. Keep
transport_model: tabularEoS for this workflow. If the same chemistry model
also contains non-table species, provide their viscosity and conductivity using
local transportDB-style files in transport/.
Additional flags:
Flag |
Default |
Description |
|---|---|---|
|
required |
Path to a fit-table input file. |
|
file stem |
Output table directory name. |
|
source limits |
Optional resampling pressure bounds [Pa] within the source table limits. |
|
source limits |
Optional resampling temperature bounds [K] within the source table limits. |
|
|
|
|
none |
Optional constant viscosity [Pa*s]. Must be paired with
|
|
none |
Optional constant thermal conductivity [W/(m*K)]. Must be paired with
|
|
off |
Read two additional pressure-major blocks after enthalpy: viscosity [Pa*s], then thermal conductivity [W/(m*K)]. |
Compatibility notes:
fit_tablemode reads density and enthalpy and writesdensityCorrectandenergyCorrecttables.For a normal
loadModule: tabularEoScase, provide viscosity and conductivity entries in the sameEoSTablestable manifest. Userefproporcanterafor property-derived transport, or thefit_tableconstant transport flags or appended transport grids for prescribed values. Keeptransport_model: tabularEoS; do not switch the case totransport_model: transportDBortransport_model: const_viscosityto supply the table species’ transport properties.fit_tabledoes not define species diffusion coefficients. Setdiffusion_modelseparately;laminarSchmidtis the intended simple choice for these generated tabular-EoS fixtures.--adaptive_gridis supported infit_tablemode only when--fit_eval_mode hermite.See Advanced fitTable Input Format for the input file grammar.
Output Selection And Referencing
--output_mode controls file generation:
kd: default and recommended for normal Stream cases.fixed: writes fixed-interval EoS tables for cases that specifically need that format.both: writes both kd and fixed outputs in the same table directory.
Notes:
The writer records the selected files in
info.desc. Users normally should not editinfo.descby hand.fixedoutput is limited to density/energy EoS corrections and requires logarithmic pressure and temperature axes.fixedmode writes density/energy fixed tables only. Optional entropy and transport outputs requirekdorboth.With
refpropandcanteradefaults, viscosity and conductivity are generated. Use--no_transportbefore choosing--output_mode fixed, or choose--output_mode both --info_mode fixedwhen you want fixed EoS corrections but still want kd transport files in the directory.kdoutput requires power-of-two cell counts. The depth controls are the simplest way to get that.fixedoutput can use non-power-of-two explicit cell counts.When
--output_mode bothis used,--info_modeselects whetherinfo.descpoints the runtime to the kd or fixed EoS correction files.
For ordinary tabulated-EoS cases, use the default --output_mode kd.
Table Format Details
All source modes produce the same EoS table representation: a table directory
containing residual corrections to a simple baseline equation of state. The
densityCorrect and energyCorrect files do not store raw density or raw
internal energy. They store the amount that must be added to the baseline model
to recover the sampled source property. The baseline coefficients are written
to info.desc as m, R, b, r1, n, and hf.
For each sampled pressure/temperature state, the utility writes:
At run time, the table reader evaluates the baseline model from the coefficients
in info.desc and adds the corresponding correction surface. In other words,
the tabulated files provide only the pressure-temperature residual terms needed
to recover the source density and internal energy. Some older descriptions
include an additional temperature-only energy correction term. The tables
generated by this utility write the pressure-temperature energyCorrect
surface directly, so no separate temperature-only correction is generated by
this tool.
The fit_table source reads density and enthalpy from the input file, but
the generated table stores an internal-energy correction. The conversion is
e = h - P/rho before the baseline correction is formed.
The optional viscosity and conductivity files are different: they store
the sampled transport property values directly, not residual corrections.
The utility spaces pressure and temperature on logarithmic axes by default.
That is the recommended setting for most real-fluid tables because useful
pressure and temperature ranges often span large intervals. Keep the default
--log_p and --log_t settings unless there is a specific reason to fit
on linear axes.
For normal case setup, leave --output_mode at its default kd. Use
fixed only when you specifically need the fixed-interval EoS table format.
Fixed-table output is restricted to logarithmic pressure and temperature axes;
if linear axes are needed, use kd output.
The correction fields are converted to bicubic Bezier patches. kd output
stores those patches behind the kd-tree lookup format. fixedTable output
stores the same patch data on a regular fixed-interval grid.
Advanced fitTable Input Format
Most users should generate tables directly from refprop mode. The
fit_table source mode is an import path for existing numeric property
tables. By default, the input file contains only density and enthalpy. If
--fit_transport_from_table is supplied, two additional pressure-major blocks
must follow enthalpy: viscosity, then thermal conductivity. The file is a
whitespace-tokenized numeric format. Blank lines are allowed, and # starts a
comment that runs to the end of the line:
tabulated_data fit_table oxygen.fitTable \
--table_name oxygen_tab --fit_eval_mode hermite \
--adaptive_grid --min_depth_x 2 --min_depth_y 2 --depth_x 6 --depth_y 6
# Molecular weight [kg/kmol], baseline coefficient n
m n
# Temperature axis [K]
nT
T_1 T_2 ... T_nT
# Pressure axis [Pa]
nP
P_1 P_2 ... P_nP
# Density [kg/m3], pressure-major
rho(P1,T1) rho(P1,T2) ... rho(P1,TnT) rho(P2,T1) ... rho(PnP,TnT)
# Enthalpy [J/kg], pressure-major
h(P1,T1) h(P1,T2) ... h(P1,TnT) h(P2,T1) ... h(PnP,TnT)
With --fit_transport_from_table, append these two blocks:
# Viscosity [Pa*s], pressure-major
mu(P1,T1) mu(P1,T2) ... mu(P1,TnT) mu(P2,T1) ... mu(PnP,TnT)
# Thermal conductivity [W/(m*K)], pressure-major
k(P1,T1) k(P1,T2) ... k(P1,TnT) k(P2,T1) ... k(PnP,TnT)
m is molecular weight [kg/kmol], n is the baseline coefficient in
e = n R T + hf, temperature is [K], pressure is [Pa], density is [kg/m3],
enthalpy is [J/kg], viscosity is [Pa*s], and thermal conductivity is
[W/(m*K)]. Temperature and pressure axes must be strictly increasing and
positive. The density, enthalpy, viscosity, and conductivity values are
pressure-major arrays with shape (nP, nT). Transport values must be finite
and positive when present.
Minimal numeric example:
# m, n
28.0 1.0
# two temperature samples
2
300.0 600.0
# two pressure samples
2
100000.0 200000.0
# rho(P1,T1), rho(P1,T2), rho(P2,T1), rho(P2,T2)
1000.0 1100.0
1200.0 1300.0
# h(P1,T1), h(P1,T2), h(P2,T1), h(P2,T2)
201000.0 202000.0
203000.0 204000.0
Dependencies And Troubleshooting
The utility is installed as tabulated_data in the solver bin directory.
canteramode requires the Python Cantera package.refpropmode requires the CoolProp Python package. The default--backend HEOSpath uses CoolProp’s HEOS backend. Use--backend REFPROPonly when a local REFPROP installation is available and visible to CoolProp. For example:export COOLPROP_REFPROP_ROOT=/path/to/REFPROP
where the directory contains
librefprop.so,FLUIDS/, andMIXTURES/.fit_tablemode uses the numeric input file directly and does not require Cantera or CoolProp.If
--omega_mode fitfileis used,--omega_fit_filemust be provided.If explicitly-provided
--tlimit_hi_fitor--tlimit_lo_fitpaths are invalid, the utility exits with an error.
The tabulated_data CLI will auto-bootstrap the local Python environment
when required packages are missing. You can also create or update that
environment explicitly:
setup_tabulated_data_env
For cantera mode support, install the optional Cantera package into that
same environment:
setup_tabulated_data_env --with-cantera
You can also request explicit setup inline when launching the CLI:
tabulated_data --setup-env refprop --fluid Water \
--pmin 1.0e5 --pmax 2.0e7 --tmin 280 --tmax 600
For the latest option set, run:
tabulated_data -h
tabulated_data refprop -h
tabulated_data cantera -h
tabulated_data fit_table -h
Optional Viewer
The command-line tool is the primary documented path for reproducible table
generation. A secondary viewer, tabulated_data_viewer, is also installed for
users who want a GUI-like way to inspect generated tables or generate REFPROP
tables interactively.
To launch the viewer from an installed tree:
tabulated_data_viewer
If the local tabulator environment does not exist yet, create or update it before launching:
tabulated_data_viewer --setup-env
From the repository root during development, the equivalent launcher is:
python tools/tabulated_data/tabulated_data_viewer.py
The viewer can browse table directories containing info.desc, show metadata
and field previews, and save/load generation presets. It is optional; all table
generation workflows described above can be run directly through
tabulated_data.