modelActivityCoefficient
Extends from Modelica.Icons.RectangularSensor (Icon representing a linear measurement device).
Information
s1·S1 + .. + snS·SnS <-> p1·P1 + .. + pnP·PnP
By redefinition of stoichometry as vi = -si, Ai = Si for i=1..nS vi = pi-nS, Ai = Pi-nS for i=nS+1..nS+nP
So the reaction can be written also as 0 = ∑ (vi · Ai)
Equilibrium equation
K = product(a(S).^s) / product( a(P).^s ) = product(a(A).^v) |
dissociation constant |
ΔrG = ∑ (vi · ΔfGi) = ΔrH - T·ΔrS = -R·T·log(K) |
molar Gibb's energy of the reaction |
ΔrH = ∑ (vi · ΔfHi) |
molar enthalpy of the reaction |
molar entropy of the reaction |
Notations
Ai |
i-th substance |
vi |
stochiometric coefficients of i-th substance |
K |
dissociation constant (activity based) |
a(Ai)=fi*xi |
activity of the substance A |
fi |
activity coefficient of the substance A |
xi |
mole fraction of the substance A |
ΔfHi |
molar enthalpy of formation of i-th substance |
ΔfGi |
molar Gibbs energy of formation of i-th substance |
ΔfSi |
molar entropy of formation of i-th substance |
Δrω |
change of number of microstates of particles by reaction |
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Units.SI.Temperature | T | system.T_ambient | Temperature if not useTemperatureInput |
| Modelica.Units.SI.AmountOfSubstance | n | 1 | Amount of all substances in solution per one liter of solution if not useTotalAmountOfSubstancesInput |
| Modelica.Units.SI.Mass | m | 1 | Mass of solvent per one liter of solution |
| Modelica.Units.SI.StoichiometricNumber[nS] | s | ones(nS) | Stoichiometric reaction coefficient for substrates |
| Modelica.Units.SI.StoichiometricNumber[nP] | p | ones(nP) | Stoichiometric reaction coefficients for products |
| Boolean | MolarityBased | true | if dissociation coefficient is molarity based |
| Real | DissociationCoefficient_MoleFractionBased | if MolarityBased then DissociationCoefficient_MolarityBased/((n/1)^(p*ones(nP) - s*ones(nS))) else DissociationCoefficient_MolalityBased/((n/m)^(p*ones(nP) - s*ones(nS))) | K as ratio of mole fractions |
| Real | DissociationCoefficient_MolalityBased | ((n/m)^(p*ones(nP) - s*ones(nS)))*DissociationCoefficient_MoleFractionBased | K as ratio of molalities in moles per 1 kg of solvent |
| Real | DissociationCoefficient_MolarityBased | ((n/1)^(p*ones(nP) - s*ones(nS)))*DissociationCoefficient_MoleFractionBased | K as ratio of molar concentration in moles per liter of solution |
| Conditional inputs | |||
| Boolean | useTemperatureInput | false | =true, if temperature is from input instead of parameter |
| Boolean | useTotalAmountOfSubstancesInput | false | =true, if total amount of substances in solution is from input instead of parameter |
| Ports | |||
| Integer | nS | 0 | Number of substrates types |
| Integer | nP | 0 | Number of products types |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.RealInput | temperature | _temperature | Temperature |
| Modelica.Blocks.Interfaces.RealInput | totalAmountOfSubstances | _n | Temperature |
| Interfaces.SubstancePort_b[nP] | products | Products | |
| Interfaces.SubstancePort_b[nS] | substrates | Substrates | |
| Modelica.Blocks.Interfaces.RealOutput | activityCoeficient | Activity coeficient of one product |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.System | system | System wide properties | |
| Modelica.Units.SI.MolarEnergy | DrG | Free Gibbs energy of reaction | |
| Real | pK | = -log10('mole-fraction based dissociation coefficient') |
Revisions
2013-2015 by Marek Matejak, Charles University, Prague, Czech Republic