Appendix: tabulated_data Utility
The tabulated_data utility generates tabulated equation-of-state and optional transport files in the EoSTables/<table_name>/ layout used by tabular-EoS cases.
The utility is installed as tabulated_data in the solver bin directory.
The viewer is installed as tabulated_data_viewer and the environment setup helper as setup_tabulated_data_env.
To launch the GUI from an installed tree:
tabulated_data_viewer
If the local tabulator environment does not exist yet, you can create/update it explicitly first:
tabulated_data_viewer --setup-env
From the repository root during development, the equivalent launcher is:
python tools/tabulated_data/tabulated_data_viewer.py
To create or update the local Python environment used by the tabulator tools:
setup_tabulated_data_env
For cantera mode support, install the optional Cantera package into that same environment:
setup_tabulated_data_env --with-cantera
The tabulated_data CLI and tabulated_data_viewer will also auto-bootstrap that local environment when their required Python packages are missing.
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
What Is Being Fit
All source modes produce the same table representation: a table
directory containing corrections to a simple baseline equation of state.
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:
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 utility samples pressure and temperature on log(P) and log(T) axes
by default. The runtime supports two EoS correction readers, selected by the
info.desc file. kd files are referenced with file densityCorrect and
file energyCorrect; the evaluator decides whether to pass P/T or
log(P)/log(T) by looking for logP and logT in the filename.
fixedTable files are referenced with file densityCorrectFixed and
file energyCorrectFixed. The fixed-interval evaluator does not read an axis
flag from the filename; it always evaluates with log(P) and log(T), so
fixed-table data must be generated on logarithmic pressure and temperature
axes.
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.
What The Utility Produces
For a given source mode and set of options, the utility writes a table directory:
EoSTables/<table_name>/
The directory contains:
info.desc(table metadata + file references)omega.fitEoS correction surfaces: - kd-tree format:
densityCorrect_*.kd,energyCorrect_*.kd- fixed-table format:densityCorrect_*.fixedTable,energyCorrect_*.fixedTableOptional fields: -
entropy_*.kd-viscosity_*.kd-conductivity_*.kdOptional temperature limits: -
TlimitHi.fit-TlimitLo.fit
The exact set of files depends on source mode and output flags.
Using Generated Tables In A Case
For a tabulated-EoS case setup, the generated EoSTables/<table_name>/ directory is only one part of the setup.
The corresponding species entry in the .mdl file must also reference that table with eos=Table(name="<table_name>").
If you do not pass --table_name in refprop mode, the utility generates
a descriptive directory name such as heos_water_full_bauto. Pass a short
explicit name, such as --table_name N2, when that is the name you want to
appear in the .mdl file.
Recommended workflow:
Generate one table per tabulated species.
Keep the resulting
EoSTables/directory next tocase.varsor under$CHEMISTRY_DATABASE/data_base/EoSTables.Patch or check the species entries in the
.mdlfile so each tabulated species useseos=Table(name="<table_name>"). The--update_mdland--mdl_speciesoptions can do this while the table is generated.
The minimum case-side requirements are:
Load the
tabularEoSmodule:loadModule: tabularEoS
Use a real-fluid chemistry model:
chemistry_model: HeN2 eos_type: fluid
Point each tabulated species entry in
HeN2.mdlat its table:species = { He: <..., eos=Table(name="He"), ...> ; N2: <..., eos=Table(name="N2"), ...> ; } ;Use the tabulated-EoS transport selector:
transport_model: tabularEoS
The current generic
tabularEoSmodule expects this selector when it is loaded. Generate viscosity and conductivity tables for the species used by the case.
Do not load realFluid at the same time as tabularEoS for this workflow.
The tabularEoS module already registers the real-fluid EOS implementation.
The tabulated_data CLI can patch an existing .mdl file for you while writing a table:
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
Run the command once per tabulated species. For the generic loadModule: tabularEoS
workflow, do not use --no_transport; the runtime module also reads the
viscosity and conductivity tables selected by transport_model: tabularEoS.
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 viscosity and conductivity in the generic workflow. Species diffusion still followsdiffusion_model; withdiffusion_model: defaultthis falls back tolaminarSchmidt.transport_model: modulein flamelet or other module-driven cases is a separate mechanism and should not be confused with generictransport_model: tabularEoS.
Invocation
General CLI form:
tabulated_data [--log_level {DEBUG,INFO,WARNING,ERROR}] {cantera,fit_table,refprop} ...
Source modes:
Mode |
Use When |
Dependency |
First Command Shape |
|---|---|---|---|
|
You have a Cantera YAML mechanism and want a pure-species table. |
Python Cantera package. |
|
|
You already have a |
NumPy only. |
|
|
You want pure-fluid data from CoolProp |
CoolProp Python package, plus REFPROP if |
|
Required Inputs By Mode
Mode |
Required Inputs |
Notes |
|---|---|---|
|
|
Requires Python Cantera package. |
|
|
Pressure/temperature bounds are optional and default to fit file limits. |
|
|
Requires CoolProp Python package. Backend defaults to |
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.
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 table outputs.
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. |
|
|
|
Fit table input format:
m n
nT
T_1 T_2 ... T_nT
nP
P_1 P_2 ... P_nP
rho(P1,T1) rho(P1,T2) ... rho(P1,TnT) rho(P2,T1) ... rho(PnP,TnT)
h(P1,T1) h(P1,T2) ... h(P1,TnT) h(P2,T1) ... h(PnP,TnT)
The file is whitespace-tokenized as numbers only; do not put comments inside
the data block. 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], and enthalpy is [J/kg]. Temperature and pressure axes must
be strictly increasing and positive. The density and enthalpy values are
pressure-major arrays with shape (nP, nT).
Minimal numeric example:
28.0 1.0
2
300.0 600.0
2
100000.0 200000.0
1000.0 1100.0 1200.0 1300.0
201000.0 202000.0 203000.0 204000.0
Compatibility notes:
--adaptive_gridis supported infit_tablemode only when--fit_eval_mode hermite.
refprop Mode
Purpose: sample pure-fluid properties with CoolProp backends and generate tabulated outputs.
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. |
|
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.Default
--omega_modein this mode isauto.Pass an explicit
--table_namewhen you want a short stable.mdlreference such aseos=Table(name="N2").
Output Selection And Referencing
--output_mode controls file generation:
kd: writes kd-tree fields.fixed: writes fixed-table fields.both: writes both kd and fixed outputs.
Notes:
info.descis the runtime contract. For EoS corrections it references eitherfile densityCorrect .../file energyCorrect ...for kd-tree files, orfile densityCorrectFixed .../file energyCorrectFixed ...for fixed-table files.For kd-tree EoS files, the filename indicates whether pressure and temperature are evaluated directly or through
log(P)/log(T). The current writer uses names such asdensityCorrect_logP_logT.kd.Fixed-table EoS evaluation always uses
log(P)andlog(T)inputs, so the writer only emits fixed EoS tables on logarithmic axes.fixedTablefiles are usable table inputs, not viewer-only artifacts. They are selected only wheninfo.descuses thedensityCorrectFixedandenergyCorrectFixedkeys. With--output_mode both --info_mode kd, fixed files are written but not selected byinfo.desc.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.fixedoutput is log-axis only. Keep the default--log_pand--log_tsettings when writing fixed tables.
--info_mode controls what info.desc points to when --output_mode both is used.
Examples
Cantera species tabulation:
tabulated_data cantera chem.yaml --species O2 \
--pmin 1.0e5 --pmax 5.0e6 --tmin 250 --tmax 3000 \
--table_name O2_table --output_mode both --info_mode kd
fitTable conversion:
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
REFPROP/HEOS-style 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
Small two-species case setup:
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
Then check that case.vars contains the tabular-EoS setup:
loadModule: tabularEoS
chemistry_model: HeN2
eos_type: fluid
transport_model: tabularEoS
and that HeN2.mdl references the generated table names:
species = {
He: <..., eos=Table(name="He"), ...> ;
N2: <..., eos=Table(name="N2"), ...> ;
} ;
Dependencies And Troubleshooting
canteramode requires Cantera Python package.refpropmode requires CoolProp Python package.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.
For the latest option set, run:
tabulated_data -h
tabulated_data cantera -h
tabulated_data fit_table -h
tabulated_data refprop -h