Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pyTurbulence
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Bilocq Amaury
pyTurbulence
Commits
10abdebc
Commit
10abdebc
authored
1 month ago
by
Amaury Bilocq
Browse files
Options
Downloads
Patches
Plain Diff
Remove print
parent
8dd6eb5d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#53044
passed
1 month ago
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
docs/spectrum.png
+0
-0
0 additions, 0 deletions
docs/spectrum.png
docs/u.png
+0
-0
0 additions, 0 deletions
docs/u.png
pyTurbulence/poissonSolver.py
+4
-2
4 additions, 2 deletions
pyTurbulence/poissonSolver.py
pyTurbulence/syntheticTurbulence.py
+0
-5
0 additions, 5 deletions
pyTurbulence/syntheticTurbulence.py
with
4 additions
and
7 deletions
doc/spectrum.png
→
doc
s
/spectrum.png
+
0
−
0
View file @
10abdebc
File moved
This diff is collapsed.
Click to expand it.
doc/u.png
→
doc
s
/u.png
+
0
−
0
View file @
10abdebc
File moved
This diff is collapsed.
Click to expand it.
pyTurbulence/poissonSolver.py
+
4
−
2
View file @
10abdebc
...
...
@@ -48,7 +48,8 @@ def poisson_2d(f, nx, ny, hx, hy)->np.ndarray:
res
[:,
ny
-
1
]
=
res
[:,
0
]
return
res
def
poisson_3d
(
f
,
nx
,
ny
,
nz
,
hx
,
hy
,
hz
)
->
np
.
ndarray
:
def
poisson_3d
(
f
:
np
.
ndarray
,
nx
:
int
,
ny
:
int
,
nz
:
int
,
hx
:
float
,
hy
:
float
,
hz
:
float
)
->
np
.
ndarray
:
"""
Solve a 3D Poisson equation with periodic boundary conditions.
...
...
@@ -102,7 +103,8 @@ def poisson_3d(f, nx, ny, nz, hx, hy, hz)->np.ndarray:
res
[:,
:,
nz
-
1
]
=
res
[:,
:,
0
]
return
res
def
dilatational_velocities
(
theta
,
nx
,
ny
,
nz
,
hx
,
hy
,
hz
)
->
np
.
ndarray
:
def
dilatational_velocities
(
theta
:
np
.
ndarray
,
nx
:
int
,
ny
:
int
,
nz
:
int
,
hx
:
float
,
hy
:
float
,
hz
:
float
)
->
np
.
ndarray
:
"""
Compute the dilatational velocity field using Fourier space projection.
...
...
This diff is collapsed.
Click to expand it.
pyTurbulence/syntheticTurbulence.py
+
0
−
5
View file @
10abdebc
...
...
@@ -280,17 +280,12 @@ def compute_dilatational_velocities(u: np.ndarray,v: np.ndarray,w: np.ndarray,p:
hessian_rhs
=
np
.
array
([
np
.
gradient
(
grad
,
hx
,
hy
,
hz
,
edge_order
=
2
)
for
grad
in
grad_rhs
])
rhs_ij
=
np
.
einsum
(
'
ij...->...
'
,
hessian_rhs
)
rhs_ij
*=
2.0
print
(
f
"
mean rhs_ij =
{
np
.
mean
(
rhs_ij
)
}
"
)
ddt_p
=
poisson_3d
(
rhs_ij
,
nx
,
ny
,
nz
,
hx
,
hy
,
hz
)
# Compute dilatation from Eq.7
# -gamma*dilatation = ddt_p+v_k*dpdxk
dilatation
=
-
overGamma
*
(
np
.
sum
(
velocity
*
gradPressure
,
axis
=
0
)
+
ddt_p
)
print
(
f
"
mean dilatation =
{
np
.
mean
(
dilatation
)
}
"
)
# Compute dilatational velocity from Eq.12
vd_x
,
vd_y
,
vd_z
=
dilatational_velocities
(
dilatation
,
nx
,
ny
,
nz
,
hx
,
hy
,
hz
)
return
vd_x
,
vd_y
,
vd_z
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