Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
NTRfC
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
Container 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
TFD - Institut für Turbomaschinen und Fluid-Dynamik
tools
NTRfC
Commits
5d356d98
Commit
5d356d98
authored
2 years ago
by
Malte Nyhuis
Browse files
Options
Downloads
Patches
Plain Diff
final gci implementation
parent
9b87beb8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!10
Merge recent changes in master to we_ahrens
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ntrfc/meshquality/grid_convergece_index.py
+15
-1
15 additions, 1 deletion
ntrfc/meshquality/grid_convergece_index.py
tests/meshquality/test_ntrfc_grid_convergence_index.py
+8
-2
8 additions, 2 deletions
tests/meshquality/test_ntrfc_grid_convergence_index.py
with
23 additions
and
3 deletions
ntrfc/meshquality/grid_convergece_index.py
+
15
−
1
View file @
5d356d98
...
...
@@ -34,7 +34,7 @@ def getGCI(N1, N2, N3, fc1, fc2, fc3, D, Fs=1.25):
epsilon21
=
(
fc2
-
fc1
)
x0
=
np
.
log
(
epsilon32
/
epsilon21
)
/
np
.
log
(
r21
)
p
=
calcp
(
x0
,
Fs
,
N1
,
N2
,
N3
,
fc1
,
fc2
,
fc3
,
D
)
p
=
calcp
(
x0
,
1
,
N1
,
N2
,
N3
,
fc1
,
fc2
,
fc3
,
D
)
GCI_1
=
Fs
*
abs
((
epsilon21
/
fc1
))
*
1
/
((
r21
**
p
)
-
1
)
GCI_2
=
Fs
*
abs
((
epsilon32
/
fc2
))
*
1
/
((
r32
**
p
)
-
1
)
...
...
@@ -62,6 +62,20 @@ def getGCI(N1, N2, N3, fc1, fc2, fc3, D, Fs=1.25):
EERE_2_p1
=
abs
((
f_extra_p1
-
fc2
)
/
f_extra_p1
)
EERE_3_p1
=
abs
((
f_extra_p1
-
fc3
)
/
f_extra_p1
)
text
=
""
text
+=
f
'
{
"
GCI_1
"
:
<
16
}
{
GCI_1
}
\n
'
text
+=
f
'
{
"
GCI_2
"
:
<
16
}
{
GCI_2
}
\n
'
text
+=
f
'
{
"
GCI_3
"
:
<
16
}
{
GCI_3
}
\n
'
text
+=
f
'
{
"
EERE_1
"
:
<
16
}
{
EERE_1
}
\n
'
text
+=
f
'
{
"
EERE_2
"
:
<
16
}
{
EERE_2
}
\n
'
text
+=
f
'
{
"
EERE_3
"
:
<
16
}
{
EERE_3
}
\n
'
text
+=
f
'
{
"
GCI_1_p1
"
:
<
16
}
{
GCI_1_p1
}
\n
'
text
+=
f
'
{
"
GCI_2_p1
"
:
<
16
}
{
GCI_2_p1
}
\n
'
text
+=
f
'
{
"
GCI_3_p1
"
:
<
16
}
{
GCI_3_p1
}
\n
'
text
+=
f
'
{
"
EERE_1_p1
"
:
<
16
}
{
EERE_1_p1
}
\n
'
text
+=
f
'
{
"
EERE_2_p1
"
:
<
16
}
{
EERE_2_p1
}
\n
'
text
+=
f
'
{
"
EERE_3_p1
"
:
<
16
}
{
EERE_3_p1
}
\n
'
print
(
text
)
return
GCI_1
,
GCI_2
,
GCI_3
# return [GCI_1, GCI_2, GCI_3], [EERE_1, EERE_2, EERE_3], [GCI_1_p1, GCI_2_p1, GCI_3_p1], \
# [EERE_1_p1, EERE_2_p1, EERE_3_p1]
This diff is collapsed.
Click to expand it.
tests/meshquality/test_ntrfc_grid_convergence_index.py
+
8
−
2
View file @
5d356d98
def
test_getgci
():
# todo FILL
from
ntrfc.meshquality.grid_convergece_index
import
getGCI
from
ntrfc.meshquality.grid_convergece_index
import
getGCI
import
numpy
as
np
#
fc3
=
23.263
fc2
=
23.165
fc1
=
23.151
...
...
@@ -9,7 +10,12 @@ def test_getgci():
N3
=
18576
N2
=
74304
N1
=
297216
Fs
=
1.25
D
=
2
GCI_1
,
GCI_2
,
GCI_3
=
getGCI
(
N1
,
N2
,
N3
,
fc1
,
fc2
,
fc3
,
D
,
Fs
=
1.25
)
assert
np
.
isclose
(
GCI_1
,
0.0001259844787122061
),
"
GCI_1 computation does not seem to be correct
"
assert
np
.
isclose
(
GCI_2
,
0.0008813583711057829
),
"
GCI_3 computation does not seem to be correct
"
assert
np
.
isclose
(
GCI_3
,
0.0061695085977409286
),
"
GCI_3 computation does not seem to be correct
"
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