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
2b8daac7
Commit
2b8daac7
authored
3 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Add B12
parent
98580c31
No related branches found
Branches containing commit
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
+11
-0
11 additions, 0 deletions
include/teqp/derivs.hpp
src/tests/catch_tests.cxx
+7
-0
7 additions, 0 deletions
src/tests/catch_tests.cxx
with
18 additions
and
0 deletions
include/teqp/derivs.hpp
+
11
−
0
View file @
2b8daac7
...
...
@@ -179,6 +179,17 @@ auto get_Bnvir(const Model& model, const TType T, const ContainerType& molefrac)
return
o
;
}
template
<
typename
Model
,
typename
TType
,
typename
ContainerType
>
typename
ContainerType
::
value_type
get_B12vir
(
const
Model
&
model
,
const
TType
T
,
const
ContainerType
&
molefrac
)
{
auto
B2
=
get_B2vir
(
model
,
T
,
molefrac
);
// Overall B2 for mixture
auto
B20
=
get_B2vir
(
model
,
T
,
std
::
valarray
<
double
>
({
1
,
0
}));
// Pure first component with index 0
auto
B21
=
get_B2vir
(
model
,
T
,
std
::
valarray
<
double
>
({
0
,
1
}));
// Pure second component with index 1
auto
z0
=
molefrac
[
0
];
auto
B12
=
(
B2
-
z0
*
z0
*
B20
-
(
1
-
z0
)
*
(
1
-
z0
)
*
B21
)
/
(
2
*
z0
*
(
1
-
z0
));
return
B12
;
}
/***
* \brief Calculate the residual entropy (s^+ = -sr/R) from derivatives of alphar
*/
...
...
This diff is collapsed.
Click to expand it.
src/tests/catch_tests.cxx
+
7
−
0
View file @
2b8daac7
...
...
@@ -145,4 +145,11 @@ TEST_CASE("Trace critical locus for vdW", "[vdW][crit]")
std
::
string
filename
=
""
;
trace_critical_arclength_binary
(
vdW
,
T0
,
rhovec0
,
filename
);
auto
tic1
=
std
::
chrono
::
steady_clock
::
now
();
}
TEST_CASE
(
"TEST B12"
,
""
)
{
const
auto
model
=
build_vdW
();
const
double
T
=
298.15
;
const
std
::
valarray
<
double
>
molefrac
=
{
1
/
3
,
2
/
3
};
auto
B12
=
get_B12vir
(
model
,
T
,
molefrac
);
}
\ No newline at end of file
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