Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
teqp_fork_old
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sven Michael Pohl
teqp_fork_old
Commits
511a4ad9
Commit
511a4ad9
authored
1 year ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Update some correlation integrals
Add some forceeval and type double where possible
parent
e7602c4a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/teqp/models/saft/correlation_integrals.hpp
+15
-14
15 additions, 14 deletions
include/teqp/models/saft/correlation_integrals.hpp
with
15 additions
and
14 deletions
include/teqp/models/saft/correlation_integrals.hpp
+
15
−
14
View file @
511a4ad9
...
...
@@ -38,14 +38,15 @@ public:
template
<
typename
TType
,
typename
RhoType
>
auto
get_J
(
const
TType
&
Tstar
,
const
RhoType
&
rhostar
)
const
{
auto
Z_1
=
0.3
+
0.05
*
n
;
auto
Z_2
=
1.0
/
n
;
auto
A_0
=
a00
+
a10
*
rhostar
+
a20
*
rhostar
*
rhostar
+
a30
*
rhostar
*
rhostar
*
rhostar
;
auto
A_1
=
a01
+
a11
*
rhostar
+
a21
*
rhostar
*
rhostar
+
a31
*
rhostar
*
rhostar
*
rhostar
;
auto
A_2
=
a02
+
a12
*
rhostar
+
a22
*
rhostar
*
rhostar
+
a32
*
rhostar
*
rhostar
*
rhostar
;
double
Z_1
=
0.3
+
0.05
*
n
;
double
Z_2
=
1.0
/
n
;
auto
A_0
=
forceeval
(
a00
+
a10
*
rhostar
+
a20
*
rhostar
*
rhostar
+
a30
*
rhostar
*
rhostar
*
rhostar
)
;
auto
A_1
=
forceeval
(
a01
+
a11
*
rhostar
+
a21
*
rhostar
*
rhostar
+
a31
*
rhostar
*
rhostar
*
rhostar
)
;
auto
A_2
=
forceeval
(
a02
+
a12
*
rhostar
+
a22
*
rhostar
*
rhostar
+
a32
*
rhostar
*
rhostar
*
rhostar
)
;
// |x| = sqrt(x^2), the latter is well-suited to differentiation
auto
differentiable_abs
=
[](
const
auto
&
x
){
return
sqrt
(
x
*
x
);
};
std
::
common_type_t
<
TType
,
RhoType
>
out
=
(
A_0
+
A_1
*
pow
(
Tstar
,
Z_1
)
+
A_2
*
pow
(
Tstar
,
Z_2
))
*
exp
(
1.0
/
(
Tstar
+
4.0
/
pow
(
differentiable_abs
(
log
(
rhostar
/
sqrt
(
2.0
))),
3.0
)));
auto
differentiable_abs
=
[](
const
auto
&
x
){
return
forceeval
(
sqrt
(
x
*
x
));
};
// return forceeval(A_2*differentiable_abs(Tstar));
std
::
common_type_t
<
TType
,
RhoType
>
out
=
(
A_0
+
A_1
*
pow
(
Tstar
,
Z_1
)
+
A_2
*
pow
(
Tstar
,
Z_2
))
*
exp
(
1.0
/
(
Tstar
+
4.0
/
pow
(
differentiable_abs
(
log
(
forceeval
(
rhostar
/
sqrt
(
2.0
)))),
3.0
)));
return
out
;
}
};
...
...
@@ -73,13 +74,13 @@ public:
template
<
typename
TType
,
typename
RhoType
>
auto
get_K
(
const
TType
&
Tstar
,
const
RhoType
&
rhostar
)
const
{
auto
Z_1
=
2.0
;
auto
Z_2
=
3.0
;
auto
Z_3
=
4.0
;
auto
b_0
=
a00
+
a10
*
rhostar
+
a20
*
rhostar
*
rhostar
+
a30
*
rhostar
*
rhostar
*
rhostar
;
auto
b_1
=
a01
+
a11
*
rhostar
+
a21
*
rhostar
*
rhostar
+
a31
*
rhostar
*
rhostar
*
rhostar
;
auto
b_2
=
a02
+
a12
*
rhostar
+
a22
*
rhostar
*
rhostar
+
a32
*
rhostar
*
rhostar
*
rhostar
;
auto
b_3
=
a03
+
a13
*
rhostar
+
a23
*
rhostar
*
rhostar
+
a33
*
rhostar
*
rhostar
*
rhostar
;
double
Z_1
=
2.0
;
double
Z_2
=
3.0
;
double
Z_3
=
4.0
;
auto
b_0
=
forceeval
(
a00
+
a10
*
rhostar
+
a20
*
rhostar
*
rhostar
+
a30
*
rhostar
*
rhostar
*
rhostar
)
;
auto
b_1
=
forceeval
(
a01
+
a11
*
rhostar
+
a21
*
rhostar
*
rhostar
+
a31
*
rhostar
*
rhostar
*
rhostar
)
;
auto
b_2
=
forceeval
(
a02
+
a12
*
rhostar
+
a22
*
rhostar
*
rhostar
+
a32
*
rhostar
*
rhostar
*
rhostar
)
;
auto
b_3
=
forceeval
(
a03
+
a13
*
rhostar
+
a23
*
rhostar
*
rhostar
+
a33
*
rhostar
*
rhostar
*
rhostar
)
;
std
::
common_type_t
<
TType
,
RhoType
>
out
=
b_0
+
b_1
*
Tstar
+
b_2
*
pow
(
exp
(
pow
(
1.0
-
rhostar
/
sqrt
(
2.0
),
Z_3
)),
Z_1
)
+
b_3
*
pow
(
exp
(
pow
(
1.0
-
rhostar
/
sqrt
(
2.0
),
Z_3
)),
Z_2
);
return
out
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment