Skip to content

Commit

Permalink
GERG2008 EoS
Browse files Browse the repository at this point in the history
  • Loading branch information
fedebenelli committed Dec 19, 2024
1 parent 75c4456 commit daeb018
Show file tree
Hide file tree
Showing 6 changed files with 399 additions and 3,906 deletions.
21 changes: 19 additions & 2 deletions src/adiff/autodiff_api/armodel_adiff_api.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ subroutine residual_helmholtz(&
type(hyperdual) :: d_v, d_t, d_n(size(n))
type(hyperdual) :: d_Ar

logical :: any_deriv

any_deriv = .false.

if (present(ArV)) then
any_deriv = .true.
if (present(ArV2)) call get_dardv2
if (present(ArVn)) call get_dardvn
if (present(ArTV)) call get_dardvt
Expand All @@ -88,21 +93,33 @@ subroutine residual_helmholtz(&
end if

if (present(ArT)) then
any_deriv = .true.
if (present(ArT2)) call get_dardt2
if (.not. (present(ArT2) .and. present(ArTn))) call get_dardt
end if

if (present(ArTn)) call get_dardtn
if (present(ArTn)) then
any_deriv = .true.
call get_dardtn
end if


if (present(Arn)) then
any_deriv = .true.
if (present(Arn2)) then
call get_dardn2
else
call get_dardn
end if
end if

if (present(Ar)) Ar = d_Ar%f0
if (present(Ar)) then
if (.not. any_deriv) then
call reset_vars
d_ar = self%Ar(d_n, d_v, d_t)
end if
Ar = d_Ar%f0
end if

contains

Expand Down
11 changes: 8 additions & 3 deletions src/models/models.f90
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,26 @@ module yaeos__models
!! should provide.
!! - **Cubic Equations of state**:
!! - `AlphaFunction` type
!! - `CubicMixRule` type
!! - `CubicEos` type that extends `ArModel` to use a generic
!! two-parameter EoS. Implemented models that use this type can be
!! seen at [[yaeos__models_ar_cubic_implementations(module)]]
!! - `QMR` (Quadratic Mixing Rule) type: extensible derived type that
!! - `QMR` (Quadratic Mixing Rule) type: extensible derived type that
!! defaults to classic vdW mixing rules.
!! - `MHV` (Modified Huron-Vidal) type: Michelsens first order modified
!! Huron-Vidal mixing rule.
!! - **GERG2008 Equation of State**:
!! - GERG2008 multifluid equation of state

! Base model structure
use yaeos__models_base, only: BaseModel

! Residual Helmholtz Models
use yaeos__models_ar, only: ArModel, size

! GERG2008
use yaeos__models_ar_gerg2008, only: &
Gerg2008, Gerg2008Binary, G2008Components, gerg_2008

! Cubic EoS models
use yaeos__models_ar_genericcubic, only: &
CubicEoS, GenericCubic_Ar, AlphaFunction, CubicMixRule
Expand All @@ -47,4 +52,4 @@ module yaeos__models
! Implemented models
use yaeos__models_ge_implementations

end module
end module yaeos__models
Loading

0 comments on commit daeb018

Please sign in to comment.