AGA8 WebAssembly  1.0
bindings for AGA8 gas properties calculations
Loading...
Searching...
No Matches
Detail.cpp File Reference

Implementation of the AGA 8 Part 1 DETAIL equation of state for natural gas mixtures. More...

#include "Detail.h"
#include <math.h>
#include <cmath>
#include <iostream>
#include <cstdlib>
Include dependency graph for Detail.cpp:

Go to the source code of this file.

Functions

static void xTermsDetail (const std::vector< double > &x)
 
static void Alpha0Detail (const double T, const double D, const std::vector< double > &x, double a0[3])
 Calculates the ideal gas Helmholtz energy and its derivatives with respect to T and D.
 
static void AlpharDetail (const int itau, const int idel, const double T, const double D, double ar[4][4])
 Calculates derivatives of the residual Helmholtz energy with respect to temperature and density.
 
double sq (double x)
 
void MolarMassDetail (const std::vector< double > &x, double &Mm)
 Calculate molar mass of a mixture based on composition.
 
void PressureDetail (const double T, const double D, const std::vector< double > &x, double &P, double &Z)
 Calculates pressure and compressibility factor as a function of temperature and density.
 
void DensityDetail (const double T, const double P, const std::vector< double > &x, double &D, int &ierr, std::string &herr)
 Calculates density as a function of temperature and pressure using an iterative method.
 
void PropertiesDetail (const double T, const double D, const std::vector< double > &x, double &P, double &Z, double &dPdD, double &d2PdD2, double &d2PdTD, double &dPdT, double &U, double &H, double &S, double &Cv, double &Cp, double &W, double &G, double &JT, double &Kappa, double &Cf)
 Calculates thermodynamic properties as a function of temperature and density.
 
void SetupDetail ()
 The following routine must be called once before any other routine.
 

Variables

static double RDetail
 
static const int NcDetail = 21
 
static const int MaxFlds = 21
 
static const int NTerms = 58
 
static const double epsilon = 1e-15
 
static int fn [NTerms+1]
 
static int gn [NTerms+1]
 
static int qn [NTerms+1]
 
static double an [NTerms+1]
 
static double un [NTerms+1]
 
static int bn [NTerms+1]
 
static int kn [NTerms+1]
 
static double Bsnij2 [MaxFlds+1][MaxFlds+1][18+1]
 
static double Bs [18+1]
 
static double Csn [NTerms+1]
 
static double Fi [MaxFlds+1]
 
static double Gi [MaxFlds+1]
 
static double Qi [MaxFlds+1]
 
static double Ki25 [MaxFlds+1]
 
static double Ei25 [MaxFlds+1]
 
static double Kij5 [MaxFlds+1][MaxFlds+1]
 
static double Uij5 [MaxFlds+1][MaxFlds+1]
 
static double Gij5 [MaxFlds+1][MaxFlds+1]
 
static double Tun [NTerms+1]
 
static double Told
 
static double n0i [MaxFlds+1][7+1]
 
static double th0i [MaxFlds+1][7+1]
 
static double MMiDetail [MaxFlds+1]
 
static double K3
 
static double xold [MaxFlds+1]
 
static double dPdDsave
 

Detailed Description

Implementation of the AGA 8 Part 1 DETAIL equation of state for natural gas mixtures.

This implementation is based on the AGA Report No. 8, Part 1 - DETAIL method for the calculation of thermodynamic properties of natural gas mixtures. The code provides routines for calculating:

  • Pressure from temperature and density
  • Density from temperature and pressure (iterative)
  • Various thermodynamic properties

The mixture compositions are specified using mole fractions for 21 components in the following order:

  1. Methane 8. Isopentane 15. Hydrogen
  2. Nitrogen 9. n-Pentane 16. Oxygen
  3. Carbon dioxide 10. n-Hexane 17. Carbon monoxide
  4. Ethane 11. n-Heptane 18. Water
  5. Propane 12. n-Octane 19. Hydrogen sulfide
  6. Isobutane 13. n-Nonane 20. Helium
  7. n-Butane 14. n-Decane 21. Argon
Note
Before using any other functions, SetupDetail() must be called once to initialize constants
Author
Eric W. Lemmon (Original FORTRAN)
Ian H. Bell (C++ Translation)
Volker Heinemann, RMG Messtechnik GmbH (Contributor)
Jason Lu, Thermo Fisher Scientific (Contributor)
Version
2.0 (April 2017)

Definition in file Detail.cpp.

Function Documentation

◆ Alpha0Detail()

static void Alpha0Detail ( const double T,
const double D,
const std::vector< double > & x,
double a0[3] )
static

Calculates the ideal gas Helmholtz energy and its derivatives with respect to T and D.

This function computes the ideal gas Helmholtz energy and its first and second temperature derivatives. This calculation is not required when only pressure (P) or compressibility factor (Z) is needed.

Parameters
TTemperature in Kelvin (K)
DDensity in moles per liter (mol/l)
xVector of mole fractions representing composition
a0Array to store results:
  • a0[0]: Ideal gas Helmholtz energy (J/mol)
  • a0[1]: First temperature derivative ∂(a0)/∂T [J/(mol-K)]
  • a0[2]: Second temperature derivative T*∂²(a0)/∂T² [J/(mol-K)]
Note
The function uses hyperbolic functions and logarithmic terms to compute the ideal gas contributions for each component in the mixture.
Warning
Input array x must be of sufficient size to handle all components (NcDetail)
Output array a0 must be of size 3 to store all computed values

Definition at line 550 of file Detail.cpp.

551{
552 // Private Sub Alpha0Detail(T, D, x, a0)
553
554 // Calculate the ideal gas Helmholtz energy and its derivatives with respect to T and D.
555 // This routine is not needed when only P (or Z) is calculated.
556
557 // Inputs:
558 // T - Temperature (K)
559 // D - Density (mol/l)
560 // x() - Composition (mole fraction)
561
562 // Outputs:
563 // a0(0) - Ideal gas Helmholtz energy (J/mol)
564 // a0(1) - partial (a0)/partial(T) [J/(mol-K)]
565 // a0(2) - T*partial^2(a0)/partial(T)^2 [J/(mol-K)]
566
567 double LogT, LogD, LogHyp, th0T, LogxD;
568 double SumHyp0, SumHyp1, SumHyp2;
569 double em, ep, hcn, hsn;
570
571 a0[0] = 0;
572 a0[1] = 0;
573 a0[2] = 0;
574 if (D > epsilon)
575 {
576 LogD = log(D);
577 }
578 else
579 {
580 LogD = log(epsilon);
581 }
582 LogT = log(T);
583 for (std::size_t i = 1; i <= NcDetail; ++i)
584 {
585 if (x[i] > 0)
586 {
587 LogxD = LogD + log(x[i]);
588 SumHyp0 = 0;
589 SumHyp1 = 0;
590 SumHyp2 = 0;
591 for (int j = 4; j <= 7; ++j)
592 {
593 if (th0i[i][j] > 0)
594 {
595 th0T = th0i[i][j] / T;
596 ep = exp(th0T);
597 em = 1 / ep;
598 hsn = (ep - em) / 2;
599 hcn = (ep + em) / 2;
600 if (j == 4 || j == 6)
601 {
602 LogHyp = log(std::abs(hsn));
603 SumHyp0 += n0i[i][j] * LogHyp;
604 SumHyp1 += n0i[i][j] * (LogHyp - th0T * hcn / hsn);
605 SumHyp2 += n0i[i][j] * sq(th0T / hsn);
606 }
607 else
608 {
609 LogHyp = log(std::abs(hcn));
610 SumHyp0 += -n0i[i][j] * LogHyp;
611 SumHyp1 += -n0i[i][j] * (LogHyp - th0T * hsn / hcn);
612 SumHyp2 += +n0i[i][j] * sq(th0T / hcn);
613 }
614 }
615 }
616 a0[0] += x[i] * (LogxD + n0i[i][1] + n0i[i][2] / T - n0i[i][3] * LogT + SumHyp0);
617 a0[1] += x[i] * (LogxD + n0i[i][1] - n0i[i][3] * (1 + LogT) + SumHyp1);
618 a0[2] += -x[i] * (n0i[i][3] + SumHyp2);
619 }
620 }
621 a0[0] = a0[0] * RDetail * T;
622 a0[1] = a0[1] * RDetail;
623 a0[2] = a0[2] * RDetail;
624}
static double th0i[MaxFlds+1][7+1]
Definition Detail.cpp:138
double sq(double x)
Definition Detail.cpp:142
static double RDetail
Definition Detail.cpp:127
static const double epsilon
Definition Detail.cpp:129
static const int NcDetail
Definition Detail.cpp:128
static double n0i[MaxFlds+1][7+1]
Definition Detail.cpp:138

References epsilon, n0i, NcDetail, RDetail, sq(), and th0i.

Referenced by PropertiesDetail().

◆ AlpharDetail()

static void AlpharDetail ( const int itau,
const int idel,
const double T,
const double D,
double ar[4][4] )
static

Calculates derivatives of the residual Helmholtz energy with respect to temperature and density.

This function computes various derivatives of the residual Helmholtz energy based on temperature and density inputs. The xTerms subroutine must be called before this routine if x has changed.

Parameters
itauSet to 1 to calculate derivatives with respect to T [ar(1,0), ar(1,1), ar(2,0)], 0 otherwise
idelCurrently not used, reserved for future use in specifying highest density derivative
TTemperature in Kelvin
DDensity in mol/l
ar[4][4]Output array containing the following derivatives:
  • ar[0][0]: Residual Helmholtz energy (J/mol)
  • ar[0][1]: D*∂(ar)/∂D (J/mol)
  • ar[0][2]: D²*∂²(ar)/∂D² (J/mol)
  • ar[0][3]: D³*∂³(ar)/∂D³ (J/mol)
  • ar[1][0]: ∂(ar)/∂T [J/(mol-K)]
  • ar[1][1]: D*∂²(ar)/∂D∂T [J/(mol-K)]
  • ar[2][0]: T*∂²(ar)/∂T² [J/(mol-K)]
Note
This function is part of the GERG-2008 equation of state calculations
The function assumes that global variables Told, Tun, K3, RDetail, un, Bs, Csn, bn, kn are properly initialized

Definition at line 649 of file Detail.cpp.

650{
651 // Private Sub AlpharDetail(itau, idel, T, D, ar)
652
653 // Calculate the derivatives of the residual Helmholtz energy (ar) with respect to T and D.
654 // itau and idel are inputs that contain the highest derivatives needed.
655 // Outputs are returned in the array ar.
656 // Subroutine xTerms must be called before this routine if x has changed
657
658 // Inputs:
659 // itau - Set this to 1 to calculate "ar" derivatives with respect to T [i.e., ar(1,0), ar(1,1), and ar(2,0)], otherwise set it to 0.
660 // idel - Currently not used, but kept as an input for future use in specifing the highest density derivative needed.
661 // T - Temperature (K)
662 // D - Density (mol/l)
663
664 // Outputs:
665 // ar(0,0) - Residual Helmholtz energy (J/mol)
666 // ar(0,1) - D*partial (ar)/partial(D) (J/mol)
667 // ar(0,2) - D^2*partial^2(ar)/partial(D)^2 (J/mol)
668 // ar(0,3) - D^3*partial^3(ar)/partial(D)^3 (J/mol)
669 // ar(1,0) - partial (ar)/partial(T) [J/(mol-K)]
670 // ar(1,1) - D*partial^2(ar)/partial(D)/partial(T) [J/(mol-K)]
671 // ar(2,0) - T*partial^2(ar)/partial(T)^2 [J/(mol-K)]
672
673 double ckd, bkd, Dred;
674 double Sum, s0, s1, s2, s3, RT;
675 double Sum0[NTerms + 1], SumB[NTerms + 1], Dknn[9 + 1], Expn[4 + 1];
676 double CoefD1[NTerms + 1], CoefD2[NTerms + 1], CoefD3[NTerms + 1];
677 double CoefT1[NTerms + 1], CoefT2[NTerms + 1];
678
679 for (int i = 0; i <= 3; ++i)
680 {
681 for (int j = 0; j <= 3; ++j)
682 {
683 ar[i][j] = 0;
684 }
685 }
686 if (std::abs(T - Told) > 0.0000001)
687 {
688 for (int n = 1; n <= 58; ++n)
689 {
690 Tun[n] = pow(T, -un[n]);
691 }
692 }
693 Told = T;
694
695 // Precalculation of common powers and exponents of density
696 Dred = K3 * D;
697 Dknn[0] = 1;
698 for (int n = 1; n <= 9; ++n)
699 {
700 Dknn[n] = Dred * Dknn[n - 1];
701 }
702 Expn[0] = 1;
703 for (int n = 1; n <= 4; ++n)
704 {
705 Expn[n] = exp(-Dknn[n]);
706 }
707 RT = RDetail * T;
708
709 for (int n = 1; n <= 58; ++n)
710 {
711 // Contributions to the Helmholtz energy and its derivatives with respect to temperature
712 CoefT1[n] = RDetail * (un[n] - 1);
713 CoefT2[n] = CoefT1[n] * un[n];
714 // Contributions to the virial coefficients
715 SumB[n] = 0;
716 Sum0[n] = 0;
717 if (n <= 18)
718 {
719 Sum = Bs[n] * D;
720 if (n >= 13)
721 {
722 Sum += -Csn[n] * Dred;
723 }
724 SumB[n] = Sum * Tun[n];
725 }
726 if (n >= 13)
727 {
728 // Contributions to the residual part of the Helmholtz energy
729 Sum0[n] = Csn[n] * Dknn[bn[n]] * Tun[n] * Expn[kn[n]];
730 // Contributions to the derivatives of the Helmholtz energy with respect to density
731 bkd = bn[n] - kn[n] * Dknn[kn[n]];
732 ckd = kn[n] * kn[n] * Dknn[kn[n]];
733 CoefD1[n] = bkd;
734 CoefD2[n] = bkd * (bkd - 1) - ckd;
735 CoefD3[n] = (bkd - 2) * CoefD2[n] + ckd * (1 - kn[n] - 2 * bkd);
736 }
737 else
738 {
739 CoefD1[n] = 0;
740 CoefD2[n] = 0;
741 CoefD3[n] = 0;
742 }
743 }
744
745 for (int n = 1; n <= 58; ++n)
746 {
747 // Density derivatives
748 s0 = Sum0[n] + SumB[n];
749 s1 = Sum0[n] * CoefD1[n] + SumB[n];
750 s2 = Sum0[n] * CoefD2[n];
751 s3 = Sum0[n] * CoefD3[n];
752 ar[0][0] = ar[0][0] + RT * s0;
753 ar[0][1] = ar[0][1] + RT * s1;
754 ar[0][2] = ar[0][2] + RT * s2;
755 ar[0][3] = ar[0][3] + RT * s3;
756 // Temperature derivatives
757 if (itau > 0)
758 {
759 ar[1][0] = ar[1][0] - CoefT1[n] * s0;
760 ar[1][1] = ar[1][1] - CoefT1[n] * s1;
761 ar[2][0] = ar[2][0] + CoefT2[n] * s0;
762 // The following are not used, but fully functional
763 // ar(1, 2) = ar(1, 2) - CoefT1(n) * s2;
764 // ar(1, 3) = ar(1, 3) - CoefT1(n) * s3;
765 // ar(2, 1) = ar(2, 1) + CoefT2(n) * s1;
766 // ar(2, 2) = ar(2, 2) + CoefT2(n) * s2;
767 // ar(2, 3) = ar(2, 3) + CoefT2(n) * s3;
768 }
769 }
770}
static int kn[NTerms+1]
Definition Detail.cpp:132
static double Tun[NTerms+1]
Definition Detail.cpp:137
static double Bs[18+1]
Definition Detail.cpp:133
static int bn[NTerms+1]
Definition Detail.cpp:132
static double Told
Definition Detail.cpp:137
static double un[NTerms+1]
Definition Detail.cpp:131
static const int NTerms
Definition Detail.cpp:128
static double K3
Definition Detail.cpp:139
static double Csn[NTerms+1]
Definition Detail.cpp:133

References bn, Bs, Csn, K3, kn, NTerms, RDetail, Told, Tun, and un.

Referenced by PressureDetail(), and PropertiesDetail().

◆ DensityDetail()

void DensityDetail ( const double T,
const double P,
const std::vector< double > & x,
double & D,
int & ierr,
std::string & herr )

Calculates density as a function of temperature and pressure using an iterative method.

This function uses an iterative Newton's method that calls PressureDetail to find the correct state point. Generally only 6 iterations at most are required. If the iteration fails to converge, the ideal gas density and an error message are returned. No checks are made to determine the phase boundary, which would have guaranteed that the output is in the gas phase. It is up to the user to locate the phase boundary, and thus identify the phase of the T and P inputs. If the state point is 2-phase, the output density will represent a metastable state.

Parameters
TTemperature in Kelvin (K)
PPressure in kiloPascals (kPa)
xVector of mole fractions representing composition
DDensity in mol/l (can be negative to use as initial guess)
ierrError number (0 indicates no error)
herrError message string (empty if no error)
Note
If D is passed as negative, its absolute value will be used as initial estimate
If P is zero (or very close to zero), D will be set to 0
If calculation fails to converge, ideal gas density is returned with error message
See also
DensityDetail_wrapper for the Emscripten wrapped version of this function

Definition at line 246 of file Detail.cpp.

247{
248 // Sub DensityDetail(T, P, x, D, ierr, herr)
249
250 // Calculate density as a function of temperature and pressure. This is an iterative routine that calls PressureDetail
251 // to find the correct state point. Generally only 6 iterations at most are required.
252 // If the iteration fails to converge, the ideal gas density and an error message are returned.
253 // No checks are made to determine the phase boundary, which would have guaranteed that the output is in the gas phase.
254 // It is up to the user to locate the phase boundary, and thus identify the phase of the T and P inputs.
255 // If the state point is 2-phase, the output density will represent a metastable state.
256
257 // Inputs:
258 // T - Temperature (K)
259 // P - Pressure (kPa)
260 // x() - Composition (mole fraction)
261
262 // Outputs:
263 // D - Density (mol/l) (make D negative and send as an input to use as an initial guess)
264 // ierr - Error number (0 indicates no error)
265 // herr - Error message if ierr is not equal to zero
266
267 double plog, vlog, P2, Z, dpdlv, vdiff, tolr;
268
269 ierr = 0;
270 herr = "";
271 if (std::abs(P) < epsilon)
272 {
273 D = 0;
274 return;
275 }
276 tolr = 0.0000001;
277 if (D > -epsilon)
278 {
279 D = P / RDetail / T; // Ideal gas estimate
280 }
281 else
282 {
283 D = std::abs(D); // If D<0, then use as initial estimate
284 }
285 plog = log(P);
286 vlog = -log(D);
287 for (int it = 1; it <= 20; ++it)
288 {
289 if (vlog < -7 || vlog > 100)
290 {
291 ierr = 1;
292 herr = "Calculation failed to converge in DETAIL method, ideal gas density returned.";
293 D = P / RDetail / T;
294 return;
295 }
296 D = exp(-vlog);
297 PressureDetail(T, D, x, P2, Z);
298 if (dPdDsave < epsilon || P2 < epsilon)
299 {
300 vlog += 0.1;
301 }
302 else
303 {
304 // Find the next density with a first order Newton's type iterative scheme, with
305 // log(P) as the known variable and log(v) as the unknown property.
306 // See AGA 8 publication for further information.
307 dpdlv = -D * dPdDsave; // d(p)/d[log(v)]
308 vdiff = (log(P2) - plog) * P2 / dpdlv;
309 vlog = vlog - vdiff;
310 if (std::abs(vdiff) < tolr)
311 {
312 D = exp(-vlog);
313 return; // Iteration converged
314 }
315 }
316 }
317 ierr = 1;
318 herr = "Calculation failed to converge in DETAIL method, ideal gas density returned.";
319 D = P / RDetail / T;
320 return;
321}
void PressureDetail(const double T, const double D, const std::vector< double > &x, double &P, double &Z)
Calculates pressure and compressibility factor as a function of temperature and density.
Definition Detail.cpp:196
static double dPdDsave
Definition Detail.cpp:140

References dPdDsave, epsilon, PressureDetail(), and RDetail.

Referenced by DensityDetail_wrapper().

◆ MolarMassDetail()

void MolarMassDetail ( const std::vector< double > & x,
double & Mm )

Calculate molar mass of a mixture based on composition.

This function calculates the molar mass of a mixture using the mole fractions of each component provided in the composition array.

Parameters
xVector of mole fractions for each component in the mixture. Must sum to 1.0. Use mole fractions only (not mass fractions or mole percents). Components must be ordered according to the fluid order defined in the implementation.
[out]MmCalculated molar mass of the mixture in g/mol
Note
The composition array x must contain valid mole fractions that sum to 1.0
See also
MolarMassDetail_wrapper for the Emscripten wrapped version of this function

Definition at line 158 of file Detail.cpp.

159{
160 // Calculate molar mass of the mixture with the compositions contained in the x() input array
161
162 // Inputs:
163 // x() - Composition (mole fraction)
164 // Do not send mole percents or mass fractions in the x() array, otherwise the output will be incorrect.
165 // The sum of the compositions in the x() array must be equal to one.
166 // The order of the fluids in this array is given at the top of this code.
167
168 // Outputs:
169 // Mm - Molar mass (g/mol)
170
171 Mm = 0;
172 for (std::size_t i = 1; i <= NcDetail; ++i)
173 {
174 Mm += x[i] * MMiDetail[i];
175 }
176}
static double MMiDetail[MaxFlds+1]
Definition Detail.cpp:139

References MMiDetail, and NcDetail.

Referenced by MolarMassDetail_wrapper(), and PropertiesDetail().

◆ PressureDetail()

void PressureDetail ( const double T,
const double D,
const std::vector< double > & x,
double & P,
double & Z )

Calculates pressure and compressibility factor as a function of temperature and density.

This function computes the pressure and compressibility factor for a gas mixture using the GERG-2008 equation of state. It also calculates d(P)/d(D) which is cached for use in iterative density calculations.

Parameters
TTemperature in Kelvin (K)
DDensity in moles per liter (mol/l)
xVector of composition mole fractions (must sum to 1.0)
[out]PPressure in kiloPascals (kPa)
[out]ZCompressibility factor (dimensionless)
Note
The composition vector x must contain mole fractions, not mole percents or mass fractions
The sum of all mole fractions in x must equal 1.0
The derivative d(P)/d(D) is cached internally but not returned as an argument
See also
PressureDetail_wrapper for the Emscripten wrapped version of this function

Definition at line 196 of file Detail.cpp.

197{
198 // Sub Pressure(T, D, x, P, Z)
199
200 // Calculate pressure as a function of temperature and density. The derivative d(P)/d(D) is also calculated
201 // for use in the iterative DensityDetail subroutine (and is only returned as a common variable).
202
203 // Inputs:
204 // T - Temperature (K)
205 // D - Density (mol/l)
206 // x() - Composition (mole fraction)
207 // Do not send mole percents or mass fractions in the x() array, otherwise the output will be incorrect.
208 // The sum of the compositions in the x() array must be equal to one.
209
210 // Outputs:
211 // P - Pressure (kPa)
212 // Z - Compressibility factor
213 // dPdDsave - d(P)/d(D) [kPa/(mol/l)] (at constant temperature)
214 // - This variable is cached in the common variables for use in the iterative density solver, but not returned as an argument.
215
216 double ar[3 + 1][3 + 1];
217 xTermsDetail(x);
218 AlpharDetail(0, 2, T, D, ar);
219 Z = 1 + ar[0][1] / RDetail / T; // ar(0,1) is the first derivative of alpha(r) with respect to density
220 P = D * RDetail * T * Z;
221 dPdDsave = RDetail * T + 2 * ar[0][1] + ar[0][2]; // d(P)/d(D) for use in density iteration
222}
static void AlpharDetail(const int itau, const int idel, const double T, const double D, double ar[4][4])
Calculates derivatives of the residual Helmholtz energy with respect to temperature and density.
Definition Detail.cpp:649
static void xTermsDetail(const std::vector< double > &x)
Definition Detail.cpp:430

References AlpharDetail(), dPdDsave, RDetail, and xTermsDetail().

Referenced by DensityDetail(), and PressureDetail_wrapper().

◆ PropertiesDetail()

void PropertiesDetail ( const double T,
const double D,
const std::vector< double > & x,
double & P,
double & Z,
double & dPdD,
double & d2PdD2,
double & d2PdTD,
double & dPdT,
double & U,
double & H,
double & S,
double & Cv,
double & Cp,
double & W,
double & G,
double & JT,
double & Kappa,
double & Cf )

Calculates thermodynamic properties as a function of temperature and density.

If density is unknown, call DensityDetail first with known pressure and temperature values. Makes calls to Molarmass, Alpha0Detail, and AlpharDetail subroutines.

Parameters
TTemperature in Kelvin (K)
DDensity in mol/l
xVector of mole fractions representing composition
[out]PPressure in kPa
[out]ZCompressibility factor
[out]dPdDFirst derivative of pressure with respect to density at constant temperature [kPa/(mol/l)]
[out]d2PdD2Second derivative of pressure with respect to density at constant temperature [kPa/(mol/l)^2]
[out]d2PdTDSecond derivative of pressure with respect to temperature and density [kPa/(mol/l)/K]
[out]dPdTFirst derivative of pressure with respect to temperature at constant density (kPa/K)
[out]UInternal energy in J/mol
[out]HEnthalpy in J/mol
[out]SEntropy in J/(mol-K)
[out]CvIsochoric heat capacity in J/(mol-K)
[out]CpIsobaric heat capacity in J/(mol-K)
[out]WSpeed of sound in m/s
[out]GGibbs energy in J/mol
[out]JTJoule-Thomson coefficient in K/kPa
[out]KappaIsentropic Exponent
[out]CfCritical Flow Factor (dimensionless)
See also
PropertiesDetail_wrapper for the Emscripten wrapped version of this function

Definition at line 350 of file Detail.cpp.

351{
352 // Sub Properties(T, D, x, P, Z, dPdD, d2PdD2, d2PdTD, dPdT, U, H, S, Cv, Cp, W, G, JT, Kappa)
353
354 // Calculate thermodynamic properties as a function of temperature and density. Calls are made to the subroutines
355 // Molarmass, Alpha0Detail, and AlpharDetail. If the density is not known, call subroutine DensityDetail first
356 // with the known values of pressure and temperature.
357
358 // Inputs:
359 // T - Temperature (K)
360 // D - Density (mol/l)
361 // x() - Composition (mole fraction)
362
363 // Outputs:
364 // P - Pressure (kPa)
365 // Z - Compressibility factor
366 // dPdD - First derivative of pressure with respect to density at constant temperature [kPa/(mol/l)]
367 // d2PdD2 - Second derivative of pressure with respect to density at constant temperature [kPa/(mol/l)^2]
368 // d2PdTD - Second derivative of pressure with respect to temperature and density [kPa/(mol/l)/K] (currently not calculated)
369 // dPdT - First derivative of pressure with respect to temperature at constant density (kPa/K)
370 // U - Internal energy (J/mol)
371 // H - Enthalpy (J/mol)
372 // S - Entropy [J/(mol-K)]
373 // Cv - Isochoric heat capacity [J/(mol-K)]
374 // Cp - Isobaric heat capacity [J/(mol-K)]
375 // W - Speed of sound (m/s)
376 // G - Gibbs energy (J/mol)
377 // JT - Joule-Thomson coefficient (K/kPa)
378 // Kappa - Isentropic Exponent
379 // Cf - Critical Flow Factor (dimensionless)
380
381 double a0[2 + 1], ar[3 + 1][3 + 1], Mm, A, R, RT;
382
383 MolarMassDetail(x, Mm);
384 xTermsDetail(x);
385
386 // Calculate the ideal gas Helmholtz energy, and its first and second derivatives with respect to temperature.
387 Alpha0Detail(T, D, x, a0);
388
389 // Calculate the real gas Helmholtz energy, and its derivatives with respect to temperature and/or density.
390 AlpharDetail(2, 3, T, D, ar);
391
392 R = RDetail;
393 RT = R * T;
394 Z = 1 + ar[0][1] / RT;
395 P = D * RT * Z;
396 dPdD = RT + 2 * ar[0][1] + ar[0][2];
397 dPdT = D * R + D * ar[1][1];
398 A = a0[0] + ar[0][0];
399 S = -a0[1] - ar[1][0];
400 U = A + T * S;
401 Cv = -(a0[2] + ar[2][0]);
402 if (D > epsilon)
403 {
404 H = U + P / D;
405 G = A + P / D;
406 Cp = Cv + T * sq(dPdT / D) / dPdD;
407 d2PdD2 = (2 * ar[0][1] + 4 * ar[0][2] + ar[0][3]) / D;
408 JT = (T / D * dPdT / dPdD - 1) / Cp / D;
409 }
410 else
411 {
412 H = U + RT;
413 G = A + RT;
414 Cp = Cv + R;
415 d2PdD2 = 0;
416 JT = 1E+20; //=(dB/dT*T-B)/Cp for an ideal gas, but dB/dT is not calculated here
417 }
418 W = 1000 * Cp / Cv * dPdD / Mm;
419 if (W < 0)
420 {
421 W = 0;
422 }
423 W = sqrt(W);
424 Kappa = W * W * Mm / (RT * 1000 * Z);
425 Cf = sqrt(Kappa * pow( (2 / (Kappa + 1)), ((Kappa + 1) / (Kappa - 1))));
426 d2PdTD = 0;
427}
void MolarMassDetail(const std::vector< double > &x, double &Mm)
Calculate molar mass of a mixture based on composition.
Definition Detail.cpp:158
static void Alpha0Detail(const double T, const double D, const std::vector< double > &x, double a0[3])
Calculates the ideal gas Helmholtz energy and its derivatives with respect to T and D.
Definition Detail.cpp:550

References Alpha0Detail(), AlpharDetail(), epsilon, MolarMassDetail(), RDetail, sq(), and xTermsDetail().

Referenced by PropertiesDetail_wrapper().

◆ SetupDetail()

void SetupDetail ( )

The following routine must be called once before any other routine.

Initializes all constants and parameters for the DETAIL model equations of state

This function sets up all the necessary parameters for the AGA8 equation of state in its "DETAIL" version. It initializes:

  • Gas constant (RDetail)
  • Molar masses for 21 components (MMiDetail)
  • Equation of state coefficients (an)
  • Density exponents (bn)
  • Temperature exponents (un)
  • Various flags (fn, gn, qn, sn, wn)
  • Binary interaction parameters:
    • Energy parameters (Eij)
    • Size parameters (Kij)
    • Orientation parameters (Gij)
    • Conformal energy parameters (Uij)
  • Component-specific parameters:
    • Energy parameters (Ei)
    • Size parameters (Ki)
    • Orientation parameters (Gi)
    • Quadrupole parameters (Qi)
    • Dipole parameters (Si)
    • Association parameters (Wi)
  • Ideal gas parameters (n0i, th0i)

The function also performs necessary precalculations of constants used in the equation of state calculations to optimize performance.

This implementation corresponds to the reference equations for natural gas mixtures as published in the DETAIL formulation.

Note
this function is directly bind to SetupDetail() in the Emscripten wrapper

Definition at line 806 of file Detail.cpp.

807{
808 // Initialize all the constants and parameters in the DETAIL model.
809 // Some values are modified for calculations that do not depend on T, D, and x in order to speed up the program.
810
811 int sn[NTerms + 1], wn[NTerms + 1];
812 double Ei[MaxFlds + 1], Ki[MaxFlds + 1], Si[MaxFlds + 1], Wi[MaxFlds + 1], Bsnij;
813 double Kij[MaxFlds + 1][MaxFlds + 1], Gij[MaxFlds + 1][MaxFlds + 1], Eij[MaxFlds + 1][MaxFlds + 1], Uij[MaxFlds + 1][MaxFlds + 1];
814 double d0;
815
816 RDetail = 8.31451;
817
818 // Molar masses (g/mol)
819 MMiDetail[1] = 16.043; // Methane
820 MMiDetail[2] = 28.0135; // Nitrogen
821 MMiDetail[3] = 44.01; // Carbon dioxide
822 MMiDetail[4] = 30.07; // Ethane
823 MMiDetail[5] = 44.097; // Propane
824 MMiDetail[6] = 58.123; // Isobutane
825 MMiDetail[7] = 58.123; // n-Butane
826 MMiDetail[8] = 72.15; // Isopentane
827 MMiDetail[9] = 72.15; // n-Pentane
828 MMiDetail[10] = 86.177; // Hexane
829 MMiDetail[11] = 100.204; // Heptane
830 MMiDetail[12] = 114.231; // Octane
831 MMiDetail[13] = 128.258; // Nonane
832 MMiDetail[14] = 142.285; // Decane
833 MMiDetail[15] = 2.0159; // Hydrogen
834 MMiDetail[16] = 31.9988; // Oxygen
835 MMiDetail[17] = 28.01; // Carbon monoxide
836 MMiDetail[18] = 18.0153; // Water
837 MMiDetail[19] = 34.082; // Hydrogen sulfide
838 MMiDetail[20] = 4.0026; // Helium
839 MMiDetail[21] = 39.948; // Argon
840
841 // Initialize constants
842 Told = 0;
843 for (int i = 1; i <= NTerms; ++i)
844 {
845 an[i] = 0;
846 bn[i] = 0;
847 gn[i] = 0;
848 fn[i] = 0;
849 kn[i] = 0;
850 qn[i] = 0;
851 sn[i] = 0;
852 un[i] = 0;
853 wn[i] = 0;
854 }
855
856 for (int i = 1; i <= MaxFlds; ++i)
857 {
858 Ei[i] = 0;
859 Fi[i] = 0;
860 Gi[i] = 0;
861 Ki[i] = 0;
862 Qi[i] = 0;
863 Si[i] = 0;
864 Wi[i] = 0;
865 xold[i] = 0;
866 for (int j = 1; j <= MaxFlds; ++j)
867 {
868 Eij[i][j] = 1;
869 Gij[i][j] = 1;
870 Kij[i][j] = 1;
871 Uij[i][j] = 1;
872 }
873 }
874
875 // Coefficients of the equation of state
876 an[1] = 0.1538326;
877 an[2] = 1.341953;
878 an[3] = -2.998583;
879 an[4] = -0.04831228;
880 an[5] = 0.3757965;
881 an[6] = -1.589575;
882 an[7] = -0.05358847;
883 an[8] = 0.88659463;
884 an[9] = -0.71023704;
885 an[10] = -1.471722;
886 an[11] = 1.32185035;
887 an[12] = -0.78665925;
888 an[13] = 0.00000000229129;
889 an[14] = 0.1576724;
890 an[15] = -0.4363864;
891 an[16] = -0.04408159;
892 an[17] = -0.003433888;
893 an[18] = 0.03205905;
894 an[19] = 0.02487355;
895 an[20] = 0.07332279;
896 an[21] = -0.001600573;
897 an[22] = 0.6424706;
898 an[23] = -0.4162601;
899 an[24] = -0.06689957;
900 an[25] = 0.2791795;
901 an[26] = -0.6966051;
902 an[27] = -0.002860589;
903 an[28] = -0.008098836;
904 an[29] = 3.150547;
905 an[30] = 0.007224479;
906 an[31] = -0.7057529;
907 an[32] = 0.5349792;
908 an[33] = -0.07931491;
909 an[34] = -1.418465;
910 an[35] = -5.99905E-17;
911 an[36] = 0.1058402;
912 an[37] = 0.03431729;
913 an[38] = -0.007022847;
914 an[39] = 0.02495587;
915 an[40] = 0.04296818;
916 an[41] = 0.7465453;
917 an[42] = -0.2919613;
918 an[43] = 7.294616;
919 an[44] = -9.936757;
920 an[45] = -0.005399808;
921 an[46] = -0.2432567;
922 an[47] = 0.04987016;
923 an[48] = 0.003733797;
924 an[49] = 1.874951;
925 an[50] = 0.002168144;
926 an[51] = -0.6587164;
927 an[52] = 0.000205518;
928 an[53] = 0.009776195;
929 an[54] = -0.02048708;
930 an[55] = 0.01557322;
931 an[56] = 0.006862415;
932 an[57] = -0.001226752;
933 an[58] = 0.002850908;
934
935 // Density exponents
936 bn[1] = 1;
937 bn[2] = 1;
938 bn[3] = 1;
939 bn[4] = 1;
940 bn[5] = 1;
941 bn[6] = 1;
942 bn[7] = 1;
943 bn[8] = 1;
944 bn[9] = 1;
945 bn[10] = 1;
946 bn[11] = 1;
947 bn[12] = 1;
948 bn[13] = 1;
949 bn[14] = 1;
950 bn[15] = 1;
951 bn[16] = 1;
952 bn[17] = 1;
953 bn[18] = 1;
954 bn[19] = 2;
955 bn[20] = 2;
956 bn[21] = 2;
957 bn[22] = 2;
958 bn[23] = 2;
959 bn[24] = 2;
960 bn[25] = 2;
961 bn[26] = 2;
962 bn[27] = 2;
963 bn[28] = 3;
964 bn[29] = 3;
965 bn[30] = 3;
966 bn[31] = 3;
967 bn[32] = 3;
968 bn[33] = 3;
969 bn[34] = 3;
970 bn[35] = 3;
971 bn[36] = 3;
972 bn[37] = 3;
973 bn[38] = 4;
974 bn[39] = 4;
975 bn[40] = 4;
976 bn[41] = 4;
977 bn[42] = 4;
978 bn[43] = 4;
979 bn[44] = 4;
980 bn[45] = 5;
981 bn[46] = 5;
982 bn[47] = 5;
983 bn[48] = 5;
984 bn[49] = 5;
985 bn[50] = 6;
986 bn[51] = 6;
987 bn[52] = 7;
988 bn[53] = 7;
989 bn[54] = 8;
990 bn[55] = 8;
991 bn[56] = 8;
992 bn[57] = 9;
993 bn[58] = 9;
994
995 // Exponents on density in EXP[-cn*D^kn] part
996 // The cn part in this term is not included in this program since it is 1 when kn<>0][and 0 otherwise
997 kn[13] = 3;
998 kn[14] = 2;
999 kn[15] = 2;
1000 kn[16] = 2;
1001 kn[17] = 4;
1002 kn[18] = 4;
1003 kn[21] = 2;
1004 kn[22] = 2;
1005 kn[23] = 2;
1006 kn[24] = 4;
1007 kn[25] = 4;
1008 kn[26] = 4;
1009 kn[27] = 4;
1010 kn[29] = 1;
1011 kn[30] = 1;
1012 kn[31] = 2;
1013 kn[32] = 2;
1014 kn[33] = 3;
1015 kn[34] = 3;
1016 kn[35] = 4;
1017 kn[36] = 4;
1018 kn[37] = 4;
1019 kn[40] = 2;
1020 kn[41] = 2;
1021 kn[42] = 2;
1022 kn[43] = 4;
1023 kn[44] = 4;
1024 kn[46] = 2;
1025 kn[47] = 2;
1026 kn[48] = 4;
1027 kn[49] = 4;
1028 kn[51] = 2;
1029 kn[53] = 2;
1030 kn[54] = 1;
1031 kn[55] = 2;
1032 kn[56] = 2;
1033 kn[57] = 2;
1034 kn[58] = 2;
1035
1036 // Temperature exponents
1037 un[1] = 0;
1038 un[2] = 0.5;
1039 un[3] = 1;
1040 un[4] = 3.5;
1041 un[5] = -0.5;
1042 un[6] = 4.5;
1043 un[7] = 0.5;
1044 un[8] = 7.5;
1045 un[9] = 9.5;
1046 un[10] = 6;
1047 un[11] = 12;
1048 un[12] = 12.5;
1049 un[13] = -6;
1050 un[14] = 2;
1051 un[15] = 3;
1052 un[16] = 2;
1053 un[17] = 2;
1054 un[18] = 11;
1055 un[19] = -0.5;
1056 un[20] = 0.5;
1057 un[21] = 0;
1058 un[22] = 4;
1059 un[23] = 6;
1060 un[24] = 21;
1061 un[25] = 23;
1062 un[26] = 22;
1063 un[27] = -1;
1064 un[28] = -0.5;
1065 un[29] = 7;
1066 un[30] = -1;
1067 un[31] = 6;
1068 un[32] = 4;
1069 un[33] = 1;
1070 un[34] = 9;
1071 un[35] = -13;
1072 un[36] = 21;
1073 un[37] = 8;
1074 un[38] = -0.5;
1075 un[39] = 0;
1076 un[40] = 2;
1077 un[41] = 7;
1078 un[42] = 9;
1079 un[43] = 22;
1080 un[44] = 23;
1081 un[45] = 1;
1082 un[46] = 9;
1083 un[47] = 3;
1084 un[48] = 8;
1085 un[49] = 23;
1086 un[50] = 1.5;
1087 un[51] = 5;
1088 un[52] = -0.5;
1089 un[53] = 4;
1090 un[54] = 7;
1091 un[55] = 3;
1092 un[56] = 0;
1093 un[57] = 1;
1094 un[58] = 0;
1095
1096 // Flags
1097 fn[13] = 1;
1098 fn[27] = 1;
1099 fn[30] = 1;
1100 fn[35] = 1;
1101 gn[5] = 1;
1102 gn[6] = 1;
1103 gn[25] = 1;
1104 gn[29] = 1;
1105 gn[32] = 1;
1106 gn[33] = 1;
1107 gn[34] = 1;
1108 gn[51] = 1;
1109 gn[54] = 1;
1110 gn[56] = 1;
1111 qn[7] = 1;
1112 qn[16] = 1;
1113 qn[26] = 1;
1114 qn[28] = 1;
1115 qn[37] = 1;
1116 qn[42] = 1;
1117 qn[47] = 1;
1118 qn[49] = 1;
1119 qn[52] = 1;
1120 qn[58] = 1;
1121 sn[8] = 1;
1122 sn[9] = 1;
1123 wn[10] = 1;
1124 wn[11] = 1;
1125 wn[12] = 1;
1126
1127 // Energy parameters
1128 Ei[1] = 151.3183;
1129 Ei[2] = 99.73778;
1130 Ei[3] = 241.9606;
1131 Ei[4] = 244.1667;
1132 Ei[5] = 298.1183;
1133 Ei[6] = 324.0689;
1134 Ei[7] = 337.6389;
1135 Ei[8] = 365.5999;
1136 Ei[9] = 370.6823;
1137 Ei[10] = 402.636293;
1138 Ei[11] = 427.72263;
1139 Ei[12] = 450.325022;
1140 Ei[13] = 470.840891;
1141 Ei[14] = 489.558373;
1142 Ei[15] = 26.95794;
1143 Ei[16] = 122.7667;
1144 Ei[17] = 105.5348;
1145 Ei[18] = 514.0156;
1146 Ei[19] = 296.355;
1147 Ei[20] = 2.610111;
1148 Ei[21] = 119.6299;
1149
1150 // Size parameters
1151 Ki[1] = 0.4619255;
1152 Ki[2] = 0.4479153;
1153 Ki[3] = 0.4557489;
1154 Ki[4] = 0.5279209;
1155 Ki[5] = 0.583749;
1156 Ki[6] = 0.6406937;
1157 Ki[7] = 0.6341423;
1158 Ki[8] = 0.6738577;
1159 Ki[9] = 0.6798307;
1160 Ki[10] = 0.7175118;
1161 Ki[11] = 0.7525189;
1162 Ki[12] = 0.784955;
1163 Ki[13] = 0.8152731;
1164 Ki[14] = 0.8437826;
1165 Ki[15] = 0.3514916;
1166 Ki[16] = 0.4186954;
1167 Ki[17] = 0.4533894;
1168 Ki[18] = 0.3825868;
1169 Ki[19] = 0.4618263;
1170 Ki[20] = 0.3589888;
1171 Ki[21] = 0.4216551;
1172
1173 // Orientation parameters
1174 Gi[2] = 0.027815;
1175 Gi[3] = 0.189065;
1176 Gi[4] = 0.0793;
1177 Gi[5] = 0.141239;
1178 Gi[6] = 0.256692;
1179 Gi[7] = 0.281835;
1180 Gi[8] = 0.332267;
1181 Gi[9] = 0.366911;
1182 Gi[10] = 0.289731;
1183 Gi[11] = 0.337542;
1184 Gi[12] = 0.383381;
1185 Gi[13] = 0.427354;
1186 Gi[14] = 0.469659;
1187 Gi[15] = 0.034369;
1188 Gi[16] = 0.021;
1189 Gi[17] = 0.038953;
1190 Gi[18] = 0.3325;
1191 Gi[19] = 0.0885;
1192
1193 // Quadrupole parameters
1194 Qi[3] = 0.69;
1195 Qi[18] = 1.06775;
1196 Qi[19] = 0.633276;
1197 Fi[15] = 1; // High temperature parameter
1198 Si[18] = 1.5822; // Dipole parameter
1199 Si[19] = 0.39; // Dipole parameter
1200 Wi[18] = 1; // Association parameter
1201
1202 // Energy parameters
1203 Eij[1][2] = 0.97164;
1204 Eij[1][3] = 0.960644;
1205 Eij[1][5] = 0.994635;
1206 Eij[1][6] = 1.01953;
1207 Eij[1][7] = 0.989844;
1208 Eij[1][8] = 1.00235;
1209 Eij[1][9] = 0.999268;
1210 Eij[1][10] = 1.107274;
1211 Eij[1][11] = 0.88088;
1212 Eij[1][12] = 0.880973;
1213 Eij[1][13] = 0.881067;
1214 Eij[1][14] = 0.881161;
1215 Eij[1][15] = 1.17052;
1216 Eij[1][17] = 0.990126;
1217 Eij[1][18] = 0.708218;
1218 Eij[1][19] = 0.931484;
1219 Eij[2][3] = 1.02274;
1220 Eij[2][4] = 0.97012;
1221 Eij[2][5] = 0.945939;
1222 Eij[2][6] = 0.946914;
1223 Eij[2][7] = 0.973384;
1224 Eij[2][8] = 0.95934;
1225 Eij[2][9] = 0.94552;
1226 Eij[2][15] = 1.08632;
1227 Eij[2][16] = 1.021;
1228 Eij[2][17] = 1.00571;
1229 Eij[2][18] = 0.746954;
1230 Eij[2][19] = 0.902271;
1231 Eij[3][4] = 0.925053;
1232 Eij[3][5] = 0.960237;
1233 Eij[3][6] = 0.906849;
1234 Eij[3][7] = 0.897362;
1235 Eij[3][8] = 0.726255;
1236 Eij[3][9] = 0.859764;
1237 Eij[3][10] = 0.855134;
1238 Eij[3][11] = 0.831229;
1239 Eij[3][12] = 0.80831;
1240 Eij[3][13] = 0.786323;
1241 Eij[3][14] = 0.765171;
1242 Eij[3][15] = 1.28179;
1243 Eij[3][17] = 1.5;
1244 Eij[3][18] = 0.849408;
1245 Eij[3][19] = 0.955052;
1246 Eij[4][5] = 1.02256;
1247 Eij[4][7] = 1.01306;
1248 Eij[4][9] = 1.00532;
1249 Eij[4][15] = 1.16446;
1250 Eij[4][18] = 0.693168;
1251 Eij[4][19] = 0.946871;
1252 Eij[5][7] = 1.0049;
1253 Eij[5][15] = 1.034787;
1254 Eij[6][15] = 1.3;
1255 Eij[7][15] = 1.3;
1256 Eij[10][19] = 1.008692;
1257 Eij[11][19] = 1.010126;
1258 Eij[12][19] = 1.011501;
1259 Eij[13][19] = 1.012821;
1260 Eij[14][19] = 1.014089;
1261 Eij[15][17] = 1.1;
1262
1263 // Conformal energy parameters
1264 Uij[1][2] = 0.886106;
1265 Uij[1][3] = 0.963827;
1266 Uij[1][5] = 0.990877;
1267 Uij[1][7] = 0.992291;
1268 Uij[1][9] = 1.00367;
1269 Uij[1][10] = 1.302576;
1270 Uij[1][11] = 1.191904;
1271 Uij[1][12] = 1.205769;
1272 Uij[1][13] = 1.219634;
1273 Uij[1][14] = 1.233498;
1274 Uij[1][15] = 1.15639;
1275 Uij[1][19] = 0.736833;
1276 Uij[2][3] = 0.835058;
1277 Uij[2][4] = 0.816431;
1278 Uij[2][5] = 0.915502;
1279 Uij[2][7] = 0.993556;
1280 Uij[2][15] = 0.408838;
1281 Uij[2][19] = 0.993476;
1282 Uij[3][4] = 0.96987;
1283 Uij[3][10] = 1.066638;
1284 Uij[3][11] = 1.077634;
1285 Uij[3][12] = 1.088178;
1286 Uij[3][13] = 1.098291;
1287 Uij[3][14] = 1.108021;
1288 Uij[3][17] = 0.9;
1289 Uij[3][19] = 1.04529;
1290 Uij[4][5] = 1.065173;
1291 Uij[4][6] = 1.25;
1292 Uij[4][7] = 1.25;
1293 Uij[4][8] = 1.25;
1294 Uij[4][9] = 1.25;
1295 Uij[4][15] = 1.61666;
1296 Uij[4][19] = 0.971926;
1297 Uij[10][19] = 1.028973;
1298 Uij[11][19] = 1.033754;
1299 Uij[12][19] = 1.038338;
1300 Uij[13][19] = 1.042735;
1301 Uij[14][19] = 1.046966;
1302
1303 // Size parameters
1304 Kij[1][2] = 1.00363;
1305 Kij[1][3] = 0.995933;
1306 Kij[1][5] = 1.007619;
1307 Kij[1][7] = 0.997596;
1308 Kij[1][9] = 1.002529;
1309 Kij[1][10] = 0.982962;
1310 Kij[1][11] = 0.983565;
1311 Kij[1][12] = 0.982707;
1312 Kij[1][13] = 0.981849;
1313 Kij[1][14] = 0.980991;
1314 Kij[1][15] = 1.02326;
1315 Kij[1][19] = 1.00008;
1316 Kij[2][3] = 0.982361;
1317 Kij[2][4] = 1.00796;
1318 Kij[2][15] = 1.03227;
1319 Kij[2][19] = 0.942596;
1320 Kij[3][4] = 1.00851;
1321 Kij[3][10] = 0.910183;
1322 Kij[3][11] = 0.895362;
1323 Kij[3][12] = 0.881152;
1324 Kij[3][13] = 0.86752;
1325 Kij[3][14] = 0.854406;
1326 Kij[3][19] = 1.00779;
1327 Kij[4][5] = 0.986893;
1328 Kij[4][15] = 1.02034;
1329 Kij[4][19] = 0.999969;
1330 Kij[10][19] = 0.96813;
1331 Kij[11][19] = 0.96287;
1332 Kij[12][19] = 0.957828;
1333 Kij[13][19] = 0.952441;
1334 Kij[14][19] = 0.948338;
1335
1336 // Orientation parameters
1337 Gij[1][3] = 0.807653;
1338 Gij[1][15] = 1.95731;
1339 Gij[2][3] = 0.982746;
1340 Gij[3][4] = 0.370296;
1341 Gij[3][18] = 1.67309;
1342
1343 // Ideal gas parameters
1344 n0i[1][3] = 4.00088;
1345 n0i[1][4] = 0.76315;
1346 n0i[1][5] = 0.0046;
1347 n0i[1][6] = 8.74432;
1348 n0i[1][7] = -4.46921;
1349 n0i[1][1] = 29.83843397;
1350 n0i[1][2] = -15999.69151;
1351 n0i[2][3] = 3.50031;
1352 n0i[2][4] = 0.13732;
1353 n0i[2][5] = -0.1466;
1354 n0i[2][6] = 0.90066;
1355 n0i[2][7] = 0;
1356 n0i[2][1] = 17.56770785;
1357 n0i[2][2] = -2801.729072;
1358 n0i[3][3] = 3.50002;
1359 n0i[3][4] = 2.04452;
1360 n0i[3][5] = -1.06044;
1361 n0i[3][6] = 2.03366;
1362 n0i[3][7] = 0.01393;
1363 n0i[3][1] = 20.65844696;
1364 n0i[3][2] = -4902.171516;
1365 n0i[4][3] = 4.00263;
1366 n0i[4][4] = 4.33939;
1367 n0i[4][5] = 1.23722;
1368 n0i[4][6] = 13.1974;
1369 n0i[4][7] = -6.01989;
1370 n0i[4][1] = 36.73005938;
1371 n0i[4][2] = -23639.65301;
1372 n0i[5][3] = 4.02939;
1373 n0i[5][4] = 6.60569;
1374 n0i[5][5] = 3.197;
1375 n0i[5][6] = 19.1921;
1376 n0i[5][7] = -8.37267;
1377 n0i[5][1] = 44.70909619;
1378 n0i[5][2] = -31236.63551;
1379 n0i[6][3] = 4.06714;
1380 n0i[6][4] = 8.97575;
1381 n0i[6][5] = 5.25156;
1382 n0i[6][6] = 25.1423;
1383 n0i[6][7] = 16.1388;
1384 n0i[6][1] = 34.30180349;
1385 n0i[6][2] = -38525.50276;
1386 n0i[7][3] = 4.33944;
1387 n0i[7][4] = 9.44893;
1388 n0i[7][5] = 6.89406;
1389 n0i[7][6] = 24.4618;
1390 n0i[7][7] = 14.7824;
1391 n0i[7][1] = 36.53237783;
1392 n0i[7][2] = -38957.80933;
1393 n0i[8][3] = 4;
1394 n0i[8][4] = 11.7618;
1395 n0i[8][5] = 20.1101;
1396 n0i[8][6] = 33.1688;
1397 n0i[8][7] = 0;
1398 n0i[8][1] = 43.17218626;
1399 n0i[8][2] = -51198.30946;
1400 n0i[9][3] = 4;
1401 n0i[9][4] = 8.95043;
1402 n0i[9][5] = 21.836;
1403 n0i[9][6] = 33.4032;
1404 n0i[9][7] = 0;
1405 n0i[9][1] = 42.67837089;
1406 n0i[9][2] = -45215.83;
1407 n0i[10][3] = 4;
1408 n0i[10][4] = 11.6977;
1409 n0i[10][5] = 26.8142;
1410 n0i[10][6] = 38.6164;
1411 n0i[10][7] = 0;
1412 n0i[10][1] = 46.99717188;
1413 n0i[10][2] = -52746.83318;
1414 n0i[11][3] = 4;
1415 n0i[11][4] = 13.7266;
1416 n0i[11][5] = 30.4707;
1417 n0i[11][6] = 43.5561;
1418 n0i[11][7] = 0;
1419 n0i[11][1] = 52.07631631;
1420 n0i[11][2] = -57104.81056;
1421 n0i[12][3] = 4;
1422 n0i[12][4] = 15.6865;
1423 n0i[12][5] = 33.8029;
1424 n0i[12][6] = 48.1731;
1425 n0i[12][7] = 0;
1426 n0i[12][1] = 57.25830934;
1427 n0i[12][2] = -60546.76385;
1428 n0i[13][3] = 4;
1429 n0i[13][4] = 18.0241;
1430 n0i[13][5] = 38.1235;
1431 n0i[13][6] = 53.3415;
1432 n0i[13][7] = 0;
1433 n0i[13][1] = 62.09646901;
1434 n0i[13][2] = -66600.12837;
1435 n0i[14][3] = 4;
1436 n0i[14][4] = 21.0069;
1437 n0i[14][5] = 43.4931;
1438 n0i[14][6] = 58.3657;
1439 n0i[14][7] = 0;
1440 n0i[14][1] = 65.93909154;
1441 n0i[14][2] = -74131.45483;
1442 n0i[15][3] = 2.47906;
1443 n0i[15][4] = 0.95806;
1444 n0i[15][5] = 0.45444;
1445 n0i[15][6] = 1.56039;
1446 n0i[15][7] = -1.3756;
1447 n0i[15][1] = 13.07520288;
1448 n0i[15][2] = -5836.943696;
1449 n0i[16][3] = 3.50146;
1450 n0i[16][4] = 1.07558;
1451 n0i[16][5] = 1.01334;
1452 n0i[16][6] = 0;
1453 n0i[16][7] = 0;
1454 n0i[16][1] = 16.8017173;
1455 n0i[16][2] = -2318.32269;
1456 n0i[17][3] = 3.50055;
1457 n0i[17][4] = 1.02865;
1458 n0i[17][5] = 0.00493;
1459 n0i[17][6] = 0;
1460 n0i[17][7] = 0;
1461 n0i[17][1] = 17.45786899;
1462 n0i[17][2] = -2635.244116;
1463 n0i[18][3] = 4.00392;
1464 n0i[18][4] = 0.01059;
1465 n0i[18][5] = 0.98763;
1466 n0i[18][6] = 3.06904;
1467 n0i[18][7] = 0;
1468 n0i[18][1] = 21.57882705;
1469 n0i[18][2] = -7766.733078;
1470 n0i[19][3] = 4;
1471 n0i[19][4] = 3.11942;
1472 n0i[19][5] = 1.00243;
1473 n0i[19][6] = 0;
1474 n0i[19][7] = 0;
1475 n0i[19][1] = 21.5830944;
1476 n0i[19][2] = -6069.035869;
1477 n0i[20][3] = 2.5;
1478 n0i[20][4] = 0;
1479 n0i[20][5] = 0;
1480 n0i[20][6] = 0;
1481 n0i[20][7] = 0;
1482 n0i[20][1] = 10.04639507;
1483 n0i[20][2] = -745.375;
1484 n0i[21][3] = 2.5;
1485 n0i[21][4] = 0;
1486 n0i[21][5] = 0;
1487 n0i[21][6] = 0;
1488 n0i[21][7] = 0;
1489 n0i[21][1] = 10.04639507;
1490 n0i[21][2] = -745.375;
1491 th0i[1][4] = 820.659;
1492 th0i[1][5] = 178.41;
1493 th0i[1][6] = 1062.82;
1494 th0i[1][7] = 1090.53;
1495 th0i[2][4] = 662.738;
1496 th0i[2][5] = 680.562;
1497 th0i[2][6] = 1740.06;
1498 th0i[2][7] = 0;
1499 th0i[3][4] = 919.306;
1500 th0i[3][5] = 865.07;
1501 th0i[3][6] = 483.553;
1502 th0i[3][7] = 341.109;
1503 th0i[4][4] = 559.314;
1504 th0i[4][5] = 223.284;
1505 th0i[4][6] = 1031.38;
1506 th0i[4][7] = 1071.29;
1507 th0i[5][4] = 479.856;
1508 th0i[5][5] = 200.893;
1509 th0i[5][6] = 955.312;
1510 th0i[5][7] = 1027.29;
1511 th0i[6][4] = 438.27;
1512 th0i[6][5] = 198.018;
1513 th0i[6][6] = 1905.02;
1514 th0i[6][7] = 893.765;
1515 th0i[7][4] = 468.27;
1516 th0i[7][5] = 183.636;
1517 th0i[7][6] = 1914.1;
1518 th0i[7][7] = 903.185;
1519 th0i[8][4] = 292.503;
1520 th0i[8][5] = 910.237;
1521 th0i[8][6] = 1919.37;
1522 th0i[8][7] = 0;
1523 th0i[9][4] = 178.67;
1524 th0i[9][5] = 840.538;
1525 th0i[9][6] = 1774.25;
1526 th0i[9][7] = 0;
1527 th0i[10][4] = 182.326;
1528 th0i[10][5] = 859.207;
1529 th0i[10][6] = 1826.59;
1530 th0i[10][7] = 0;
1531 th0i[11][4] = 169.789;
1532 th0i[11][5] = 836.195;
1533 th0i[11][6] = 1760.46;
1534 th0i[11][7] = 0;
1535 th0i[12][4] = 158.922;
1536 th0i[12][5] = 815.064;
1537 th0i[12][6] = 1693.07;
1538 th0i[12][7] = 0;
1539 th0i[13][4] = 156.854;
1540 th0i[13][5] = 814.882;
1541 th0i[13][6] = 1693.79;
1542 th0i[13][7] = 0;
1543 th0i[14][4] = 164.947;
1544 th0i[14][5] = 836.264;
1545 th0i[14][6] = 1750.24;
1546 th0i[14][7] = 0;
1547 th0i[15][4] = 228.734;
1548 th0i[15][5] = 326.843;
1549 th0i[15][6] = 1651.71;
1550 th0i[15][7] = 1671.69;
1551 th0i[16][4] = 2235.71;
1552 th0i[16][5] = 1116.69;
1553 th0i[16][6] = 0;
1554 th0i[16][7] = 0;
1555 th0i[17][4] = 1550.45;
1556 th0i[17][5] = 704.525;
1557 th0i[17][6] = 0;
1558 th0i[17][7] = 0;
1559 th0i[18][4] = 268.795;
1560 th0i[18][5] = 1141.41;
1561 th0i[18][6] = 2507.37;
1562 th0i[18][7] = 0;
1563 th0i[19][4] = 1833.63;
1564 th0i[19][5] = 847.181;
1565 th0i[19][6] = 0;
1566 th0i[19][7] = 0;
1567 th0i[20][4] = 0;
1568 th0i[20][5] = 0;
1569 th0i[20][6] = 0;
1570 th0i[20][7] = 0;
1571 th0i[21][4] = 0;
1572 th0i[21][5] = 0;
1573 th0i[21][6] = 0;
1574 th0i[21][7] = 0;
1575
1576 // Precalculations of constants
1577 for (int i = 1; i <= MaxFlds; ++i)
1578 {
1579 Ki25[i] = pow(Ki[i], 2.5);
1580 Ei25[i] = pow(Ei[i], 2.5);
1581 }
1582 for (int i = 1; i <= MaxFlds; ++i)
1583 {
1584 for (int j = i; j <= MaxFlds; ++j)
1585 {
1586 for (int n = 1; n <= 18; ++n)
1587 {
1588 Bsnij = 1;
1589 if (gn[n] == 1)
1590 {
1591 Bsnij = Gij[i][j] * (Gi[i] + Gi[j]) / 2;
1592 }
1593 if (qn[n] == 1)
1594 {
1595 Bsnij = Bsnij * Qi[i] * Qi[j];
1596 }
1597 if (fn[n] == 1)
1598 {
1599 Bsnij = Bsnij * Fi[i] * Fi[j];
1600 }
1601 if (sn[n] == 1)
1602 {
1603 Bsnij = Bsnij * Si[i] * Si[j];
1604 }
1605 if (wn[n] == 1)
1606 {
1607 Bsnij = Bsnij * Wi[i] * Wi[j];
1608 }
1609 Bsnij2[i][j][n] = an[n] * pow(Eij[i][j] * sqrt(Ei[i] * Ei[j]), un[n]) * pow(Ki[i] * Ki[j], 1.5) * Bsnij;
1610 }
1611 Kij5[i][j] = (pow(Kij[i][j], 5) - 1) * Ki25[i] * Ki25[j];
1612 Uij5[i][j] = (pow(Uij[i][j], 5) - 1) * Ei25[i] * Ei25[j];
1613 Gij5[i][j] = (Gij[i][j] - 1) * (Gi[i] + Gi[j]) / 2;
1614 }
1615 }
1616 // Ideal gas terms
1617 d0 = 101.325 / RDetail / 298.15;
1618 for (int i = 1; i <= MaxFlds; ++i)
1619 {
1620 n0i[i][3] = n0i[i][3] - 1;
1621 n0i[i][1] = n0i[i][1] - log(d0);
1622 }
1623 return;
1624
1625 // Code to produce nearly exact values for n0[1] and n0[2]
1626 // This is not called in the current code, but included below to show how the values were calculated. The return above can be removed to call this code.
1627 // T0 = 298.15;
1628 // d0 = 101.325 / RDetail / T0;
1629 // for (int i=1; i <= MaxFlds; ++i){
1630 // n1 = 0; n2 = 0;
1631 // if (th0i[i][4] > 0) {n2 = n2 - n0i[i][4] * th0i[i][4] / tanh(th0i[i][4] / T0); n1 = n1 - n0i[i][4] * log(sinh(th0i[i][4] / T0));}
1632 // if (th0i[i][5] > 0) {n2 = n2 + n0i[i][5] * th0i[i][5] * tanh(th0i[i][5] / T0); n1 = n1 + n0i[i][5] * log(cosh(th0i[i][5] / T0));}
1633 // if (th0i[i][6] > 0) {n2 = n2 - n0i[i][6] * th0i[i][6] / tanh(th0i[i][6] / T0); n1 = n1 - n0i[i][6] * log(sinh(th0i[i][6] / T0));}
1634 // if (th0i[i][7] > 0) {n2 = n2 + n0i[i][7] * th0i[i][7] * tanh(th0i[i][7] / T0); n1 = n1 + n0i[i][7] * log(cosh(th0i[i][7] / T0));}
1635 // n0i[i][2] = n2 - n0i[i][3] * T0;
1636 // n0i[i][3] = n0i[i][3] - 1;
1637 // n0i[i][1] = n1 - n2 / T0 + n0i[i][3] * (1 + log(T0)) - log(d0);
1638 // }
1639}
static double Qi[MaxFlds+1]
Definition Detail.cpp:134
static double Ki25[MaxFlds+1]
Definition Detail.cpp:135
static double an[NTerms+1]
Definition Detail.cpp:131
static const int MaxFlds
Definition Detail.cpp:128
static double Uij5[MaxFlds+1][MaxFlds+1]
Definition Detail.cpp:136
static int qn[NTerms+1]
Definition Detail.cpp:130
static double Bsnij2[MaxFlds+1][MaxFlds+1][18+1]
Definition Detail.cpp:133
static double Gi[MaxFlds+1]
Definition Detail.cpp:134
static double Kij5[MaxFlds+1][MaxFlds+1]
Definition Detail.cpp:136
static double Ei25[MaxFlds+1]
Definition Detail.cpp:135
static int fn[NTerms+1]
Definition Detail.cpp:130
static double xold[MaxFlds+1]
Definition Detail.cpp:139
static double Fi[MaxFlds+1]
Definition Detail.cpp:134
static double Gij5[MaxFlds+1][MaxFlds+1]
Definition Detail.cpp:136
static int gn[NTerms+1]
Definition Detail.cpp:130

References an, bn, Bsnij2, Ei25, Fi, fn, Gi, Gij5, gn, Ki25, Kij5, kn, MaxFlds, MMiDetail, n0i, NTerms, Qi, qn, RDetail, th0i, Told, Uij5, un, and xold.

Referenced by EMSCRIPTEN_BINDINGS().

◆ sq()

double sq ( double x)
inline

Definition at line 142 of file Detail.cpp.

142{ return x * x; }

Referenced by Alpha0Detail(), PropertiesDetail(), and xTermsDetail().

◆ xTermsDetail()

static void xTermsDetail ( const std::vector< double > & x)
static

Definition at line 430 of file Detail.cpp.

431{
432 // Calculate terms dependent only on composition
433 //
434 // Inputs:
435 // x() - Composition (mole fraction)
436
437 double G, Q, F, U, Q2, xij, xi2;
438 int icheck;
439
440 // Check to see if a component fraction has changed. If x is the same as the previous call, then exit.
441 icheck = 0;
442 for (std::size_t i = 1; i <= NcDetail; ++i)
443 {
444 if (std::abs(x[i] - xold[i]) > 0.0000001)
445 {
446 icheck = 1;
447 }
448 xold[i] = x[i];
449 }
450 if (icheck == 0)
451 {
452 return;
453 }
454
455 K3 = 0;
456 U = 0;
457 G = 0;
458 Q = 0;
459 F = 0;
460 for (int n = 1; n <= 18; ++n)
461 {
462 Bs[n] = 0;
463 }
464
465 // Calculate pure fluid contributions
466 for (std::size_t i = 1; i <= NcDetail; ++i)
467 {
468 if (x[i] > 0)
469 {
470 xi2 = sq(x[i]);
471 K3 += x[i] * Ki25[i]; // K, U, and G are the sums of a pure fluid contribution and a
472 U += x[i] * Ei25[i]; // binary pair contribution
473 G += x[i] * Gi[i];
474 Q += x[i] * Qi[i]; // Q and F depend only on the pure fluid parts
475 F += xi2 * Fi[i];
476 for (int n = 1; n <= 18; ++n)
477 {
478 Bs[n] = Bs[n] + xi2 * Bsnij2[i][i][n]; // Pure fluid contributions to second virial coefficient
479 }
480 }
481 }
482 K3 = sq(K3);
483 U = sq(U);
484
485 // Binary pair contributions
486 for (std::size_t i = 1; i <= NcDetail - 1; ++i)
487 {
488 if (x[i] > 0)
489 {
490 for (std::size_t j = i + 1; j <= NcDetail; ++j)
491 {
492 if (x[j] > 0)
493 {
494 xij = 2 * x[i] * x[j];
495 K3 = K3 + xij * Kij5[i][j];
496 U = U + xij * Uij5[i][j];
497 G = G + xij * Gij5[i][j];
498 for (int n = 1; n <= 18; ++n)
499 {
500 Bs[n] = Bs[n] + xij * Bsnij2[i][j][n]; // Second virial coefficients of mixture
501 }
502 }
503 }
504 }
505 }
506 K3 = pow(K3, 0.6);
507 U = pow(U, 0.2);
508
509 // Third virial and higher coefficients
510 Q2 = sq(Q);
511 for (int n = 13; n <= 58; ++n)
512 {
513 Csn[n] = an[n] * pow(U, un[n]);
514 if (gn[n] == 1)
515 {
516 Csn[n] = Csn[n] * G;
517 }
518 if (qn[n] == 1)
519 {
520 Csn[n] = Csn[n] * Q2;
521 }
522 if (fn[n] == 1)
523 {
524 Csn[n] = Csn[n] * F;
525 }
526 }
527}

References an, Bs, Bsnij2, Csn, Ei25, Fi, fn, Gi, Gij5, gn, K3, Ki25, Kij5, NcDetail, Qi, qn, sq(), Uij5, un, and xold.

Referenced by PressureDetail(), and PropertiesDetail().

Variable Documentation

◆ an

double an[NTerms+1]
static

Definition at line 131 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ bn

int bn[NTerms+1]
static

Definition at line 132 of file Detail.cpp.

Referenced by AlpharDetail(), and SetupDetail().

◆ Bs

double Bs[18+1]
static

Definition at line 133 of file Detail.cpp.

Referenced by AlpharDetail(), and xTermsDetail().

◆ Bsnij2

double Bsnij2[MaxFlds+1][MaxFlds+1][18+1]
static

Definition at line 133 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ Csn

double Csn[NTerms+1]
static

Definition at line 133 of file Detail.cpp.

Referenced by AlpharDetail(), and xTermsDetail().

◆ dPdDsave

double dPdDsave
static

◆ Ei25

double Ei25[MaxFlds+1]
static

Definition at line 135 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ epsilon

◆ Fi

double Fi[MaxFlds+1]
static

Definition at line 134 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ fn

int fn[NTerms+1]
static

Definition at line 130 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ Gi

double Gi[MaxFlds+1]
static

Definition at line 134 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ Gij5

double Gij5[MaxFlds+1][MaxFlds+1]
static

Definition at line 136 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ gn

int gn[NTerms+1]
static

Definition at line 130 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ K3

double K3
static

Definition at line 139 of file Detail.cpp.

Referenced by AlpharDetail(), and xTermsDetail().

◆ Ki25

double Ki25[MaxFlds+1]
static

Definition at line 135 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ Kij5

double Kij5[MaxFlds+1][MaxFlds+1]
static

Definition at line 136 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ kn

int kn[NTerms+1]
static

Definition at line 132 of file Detail.cpp.

Referenced by AlpharDetail(), and SetupDetail().

◆ MaxFlds

const int MaxFlds = 21
static

Definition at line 128 of file Detail.cpp.

Referenced by SetupDetail(), and SetupGERG().

◆ MMiDetail

double MMiDetail[MaxFlds+1]
static

Definition at line 139 of file Detail.cpp.

Referenced by MolarMassDetail(), and SetupDetail().

◆ n0i

double n0i[MaxFlds+1][7+1]
static

Definition at line 138 of file Detail.cpp.

Referenced by Alpha0Detail(), Alpha0GERG(), SetupDetail(), and SetupGERG().

◆ NcDetail

const int NcDetail = 21
static

Definition at line 128 of file Detail.cpp.

Referenced by Alpha0Detail(), MolarMassDetail(), and xTermsDetail().

◆ NTerms

const int NTerms = 58
static

Definition at line 128 of file Detail.cpp.

Referenced by AlpharDetail(), and SetupDetail().

◆ Qi

double Qi[MaxFlds+1]
static

Definition at line 134 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ qn

int qn[NTerms+1]
static

Definition at line 130 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ RDetail

double RDetail
static

◆ th0i

double th0i[MaxFlds+1][7+1]
static

Definition at line 138 of file Detail.cpp.

Referenced by Alpha0Detail(), Alpha0GERG(), SetupDetail(), and SetupGERG().

◆ Told

double Told
static

Definition at line 137 of file Detail.cpp.

Referenced by AlpharDetail(), AlpharGERG(), ReducingParametersGERG(), SetupDetail(), and SetupGERG().

◆ Tun

double Tun[NTerms+1]
static

Definition at line 137 of file Detail.cpp.

Referenced by AlpharDetail().

◆ Uij5

double Uij5[MaxFlds+1][MaxFlds+1]
static

Definition at line 136 of file Detail.cpp.

Referenced by SetupDetail(), and xTermsDetail().

◆ un

double un[NTerms+1]
static

Definition at line 131 of file Detail.cpp.

Referenced by AlpharDetail(), SetupDetail(), and xTermsDetail().

◆ xold

double xold[MaxFlds+1]
static

Definition at line 139 of file Detail.cpp.

Referenced by ReducingParametersGERG(), SetupDetail(), SetupGERG(), and xTermsDetail().