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
f43ca35f
Commit
f43ca35f
authored
2 months ago
by
Amaury Bilocq
Browse files
Options
Downloads
Patches
Plain Diff
modify computation of rhs for pressure
parent
10abdebc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#53052
passed
2 months ago
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
pyTurbulence/solver.py
+2
-2
2 additions, 2 deletions
pyTurbulence/solver.py
pyTurbulence/syntheticTurbulence.py
+3
-10
3 additions, 10 deletions
pyTurbulence/syntheticTurbulence.py
with
5 additions
and
12 deletions
pyTurbulence/solver.py
+
2
−
2
View file @
f43ca35f
...
@@ -22,7 +22,7 @@ def solve(user_params)->dict:
...
@@ -22,7 +22,7 @@ def solve(user_params)->dict:
-
"
k0
"
(int): Peak wavenumber (default: 4).
-
"
k0
"
(int): Peak wavenumber (default: 4).
-
"
domain_size
"
(list, tuple, np.ndarray): Size of the simulation domain, should be a 3D vector (default: [2π, 2π, 2π]).
-
"
domain_size
"
(list, tuple, np.ndarray): Size of the simulation domain, should be a 3D vector (default: [2π, 2π, 2π]).
-
"
domain_resolution
"
(list, tuple, np.ndarray): Resolution of the domain, should be a 3D vector (default: [64, 64, 64]).
-
"
domain_resolution
"
(list, tuple, np.ndarray): Resolution of the domain, should be a 3D vector (default: [64, 64, 64]).
-
"
Spectrum
"
(str): Type of spectrum for turbulence generation. Options:
"
PassotPouquet
"
,
"
Const
an
t
"
(default:
"
PassotPouquet
"
).
-
"
Spectrum
"
(str): Type of spectrum for turbulence generation. Options:
"
PassotPouquet
"
,
"
Gaussi
an
"
(default:
"
PassotPouquet
"
).
-
"
gamma
"
(float): Heat capacity ratio, typically between 1 and 2 (default: 1.4).
-
"
gamma
"
(float): Heat capacity ratio, typically between 1 and 2 (default: 1.4).
-
"
case
"
(int): Dimensionalisation of the density and temperature fluctuations (from Ristorcelli & Blaisdell). Options: 1, 2 (default: 1).
-
"
case
"
(int): Dimensionalisation of the density and temperature fluctuations (from Ristorcelli & Blaisdell). Options: 1, 2 (default: 1).
-
"
output_dir
"
(str): Directory to store output results (default:
"
results
"
).
-
"
output_dir
"
(str): Directory to store output results (default:
"
results
"
).
...
@@ -202,7 +202,7 @@ def _validate_params(params) -> dict:
...
@@ -202,7 +202,7 @@ def _validate_params(params) -> dict:
# Define allowed values for specific parameters
# Define allowed values for specific parameters
allowed_values
=
{
allowed_values
=
{
"
Spectrum
"
:
{
"
PassotPouquet
"
,
"
Gaussian
"
,
"
Exponential
"
},
# Allowed spectrum types
"
Spectrum
"
:
{
"
PassotPouquet
"
,
"
Gaussian
"
},
# Allowed spectrum types
"
case
"
:
{
1
,
2
},
# Allowed integer cases
"
case
"
:
{
1
,
2
},
# Allowed integer cases
}
}
...
...
This diff is collapsed.
Click to expand it.
pyTurbulence/syntheticTurbulence.py
+
3
−
10
View file @
f43ca35f
...
@@ -160,16 +160,9 @@ def compute_solenoidal_pressure(u: np.ndarray,v: np.ndarray,w: np.ndarray,
...
@@ -160,16 +160,9 @@ def compute_solenoidal_pressure(u: np.ndarray,v: np.ndarray,w: np.ndarray,
hy
=
domain_size
[
1
]
/
ny
hy
=
domain_size
[
1
]
/
ny
hz
=
domain_size
[
2
]
/
nz
hz
=
domain_size
[
2
]
/
nz
dudx
,
dudy
,
dudz
=
np
.
gradient
(
u
,
hx
,
hy
,
hz
,
edge_order
=
2
)
velocity
=
np
.
array
([
u
,
v
,
w
])
dvdx
,
dvdy
,
dvdz
=
np
.
gradient
(
v
,
hx
,
hy
,
hz
,
edge_order
=
2
)
gradVelocity
=
np
.
array
([
np
.
gradient
(
vel
,
hx
,
hy
,
hz
,
edge_order
=
2
)
for
vel
in
velocity
])
dwdx
,
dwdy
,
dwdz
=
np
.
gradient
(
w
,
hx
,
hy
,
hz
,
edge_order
=
2
)
rhs
=
-
np
.
einsum
(
'
ij...,ji...->...
'
,
gradVelocity
,
gradVelocity
)
grad
=
np
.
array
([[
dudx
,
dudy
,
dudz
],[
dvdx
,
dvdy
,
dvdz
],[
dwdx
,
dwdy
,
dwdz
]])
rhs
=
np
.
zeros
([
nx
,
ny
,
nz
])
for
i
in
range
(
3
):
for
j
in
range
(
3
):
rhs
+=
-
1.
*
grad
[
i
][
j
]
*
grad
[
j
][
i
]
pressure
=
poisson_3d
(
rhs
,
nx
,
ny
,
nz
,
hx
,
hy
,
hz
)
pressure
=
poisson_3d
(
rhs
,
nx
,
ny
,
nz
,
hx
,
hy
,
hz
)
return
pressure
return
pressure
...
...
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