modelSubstance
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
| Type | Name | Default | Description |
|---|---|---|---|
| Advanced | |||
| Chemical.Utilities.Units.Inertance | L (from PartialBoundaryBase) | dropOfCommons.L | |
| Modelica.Units.SI.MolarFlowRate | n_flow_reg (from PartialBoundaryBase) | dropOfCommons.n_flow_reg | Regularization threshold of mass flow rate |
| Substance | |||
| Chemical.Interfaces.Definition | substanceDefinition (from PartialBoundary) | dropOfCommons.DefaultSubstance | Definition of the substance |
| Modelica.Units.SI.Mass | m_start (from PartialSubstance) | Start value for mass of the substance | |
| Boolean | preferMass | true | prefere state as mass, otherwise amountOfSubstance |
| Modelica.Units.SI.Mass | mass_start | dropOfCommons.DefaultMass | Initial mass of the substance |
| Modelica.Units.SI.AmountOfSubstance | amountOfSubstance_start | dropOfCommons.DefaultAmount | Initial amount of substance base molecules |
| Conditional inputs | |||
| Boolean | useRear (from PartialBoundary) | false | Use rearwards conector? |
| Boolean | useFore (from PartialBoundary) | true | Use forwards connector? |
| Chemical solution | |||
| Boolean | useSolution (from PartialSubstance) | false | Use solution port? |
| Boolean | useRearSolution (from PartialSubstance) | useRear and (not useSolution) | Use solution from rear? |
| Chemical.Interfaces.SolutionState | solutionParam (from PartialSubstance) | Chemical.Interfaces.SolutionState(phase = Chemical.Interfaces.Phase.Incompressible) | Constant chemical solution state if not from rear or input |
| Initialization | |||
| InitializationSubstance | initAmount | Chemical.Utilities.Types.InitializationSubstance.state | Initialization |
| Modelica.Units.SI.MolarFlowRate | change_start | 0 | Initial molar change of substance base molecules |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Chemical.Interfaces.Rear | rear (from PartialBoundary) | ||
| Chemical.Interfaces.Fore | fore (from PartialBoundary) | ||
| Chemical.Interfaces.SolutionPort | solution (from PartialSubstance) | To connect substance with solution, where is pressented |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Fluid.System | system (from PartialBoundaryBase) | System wide properties | |
| Modelica.Units.SI.AmountOfSubstance | n (from PartialSubstance) | Amount of base molecules inside all clusters in compartment | |
| Chemical.Interfaces.Properties.SubstanceProperties | substance (from PartialSubstance) | ||
| Modelica.Units.SI.Concentration | c (from PartialSubstance) | Concentration | |
| Modelica.Units.SI.MassConcentration | M (from PartialSubstance) | Mass concentration | |
| Modelica.Units.SI.Molality | b (from PartialSubstance) | Molality | |
| Modelica.Units.SI.MoleFraction | x (from PartialSubstance) | Mole fraction | |
| Modelica.Units.SI.MassFraction | X (from PartialSubstance) | Mass fraction | |
| Modelica.Units.SI.Mass | mass | n*molarMassOfBaseMolecule | Mass |
Revisions
2009-2025 by Marek Matejak, Ph.D.