calc_fugacity_gas_mixture
Calculate the fugacity of gas mixtures using equation of state models like PR, SRK, RK, or vdW. Input temperature, pressure, and component properties for precise thermodynamic modeling.
Instructions
This function calculates the fugacity of a mixture of gases 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 |
---|---|---|---|
components | Yes | List of components with their properties | |
eos_model | No | EOS model to use, e.g., 'SRK', 'PR' | SRK |
pressure | Yes | Pressure of the system | |
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": {
"components": {
"description": "List of components with their properties",
"items": {
"$ref": "#/$defs/Component"
},
"title": "Components",
"type": "array"
},
"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"
},
"temperature": {
"$ref": "#/$defs/Temperature",
"description": "Temperature of the system",
"title": "Temperature"
}
},
"required": [
"components",
"temperature",
"pressure"
],
"type": "object"
}