calc_gas_component_fugacity
Calculate single-gas component fugacity using equation of states (EOS) like PR, SRK, RK, or vdW. Input component details, temperature, pressure, and optionally select solver method for accurate thermodynamic modeling.
Instructions
This function calculates the fugacity of single-gas component using different equation of states (EOS) including Peng-Robinson (PR), Soave-Redlich-Kwong (SRK), Redlich-Kwong (RK), and van der Waals (vdW).
Input Schema
Name | Required | Description | Default |
---|---|---|---|
component | Yes | Component name and properties | |
custom_reference_config | No | Custom reference configuration provided by PyThermoDB, this consists of the reference for data and equations for each component. | None |
custom_reference_content | No | Custom reference content provided by PyThermoDB, this consists of data and equations for all components. | None |
eos_model | No | EOS model to use, e.g., 'SRK', 'PR' | SRK |
pressure | Yes | Pressure of the system | |
solver_method | No | Solver method for fugacity calculation, e.g., 'least-square method', 'fsolve', 'root' | ls |
temperature | Yes | Temperature of the system |
Input Schema (JSON Schema)
{
"$defs": {
"Component": {
"description": "Component model for input validation",
"properties": {
"formula": {
"description": "Chemical formula of the component",
"title": "Formula",
"type": "string"
},
"mole_fraction": {
"default": 1,
"description": "Mole fraction of the component in a mixture, if applicable",
"title": "Mole Fraction",
"type": "number"
},
"name": {
"description": "Name of the component",
"title": "Name",
"type": "string"
},
"state": {
"description": "State of the component: 'g' for gas, 'l' for liquid, 's' for solid",
"enum": [
"g",
"l",
"s"
],
"title": "State",
"type": "string"
}
},
"required": [
"name",
"formula",
"state"
],
"title": "Component",
"type": "object"
},
"Pressure": {
"description": "Pressure model for input validation",
"properties": {
"unit": {
"description": "Pressure unit, e.g., 'bar', 'atm', 'Pa'",
"title": "Unit",
"type": "string"
},
"value": {
"description": "Pressure value",
"title": "Value",
"type": "number"
}
},
"required": [
"value",
"unit"
],
"title": "Pressure",
"type": "object"
},
"Temperature": {
"description": "Temperature model for input validation",
"properties": {
"unit": {
"description": "Temperature unit, e.g., 'K', 'C', 'F'",
"title": "Unit",
"type": "string"
},
"value": {
"description": "Temperature value",
"title": "Value",
"type": "number"
}
},
"required": [
"value",
"unit"
],
"title": "Temperature",
"type": "object"
}
},
"properties": {
"component": {
"$ref": "#/$defs/Component",
"description": "Component name and properties",
"title": "Component"
},
"custom_reference_config": {
"default": "None",
"description": "Custom reference configuration provided by PyThermoDB, this consists of the reference for data and equations for each component.",
"title": "Custom Reference Config",
"type": "string"
},
"custom_reference_content": {
"default": "None",
"description": "Custom reference content provided by PyThermoDB, this consists of data and equations for all components.",
"title": "Custom Reference Content",
"type": "string"
},
"eos_model": {
"default": "SRK",
"description": "EOS model to use, e.g., 'SRK', 'PR'",
"enum": [
"PR",
"SRK",
"RK",
"vdW"
],
"title": "Eos Model",
"type": "string"
},
"pressure": {
"$ref": "#/$defs/Pressure",
"description": "Pressure of the system",
"title": "Pressure"
},
"solver_method": {
"default": "ls",
"description": "Solver method for fugacity calculation, e.g., 'least-square method', 'fsolve', 'root'",
"enum": [
"ls",
"fsolve",
"root"
],
"title": "Solver Method",
"type": "string"
},
"temperature": {
"$ref": "#/$defs/Temperature",
"description": "Temperature of the system",
"title": "Temperature"
}
},
"required": [
"component",
"temperature",
"pressure"
],
"type": "object"
}