### Model description

The model consists of very basic flash equations, i.e., the component mole balances, phase equilibria (VLE), and the summation of mole fractions in liquid and vapor phase. The temperature is constant:

Therein, the vapor pressure is to be calculated via a DIPPR equation, which will again be treated as a function:

As the parameters in this functions specify the mixture used in this process, it makes sense to specify them in a parameter list. Thus, we could set up another paramater specification for another mixture and could solve this system with the same variable specification.

### Workflow

#### Notation of equation system

For the notation of the equation, we need to set up the following symbols. Note that we do not define the parameters of the DIPPR equation in a separate notation for simplicity (although it would be possible). However, we will use a parameter list:

##### Base names

- , DIPPR parameter A
- , DIPPR parameter B in K
- , DIPPR parameter C
- , DIPPR parameter D in 1/T^E
- , DIPPR parameter E
- , feed mole flow in kmol/h
- , liquid mole flow in kmol/h
- , pressure in Pa
- , temperature in K
- , vapor mole flow in kmol/h
- , liquid mole fraction in mol/mol
- , vapor mole fraction in mol/mol
- , feed mole fraction in mol/mol

##### Superscripts

**,**phase equilibrium

##### Indices

- , component index 1…NC

The resulting notation has ID 182668.

#### Parameter list

After the notation has been set up, we can move to the Parameter List tab. Here, we take the following steps:

- Load the notation that was created in the previous step
- Add all parameter by clicking on the “+” button, writing the parameter into the Tex Expression, rendering, and confirming. Add the parameters in their general form, i.e., , , , , and . This is how they will be used in the function. Do not add any component index
- Save the parameter list

The parameter list is saved with ID 182669.

#### Equations

Now formulate the equations of the model and save them. The parameter list does not need to be loaded for any of the equations.

The equations of this example have the IDs 182670, 182671, 182672, and 182673.

#### Definition of function

To create the DIPPR function for the vapor pressure, we take the following steps:

- Load the notation of this example
- Load the parameter list of this example
- Add an informative description of the function
- Make sure that Free interface and Specify formula are selected in the Interface & Body Settings
- Move to the tab Interface Specifications; add as output and as input. Theoretically, it would make sense to use engineering units for this example, but we will not do that in this example. As a result, we need to make sure manually that our equations are unit-consistent
- Move to the tab Body Specification and add the formula from the section on the model formulation from above:
- Save the function

The function has ID 182674.

#### Equation system

Go to the tab Equation System and add your equations in the same way as in the previous examples. Then go to the Functions tab within the equation system and take the following steps:

- Add the function by clicking on the “Add” button at the bottom
- Add an application by clicking on “Add Application”
- Add as Applied Naming for the output and as Applied Naming for the input
- Add the parameters
- , , , , and (now with component index!) as Applied Naming for the parameters
- Confirm that and confirm again to close the popup windows. You should now see one application of the function within the equation system

The resulting equation system has ID 182675.

#### Evaluation / Simulation

Next, we can move to the “Simulation” section and load the equation system we just created. Then, we take the following steps:

- Add a description for your simulation
- In the tab on the Generic System, go to Functions and check whether MOSAICmodeling confirms two usages of the function in one application
- Go to Indexing and enter 2 as Max Value for NC; then click on Confirm Index Data
- Go to the Specifications tab and assign the following variables as design values:
- Assign the remaining six variables – i.e., , , , , , and – as iteration values
- Now you may wonder where your parameters for the vapor pressure function are. Therefore, go to the Parameters tab where you should find these ten parameters

### Initialization and results

To initialize and specify the model, take the following steps:

- Initialize this example with the design values and initial guesses given in Table 1
- Save the variable specification
- Enter the parameter values given in Table 1
- Save the parameter specification
- Save the simulation
- Go to the Evaluation tab and generate the code for your preferred environment / software package
- Simulate the flash

This simulation is available with ID 182676 with variable specification 182677 and parameter specification 182678. The solution for all iteration variables is also given in Table 1.

Name | Description | Value / Initial guess | Solution |
---|---|---|---|

Feed mole flow in kmol/h | 1.0 | ||

Pressure in Pa | 101325 | ||

Temperature in K | 354.6 | ||

Feed mole fraction of component 1 in mol/mol | 0.5 | ||

Feed mole fraction of component 2 in mol/mol | 0.5 | ||

Parameter in DIPPR equation | 82.718 | ||

Parameter in DIPPR equation | -6904.5 | ||

Parameter in DIPPR equation | -8.8622 | ||

Parameter in DIPPR equation | 7.4664E-6 | ||

Parameter in DIPPR equation | 2.0 | ||

Parameter in DIPPR equation | 73.649 | ||

Parameter in DIPPR equation | -7258.2 | ||

Parameter in DIPPR equation | -7.3037 | ||

Parameter in DIPPR equation | 4.1653E-6 | ||

Parameter in DIPPR equation | 2.0 | ||

Calculated vapor pressure of component 1 in Pa | 190176.44 | ||

Calculated vapor pressure of component 2 in Pa | 50216.55 | ||

Liquid mole flow in kmol/h | 0.5 | 0.57892 | |

Vapor mole flow in kmol/h | 0.5 | 0.42108 | |

Liquid mole fraction of component 1 in mol/mol | 0.5 | 0.36516 | |

Liquid mole fraction of component 2 in mol/mol | 0.5 | 0.63484 | |

Vapor mole fraction of component 1 in mol/mol | 0.5 | 0.68538 | |

Vapor mole fraction of component 2 in mol/mol | 0.5 | 0.31462 |