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
a69bdd6e
Verified
Commit
a69bdd6e
authored
2 months ago
by
Bilocq Amaury
Browse files
Options
Downloads
Patches
Plain Diff
Fix the pipelines and remove unecessary test cases
parent
b6d51a96
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#53304
failed
2 months ago
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
pyTurbulence/solver.py
+2
-2
2 additions, 2 deletions
pyTurbulence/solver.py
pyTurbulence/spectrum.py
+0
-2
0 additions, 2 deletions
pyTurbulence/spectrum.py
test/test_Spectrum.py
+0
-11
0 additions, 11 deletions
test/test_Spectrum.py
with
2 additions
and
15 deletions
pyTurbulence/solver.py
+
2
−
2
View file @
a69bdd6e
...
@@ -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
"
,
"
Gaussian
"
(default:
"
PassotPouquet
"
).
-
"
Spectrum
"
(str): Type of spectrum for turbulence generation. Options:
"
PassotPouquet
"
(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): Type of turbulent fields to generate. Options: 0, 1 (default: 1). 0: incompressible - 1: compressible.
-
"
case
"
(int): Type of turbulent fields to generate. Options: 0, 1 (default: 1). 0: incompressible - 1: compressible.
-
"
output_dir
"
(str): Directory to store output results (default:
"
results
"
).
-
"
output_dir
"
(str): Directory to store output results (default:
"
results
"
).
...
@@ -210,7 +210,7 @@ def _validate_params(params) -> dict:
...
@@ -210,7 +210,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
"
},
# Allowed spectrum types
"
Spectrum
"
:
{
"
PassotPouquet
"
},
# Allowed spectrum types
"
case
"
:
{
0
,
1
},
# Allowed integer cases
"
case
"
:
{
0
,
1
},
# Allowed integer cases
}
}
...
...
This diff is collapsed.
Click to expand it.
pyTurbulence/spectrum.py
+
0
−
2
View file @
a69bdd6e
...
@@ -26,8 +26,6 @@ def energy_spectrum(spectrum: str, k: np.ndarray, urms: float, k0: float) -> np.
...
@@ -26,8 +26,6 @@ def energy_spectrum(spectrum: str, k: np.ndarray, urms: float, k0: float) -> np.
E_k
=
np
.
empty_like
(
k
)
E_k
=
np
.
empty_like
(
k
)
if
spectrum
==
"
PassotPouquet
"
:
if
spectrum
==
"
PassotPouquet
"
:
E_k
=
(
urms
**
2
*
16.
*
np
.
sqrt
(
2.
/
np
.
pi
)
*
k
**
4
/
k0
**
5
)
*
np
.
exp
(
-
2.
*
(
k
/
k0
)
**
2
)
E_k
=
(
urms
**
2
*
16.
*
np
.
sqrt
(
2.
/
np
.
pi
)
*
k
**
4
/
k0
**
5
)
*
np
.
exp
(
-
2.
*
(
k
/
k0
)
**
2
)
if
spectrum
==
"
Gaussian
"
:
E_k
=
0.00013
*
k
**
4
*
np
.
exp
(
-
2.
*
k
**
2
/
k0
**
2
)
return
E_k
return
E_k
def
compute_tke_spectrum
(
u
:
np
.
ndarray
,
v
:
np
.
ndarray
,
w
:
np
.
ndarray
,
def
compute_tke_spectrum
(
u
:
np
.
ndarray
,
v
:
np
.
ndarray
,
w
:
np
.
ndarray
,
...
...
This diff is collapsed.
Click to expand it.
test/test_Spectrum.py
+
0
−
11
View file @
a69bdd6e
...
@@ -14,15 +14,4 @@ def test_energy_spectrum_passot_pouquet():
...
@@ -14,15 +14,4 @@ def test_energy_spectrum_passot_pouquet():
assert
np
.
isclose
(
k0_spectrum
,
k0
,
rtol
=
1e-2
),
"
Test failed: PassotPouquet spectrum does not match expected k0
"
assert
np
.
isclose
(
k0_spectrum
,
k0
,
rtol
=
1e-2
),
"
Test failed: PassotPouquet spectrum does not match expected k0
"
assert
np
.
isclose
(
TKE_spectrum
,
TKE
,
rtol
=
1e-2
),
"
Test failed: PassotPouquet spectrum does not conserve TKE
"
assert
np
.
isclose
(
TKE_spectrum
,
TKE
,
rtol
=
1e-2
),
"
Test failed: PassotPouquet spectrum does not conserve TKE
"
def
test_energy_spectrum_constant
():
k
=
np
.
linspace
(
0
,
1024
,
1024
)
TKE
=
0.5
k0
=
4.0
spectrum
=
energy_spectrum
(
"
Constant
"
,
k
,
TKE
,
k0
)
TKE_spectrum
=
np
.
trapz
(
spectrum
,
k
)
idxMax
=
np
.
argmax
(
spectrum
)
k0_spectrum
=
k
[
idxMax
]
assert
np
.
isclose
(
k0_spectrum
,
k0
,
1e-2
),
"
Test failed: Constant spectrum does not match expected k0
"
test_energy_spectrum_passot_pouquet
()
test_energy_spectrum_passot_pouquet
()
test_energy_spectrum_constant
()
\ 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