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
8a75c240
Commit
8a75c240
authored
3 years ago
by
Ian Bell
Browse files
Options
Downloads
Patches
Plain Diff
Test the pure fluid multiparameter models
parent
0665e076
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
notebooks/test_pure_multifluid.py
+41
-0
41 additions, 0 deletions
notebooks/test_pure_multifluid.py
with
41 additions
and
0 deletions
notebooks/test_pure_multfluid.py
→
notebooks/test_pure_mult
i
fluid.py
+
41
−
0
View file @
8a75c240
import
glob
,
os
import
glob
,
os
,
json
import
numpy
as
np
import
CoolProp.CoolProp
as
CP
CP
.
set_config_string
(
CP
.
ALTERNATIVE_REFPROP_PATH
,
r
'
C:\Users\ihb\Code\REFPROP-cmake\bld\Release
'
)
import
teqp
for
jname
in
glob
.
glob
(
'
../mycp/dev/fluids/*.json
'
):
root
=
teqp
.
get_datapath
()
for
jname
in
glob
.
glob
(
root
+
'
/dev/fluids/*.json
'
):
name
=
os
.
path
.
split
(
jname
)[
1
].
split
(
'
.
'
)[
0
]
try
:
model
=
teqp
.
build_multifluid_model
([
name
],
'
../mycp
'
,
'
../mycp
/dev/mixtures/mixture_binary_pairs.json
'
,{
'
estimate
'
:
'
linear
'
})
model
=
teqp
.
build_multifluid_model
([
name
],
root
,
root
+
'
/dev/mixtures/mixture_binary_pairs.json
'
,{
'
estimate
'
:
'
linear
'
})
Tc
=
model
.
get_Tcvec
()[
0
]
rhoc
=
1
/
model
.
get_vcvec
()[
0
]
z
=
np
.
array
([
1.0
])
# print(Tc, rhoc)
diff
=
model
.
get_Ar00
(
Tc
+
10
,
rhoc
,
z
)
-
CP
.
PropsSI
(
'
alphar
'
,
'
T
'
,
Tc
+
10
,
'
Dmolar
'
,
rhoc
,
name
)
if
abs
(
diff
)
>
1e-13
:
print
(
name
,
diff
,
rhoc
,
Tc
+
10
,
model
.
get_Ar00
(
Tc
+
10
,
rhoc
,
z
),
CP
.
PropsSI
(
'
alphar
'
,
'
T
'
,
Tc
+
10
,
'
Dmolar
'
,
rhoc
,
name
))
def
get_REFPROP_name
(
name
):
j
=
json
.
load
(
open
(
root
+
f
'
/dev/fluids/
{
name
}
.json
'
))
return
j
[
'
INFO
'
][
'
REFPROP_NAME
'
]
RPname
=
get_REFPROP_name
(
name
)
TcRP
,
rhocRP
=
[
CP
.
PropsSI
(
'
REFPROP::
'
+
RPname
,
k
)
for
k
in
[
'
Tcrit
'
,
'
rhomolar_critical
'
]]
# If EOS is the same according to the DOI:
if
abs
(
TcRP
-
Tc
)
>
1e-10
:
print
(
name
,
TcRP
,
Tc
,
'
!!!!!!!! TC(RP,teqp) !!!!!!
'
)
if
abs
(
rhocRP
-
rhoc
)
>
1e-10
:
print
(
name
,
rhocRP
,
rhoc
,
'
!!!!!!!! RHOC(RP,teqp) !!!!!!
'
)
continue
if
RPname
!=
'
N/A
'
:
diffRP
=
model
.
get_Ar00
(
Tc
+
10
,
rhoc
,
z
)
-
CP
.
PropsSI
(
'
alphar
'
,
'
T
'
,
Tc
+
10
,
'
Dmolar
'
,
rhoc
,
'
REFPROP::
'
+
RPname
)
if
abs
(
diffRP
)
>
1e-5
:
print
(
TcRP
,
Tc
)
print
(
rhocRP
,
rhoc
)
print
(
name
,
diffRP
,
rhoc
,
Tc
+
10
,
model
.
get_Ar00
(
Tc
+
10
,
rhoc
,
z
),
CP
.
PropsSI
(
'
alphar
'
,
'
T
'
,
Tc
+
10
,
'
Dmolar
'
,
rhoc
,
'
REFPROP::
'
+
RPname
))
except
BaseException
as
BE
:
print
(
name
,
BE
)
\ 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