Difference between revisions of "How to "Set" the partial pressure of a gas?"

From wiki.olisystems.com
Jump to: navigation, search
Line 31: Line 31:
 
If we now run the simulation we will only get a simulation of the solubility of carbon dioxide in water at a constant temperature and pressure. This is not what we want.  What we want is a solubility calculation for calcite and to keep the amount of carbon dioxide at a constant partial pressure.   
 
If we now run the simulation we will only get a simulation of the solubility of carbon dioxide in water at a constant temperature and pressure. This is not what we want.  What we want is a solubility calculation for calcite and to keep the amount of carbon dioxide at a constant partial pressure.   
  
We cannot do this exactly but we can make an approximation.  What we will do is use a custom calculation.  OLI does not naturally allow you to adjust two or three variables simultaneously in a survey. This can cause some confusion in the calculation. However, we need to do this for this simulation.  To do this we need to enable custom calculations in a survey. Please see
+
We cannot do this exactly but we can make an approximation.  What we will do is use a custom calculation.  OLI does not naturally allow you to adjust two or three variables simultaneously in a survey. This can cause some confusion in the calculation. However, we need to do this for this simulation.  To do this we need to enable custom calculations in a survey. Please see '''[[Enabling custom calculation within survey]]''' on how to enable this feature.
 +
 
 +
So here is the procedure, we need to create a precipitation point which adjusts some inflow - in this case CaCO<sub>3</sub> and fixes (sets) a solid  - CaCO<sub>3PPT</sub>.  In addition we need to adjust the pressure to force a vapor phase.  We do not need a lot of vapor so a bubble point calculation is sufficient.  Here we will adjust the pressure (total) to set a total vapor amount (in moles).
 +
 
 +
After enabling the features, click the <u>'''Specs...'''</u> button once gain. The select <u>'''Calculation Type'''</u>
 +
 
 +
[[File:2017-04-14 12-17-26.png]]
 +
 
 +
From the '''<u>Type of Calculation</u>''' button and select '''<u>Custom</u>'''
 +
 
 +
[[File:2017-04-14 12-18-52.png]]
 +
 
 +
Secondary <u>'''Specs...'''</u> button now becomes active. Please select it.
 +
 
 +
[[File:2017-04-14 12-20-42.png]]
 +
 
 +
This is a complicated dialog. There is a hard-and-fast rule here that cannot be violated; the number of Free variables must equal the number of free variables. The number in the top section has to be the same as the number in the bottom section.
 +
 
 +
[[File:2017-04-14 12-22-32.png]]
 +
 
 +
Let's look at the bottom section first (it's easier to explain).  We are going to let the program determine the final values of pressure and inflow values of CACO3.  Select both now.
 +
 
 +
[[File:2017-04-14 12-23-58.png]]
 +
 
 +
Now we need to find the values to fix in the top section.  To do this you must speak "OLI".  The variables we need are '''CACO3 (Calcite) - Sol''' (this is the amount of CaCO<sub>3</sub> solid in moles and '''Moles (True) - Vapor''' which is the total vapor moles.
 +
 
 +
[[File:2017-04-14 12-28-18.png]]
 +
 
 +
You will notice that the number of fix variables equals the number of free variables.  We are adjusting the inflow amount of CaCO3 to match a target amount of solid. This is what we do in a standard precipitation point calculation. You just did it manually. We are also adjusting the pressure to produce a specific amount of vapor. This it essence of a bubble point calculation.
 +
 
 +
Click OK to accept the values.
 +
 
 +
When back on the main Survey grid, we need to specify our set values.
 +
 
 +
[[File:2017-04-14 12-31-55.png]]
 +
 
 +
Notice that there are zeroes in the indicated area and that the calculate button is <span style="color:#FF0000">RED</span> indicating we are missing information.  We need to set the target values. OLI recommends small values, in the range of 0.000001
 +
 
 +
[[File:2017-04-14 12-34-38.png]]
 +
 
 +
The Calculate button is <span style="color:#008000">GREEN</span> indicating that the program is ready to go. Click calculate.

Revision as of 09:36, 14 April 2017

How do you set the partial pressure of a gas in OLI Studio?

The short is answer is that you cannot.

OK, now for the real answer. You can "Set" the partial pressure of a gas in OLI Studio via a series of calculations to get close to (sometimes very close to) the actual partial pressure that you want.

For this example, we wish to know the solubility of calcite (CaCO3) at 25 °C and 1.0 atmospheres partial pressure of carbon dioxide (PCO2)

With version 9.5.2 of OLI Studio, we have added partial pressures as a variable that you can report and plot (unfortunately not set). We will show you where these are located later on in this tutorial.

We have several methods in which to "set" the partial pressures, the easiest (and fastest) is to pick the value off a plot. Let's start by creating the OLI Studio stream we which to use.

Create an MSE stream with the following components:

2017-04-14 11-57-40.png

So far, so good...

We now need to add a survey. The default survey is temperature, we will change that to composition.

2017-04-14 11-59-32.png

To "set" the partial pressure of CO2 we need to adjust the amount of carbon dioxide we are entering into the survey. Use the Specs... button to set the composition component to CO2

2017-04-14 12-01-36.png

We need a range, let's try a range of 0 to 1 mole in 0.1 mole increments for CO2 (by the way, this is the default range for a composition survey):

2017-04-14 12-03-49.png

If we now run the simulation we will only get a simulation of the solubility of carbon dioxide in water at a constant temperature and pressure. This is not what we want. What we want is a solubility calculation for calcite and to keep the amount of carbon dioxide at a constant partial pressure.

We cannot do this exactly but we can make an approximation. What we will do is use a custom calculation. OLI does not naturally allow you to adjust two or three variables simultaneously in a survey. This can cause some confusion in the calculation. However, we need to do this for this simulation. To do this we need to enable custom calculations in a survey. Please see Enabling custom calculation within survey on how to enable this feature.

So here is the procedure, we need to create a precipitation point which adjusts some inflow - in this case CaCO3 and fixes (sets) a solid - CaCO3PPT. In addition we need to adjust the pressure to force a vapor phase. We do not need a lot of vapor so a bubble point calculation is sufficient. Here we will adjust the pressure (total) to set a total vapor amount (in moles).

After enabling the features, click the Specs... button once gain. The select Calculation Type

2017-04-14 12-17-26.png

From the Type of Calculation button and select Custom

2017-04-14 12-18-52.png

Secondary Specs... button now becomes active. Please select it.

2017-04-14 12-20-42.png

This is a complicated dialog. There is a hard-and-fast rule here that cannot be violated; the number of Free variables must equal the number of free variables. The number in the top section has to be the same as the number in the bottom section.

2017-04-14 12-22-32.png

Let's look at the bottom section first (it's easier to explain). We are going to let the program determine the final values of pressure and inflow values of CACO3. Select both now.

2017-04-14 12-23-58.png

Now we need to find the values to fix in the top section. To do this you must speak "OLI". The variables we need are CACO3 (Calcite) - Sol (this is the amount of CaCO3 solid in moles and Moles (True) - Vapor which is the total vapor moles.

2017-04-14 12-28-18.png

You will notice that the number of fix variables equals the number of free variables. We are adjusting the inflow amount of CaCO3 to match a target amount of solid. This is what we do in a standard precipitation point calculation. You just did it manually. We are also adjusting the pressure to produce a specific amount of vapor. This it essence of a bubble point calculation.

Click OK to accept the values.

When back on the main Survey grid, we need to specify our set values.

2017-04-14 12-31-55.png

Notice that there are zeroes in the indicated area and that the calculate button is RED indicating we are missing information. We need to set the target values. OLI recommends small values, in the range of 0.000001

2017-04-14 12-34-38.png

The Calculate button is GREEN indicating that the program is ready to go. Click calculate.