Skip to content

docs: Compositional fluid model documentation #3713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
255 changes: 0 additions & 255 deletions src/coreComponents/constitutive/docs/CompositionalMultiphaseFluid.rst

This file was deleted.

2 changes: 1 addition & 1 deletion src/coreComponents/constitutive/docs/FluidModels.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ single fluids and fluid mixtures.

BlackOilFluid

CompositionalMultiphaseFluid
compositional/CompositionalMultiphaseFluid

CO2BrineFluid
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.. _CompositionalMultiphaseFluid:

############################################
Compositional multiphase fluid model
############################################

.. toctree::
:maxdepth: 1

Overview
Flash
References
8 changes: 8 additions & 0 deletions src/coreComponents/constitutive/docs/compositional/Flash.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. _Flash:

Step 1: Computation of the phase fractions and phase component fractions (flash)
================================================================================

.. toctree::
StabilityTest
NegativeTwoPhaseFlash
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
.. _NegativeTwoPhaseFlash:

Negative two-phase flash
------------------------
When a cell is identified as having an unstable mixture, it is necessary to determine the amounts in the liquid
and vapor phases through phase splitting. This phase split is calculated by ensuring that the two phases are
in thermodynamic equilibrium. For a system to be in thermodynamic equilibrium, the fugacities of each component
in both the liquid and vapor phases must be equal:

.. math::
\phi_{iL} = \phi_{iV} \hspace{1cm} i=1,2,3,\ldots,N_c

where :math:`\phi_{iL}` is the fugacity of component :math:`i` in the liquid phase and :math:`\phi_{iL}` is the
fugacity of component :math:`i` in the vapor phase.

Fugacities are functions of temperature, pressure, and composition:

.. math::
\phi_{iL} = \phi_{iL}(T, p, x_i) \hspace{1cm} i=1,2,3,\ldots,N_c

and

.. math::
\phi_{iV} = \phi_{iV}(T, p, y_i) \hspace{1cm} i=1,2,3,\ldots,N_c

and are calculated directly from an equation of state.

Equilibrium constants, also known as K-values, are defined for each component as:

.. math::
K_i = \frac{y_i}{x_i}

where :math:`x_i` is the mole fraction of component :math:`i` in the liquid phase and :math:`y_i` is the
mole fraction of component :math:`i` in the vapor phase. If we denote :math:`V` as the mole fraction
of the vapor phase, the material balance indicates that the mole fractions of each component in the liquid
and vapor phases are given by:

.. math::
x_i = \frac{z_i}{1 + (K_i - 1)V}

and

.. math::
y_i = \frac{K_i z_i}{1 + (K_i - 1)V}

The value of :math:`V` corresponding to a given set of K-values is determined by solving the
so called Rachford and-Rice equation:

.. math::
F(V) = \sum_{i=1}^{N_c} \left(x_i - y_i\right) = \sum_{i=1}^{N_c} \frac{z_i(1 - K_i)}{1 + (K_i - 1)V} = 0

The flash calculation process is as follows:

#. Once the mixture is confirmed to be stable, an initial set of K-values is chosen, typically using Wilson's formula.

#. Given :math:`z_i` and :math:`K_i`, the Rachford-Rice equation is solved to determine the molar fraction of vapor, :math:`V`. This is initially solved using successive substitution, followed by Newton iterations once the residual is sufficiently reduced.

#. After :math:`V` is calculated, the corresponding liquid and vapor mole fractions, :math:`x_i` and :math:`y_i`, are computed.

#. These phase compositions are then used to calculate the component fugacities :math:`\phi_{iL}` and :math:`\phi_{iV}` in the liquid and vapor phases using the equation of state.

#. Convergence is reached when the fugacities are equal for all components. The convergence criterion is defined as:

.. math::
\sum_{i=1}^{N_c} \left( \phi_{iL} - \phi_{iV} \right)^2 < \varepsilon

where :math:`\varepsilon` is the convergence tolerance.

#. If convergence is not achieved, successive substitution is used to update the set of K-values for the next iteration. The new K-values at iteration :math:`t+1` are given by:

.. math::
K_i^{(t+1)} = K_i^{(t)} \frac{\phi_{iL}}{\phi_{iV}}
39 changes: 39 additions & 0 deletions src/coreComponents/constitutive/docs/compositional/Overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. _Overview:

Overview
=========================

This model represents a full composition description of a multiphase multicomponent fluid.
Phase behavior is modeled by an equation of state (EOS) and partitioning of components into
phases is computed based on instantaneous chemical equilibrium via a two-phase flash.
Each component (species) is characterized by molar weight and critical properties that
serve as input parameters for the EOS.

In this model the fluid is described by :math:`N_c` components with :math:`z_c` being the total
mole fraction of component :math:`c`. The fluid can partition into a liquid phase, denoted :math:`\ell`,
and a vapor phase denoted by :math:`v`. Therefore, by taking into account the molar phase component
fractions, (which is the fraction of the molar mass of phase :math:`p` represented by component
:math:`c`), the following partition matrix establishes the component distribution within the two
phases:

.. math::
\begin{bmatrix}
x_{1} & x_{2} & x_{3} & \cdots & x_{N_c} \\
y_{1} & y_{2} & y_{3} & \cdots & y_{N_c} \\
\end{bmatrix}

where :math:`x_c` is the mole fraction of component :math:`c` in the liquid phase and :math:`y_c`
is the mole fraction of component :math:`c` in the vapor phase.

The fluid properties are updated through the following steps:

1) The phase fractions (:math:`\nu_p`) and phase component fractions (:math:`x_c` and :math:`y_c`) are
computed as a function of pressure (:math:`p`), temperature (:math:`T`) and total component fractions
(:math:`z_c`).

2) The phase densities (:math:`\rho_p`) and phase viscosities (:math:`\mu_p`) are computed as a function
of pressure, temperature and the updated phase component fractions.

After calculating the phase fractions, phase component fractions, phase densities, phase viscosities,
and their derivatives with respect to pressure, temperature, and component fractions, the
:ref:`CompositionalMultiphaseFlow` then moves on to assembling the accumulation and flux terms.
Loading
Loading