Skip to content

Commit 1500d11

Browse files
fix new example case file
1 parent ad545cb commit 1500d11

11 files changed

Lines changed: 215 additions & 203 deletions

File tree

docs/documentation/case.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ This is enabled by adding ``'elliptic_smoothing': "T",`` and ``'elliptic_smoothi
331331
| `moving_ibm` | Integer | Sets the method used for IB movement. |
332332
| `vel(i)` | Real | Initial velocity of the moving IB in the i-th direction. |
333333
| `angular_vel(i)` | Real | Initial angular velocity of the moving IB in the i-th direction. |
334+
| `coefficient_of_restitution` | Real | A number 0 to 1 describing how elastic IB collisions are |
335+
| `collision_model` | Integer | Integer to select the collision model being used for IB collisions. |
336+
| `collision_time` | Real | Amount of simulation time used to resolve collisions |
337+
| `ib_coefficient_of_friction` | Real | Coefficient of friction used in IB collisions |
334338

335339
These parameters should be prepended with `patch_ib(j)%` where $j$ is the patch index.
336340

@@ -361,6 +365,13 @@ Additional details on this specification can be found in [NACA airfoil](https://
361365

362366
- `angular_vel(i)` is the initial angular velocity of the IB about the x, y, z axes for i=1, 2, 3 in radians per second. When `moving_ibm` equals 2, this rotation rate is just the starting rate of the object, which will then change due to external torques. If `moving_ibm` equals 1, then this is constant if it is a number, or can be described analytically with an expression.
363367

368+
- `coefficient_of_restitution` is a number from 0 (exclusive) to 1 (inclusive) describing how elastic IB collisions are. 0 is for perfectly inellastic collisions while 1 is for perfectly ellastic colisions.
369+
370+
- `collision_model` is an integer to select the collision model being used for IB collisions. Using 0 disables collisions and collisino checking. 1 enables the soft-sphere collision model, where all IBs must be circles or sphere and those IBs can collide with each other as well as walls.
371+
372+
- `collision_time` is approximately the amount of simulation time used to resolve collisions. This is handled by modifying the spring gonstant used to apply collision forces.
373+
- `ib_coefficient_of_friction` is the coefficient of friction used in IB collisions.
374+
364375
### 5. Fluid Material's {#sec-fluid-materials}
365376

366377
| Parameter | Type | Description |

docs/module_categories.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
"m_chemistry",
2727
"m_acoustic_src",
2828
"m_body_forces",
29-
"m_pressure_relaxation"
29+
"m_pressure_relaxation",
30+
"m_collisions"
3031
]
3132
},
3233
{

examples/3D_mibm_sphere_head_on_collision/case.py

Lines changed: 100 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# of spherical particles using the linear model"
77
# by Francesco Paolo Di Maio and Alberto Di Renzo
88

9-
# This can be used to check collision rebound angles to recreate
9+
# This can be used to check collision rebound angles to recreate
1010
# figure 4 of that paper
1111

1212
Mu = 1.84e-05
@@ -15,113 +15,115 @@
1515
# lead-up-properties
1616
velocity = 3.9
1717
dt = 5.0e-6
18-
collision_time = 200. * dt
18+
collision_time = 200.0 * dt
1919

2020
# parerticle properties
2121
radius = 5e-3
22-
collision_angle_degrees = 60.
23-
collision_angle_radians = collision_angle_degrees * math.pi / 180.
24-
domain_size = 3. * radius
22+
collision_angle_degrees = 60.0
23+
collision_angle_radians = collision_angle_degrees * math.pi / 180.0
24+
domain_size = 3.0 * radius
2525
lead_distance = 0.02 * radius
2626

2727
# simulation runs long enough to collide and travel about lead distance away again
28-
simulation_time = 2. * (lead_distance / velocity) + collision_time
28+
simulation_time = 2.0 * (lead_distance / velocity) + collision_time
2929
num_time_steps = int(simulation_time / dt)
3030
num_saves = 10
3131
t_step_save = int(num_time_steps / num_saves)
3232

3333
# Configuring case dictionary
34-
print(json.dumps({
35-
# Logistics
36-
"run_time_info": "T",
37-
# Computational Domain Parameters
38-
"x_domain%beg": 0.,
39-
"x_domain%end": domain_size,
40-
"y_domain%beg": 0.,
41-
"y_domain%end": domain_size,
42-
"z_domain%beg": 0.,
43-
"z_domain%end": domain_size,
44-
"cyl_coord": "F",
45-
"m": 60,
46-
"n": 60,
47-
"p": 60,
48-
"dt": dt,
49-
"t_step_start": 0,
50-
"t_step_stop": num_time_steps,
51-
"t_step_save": t_step_save,
52-
# Simulation Algorithm Parameters
53-
"num_patches": 1,
54-
# Use the 5 equation model
55-
"model_eqns": 2,
56-
"alt_soundspeed": "F",
57-
# One fluids: air
58-
"num_fluids": 1,
59-
"mpp_lim": "F",
60-
# Correct errors when computing speed of sound
61-
"mixture_err": "T",
62-
# Use TVD RK3 for time marching
63-
"time_stepper": 3,
64-
# Use WENO5
65-
"weno_order": 5,
66-
"weno_eps": 1.0e-16,
67-
"weno_avg": "T",
68-
"avg_state": 2,
69-
"mapped_weno": "T",
70-
"null_weights": "F",
71-
"mp_weno": "T",
72-
"riemann_solver": 2,
73-
"wave_speeds": 1,
74-
# We use ghost-cell
75-
"bc_x%beg": -3,
76-
"bc_x%end": -3,
77-
"bc_y%beg": -15,
78-
"bc_y%end": -15,
79-
"bc_z%beg": -3,
80-
"bc_z%end": -3,
81-
# Set IB to True and add 1 patch
82-
"ib": "T",
83-
"num_ibs": 1,
84-
# Formatted Database Files Structure Parameters
85-
"format": 1,
86-
"precision": 2,
87-
"prim_vars_wrt": "T",
88-
"E_wrt": "T",
89-
"parallel_io": "T",
90-
# Patch: Constant Tube filled with air
91-
# Specify the cylindrical air tube grid geometry
92-
"patch_icpp(1)%geometry": 9,
93-
"patch_icpp(1)%x_centroid": 0.5 * domain_size,
94-
"patch_icpp(1)%y_centroid": 0.5 * domain_size,
95-
"patch_icpp(1)%z_centroid": 0.5 * domain_size,
96-
"patch_icpp(1)%length_x": domain_size,
97-
"patch_icpp(1)%length_y": domain_size,
98-
"patch_icpp(1)%length_z": domain_size,
99-
# Specify the patch primitive variables
100-
"patch_icpp(1)%vel(1)": 0.0e00,
101-
"patch_icpp(1)%vel(2)": 0.0e00,
102-
"patch_icpp(1)%vel(3)": 0.0e00,
103-
"patch_icpp(1)%pres": 1.0e00,
104-
"patch_icpp(1)%alpha_rho(1)": 1.0e00,
105-
"patch_icpp(1)%alpha(1)": 1.0e00,
106-
# Patch: Sphere Immersed Boundary
107-
"patch_ib(1)%geometry": 8,
108-
"patch_ib(1)%x_centroid": -1. * lead_distance * math.sin(collision_angle_radians), # get a lead up distance to the collision
109-
"patch_ib(1)%y_centroid": radius + lead_distance * math.sin(collision_angle_radians),
110-
"patch_ib(1)%z_centroid": 0.0,
111-
"patch_ib(1)%radius": radius,
112-
"patch_ib(1)%slip": "F",
113-
"patch_ib(1)%mass": 1.0e6, # arbitrarily high mass to ignore fluid
114-
"patch_ib(1)%vel(1)": velocity * math.sin(collision_angle_radians),
115-
"patch_ib(1)%vel(2)": -velocity * math.cos(collision_angle_radians),
116-
"patch_ib(1)%moving_ibm": 2
117-
# Collisions
118-
"collision_model": 1,
119-
"ib_coefficient_of_friction": 0.092,
120-
"collision_time": collision_time,
121-
"coefficient_of_restitution": 0.98,
122-
# Fluids Physical Parameters
123-
"fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40)
124-
"fluid_pp(1)%pi_inf": 0,
34+
print(
35+
json.dumps(
36+
{
37+
# Logistics
38+
"run_time_info": "T",
39+
# Computational Domain Parameters
40+
"x_domain%beg": 0.0,
41+
"x_domain%end": domain_size,
42+
"y_domain%beg": 0.0,
43+
"y_domain%end": domain_size,
44+
"z_domain%beg": 0.0,
45+
"z_domain%end": domain_size,
46+
"cyl_coord": "F",
47+
"m": 60,
48+
"n": 60,
49+
"p": 60,
50+
"dt": dt,
51+
"t_step_start": 0,
52+
"t_step_stop": num_time_steps,
53+
"t_step_save": t_step_save,
54+
# Simulation Algorithm Parameters
55+
"num_patches": 1,
56+
# Use the 5 equation model
57+
"model_eqns": 2,
58+
"alt_soundspeed": "F",
59+
# One fluids: air
60+
"num_fluids": 1,
61+
"mpp_lim": "F",
62+
# Correct errors when computing speed of sound
63+
"mixture_err": "T",
64+
# Use TVD RK3 for time marching
65+
"time_stepper": 3,
66+
# Use WENO5
67+
"weno_order": 5,
68+
"weno_eps": 1.0e-16,
69+
"weno_avg": "T",
70+
"avg_state": 2,
71+
"mapped_weno": "T",
72+
"null_weights": "F",
73+
"mp_weno": "T",
74+
"riemann_solver": 2,
75+
"wave_speeds": 1,
76+
# We use ghost-cell
77+
"bc_x%beg": -3,
78+
"bc_x%end": -3,
79+
"bc_y%beg": -15,
80+
"bc_y%end": -15,
81+
"bc_z%beg": -3,
82+
"bc_z%end": -3,
83+
# Set IB to True and add 1 patch
84+
"ib": "T",
85+
"num_ibs": 1,
86+
# Formatted Database Files Structure Parameters
87+
"format": 1,
88+
"precision": 2,
89+
"prim_vars_wrt": "T",
90+
"E_wrt": "T",
91+
"parallel_io": "T",
92+
# Patch: Constant Tube filled with air
93+
# Specify the cylindrical air tube grid geometry
94+
"patch_icpp(1)%geometry": 9,
95+
"patch_icpp(1)%x_centroid": 0.5 * domain_size,
96+
"patch_icpp(1)%y_centroid": 0.5 * domain_size,
97+
"patch_icpp(1)%z_centroid": 0.5 * domain_size,
98+
"patch_icpp(1)%length_x": domain_size,
99+
"patch_icpp(1)%length_y": domain_size,
100+
"patch_icpp(1)%length_z": domain_size,
101+
# Specify the patch primitive variables
102+
"patch_icpp(1)%vel(1)": 0.0e00,
103+
"patch_icpp(1)%vel(2)": 0.0e00,
104+
"patch_icpp(1)%vel(3)": 0.0e00,
105+
"patch_icpp(1)%pres": 1.0e00,
106+
"patch_icpp(1)%alpha_rho(1)": 1.0e00,
107+
"patch_icpp(1)%alpha(1)": 1.0e00,
108+
# Patch: Sphere Immersed Boundary
109+
"patch_ib(1)%geometry": 8,
110+
"patch_ib(1)%x_centroid": -1.0 * lead_distance * math.sin(collision_angle_radians), # get a lead up distance to the collision
111+
"patch_ib(1)%y_centroid": radius + lead_distance * math.sin(collision_angle_radians),
112+
"patch_ib(1)%z_centroid": 0.0,
113+
"patch_ib(1)%radius": radius,
114+
"patch_ib(1)%slip": "F",
115+
"patch_ib(1)%mass": 1.0e6, # arbitrarily high mass to ignore fluid
116+
"patch_ib(1)%vel(1)": velocity * math.sin(collision_angle_radians),
117+
"patch_ib(1)%vel(2)": -velocity * math.cos(collision_angle_radians),
118+
"patch_ib(1)%moving_ibm": 2,
119+
# Collisions
120+
"collision_model": 1,
121+
"ib_coefficient_of_friction": 0.092,
122+
"collision_time": collision_time,
123+
"coefficient_of_restitution": 0.98,
124+
# Fluids Physical Parameters
125+
"fluid_pp(1)%gamma": 1.0e00 / (gam_a - 1.0e00), # 2.50(Not 1.40)
126+
"fluid_pp(1)%pi_inf": 0,
125127
}
126128
)
127-
)
129+
)

src/common/m_helper.fpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,24 +297,26 @@ contains
297297
298298
end function f_cross
299299
300-
<<<<<<< HEAD
300+
< < < < < < < HEAD
301301
!> @brief Computes the cross product c = a x b of two 3D vectors.
302302
subroutine s_cross_product(a, b, c)
303+
303304
$:GPU_ROUTINE(parallelism='[seq]')
304-
real(wp), intent(in) :: a(3), b(3)
305+
real(wp), intent(in) :: a(3), b(3)
305306
real(wp), intent(out) :: c(3)
306307
307308
c(1) = a(2)*b(3) - a(3)*b(2)
308309
c(2) = a(3)*b(1) - a(1)*b(3)
309310
c(3) = a(1)*b(2) - a(2)*b(1)
311+
310312
end subroutine s_cross_product
311313
312314
!> This procedure swaps two real numbers.
313315
!! @param lhs Left-hand side.
314316
!! @param rhs Right-hand side.
315-
=======
317+
== == == =
316318
!> Swap two real numbers.
317-
>>>>>>> master
319+
> > > > > > > master
318320
elemental subroutine s_swap(lhs, rhs)
319321
320322
real(wp), intent(inout) :: lhs, rhs

0 commit comments

Comments
 (0)