1
1
using DifferentialEquations
2
+ using JLD2
2
3
using IncompressibleNavierStokes: right_hand_side!, apply_bc_u!, momentum!, project!
3
4
4
5
function create_les_data_projected (;
@@ -75,9 +76,9 @@ function create_les_data_projected(;
75
76
t in tdatapoint && return true
76
77
return false
77
78
end
78
- all_ules = Array {T} (undef, (nles[1 ] + 2 , nles[1 ]+ 2 , D, length (tdatapoint)- 1 ))
79
- all_c = Array {T} (undef, (nles[1 ]+ 2 , nles[1 ]+ 2 , D, length (tdatapoint)- 1 ))
80
- all_t = Array {T} (undef, (length (tdatapoint)- 1 ))
79
+ all_ules = Array {T} (undef, (nles[1 ] + 2 , nles[1 ]+ 2 , D, length (tdatapoint)))
80
+ all_c = Array {T} (undef, (nles[1 ]+ 2 , nles[1 ]+ 2 , D, length (tdatapoint)))
81
+ all_t = Array {T} (undef, (length (tdatapoint)))
81
82
idx = Ref (1 )
82
83
Fdns = INS. create_right_hand_side (dns, psolver)
83
84
p = scalarfield (les)
@@ -118,6 +119,9 @@ function create_les_data_projected(;
118
119
u_current = u # Initial condition
119
120
prob = ODEProblem (rhs!, u_current, nothing , nothing )
120
121
122
+ # Store the data at t=0
123
+ filter_callback ((; u = u, t = T (0 )))
124
+
121
125
any (u -> any (isnan, u), u_current) &&
122
126
@warn " Solution contains NaNs. Probably dt is too large."
123
127
@@ -134,7 +138,7 @@ function create_les_data_projected(;
134
138
135
139
sol = solve (
136
140
prob, sciml_solver; u0 = u_current, p = nothing ,
137
- adaptive = false , dt = Δt , save_end = true , callback = cb,
141
+ adaptive = true , save_end = true , callback = cb,
138
142
tspan = tspan_chunk, tstops = tdatapoint
139
143
)
140
144
0 commit comments