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
bbcb2b15
Commit
bbcb2b15
authored
4 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Add method for residual entropy
parent
de82f8ca
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/teqp/derivs.hpp
+10
-1
10 additions, 1 deletion
include/teqp/derivs.hpp
src/main.cpp
+1
-0
1 addition, 0 deletions
src/main.cpp
with
11 additions
and
1 deletion
include/teqp/derivs.hpp
+
10
−
1
View file @
bbcb2b15
...
...
@@ -38,7 +38,7 @@ get_Psir(const Model& model, const TType T, const ContainerType& rhovec) {
}
/**
// Calculate the residual pressure from derivatives of alphar
//
/
Calculate the residual pressure from derivatives of alphar
*/
template
<
typename
Model
,
typename
TType
,
typename
ContainerType
>
typename
std
::
enable_if
<
is_container
<
ContainerType
>::
value
,
typename
ContainerType
::
value_type
>::
type
...
...
@@ -52,6 +52,15 @@ get_pr(const Model& model, const TType T, const ContainerType& rhovec) {
return
pr
*
rhotot_
*
model
.
R
*
T
;
}
/**
/// Calculate the residual entropy (s^+=-sr/R) from derivatives of alphar
*/
template
<
typename
Model
,
typename
TType
,
typename
ContainerType
>
typename
std
::
enable_if
<
is_container
<
ContainerType
>::
value
,
typename
ContainerType
::
value_type
>::
type
get_splus
(
const
Model
&
model
,
const
TType
T
,
const
ContainerType
&
rhovec
)
{
return
model
.
alphar
(
T
,
rhovec
)
+
T
*
derivT
([
&
model
](
const
auto
&
T
,
const
auto
&
rhovec
)
{
return
model
.
alphar
(
T
,
rhovec
);
},
T
,
rhovec
);
}
template
<
typename
Model
,
typename
TType
,
typename
RhoType
>
auto
build_Psir_Hessian
(
const
Model
&
model
,
const
TType
T
,
const
RhoType
&
rho
)
{
// Double derivatives in each component's concentration
...
...
This diff is collapsed.
Click to expand it.
src/main.cpp
+
1
−
0
View file @
bbcb2b15
...
...
@@ -60,6 +60,7 @@ void test_vdwMix() {
auto
dPsirdrho0
=
rhovec
[
0
]
*
derivrhoi
(
fPsir
,
T
,
rhovec
,
0
);
auto
dPsirdrho1
=
rhovec
[
1
]
*
derivrhoi
(
fPsir
,
T
,
rhovec
,
1
);
auto
pfromderiv
=
rho
*
R
*
T
-
Psir
+
dPsirdrho0
+
dPsirdrho1
;
auto
sr
=
get_splus
(
vdW
,
T
,
rhovec
);
auto
t2
=
std
::
chrono
::
steady_clock
::
now
();
auto
pfromderiv3
=
rhotot
*
R
*
T
+
get_pr
(
vdW
,
T
,
rhovec
);
...
...
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