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
9c6124ba
Commit
9c6124ba
authored
4 years ago
by
Sven Marcus
Browse files
Options
Downloads
Patches
Plain Diff
Use simulation.set_runtime_parameters()
parent
740e75f6
No related branches found
No related tags found
1 merge request
!6
Proper Python simulation tests
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Python/cubeflow/simulation.py
+14
-14
14 additions, 14 deletions
Python/cubeflow/simulation.py
Python/liddrivencavity/simulation.py
+1
-1
1 addition, 1 deletion
Python/liddrivencavity/simulation.py
Python/poiseuille/simulation.py
+22
-21
22 additions, 21 deletions
Python/poiseuille/simulation.py
with
37 additions
and
36 deletions
Python/cubeflow/simulation.py
+
14
−
14
View file @
9c6124ba
...
...
@@ -78,25 +78,25 @@ def run_simulation(physical_parameters=physical_params, grid_parameters=grid_par
writer
.
output_path
=
"
./output
"
writer
.
output_format
=
OutputFormat
.
BINARY
builder
=
Simulation
()
builder
.
set_writer
(
writer
)
simulation
=
Simulation
()
simulation
.
set_writer
(
writer
)
builder
.
set_physical_parameters
(
physical_parameters
)
builder
.
set_grid_parameters
(
grid_parameters
)
builder
.
set_simulation
_parameters
(
runtime_parameters
)
builder
.
set_kernel_config
(
kernel
)
simulation
.
set_physical_parameters
(
physical_parameters
)
simulation
.
set_grid_parameters
(
grid_parameters
)
simulation
.
set_runtime
_parameters
(
runtime_parameters
)
simulation
.
set_kernel_config
(
kernel
)
#
builder
.add_object(bottom_wall, no_slip_bc, 1, "/geo/bottomWall")
#
builder
.add_object(top_wall, no_slip_bc, 1, "/geo/topWall")
#
builder
.add_object(left_wall, no_slip_bc, 1, "/geo/leftWall")
#
builder
.add_object(right_wall, no_slip_bc, 1, "/geo/rightWall")
#
simulation
.add_object(bottom_wall, no_slip_bc, 1, "/geo/bottomWall")
#
simulation
.add_object(top_wall, no_slip_bc, 1, "/geo/topWall")
#
simulation
.add_object(left_wall, no_slip_bc, 1, "/geo/leftWall")
#
simulation
.add_object(right_wall, no_slip_bc, 1, "/geo/rightWall")
builder
.
add_object
(
obstacle
,
no_slip_bc
,
1
,
"
/geo/obstacle
"
)
simulation
.
add_object
(
obstacle
,
no_slip_bc
,
1
,
"
/geo/obstacle
"
)
builder
.
add_object
(
outflow_boundary
,
outflow_bc
,
1
,
"
/geo/outflow
"
)
builder
.
add_object
(
velocity_boundary
,
velocity_bc
,
1
,
"
/geo/velocityBoundary
"
)
simulation
.
add_object
(
outflow_boundary
,
outflow_bc
,
1
,
"
/geo/outflow
"
)
simulation
.
add_object
(
velocity_boundary
,
velocity_bc
,
1
,
"
/geo/velocityBoundary
"
)
builder
.
run_simulation
()
simulation
.
run_simulation
()
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
Python/liddrivencavity/simulation.py
+
1
−
1
View file @
9c6124ba
...
...
@@ -30,7 +30,7 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, run
simulation
.
set_grid_parameters
(
grid_params
)
simulation
.
set_physical_parameters
(
physical_params
)
simulation
.
set_
simulation
_parameters
(
runtime_params
)
simulation
.
set_
runtime
_parameters
(
runtime_params
)
simulation
.
set_kernel_config
(
kernel
)
simulation
.
set_writer
(
writer
)
...
...
This diff is collapsed.
Click to expand it.
Python/poiseuille/simulation.py
+
22
−
21
View file @
9c6124ba
...
...
@@ -28,10 +28,11 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, run
kernel
.
use_forcing
=
True
kernel
.
forcing_in_x1
=
1e-6
g_min_x1
,
g_min_x2
,
g_min_x3
=
0
,
0
,
0
g_max_x1
=
(
grid_params
.
number_of_nodes_per_direction
[
0
])
*
grid_params
.
node_distance
g_max_x2
=
(
grid_params
.
number_of_nodes_per_direction
[
1
])
*
grid_params
.
node_distance
g_max_x3
=
(
grid_params
.
number_of_nodes_per_direction
[
2
])
*
grid_params
.
node_distance
node_distance
=
grid_params
.
node_distance
min_x1
,
min_x2
,
min_x3
=
0
,
0
,
0
max_x1
=
grid_params
.
number_of_nodes_per_direction
[
0
]
*
node_distance
max_x2
=
grid_params
.
number_of_nodes_per_direction
[
1
]
*
node_distance
max_x3
=
grid_params
.
number_of_nodes_per_direction
[
2
]
*
node_distance
writer
=
Writer
()
writer
.
output_path
=
"
./output
"
...
...
@@ -40,30 +41,30 @@ def run_simulation(physical_params=physical_params, grid_params=grid_params, run
simulation
.
set_kernel_config
(
kernel
)
simulation
.
set_physical_parameters
(
physical_params
)
simulation
.
set_grid_parameters
(
grid_params
)
simulation
.
set_
simulation
_parameters
(
runtime_params
)
simulation
.
set_
runtime
_parameters
(
runtime_params
)
simulation
.
set_writer
(
writer
)
no_slip_
adapter
=
NoSlipBoundaryCondition
()
no_slip_
bc
=
NoSlipBoundaryCondition
()
block_
leng
th
=
3
*
grid_params
.
node_distance
block_
wid
th
=
3
*
node_distance
simulation
.
add_object
(
GbCuboid3D
(
g_
min_x1
-
block_
leng
th
,
g_
min_x2
-
block_
leng
th
,
g_
min_x3
-
block_
leng
th
,
g_
max_x1
+
block_
leng
th
,
g_
max_x2
+
block_
leng
th
,
g_
min_x3
),
no_slip_
adapter
,
GbCuboid3D
(
min_x1
-
block_
wid
th
,
min_x2
-
block_
wid
th
,
min_x3
-
block_
wid
th
,
max_x1
+
block_
wid
th
,
max_x2
+
block_
wid
th
,
min_x3
),
no_slip_
bc
,
State
.
SOLID
,
"
/geo/addWallZMin
"
)
simulation
.
add_object
(
GbCuboid3D
(
g_
min_x1
-
block_
leng
th
,
g_
min_x2
-
block_
leng
th
,
g_
max_x3
,
g_
max_x1
+
block_
leng
th
,
g_
max_x2
+
block_
leng
th
,
g_
max_x3
+
block_
leng
th
),
no_slip_
adapter
,
GbCuboid3D
(
min_x1
-
block_
wid
th
,
min_x2
-
block_
wid
th
,
max_x3
,
max_x1
+
block_
wid
th
,
max_x2
+
block_
wid
th
,
max_x3
+
block_
wid
th
),
no_slip_
bc
,
State
.
SOLID
,
"
/geo/addWallZMax
"
)
simulation
.
run_simulation
()
...
...
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