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
5d02964f
Commit
5d02964f
authored
3 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Update the tests to actually call alphar for pures
parent
94565dac
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_test_multifluid.cxx
+10
-1
10 additions, 1 deletion
src/tests/catch_test_multifluid.cxx
with
10 additions
and
1 deletion
src/tests/catch_test_multifluid.cxx
+
10
−
1
View file @
5d02964f
...
...
@@ -8,12 +8,13 @@
TEST_CASE
(
"Confirm failure for missing files"
,
"[multifluid]"
)
{
CHECK_THROWS
(
build_multifluid_model
({
"BADFLUID"
},
"IMPOSSIBLE PATH"
,
"IMPOSSIBLE PATH.json"
));
CHECK_THROWS
(
build_multifluid_model
({
"BADFLUID"
},
"IMPOSSIBLE PATH"
,
"../mycp/dev/mixtures/mixture_binary_pairs.json"
));
CHECK_THROWS
(
build_multifluid_model
({
"Ethane"
},
"IMPOSSIBLE PATH"
));
}
TEST_CASE
(
"Trace critical locus for nitrogen + ethane"
,
"[crit],[multifluid]"
)
{
std
::
string
root
=
"../mycp"
;
const
auto
model
=
build_multifluid_model
({
"Nitrogen"
,
"Ethane"
},
root
,
root
+
"/dev/mixtures/mixture_binary_pairs.json"
);
const
auto
model
=
build_multifluid_model
({
"Nitrogen"
,
"Ethane"
},
root
);
for
(
auto
ifluid
=
0
;
ifluid
<
2
;
++
ifluid
)
{
double
T0
=
model
.
redfunc
.
Tc
[
ifluid
];
...
...
@@ -45,18 +46,25 @@ TEST_CASE("Trace critical locus for nitrogen + ethane", "[crit],[multifluid]")
TEST_CASE
(
"Check that all pure fluid models can be instantiated"
,
"[multifluid],[all]"
){
std
::
string
root
=
"../mycp"
;
SECTION
(
"With absolute paths to json file"
)
{
int
counter
=
0
;
for
(
auto
path
:
get_files_in_folder
(
root
+
"/dev/fluids"
,
".json"
))
{
if
(
path
.
filename
().
stem
()
==
"Methanol"
)
{
continue
;
}
CAPTURE
(
path
.
string
());
auto
abspath
=
std
::
filesystem
::
absolute
(
path
).
string
();
auto
model
=
build_multifluid_model
({
abspath
},
root
,
root
+
"/dev/mixtures/mixture_binary_pairs.json"
);
std
::
valarray
<
double
>
z
(
0.0
,
1
);
model
.
alphar
(
300
,
1.0
,
z
);
counter
+=
1
;
}
CHECK
(
counter
>
100
);
}
SECTION
(
"With filename stems"
)
{
for
(
auto
path
:
get_files_in_folder
(
root
+
"/dev/fluids"
,
".json"
))
{
auto
stem
=
path
.
filename
().
stem
().
string
();
// filename without the .json
if
(
stem
==
"Methanol"
)
{
continue
;
}
auto
model
=
build_multifluid_model
({
stem
},
root
,
root
+
"/dev/mixtures/mixture_binary_pairs.json"
);
std
::
valarray
<
double
>
z
(
0.0
,
1
);
model
.
alphar
(
300
,
1.0
,
z
);
}
}
}
...
...
@@ -70,5 +78,6 @@ TEST_CASE("Check that mixtures can also do absolute paths", "[multifluid],[abspa
abspaths
.
emplace_back
(
std
::
filesystem
::
absolute
(
p
).
string
());
}
auto
model
=
build_multifluid_model
(
abspaths
,
root
,
root
+
"/dev/mixtures/mixture_binary_pairs.json"
);
auto
model2
=
build_multifluid_model
(
abspaths
,
root
);
// default path for BIP
}
}
\ 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