Skip to content

Commit

Permalink
docum
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Sep 10, 2024
1 parent 4f75399 commit 2a886d7
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 6 deletions.
66 changes: 63 additions & 3 deletions doc/page/usage/eos/cubics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,73 @@
title: Cubics
---

** Table of contents**
[TOC]
All our Cubic Equations of State are implemented based on the generic Cubic
Equation:

\[
P = \frac{RT}{V-b} - \frac{a_c\alpha(T_r)}{(V + \delta_1 b)(V - \delta_2 b)}
\]

## SoaveRedlichKwong
[[SoaveRedlichKwong]]

Using the critical constants setup the parameters to use the
SoaveRedlichKwong Equation of State

- \[\alpha(T_r) = (1 + k (1 - \sqrt{T_r}))^2\]
- \[k = 0.48 + 1.574 \omega - 0.175 \omega^2 \]
- \[a_c = 0.427480 R^2 * T_c^2/P_c\]
- \[b = 0.086640 R T_c/P_c\]
- \[\delta_1 = 1\]
- \[\delta_2 = 0\]

There is also the optional posibility to include the k_{ij} and l_{ij}
matrices. Using by default Classic Van der Waals mixing rules. For more information
about mixing rules look at [Mixing Rules](mixing.md)

## PengRobinson76
[[PengRobinson76]]

- \[\alpha(T_r) = (1 + k (1 - \sqrt{T_r}))^2\]
- \[k = 0.37464 + 1.54226 * \omega - 0.26993 \omega^2 \]
- \[a_c = 0.45723553 R^2 T_c^2 / P_c\]
- \[b = 0.07779607r R T_c/P_c\]
- \[\delta_1 = 1 + \sqrt{2}\]
- \[\delta_2 = 1 - \sqrt{2}\]

## PengRobinson78
[[PengRobinson78]]

- \[\alpha(T_r) = (1 + k (1 - \sqrt{T_r}))^2\]
- \[k = 0.37464 + 1.54226 \omega - 0.26992 \omega^2 \text{ where } \omega <=0.491\]
- \[k = 0.37464 + 1.48503 \omega - 0.16442 \omega^2 + 0.016666 \omega^3 \text{ where } \omega > 0.491\]
- \[a_c = 0.45723553 R^2 T_c^2 / P_c\]
- \[b = 0.07779607r R T_c/P_c\]
- \[\delta_1 = 1 + \sqrt{2}\]
- \[\delta_2 = 1 - \sqrt{2}\]

## RKPR
[[RKPR]]

The RKPR EoS extends the classical formulation of Cubic Equations of State by
freeing the parameter \(\delta_1\) and setting
\(\delta_2 = \frac{1+\delta_1}{1-\delta_1}\).
This extra degree provides extra ways of implementing the equation in
comparison of other Cubic EoS (like PR and SRK) which are limited to
definition of their critical constants.

Besides that extra parameter, the RKRR includes another \(\alpha\)
function:

\[
\alpha(T_r) = \left(\frac{3}{2+T_r}\right)^k
\]

In this implementation we take the simplest form which correlates
the extra parameter to the critical compressibility factor \(Z_c\) and
the \(k\) parameter of the \(\alpha\) function to \(Z_c\) and \(\omega\):

\[\delta_1 = d_1 + d_2 (d_3 - Z_c)^d_4 + d_5 (d_3 - Z_c) ^ d_6\]
\[k = (A_1 Z_c + A_0)\omega^2 + (B_1 Z_c + B_0)\omega + (C_1 Z_c + C_0)\]

## RKPR
It is also possible to include the parameters as optional arguments.
19 changes: 16 additions & 3 deletions doc/page/usage/eos/cubics/mixing.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,21 @@ subroutine my_aij_implementation(self, ai, daidt, daidt2, aij, daijdt, daijdt2)
end subroutine
```

### Constant \(k_{ij}\)

## \(G^E\) Models Mixing Rules
It is possible to mix the attractive parameter of Cubic Equations with an
excess Gibbs-based model.
This can be useful for cases of polar molecules and/or systems that have been
fitted to \(G^E\) models.

### Michelsen's Modified Huron-Vidal Mixing Rules
This mixing rule is based on the aproximate zero-pressure limit
of a cubic equation of state. At the aproximate zero-pressure limit the
attractive parameter can be expressed as:

\[
\frac{D}{RTB}(n, T) = \sum_i n_i \frac{a_i(T)}{b_i} + \frac{1}{q}
\left(\frac{G^E(n, T)}{RT} + \sum_i n_i \ln \frac{B}{nb_i} \right)
\]

### Michelsen's Modified Huron-Vidal Mixing Rules
Where \(q\) is a weak function of temperature. In the case of `MHV`
and simplicity it is considered that depends on the model used.
1 change: 1 addition & 0 deletions doc/page/usage/newmodels/autodiff.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ contains
integer :: i, j
! Associate allows us to keep the later expressions simple.
associate(&
pc => self%composition%pc, ac => self%ac, b => self%b, k => self%k,&
kij => self%kij, lij => self%lij, tc => self%compostion%tc &
Expand Down

0 comments on commit 2a886d7

Please sign in to comment.