💧
OLI API
  • Welcome to the OLI API documentation
  • Basic workflow
  • Authentication
    • Bearer Token
    • API Keys
      • Generate a Key
      • List All Keys
      • Delete a Key
  • Generating chemistry model files
    • ChemBuilder API
      • Getting Started with ChemBuilder
        • Set Thermodynamic Framework
        • Include Private Databanks
        • Include Inflows
          • Include Assays
          • Include Pseudocomponent
        • Choose Phases
        • Specify Model Name
        • Choose Redox
        • Choose Solids
        • Add Kinetics
      • ChemBuilder Query
        • Species Query
        • Redox Query
        • Solid Phase Query
        • Databank Query
        • Kinetics Query
        • Query Output Results
      • Supporting Information for ChemBuilder
        • Add Comment
        • "enabled" Keyword
        • ChemBuilder Errors
    • Chemistry Wizard
  • Uploading chemistry model files
  • Get list of uploaded files
  • Quickstart example: Python
  • Known issues and Limitations
  • OLI ENGINE API
    • Main methods
      • API call blueprint
      • Chemistry information
      • Isothermal flash
      • Isenthalpic flash
      • Bubble point flash
      • Dew point flash
      • Vapor amount flash
      • Vapor fraction flash
      • Isochoric flash
      • set pH flash
      • Precipitation point flash
      • Autoclave
      • Custom flash
      • Corrosion contact surfaces
      • Corrosion rates
      • Water analysis
  • Additional methods
    • Flash history - Chemistry model
    • Result - by jobId
    • delete file
    • cancel run
  • Inflows input
  • Optional inputs
  • Kinetic calculation inputs
  • Kinetic calculation outputs
  • Input units
  • User defined output unit set
  • Survey calculation
  • Stream output
  • Error/Warning output
  • Definition of terms
  • OLI Process API
    • Uploading a Process API package
      • Creating a Process API package
    • Get list of all uploaded ProcessAPI packages
    • Get input specs for Process API package
    • Get output specs for ProcessAPI package
    • Run a Process API calculation
    • Get calculation status and results
  • Deleting a process package
  • Undelete a process package
  • Process API input specification
    • "data" object
      • "flowsheet" object
        • "chemical-info" object
        • "general-info" object
        • "properties" object
        • "units_set_info" object
  • OLI ScaleChem API
    • Uploading chemistry model files for ScaleChem API
    • Get list of uploaded ScaleChem model files
    • Main methods
      • Brine analysis
      • Gas analysis
      • Oil analysis
      • Mixer calculation
      • Scale scenario
Powered by GitBook
On this page

Was this helpful?

  1. Generating chemistry model files
  2. ChemBuilder API
  3. Supporting Information for ChemBuilder

"enabled" Keyword

The "enabled" keyword appears in multiple Chemistry Builder JSON objects, facilitating quick toggling of properties or options without the need to create or delete JSON objects explicitly, thereby reducing parameter tuning efforts. Here are guidelines, examples, and exceptions for its usage:

  • The "enabled" keyword must be a Boolean type, accepting only true or false.

  • It must be enclosed within "{ }" in a JSON object.

  • When set to 'true', the input within the JSON object is processed.

  • When set to 'false', the input within the JSON object is disregarded.

  • If the "enabled" keyword is absent, the JSON object is processed by default.

  • If the "enabled" field contains values other than 'true' or 'false', the JSON object is still processed.

{
    	"inflows": [
		{
			"name": "H2O", 
			"enabled": true 
		},
		{
			"name": "NACL",
			"enabled": false
		},
		{ 
			"name": "CO2", 
		} ]
} 

In this example, "H2O" and "CO2" are included as inflow species, whereas "NaCl" is excluded.

{
    	"inflows": [
		{
			"name": "H2O", 
		},
		{
			"name": "NACL",
		},
		{ 
			"name": "CO2", 
			"enabled": "true"
			
		} ]
}

The "enabled" field for CO2 is assigned a string value instead of a boolean value. However, CO2 will still be added as an input despite the incorrect data type.

  "redox": {
        "enabled": false,
        "subSystems": [
            {
                "name": "Chlorine",
                "enabled": true,
                "valenceStates": [
                    {
                        "name": "Cl(-1)",
                        "enabled": true
                    },
                    {
                        "name": "Cl(+1)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+3)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+5)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+7)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+4)",
                        "enabled": false
                    }
                ]
            }
        ]
    }
    
        

In this example, "redox" is disabled, resulting in the exclusion of everything within the object.

    "redox": {
        "enabled": true,
        "subSystems": [
            {
                "name": "Chlorine",
                "enabled": true,
                "valenceStates": [
                    {
                        "name": "Cl(-1)",
                        "enabled": true
                    },
                    {
                        "name": "Cl(+1)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+3)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+5)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+7)",
                        "enabled": false
                    },
                    {
                        "name": "Cl(+4)",
                        "enabled": false
                    }
                ]
            }
        ]
    }

In this example, "redox" and "Chlorine" are enabled, with only the "Cl (-1)" valence state being active. All other valence states are ignored.

 {   
	"params": {
	"thermodynamicFramework": "MSE (H3O+ ion)",
	"privateDatabanks": [
	],
	"modelName": "quickTest",
	"inflows": [
		{ 
			"name": "H2O"
		} ,	
		{
			"name": "NACL"
		},
		{
			"name": "CO2"
		},
		{
			"name": "BENZENE"
		},
		{ 
			"name": "ETHANOL" 
		}
		],
	"phases": [
		"liquid1",
		"vapor",
		"solid",
		"liquid2"
	],
	"redox": {
		"enabled": true,
		"subSystems": [
			{
				"name":"Carbon", 
				"enabled": true
			}, 
			{
				"name": "Chlorine",
				"enabled": false,
				"valenceStates": [
					{
						"name": "Cl(-1)",
						"enabled": true
					},
					{
						"name": "Cl(+1)",
						"enabled": true
					},					
					{
						"name": "Cl(+3)",
						"enabled": false
					},
					{
						"name": "Cl(+5)",
						"enabled": false
					},
					{
						"name": "Cl(+7)",
						"enabled": false
					}
	
				]
			}
		] 
	} 
	}
 }

In this example:

  • Carbon, as a subsystem, is enabled, resulting in all its valence states being enabled by default.

  • Chlorine is enabled, with Cl(+1) and Cl(-1) valence states explicitly enabled. Cl(+4) is not specified, so it defaults to enabled. Other valence states are explicitly disabled.

  • Sodium is not included in the input, thus all its valence states are disabled by default.

It's important to note the default behaviors: missing known JSON objects are assumed to be disabled; hence Sodium is disabled by default. For the "redox" valence state, if an element like "Chlorine" is enabled, all its valence states are automatically enabled. Thus, if a valence state such as Cl(+4) is absent, it's automatically enabled. This approach mirrors OLI Studio's behavior.

To disable an individual valence state, "enabled": false must be explicitly set to override its default value.

PreviousAdd CommentNextChemBuilder Errors

Last updated 10 months ago

Was this helpful?