11using DifferentialEquations
2+ using JLD2
23using IncompressibleNavierStokes: right_hand_side!, apply_bc_u!, momentum!, project!
34
45function create_les_data_projected (;
@@ -75,9 +76,9 @@ function create_les_data_projected(;
7576 t in tdatapoint && return true
7677 return false
7778 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)))
8182 idx = Ref (1 )
8283 Fdns = INS. create_right_hand_side (dns, psolver)
8384 p = scalarfield (les)
@@ -118,6 +119,9 @@ function create_les_data_projected(;
118119 u_current = u # Initial condition
119120 prob = ODEProblem (rhs!, u_current, nothing , nothing )
120121
122+ # Store the data at t=0
123+ filter_callback ((; u = u, t = T (0 )))
124+
121125 any (u -> any (isnan, u), u_current) &&
122126 @warn " Solution contains NaNs. Probably dt is too large."
123127
@@ -134,7 +138,7 @@ function create_les_data_projected(;
134138
135139 sol = solve (
136140 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,
138142 tspan = tspan_chunk, tstops = tdatapoint
139143 )
140144
0 commit comments