Search
Girls in STEM
About FAWE Elearning
We at FAWE have built this platform to aid learners, trainers and mentors get practical help with content, an interactive platform and tools to power their teaching and learning of STEM subjects
Search
More Girls in STEM
Histoires inspirantes de femmes scientifiques africainesUncategorized
PRODUCTION OF ARTIFICIAL COLOSTRUM TO REDUCE CALF MORTALITY AND INCREASE THEIR PERFORMANCEUncategorized
- Inspiring stories from African women scientistsUncategorized
Addressing gender stereotypes in the classroomGeneral
Gender assumptions that challenge a quality education for girls in UgandaEducation
Strengthening Gender Responsive Pedagogy for STEM in UgandaEducation
RESPECT FOR WOMEN IS PARAMOUNTNetworking
Chemical Components
For our last example of component-oriented modelling, we’ll return to the Chemical System we discussed in the chapter on Vectors and Arrays. However, this time we will create component models for the various effects and show how connections in Modelica automatically ensure the conservation of species.
Species
The species we will be dealing with in this example are defined by the following
enumeration
:Note that this definition exists within a package called
ABX
. This indicates that the component models are designed to work with this three species system involvingA
,B
andX
.Mixture
Also contained in the
ABX
package is the followingconnector
definition (which can be found in theInterfaces
sub-package):Here we see that our
Mixture
connector uses concentrations as the across variables and a concentration rate as the flow variable. Although theflow
variable, in this case, is not strictly the flow of a conserved quantity, it will suffice in this example since all reactions are contained within the same volume.Note that both
C
andR
in this connector are arrays where the subscript is given by anenumeration
type. We saw earlier how Enumerations can be used in this way.Solution
Our first component model is used to track the concentration of the various chemical species within a control volume. As alluded to earlier, since all reactions occur within the same volume, we don’t need to actually specify the size of the control volume.
The
Solution
model is quite simple. Like theRegional Population
the model discussed earlier in this chapter, the rate of change of the across variable associated with its sole connector is equal to theflow
variable on that same connector:Reactions
Reaction
As we saw previously, this system has three reactions. Each of the specific reactions we’ll examine extend from the following
partial
model:We see that each reaction has a reaction coefficient,
k
, and aMixture
connector,mixture
, that ultimately connects it to theSolution
where the reaction is to take place. The internal vector variablesconsumed
andproduced
play a role that is similar to thedecline
andgrowth
variables in theSinkOrSource
discussed earlier in this chapter (i.e., they allow us to write contributions from individual reactions using an intuitive terminology).A+B->X
The first complete reaction model we will consider is the one that turns one molecule of
A
and one molecule ofB
into one molecule ofX
. Using theReaction
model, we can model this reaction as follows:The first thing to note about this model is that it is composed of non-alphanumeric characters. Specifically, the name of this model contains
+
,-
and>
. This is permitted in Modelica as long as the name is quoted using single quote characters. The rate of the reaction,R
, is used in conjunction with theconsumed
andproduced
variables inherited from theReaction
model to create equations that clearly describe both the reactants and the products in this reaction.A+B<-X
The next reaction we will consider is one that takes one molecule of
X
and transforms it (back) into one molecule ofA
and one molecule ofB
. This is the reverse of the previous reaction. The Modelica code for this reaction would be:Again, the equations convey clearly which species are reactants (i.e., are consumed in the reaction) and which are the products (i.e., those species that are produced in the reaction).
X+B->R+S
Finally, our last reaction converts molecules of
X
andB
into molecules ofR
andS
:We do not track the concentration of the
R
andS
species since they are simply byproducts and do not participate in any other reactions. This model follows the same familiar pattern as before with the exception that theA
species is not involved.System
We can combine the
Solution
model along with the various reaction models as follows:Note how modifications to the
solution
component are used to set the initial concentration of species within thesolution
component. Also, the reaction coefficients are specified via modifications to each of the reaction components. Finally, each of the reaction components is attached to thesolution.mixture
connector.Simulating this system for 10 seconds yields the following concentration trajectories:
Conclusion
From our earlier discussion of this chemical system, you may recall that the resulting system of equations was:
Each equation represents the accumulation of a particular species and each term on the right-hand side of those equations is computing the net flow of that particular species into the control volume. Constructing this system by hand for even a relatively small number of participating species is rife with opportunities to introduce errors. By using a component-oriented approach instead, we never had to assemble such a system of equations. As a result, these equations were generated automatically. By automating this process, we can avoid many potential errors and the time required to identify and fix them.
Pure-component System
Let us start with a well-known single component system: water — the most plentiful substance on earth. What is the behaviour of water under different conditions of pressure and temperature? Or even more specific, is there a single answer to the question: what is the boiling point of water? Most people would say, “of course, 100 °C”, but a more accurate response would pose a clarifying question: “At what pressure?” It is common knowledge that water boils at 100 °C (212 °F) at atmospheric pressure. By requiring a pressure specification in order to uniquely define the boiling point of water, we are acknowledging that the boiling temperature of a pure substance is pressure-dependent. In reality, we are also implicitly applying a very useful thermodynamic principle, the Gibbs Rule, but this will be the topic for later discussion.
In thermodynamics, we refer to the Normal Boiling Point as the boiling temperature of a fluid at 1 atm of pressure (that is, atmospheric pressure.) Therefore, 100 °C (212 °F) is the normal boiling point of water.
What if we want to communicate this idea? We would like to communicate the concept that the temperature at which water boils varies with pressure. What about a picture to represent this information? Here is our first phase diagram, Figure 2.1. Whereas several sentences may be required to describe the variability of the boiling point of water, the single line shown in Figure 2.1 is adequate. What does Figure 2.1 tell us? It tells us that the boiling temperature of a liquid increases as pressure increases. In other words, it says that the vapour pressure of a liquid increase as temperature increases. That is to be expected because as the temperature increases, more liquid molecules are able to escape into the vapour phase, thus increasing the pressure that the aggregate of all vapour molecules exerts on the system (i.e. vapour pressure).
The curve in Figure 2.1 is called the vapor pressure curve or boiling point curve. The line also represents the dew point curve and the bubble point curve; one on top of the other. This curve represents the transition between the vapour and liquid states.
Definition of Basic Terms
Vapour Pressure: The pressure that the vapour phase of a fluid exerts over its own liquid at equilibrium at a given temperature.
Dew Point: The pressure and temperature condition at which an infinitesimal quantity of liquid (a droplet) exists in equilibrium with vapour. It represents the condition of incipient liquid formation in an initially gaseous system. Notice that it can be also visualized as a “liquid system” where all but an infinitesimal quantity of liquid has been vaporized.
Bubble Point: The pressure and temperature condition at which the system is all liquid, and in equilibrium with an infinitesimal quantity (a bubble) of gas. This situation is, in essence, the opposite of that of the dew point.
Note:
For single-component systems, one single curve represents all three of these conditions (vapour pressure, dew point and bubble point conditions) simply because of Vapor Pressure = Dew Point = Bubble Point for unary systems.
In Figure 2.1, once a saturation pressure has been selected, there is one (and only one) saturation temperature associated with it. This is only true for a single component system. In other words, this is the only temperature (at the given pressure), at which the liquid and gas phase will co-exist in equilibrium. The rule that governs the uniqueness of this point, for a single-component system, is called the Gibbs Phase Rule. This is the second time we have mentioned this rule, pointing to its great importance in phase behaviour. Let us postpone any detailed discussion of the Gibbs Phase Rule until later.
The vapor curve, shown in Figure 2.1, represents the transition between the vapor and liquid states for a pure component. Obviously, this is not the whole story. If we cool the liquid system, it makes sense to expect ice to form (a solid phase). We can communicate this new idea by adding more information to Figure 2.1. In fact, there is a line that defines the liquid-solid transition; it is called the solidification (or melting) curve (see Figure 2.2). Furthermore, even though it is counter-intuitive, it is possible to go from solid to vapour without going through a liquid state, if the pressure is low enough. This information can be added to the diagram by including the sublimation curve. Thus, Figure 2.2 represents a more complete phase diagram for a pure-component system.
See how more and more information can be represented within the limits of the phase diagram. As petroleum and natural gas engineers, we focus our attention on the Boiling Point Curve, as it represents the transition between liquid and gas, the phases with which we deal most often. Let us focus our attention on it.
Figure 2.3 presents a P-T diagram representing the vapour pressure curve and its extremities. Two very important thermodynamic points bound the vapour pressure curve: the Critical Point at its upper end and the Triple Point at its lower end.
The Triple Point is the meeting point of the vapour pressure, solidification and sublimation curves (see Figure 2.2); hence, it represents the only condition at which all three phases of a pure substance (solid, liquid and gas) can co-exist in equilibrium.
At the Critical Point, gas and liquid are in equilibrium without any interface to differentiate them; they are no longer distinguishable in terms of their properties. As we recall, the only location on the P-T diagram where liquid and gas can be found together in equilibrium is along the vapour pressure curve. Hence, the critical point is clearly the maximum value of temperature and pressure at which liquid and vapour can be at equilibrium. This maximum temperature is called the critical temperature (Tc); the corresponding maximum pressure is called the critical pressure (Pc).
Let us conclude this first module by highlighting the most important properties of the critical point of pure substances, as shown below. The next module will be providing more details of interest that are embedded in Figure 2.3.
Properties Of The Critical Point (Tc,Pc) (For Pure Substances):
ASSIGNMENT : COMPONENT SYSTEM (TYPES OF A COMPONENT SYSTEM) ASSIGNMENT MARKS : 10 DURATION : 1 week, 3 days