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
f19db45e
Commit
f19db45e
authored
3 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Maybe fix catch testing?
parent
1b880241
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/tests/catch_tests.cxx
+40
-0
40 additions, 0 deletions
src/tests/catch_tests.cxx
with
40 additions
and
0 deletions
src/tests/catch_tests.cxx
+
40
−
0
View file @
f19db45e
...
...
@@ -5,7 +5,10 @@
#include
"teqp/models/pcsaft.hpp"
#include
"teqp/models/cubicsuperancillary.hpp"
#include
"teqp/models/CPA.hpp"
#include
"teqp/models/eos.hpp"
#include
"teqp/algorithms/VLE.hpp"
#include
"teqp/algorithms/critical_tracing.hpp"
auto
build_vdW_argon
()
{
double
Omega_b
=
1.0
/
8
,
Omega_a
=
27.0
/
64
;
...
...
@@ -185,6 +188,34 @@ TEST_CASE("Check 0n derivatives", "[virial][p]")
}
TEST_CASE
(
"Test infinite dilution critical locus derivatives"
,
"[vdWcrit]"
)
{
// Argon + Xenon
std
::
valarray
<
double
>
Tc_K
=
{
150.687
,
289.733
};
std
::
valarray
<
double
>
pc_Pa
=
{
4863000.0
,
5842000.0
};
std
::
valarray
<
double
>
molefrac
=
{
1.0
};
vdWEOS
<
double
>
vdW
(
Tc_K
,
pc_Pa
);
auto
Zc
=
3.0
/
8.0
;
using
ct
=
CriticalTracing
<
decltype
(
vdW
),
double
,
Eigen
::
ArrayXd
>
;
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
auto
rhoc0
=
pc_Pa
[
i
]
/
(
vdW
.
R
(
molefrac
)
*
Tc_K
[
i
])
/
Zc
;
double
T0
=
Tc_K
[
i
];
Eigen
::
ArrayXd
rhovec0
(
2
);
rhovec0
.
setZero
();
rhovec0
[
i
]
=
rhoc0
;
// Values for infinite dilution
auto
infdil
=
ct
::
get_drhovec_dT_crit
(
vdW
,
T0
,
rhovec0
);
auto
epinfdil
=
ct
::
eigen_problem
(
vdW
,
T0
,
rhovec0
);
// Just slightly not infinite dilution, values should be very similar
Eigen
::
ArrayXd
rhovec0almost
=
rhovec0
;
rhovec0almost
[
1
-
i
]
=
1e-6
;
auto
dil
=
ct
::
get_drhovec_dT_crit
(
vdW
,
T0
,
rhovec0almost
);
auto
epdil
=
ct
::
eigen_problem
(
vdW
,
T0
,
rhovec0almost
);
int
rr
=
0
;
}
}
TEST_CASE
(
"Trace critical locus for vdW"
,
"[vdW][crit]"
)
{
// Argon + Xenon
...
...
@@ -358,4 +389,13 @@ TEST_CASE("Test water w/ factory", "") {
CAPTURE
(
p_withassoc
);
REQUIRE
(
p_withassoc
==
3.14
);
}
TEST_CASE
(
"Check zero(ish)"
,
""
)
{
double
zero
=
0.0
;
REQUIRE
(
zero
==
0.0
);
autodiff
::
dual2nd
zeroad
(
0.0
);
REQUIRE
(
zeroad
==
0.0
);
//mcx::MultiComplex zeromcx = 0.0;
//REQUIRE(zeromcx == 0.0);
}
\ 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