Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
VirtualFluids
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
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
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
iRMB
VirtualFluids
Commits
1732fa3a
Commit
1732fa3a
authored
1 year ago
by
Hkorb
Browse files
Options
Downloads
Patches
Plain Diff
fix python scripts
parent
36f3373c
No related branches found
No related tags found
1 merge request
!296
Refactor Actuator Farm
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Python/actuator_line/actuator_line.py
+1
-1
1 addition, 1 deletion
Python/actuator_line/actuator_line.py
Python/boundary_layer/boundary_layer.py
+9
-6
9 additions, 6 deletions
Python/boundary_layer/boundary_layer.py
with
10 additions
and
7 deletions
Python/actuator_line/actuator_line.py
+
1
−
1
View file @
1732fa3a
...
...
@@ -132,7 +132,7 @@ para.set_velocity_ratio(dx/dt)
para
.
set_viscosity_ratio
(
dx
*
dx
/
dt
)
para
.
set_density_ratio
(
1.0
)
para
.
configure_main_kernel
(
gpu
.
K
ernel
.
C
ompressible
.
K17CompressibleNavierStokes
)
para
.
configure_main_kernel
(
gpu
.
k
ernel
.
c
ompressible
.
K17CompressibleNavierStokes
)
para
.
set_timestep_start_out
(
int
(
t_start_out
/
dt
))
para
.
set_timestep_out
(
int
(
t_out
/
dt
))
...
...
This diff is collapsed.
Click to expand it.
Python/boundary_layer/boundary_layer.py
+
9
−
6
View file @
1732fa3a
...
...
@@ -36,7 +36,7 @@ r"""
import
numpy
as
np
from
pathlib
import
Path
from
mpi4py
import
MPI
from
pyfluids
import
basics
,
gpu
,
logger
,
communicator
from
pyfluids
import
basics
,
gpu
,
logger
,
parallel
#%%
sim_name
=
"
ABL
"
config_file
=
Path
(
__file__
).
parent
/
"
configBoundaryLayer.txt
"
...
...
@@ -49,7 +49,7 @@ logger.Logger.initialize_logger()
#%%
grid_builder
=
gpu
.
grid_generator
.
MultipleGridBuilder
()
communicator
=
communicator
.
Communicator
.
get_instance
()
communicator
=
parallel
.
MPI
Communicator
.
get_instance
()
config
=
basics
.
ConfigurationFile
()
config
.
load
(
str
(
config_file
))
...
...
@@ -57,6 +57,9 @@ config.load(str(config_file))
para
=
gpu
.
Parameter
(
communicator
.
get_number_of_processes
(),
communicator
.
get_process_id
(),
config
)
bc_factory
=
gpu
.
BoundaryConditionFactory
()
grid_scaling_factory
=
gpu
.
GridScalingFactory
()
grid_scaling_factory
.
set_scaling_factory
(
gpu
.
GridScaling
.
ScaleCompressible
)
#%%
boundary_layer_height
=
config
.
get_float_value
(
"
boundaryLayerHeight
"
,
1000
)
z0
=
config
.
get_float_value
(
"
z0
"
,
0.1
)
...
...
@@ -129,14 +132,14 @@ para.set_velocity_ratio(dx/dt)
para
.
set_viscosity_ratio
(
dx
*
dx
/
dt
)
para
.
set_density_ratio
(
1.0
)
para
.
set
_main_kernel
(
"
CumulantK17
"
)
para
.
configure
_main_kernel
(
gpu
.
kernel
.
compressible
.
K17CompressibleNavierStokes
)
para
.
set_timestep_start_out
(
int
(
t_start_out
/
dt
))
para
.
set_timestep_out
(
int
(
t_out
/
dt
))
para
.
set_timestep_end
(
int
(
t_end
/
dt
))
para
.
set_is_body_force
(
config
.
get_bool_value
(
"
bodyForce
"
))
para
.
set_devices
(
np
.
arange
(
10
))
para
.
set_max_dev
(
communicator
.
get_number_of_process
())
para
.
set_max_dev
(
communicator
.
get_number_of_process
es
())
#%%
tm_factory
=
gpu
.
TurbulenceModelFactory
(
para
)
tm_factory
.
read_config_file
(
config
)
...
...
@@ -158,7 +161,7 @@ if read_precursor:
grid_builder
.
set_pressure_boundary_condition
(
gpu
.
SideType
.
PX
,
0
)
bc_factory
.
set_pressure_boundary_condition
(
gpu
.
PressureBC
.
OutflowNonReflective
)
bc_factory
.
set_precursor_boundary_condition
(
gpu
.
PrecursorBC
.
DistributionsPrecursor
if
use_distributions
else
gpu
.
PrecursorBC
.
VelocityPrecursor
)
bc_factory
.
set_stress_boundary_condition
(
gpu
.
StressBC
.
StressPressureBounceBack
)
bc_factory
.
set_slip_boundary_condition
(
gpu
.
SlipBC
.
SlipBounceBack
)
para
.
set_outflow_pressure_correction_factor
(
0.0
);
...
...
@@ -197,7 +200,7 @@ cuda_memory_manager = gpu.CudaMemoryManager(para)
grid_generator
=
gpu
.
GridProvider
.
make_grid_generator
(
grid_builder
,
para
,
cuda_memory_manager
,
communicator
)
#%%
#%%
sim
=
gpu
.
Simulation
(
para
,
cuda_memory_manager
,
communicator
,
grid_generator
,
bc_factory
,
tm_factory
)
sim
=
gpu
.
Simulation
(
para
,
cuda_memory_manager
,
communicator
,
grid_generator
,
bc_factory
,
tm_factory
,
grid_scaling_factory
)
#%%
sim
.
run
()
MPI
.
Finalize
()
\ 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