modelSubstance

Substance in solution
Diagram of Substance

Extends from Icons.Substance, Interfaces.PartialSubstanceInSolutionWithAdditionalPorts (Substance properties for components, where the substance is connected with the solution).

Information

n = x · n(solution) = ∫ MolarFlow

where n is amount of the substance and x is mole fraction.

The main class from “Chemical” package is called "Substance". It has one chemical connector, where chemical potential and molar flow is presented. An amount of solute "n" is accumulated by molar flow inside an instance of this class. In the default setting the amount of solution "n(solution)" is set to 55.6 as amount of water in one liter, so in this setting the concentration of very diluted solution in pure water at “mol/L” has the same value as the amount of substance at “mol”. But in the advanced settings the default amount of solution can be changed by parameter or using solution port to connect with solution. The molar flow at the port can be also negative, which means that the solute leaves the Substance instance. 


The recalculation between mole fraction, molarity and molality can be written as follows:

x = n/n(solution) = b * m(solvent)/n(solution) = c * V(solution)/n(solution)

where m(solvent) is mass of solvent, V(solution) is volume of solution, b=n/m(solvent) is molality of the substance, c=n/V(solution) is molarity of the substance.

If the amount of solution is selected to the number of total solution moles per one kilogram of solvent then the values of x will be the same as molality.

If the amount of solution is selected to the number of total solution moles in one liter of solution then the values of x will be the same as molarity.



Definition of electro-chemical potential:

u = u° + R*T*ln(gamma*x) + z*F*v

u° = DfG = DfH - T * DfS

where

x .. mole fraction of the substance in the solution

T .. temperature in Kelvins

v .. relative eletric potential of the solution

z .. elementary charge of the substance (like -1 for electron, +2 for Ca^2+)

R .. gas constant

F .. Faraday constant

gamma .. activity coefficient

u° .. chemical potential of pure substance

DfG .. free Gibbs energy of formation of the substance

DfH .. free enthalpy of formation of the substance

DfS .. free entropy of formation of the substance


Be carefull, DfS is not the same as absolute entropy of the substance S° from III. thermodinamic law! It must be calculated from tabulated value of DfG(298.15 K) and DfH as DfS=(DfH - DfG)/298.15.

Parameters

TypeNameDefaultDescription
stateOfMatter.SubstanceDatasubstanceData (from PartialSubstance)Definition of the substance
Initialization
Booleanuse_mass_starttrueuse mass_start, otherwise amountOfSubstance_start
Modelica.Units.SI.Massmass_start1Initial mass of the substance
Modelica.Units.SI.AmountOfSubstanceamountOfSubstance_start1Initial amount of substance base molecules
Clustering
BooleancalculateClusteringHeattrueOnly for self clustering substances

Connectors

TypeNameDefaultDescription
SolutionPortsolution (from PartialSubstanceInSolution)To connect substance with solution, where is pressented
SubstancePort_aport_a (from PartialSubstance)The substance
SubstanceMassPort_aport_m (from PartialSubstanceInSolutionWithAdditionalPorts)Substance mass fraction port
SubstanceMolarityPort_aport_c (from PartialSubstanceInSolutionWithAdditionalPorts)

Components

TypeNameDefaultDescription
Modelica.Units.SI.ConcentrationcMolar concentration of particles
Modelica.Fluid.Systemsystem (from PartialSubstance)System wide properties
Modelica.Units.SI.MoleFractionx (from PartialSubstance)Mole fraction of the substance
Modelica.Units.SI.ActivityOfSolutea (from PartialSubstance)Activity of the substance (mole-fraction based)
Modelica.Units.SI.MolarFlowRateq (from PartialSubstanceInSolutionWithAdditionalPorts)Molar flow rate of the substance into the component
Modelica.Units.SI.MassmassamountOfBaseMolecules*molarMassOfBaseMoleculeMass

Revisions

2009-2015 by Marek Matejak, Charles University, Prague, Czech Republic