forked from trixi-framework/TrixiParticles.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpipe_flow_3d.jl
More file actions
50 lines (39 loc) · 2.06 KB
/
pipe_flow_3d.jl
File metadata and controls
50 lines (39 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ==========================================================================================
# 3D Pipe Flow Simulation with Open Boundaries (Inflow/Outflow)
#
# This example extends the 2D pipe flow simulation (`pipe_flow_2d.jl`) to three
# dimensions.
# ==========================================================================================
using TrixiParticles
# ==========================================================================================
# ==== Resolution
particle_spacing = 0.05
# Make sure that the kernel support of fluid particles at a boundary is always fully sampled
boundary_layers = 3
# Make sure that the kernel support of fluid particles at an open boundary is always
# fully sampled.
# Note: Due to the dynamics at the inlets and outlets of open boundaries,
# it is recommended to use `open_boundary_layers > boundary_layers`
open_boundary_layers = 6
# ==========================================================================================
# ==== Experiment Setup
tspan = (0.0, 2.0)
function velocity_function3d(pos, t)
# Use this for a time-dependent inflow velocity
# return SVector(0.5prescribed_velocity * sin(2pi * t) + prescribed_velocity, 0)
return SVector(prescribed_velocity, 0.0, 0.0)
end
domain_size = (1.0, 0.4, 0.4)
boundary_size = (domain_size[1] + 2 * particle_spacing * open_boundary_layers,
domain_size[2], domain_size[3])
flow_direction = [1.0, 0.0, 0.0]
# setup simulation
trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "pipe_flow_2d.jl"),
domain_size=domain_size, boundary_size=boundary_size,
flow_direction=flow_direction, faces=(false, false, true, true, true, true),
tspan=tspan, reference_velocity=velocity_function3d,
open_boundary_layers=open_boundary_layers,
plane_in=([0.0, 0.0, 0.0], [0.0, domain_size[2], 0.0],
[0.0, 0.0, domain_size[3]]),
plane_out=([domain_size[1], 0.0, 0.0], [domain_size[1], domain_size[2], 0.0],
[domain_size[1], 0.0, domain_size[3]]))