modelSubstance

Substance
Diagram of Substance

Extends from Icons.Substance, Internal.PartialSubstance (Chemical substance base).

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 solutionState. 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
Advanced
Chemical.Utilities.Units.InertanceL (from PartialBoundaryBase)dropOfCommons.L
Modelica.Units.SI.MolarFlowRaten_flow_reg (from PartialBoundaryBase)dropOfCommons.n_flow_regRegularization threshold of mass flow rate
Substance
Chemical.Interfaces.DefinitionsubstanceDefinition (from PartialBoundary)dropOfCommons.DefaultSubstanceDefinition of the substance
Modelica.Units.SI.Massm_start (from PartialSubstance)Start value for mass of the substance
BooleanpreferMasstrueprefere state as mass, otherwise amountOfSubstance
Modelica.Units.SI.Massmass_startdropOfCommons.DefaultMassInitial mass of the substance
Modelica.Units.SI.AmountOfSubstanceamountOfSubstance_startdropOfCommons.DefaultAmountInitial amount of substance base molecules
Conditional inputs
BooleanuseRear (from PartialBoundary)falseUse rearwards conector?
BooleanuseFore (from PartialBoundary)trueUse forwards connector?
Chemical solution
BooleanuseSolution (from PartialSubstance)falseUse solution port?
BooleanuseRearSolution (from PartialSubstance)useRear and (not useSolution)Use solution from rear?
Chemical.Interfaces.SolutionStatesolutionParam (from PartialSubstance)Chemical.Interfaces.SolutionState(phase = Chemical.Interfaces.Phase.Incompressible)Constant chemical solution state if not from rear or input
Initialization
InitializationSubstanceinitAmountChemical.Utilities.Types.InitializationSubstance.stateInitialization
Modelica.Units.SI.MolarFlowRatechange_start0Initial molar change of substance base molecules

Connectors

TypeNameDefaultDescription
Chemical.Interfaces.Rearrear (from PartialBoundary)
Chemical.Interfaces.Forefore (from PartialBoundary)
Chemical.Interfaces.SolutionPortsolution (from PartialSubstance)To connect substance with solution, where is pressented

Components

TypeNameDefaultDescription
Modelica.Fluid.Systemsystem (from PartialBoundaryBase)System wide properties
Modelica.Units.SI.AmountOfSubstancen (from PartialSubstance)Amount of base molecules inside all clusters in compartment
Chemical.Interfaces.Properties.SubstancePropertiessubstance (from PartialSubstance)
Modelica.Units.SI.Concentrationc (from PartialSubstance)Concentration
Modelica.Units.SI.MassConcentrationM (from PartialSubstance)Mass concentration
Modelica.Units.SI.Molalityb (from PartialSubstance)Molality
Modelica.Units.SI.MoleFractionx (from PartialSubstance)Mole fraction
Modelica.Units.SI.MassFractionX (from PartialSubstance)Mass fraction
Modelica.Units.SI.Massmassn*molarMassOfBaseMoleculeMass

Revisions

2009-2025 by Marek Matejak, Ph.D.