Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parabolic BCs for P4estMesh{2} #1493

Merged
merged 68 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
86d14f0
generalize function signatures to P4estMesh
jlchan May 25, 2023
b5a3ede
add specializations for P4estMesh
jlchan May 25, 2023
68ac9e1
add normals
jlchan May 25, 2023
4064f89
add surface integrals
jlchan May 25, 2023
32cb2c1
fix type ambiguity
jlchan May 25, 2023
ce00a0c
generalizing `apply_jacobian!` to P4estMesh
jlchan May 25, 2023
ca9d485
resolving type ambiguity with apply_jacobian!
jlchan May 25, 2023
bc52998
Merge branch 'main' into jc/p4estMesh_parabolic_clean
jlchan May 26, 2023
70cda42
`apply_jacobian!` -> `apply_jacobian_parabolic!`
jlchan May 26, 2023
82b4b5e
`apply_jacobian!` -> `apply_jacobian_parabolic!`
jlchan May 26, 2023
dd36650
switch to `apply_jacobian_parabolic!`
jlchan May 26, 2023
7d0bf07
Update src/solvers/dgsem_tree/dg_1d_parabolic.jl
jlchan May 26, 2023
544ad6e
Merge branch 'main' into jc/apply_jacobian_parabolic!
ranocha May 26, 2023
b74ec44
missed one
jlchan May 26, 2023
169c85c
Merge branch 'jc/apply_jacobian_parabolic!' into jc/p4estMesh_parabol…
jlchan May 26, 2023
3eb7bf5
draft of prolong2interfaces and calc_interface_flux
jlchan May 26, 2023
984fde1
cache -> cache_parabolic
jlchan May 26, 2023
0ad7cf7
adding prolong2boundaries! and calc_boundary_flux_gradients! back
jlchan May 26, 2023
56dd577
remove todo
jlchan May 26, 2023
194a695
variable renaming
jlchan May 26, 2023
ff23f39
extending TreeMesh parabolic functions to P4estMesh
jlchan May 26, 2023
2a16098
adding elixir
jlchan May 26, 2023
de2513d
comments
jlchan May 26, 2023
f482e68
add prolong2boundaries! (untested)
jlchan May 26, 2023
5527827
update test
jlchan May 26, 2023
e5b91b5
initial commit
jlchan May 26, 2023
4d5776f
fix CI
jlchan May 26, 2023
9f1a4de
Merge branch 'jc/p4estMesh_parabolic_clean' into jc/p4est_parabolic_BCs
jlchan May 26, 2023
b6cf125
Merge branch 'main' into jc/p4estMesh_parabolic_clean
jlchan May 27, 2023
2d58049
Update src/solvers/dgsem_p4est/dg_2d_parabolic.jl
jlchan May 27, 2023
55368dc
Update src/solvers/dgsem_p4est/dg_2d_parabolic.jl
jlchan May 27, 2023
f3bb821
add "no mortars" check
jlchan May 27, 2023
1315428
add curved elixir
jlchan May 27, 2023
848a89b
Merge remote-tracking branch 'origin/main' into jc/p4estMesh_paraboli…
jlchan May 31, 2023
9ced755
fix gradient bug
jlchan May 31, 2023
044744a
Merge branch 'main' into jc/p4estMesh_parabolic_clean
jlchan May 31, 2023
1b3c1d2
add curved test
jlchan May 31, 2023
d570eec
Merge branch 'jc/p4estMesh_parabolic_clean' into jc/p4est_parabolic_BCs
jlchan May 31, 2023
1cce087
Apply suggestions from code review
jlchan Jun 1, 2023
3886a14
add comment on mapping
jlchan Jun 1, 2023
8976bc4
reuse P4estMesh{2} code
jlchan Jun 1, 2023
3394d9a
Merge branch 'jc/p4estMesh_parabolic_clean' into jc/p4est_parabolic_BCs
jlchan Jun 1, 2023
0a3f1fb
fix += for muladd
jlchan Jun 1, 2023
193ec00
Update examples/p4est_2d_dgsem/elixir_advection_diffusion_periodic_cu…
jlchan Jun 1, 2023
8956587
comment
jlchan Jun 1, 2023
6954db9
Merge branch 'jc/p4estMesh_parabolic_clean' into jc/p4est_parabolic_BCs
jlchan Jun 1, 2023
2fe0aa1
comments + remove cruft
jlchan Jun 2, 2023
bec055b
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 2, 2023
1ffda40
add BCs for parabolic P43st
jlchan Jun 5, 2023
4ec387e
add tests
jlchan Jun 5, 2023
93df868
Update examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl
jlchan Jun 6, 2023
399bd83
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 6, 2023
6e50436
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 15, 2023
32eb32d
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 16, 2023
b9bbd39
formatting
jlchan Jun 16, 2023
3a56f18
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 18, 2023
e35c77d
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 19, 2023
dbddf85
fix CNS convergence elixir and add to tests
jlchan Jun 19, 2023
2f9d13e
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 19, 2023
b07eb03
Merge remote-tracking branch 'jlchan/jc/p4est_parabolic_BCs' into jc/…
jlchan Jun 19, 2023
64488b2
update test values
jlchan Jun 19, 2023
d516ec5
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 19, 2023
0b6a805
Merge branch 'main' into jc/p4est_parabolic_BCs
ranocha Jun 20, 2023
3796dc8
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 20, 2023
040cb69
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 21, 2023
6e32d6c
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 21, 2023
1a7042b
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 22, 2023
28be493
Merge branch 'main' into jc/p4est_parabolic_BCs
jlchan Jun 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the linear advection-diffusion equation

diffusivity() = 5.0e-2
advection_velocity = (1.0, 0.0)
equations = LinearScalarAdvectionEquation2D(advection_velocity)
equations_parabolic = LaplaceDiffusion2D(diffusivity(), equations)

# Example setup taken from
# - Truman Ellis, Jesse Chan, and Leszek Demkowicz (2016).
# Robust DPG methods for transient convection-diffusion.
# In: Building bridges: connections and challenges in modern approaches
# to numerical partial differential equations.
# [DOI](https://doi.org/10.1007/978-3-319-41640-3_6).
function initial_condition_eriksson_johnson(x, t, equations)
l = 4
epsilon = diffusivity() # TODO: this requires epsilon < .6 due to sqrt
jlchan marked this conversation as resolved.
Show resolved Hide resolved
lambda_1 = (-1 + sqrt(1 - 4 * epsilon * l)) / (-2 * epsilon)
lambda_2 = (-1 - sqrt(1 - 4 * epsilon * l)) / (-2 * epsilon)
r1 = (1 + sqrt(1 + 4 * pi^2 * epsilon^2)) / (2 * epsilon)
s1 = (1 - sqrt(1 + 4 * pi^2 * epsilon^2)) / (2 * epsilon)
u = exp(-l * t) * (exp(lambda_1 * x[1]) - exp(lambda_2 * x[1])) +
cos(pi * x[2]) * (exp(s1 * x[1]) - exp(r1 * x[1])) / (exp(-s1) - exp(-r1))
return SVector{1}(u)
end
initial_condition = initial_condition_eriksson_johnson

boundary_conditions = Dict(:x_neg => BoundaryConditionDirichlet(initial_condition),
:y_neg => BoundaryConditionDirichlet(initial_condition),
:y_pos => BoundaryConditionDirichlet(initial_condition),
:x_pos => boundary_condition_do_nothing)

boundary_conditions_parabolic = Dict(:x_neg => BoundaryConditionDirichlet(initial_condition),
:x_pos => BoundaryConditionDirichlet(initial_condition),
:y_neg => BoundaryConditionDirichlet(initial_condition),
:y_pos => BoundaryConditionDirichlet(initial_condition))

# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg=3, surface_flux=flux_lax_friedrichs)

coordinates_min = (-1.0, -0.5)
coordinates_max = ( 0.0, 0.5)

# This maps the domain [-1, 1]^2 to [-1, 0] x [-0.5, 0.5] while also
# introducing a curved warping to interior nodes.
function mapping(xi, eta)
x = xi + 0.1 * sin(pi * xi) * sin(pi * eta)
y = eta + 0.1 * sin(pi * xi) * sin(pi * eta)
return SVector(0.5 * (1 + x) - 1, 0.5 * y)
end

trees_per_dimension = (4, 4)
mesh = P4estMesh(trees_per_dimension,
polydeg=3, initial_refinement_level=2,
mapping=mapping, periodicity=(false, false))

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic), initial_condition, solver,
boundary_conditions = (boundary_conditions, boundary_conditions_parabolic))


###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span `tspan`
tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan);

# At the beginning of the main loop, the SummaryCallback prints a summary of the simulation setup
# and resets the timers
summary_callback = SummaryCallback()

# The AnalysisCallback allows to analyse the solution in regular intervals and prints the results
analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval=analysis_interval)

# The AliveCallback prints short status information in regular intervals
alive_callback = AliveCallback(analysis_interval=analysis_interval)

# Create a CallbackSet to collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, alive_callback)


###############################################################################
# run the simulation

# OrdinaryDiffEq's `solve` method evolves the solution in time and executes the passed callbacks
time_int_tol = 1.0e-11
sol = solve(ode, RDPK3SpFSAL49(); abstol=time_int_tol, reltol=time_int_tol,
ode_default_options()..., callback=callbacks)

# Print the timer summary
summary_callback()
209 changes: 209 additions & 0 deletions examples/p4est_2d_dgsem/elixir_navierstokes_convergence.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the ideal compressible Navier-Stokes equations

prandtl_number() = 0.72
mu() = 0.01

equations = CompressibleEulerEquations2D(1.4)
equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu=mu(), Prandtl=prandtl_number(),
gradient_variables=GradientVariablesPrimitive())

# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg=3, surface_flux=flux_lax_friedrichs,
volume_integral=VolumeIntegralWeakForm())

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = ( 1.0, 1.0) # maximum coordinates (max(x), max(y))

trees_per_dimension = (4, 4)
mesh = P4estMesh(trees_per_dimension,
polydeg=3, initial_refinement_level=2,
coordinates_min=coordinates_min, coordinates_max=coordinates_max,
periodicity=(true, false))

# Note: the initial condition cannot be specialized to `CompressibleNavierStokesDiffusion2D`
# since it is called by both the parabolic solver (which passes in `CompressibleNavierStokesDiffusion2D`)
# and by the initial condition (which passes in `CompressibleEulerEquations2D`).
# This convergence test setup was originally derived by Andrew Winters (@andrewwinters5000)
function initial_condition_navier_stokes_convergence_test(x, t, equations)
# Amplitude and shift
A = 0.5
c = 2.0

# convenience values for trig. functions
pi_x = pi * x[1]
pi_y = pi * x[2]
pi_t = pi * t

rho = c + A * sin(pi_x) * cos(pi_y) * cos(pi_t)
v1 = sin(pi_x) * log(x[2] + 2.0) * (1.0 - exp(-A * (x[2] - 1.0)) ) * cos(pi_t)
v2 = v1
p = rho^2

return prim2cons(SVector(rho, v1, v2, p), equations)
end

@inline function source_terms_navier_stokes_convergence_test(u, x, t, equations)
y = x[2]

# TODO: parabolic
# we currently need to hardcode these parameters until we fix the "combined equation" issue
# see also https://github.com/trixi-framework/Trixi.jl/pull/1160
jlchan marked this conversation as resolved.
Show resolved Hide resolved
inv_gamma_minus_one = inv(equations.gamma - 1)
Pr = prandtl_number()
mu_ = mu()

# Same settings as in `initial_condition`
# Amplitude and shift
A = 0.5
c = 2.0

# convenience values for trig. functions
pi_x = pi * x[1]
pi_y = pi * x[2]
pi_t = pi * t

# compute the manufactured solution and all necessary derivatives
rho = c + A * sin(pi_x) * cos(pi_y) * cos(pi_t)
rho_t = -pi * A * sin(pi_x) * cos(pi_y) * sin(pi_t)
rho_x = pi * A * cos(pi_x) * cos(pi_y) * cos(pi_t)
rho_y = -pi * A * sin(pi_x) * sin(pi_y) * cos(pi_t)
rho_xx = -pi * pi * A * sin(pi_x) * cos(pi_y) * cos(pi_t)
rho_yy = -pi * pi * A * sin(pi_x) * cos(pi_y) * cos(pi_t)

v1 = sin(pi_x) * log(y + 2.0) * (1.0 - exp(-A * (y - 1.0))) * cos(pi_t)
v1_t = -pi * sin(pi_x) * log(y + 2.0) * (1.0 - exp(-A * (y - 1.0))) * sin(pi_t)
v1_x = pi * cos(pi_x) * log(y + 2.0) * (1.0 - exp(-A * (y - 1.0))) * cos(pi_t)
v1_y = sin(pi_x) * (A * log(y + 2.0) * exp(-A * (y - 1.0)) + (1.0 - exp(-A * (y - 1.0))) / (y + 2.0)) * cos(pi_t)
v1_xx = -pi * pi * sin(pi_x) * log(y + 2.0) * (1.0 - exp(-A * (y - 1.0))) * cos(pi_t)
v1_xy = pi * cos(pi_x) * (A * log(y + 2.0) * exp(-A * (y - 1.0)) + (1.0 - exp(-A * (y - 1.0))) / (y + 2.0)) * cos(pi_t)
v1_yy = (sin(pi_x) * ( 2.0 * A * exp(-A * (y - 1.0)) / (y + 2.0)
- A * A * log(y + 2.0) * exp(-A * (y - 1.0))
- (1.0 - exp(-A * (y - 1.0))) / ((y + 2.0) * (y + 2.0))) * cos(pi_t))
v2 = v1
v2_t = v1_t
v2_x = v1_x
v2_y = v1_y
v2_xx = v1_xx
v2_xy = v1_xy
v2_yy = v1_yy

p = rho * rho
p_t = 2.0 * rho * rho_t
p_x = 2.0 * rho * rho_x
p_y = 2.0 * rho * rho_y
p_xx = 2.0 * rho * rho_xx + 2.0 * rho_x * rho_x
p_yy = 2.0 * rho * rho_yy + 2.0 * rho_y * rho_y

# Note this simplifies slightly because the ansatz assumes that v1 = v2
E = p * inv_gamma_minus_one + 0.5 * rho * (v1^2 + v2^2)
E_t = p_t * inv_gamma_minus_one + rho_t * v1^2 + 2.0 * rho * v1 * v1_t
E_x = p_x * inv_gamma_minus_one + rho_x * v1^2 + 2.0 * rho * v1 * v1_x
E_y = p_y * inv_gamma_minus_one + rho_y * v1^2 + 2.0 * rho * v1 * v1_y

# Some convenience constants
T_const = equations.gamma * inv_gamma_minus_one / Pr
inv_rho_cubed = 1.0 / (rho^3)

# compute the source terms
# density equation
du1 = rho_t + rho_x * v1 + rho * v1_x + rho_y * v2 + rho * v2_y

# x-momentum equation
du2 = ( rho_t * v1 + rho * v1_t + p_x + rho_x * v1^2
+ 2.0 * rho * v1 * v1_x
+ rho_y * v1 * v2
+ rho * v1_y * v2
+ rho * v1 * v2_y
# stress tensor from x-direction
- 4.0 / 3.0 * v1_xx * mu_
+ 2.0 / 3.0 * v2_xy * mu_
- v1_yy * mu_
- v2_xy * mu_ )
# y-momentum equation
du3 = ( rho_t * v2 + rho * v2_t + p_y + rho_x * v1 * v2
+ rho * v1_x * v2
+ rho * v1 * v2_x
+ rho_y * v2^2
+ 2.0 * rho * v2 * v2_y
# stress tensor from y-direction
- v1_xy * mu_
- v2_xx * mu_
- 4.0 / 3.0 * v2_yy * mu_
+ 2.0 / 3.0 * v1_xy * mu_ )
# total energy equation
du4 = ( E_t + v1_x * (E + p) + v1 * (E_x + p_x)
+ v2_y * (E + p) + v2 * (E_y + p_y)
# stress tensor and temperature gradient terms from x-direction
- 4.0 / 3.0 * v1_xx * v1 * mu_
+ 2.0 / 3.0 * v2_xy * v1 * mu_
- 4.0 / 3.0 * v1_x * v1_x * mu_
+ 2.0 / 3.0 * v2_y * v1_x * mu_
- v1_xy * v2 * mu_
- v2_xx * v2 * mu_
- v1_y * v2_x * mu_
- v2_x * v2_x * mu_
- T_const * inv_rho_cubed * ( p_xx * rho * rho
- 2.0 * p_x * rho * rho_x
+ 2.0 * p * rho_x * rho_x
- p * rho * rho_xx ) * mu_
# stress tensor and temperature gradient terms from y-direction
- v1_yy * v1 * mu_
- v2_xy * v1 * mu_
- v1_y * v1_y * mu_
- v2_x * v1_y * mu_
- 4.0 / 3.0 * v2_yy * v2 * mu_
+ 2.0 / 3.0 * v1_xy * v2 * mu_
- 4.0 / 3.0 * v2_y * v2_y * mu_
+ 2.0 / 3.0 * v1_x * v2_y * mu_
- T_const * inv_rho_cubed * ( p_yy * rho * rho
- 2.0 * p_y * rho * rho_y
+ 2.0 * p * rho_y * rho_y
- p * rho * rho_yy ) * mu_ )

return SVector(du1, du2, du3, du4)
end

initial_condition = initial_condition_navier_stokes_convergence_test

# BC types
velocity_bc_top_bottom = NoSlip((x, t, equations) -> initial_condition_navier_stokes_convergence_test(x, t, equations)[2:3])
heat_bc_top_bottom = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_top_bottom = BoundaryConditionNavierStokesWall(velocity_bc_top_bottom, heat_bc_top_bottom)

# define inviscid boundary conditions
boundary_conditions = Dict(:y_neg => boundary_condition_slip_wall,
:y_pos => boundary_condition_slip_wall)

# define viscous boundary conditions
boundary_conditions_parabolic = Dict(:y_neg => boundary_condition_top_bottom,
:y_pos => boundary_condition_top_bottom)

semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic), initial_condition, solver;
boundary_conditions=(boundary_conditions, boundary_conditions_parabolic),
source_terms=source_terms_navier_stokes_convergence_test)

# ###############################################################################
# # ODE solvers, callbacks etc.

# Create ODE problem with time span `tspan`
tspan = (0.0, 0.5)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()
alive_callback = AliveCallback(alive_interval=10)
analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval=analysis_interval)
callbacks = CallbackSet(summary_callback, alive_callback, analysis_callback)

###############################################################################
# run the simulation

time_int_tol = 1e-8
sol = solve(ode, RDPK3SpFSAL49(); abstol=time_int_tol, reltol=time_int_tol, dt = 1e-5,
ode_default_options()..., callback=callbacks)
summary_callback() # print the timer summary

82 changes: 82 additions & 0 deletions examples/p4est_2d_dgsem/elixir_navierstokes_lid_driven_cavity.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the ideal compressible Navier-Stokes equations

# TODO: parabolic; unify names of these accessor functions
ranocha marked this conversation as resolved.
Show resolved Hide resolved
prandtl_number() = 0.72
mu() = 0.001

equations = CompressibleEulerEquations2D(1.4)
equations_parabolic = CompressibleNavierStokesDiffusion2D(equations, mu=mu(),
Prandtl=prandtl_number())

# Create DG solver with polynomial degree = 3 and (local) Lax-Friedrichs/Rusanov flux as surface flux
solver = DGSEM(polydeg=3, surface_flux=flux_lax_friedrichs)

coordinates_min = (-1.0, -1.0) # minimum coordinates (min(x), min(y))
coordinates_max = ( 1.0, 1.0) # maximum coordinates (max(x), max(y))

# Create a uniformly refined mesh
trees_per_dimension = (4, 4)
mesh = P4estMesh(trees_per_dimension,
polydeg=3, initial_refinement_level=2,
coordinates_min=coordinates_min, coordinates_max=coordinates_max,
periodicity=(false, false))

function initial_condition_cavity(x, t, equations::CompressibleEulerEquations2D)
Ma = 0.1
rho = 1.0
u, v = 0.0, 0.0
p = 1.0 / (Ma^2 * equations.gamma)
return prim2cons(SVector(rho, u, v, p), equations)
end
initial_condition = initial_condition_cavity

# BC types
velocity_bc_lid = NoSlip((x, t, equations) -> SVector(1.0, 0.0))
velocity_bc_cavity = NoSlip((x, t, equations) -> SVector(0.0, 0.0))
heat_bc = Adiabatic((x, t, equations) -> 0.0)
boundary_condition_lid = BoundaryConditionNavierStokesWall(velocity_bc_lid, heat_bc)
boundary_condition_cavity = BoundaryConditionNavierStokesWall(velocity_bc_cavity, heat_bc)

# define periodic boundary conditions everywhere
boundary_conditions = Dict( :x_neg => boundary_condition_slip_wall,
:y_neg => boundary_condition_slip_wall,
:y_pos => boundary_condition_slip_wall,
:x_pos => boundary_condition_slip_wall)

boundary_conditions_parabolic = Dict( :x_neg => boundary_condition_cavity,
:y_neg => boundary_condition_cavity,
:y_pos => boundary_condition_lid,
:x_pos => boundary_condition_cavity)

# A semidiscretization collects data structures and functions for the spatial discretization
semi = SemidiscretizationHyperbolicParabolic(mesh, (equations, equations_parabolic),
initial_condition, solver;
boundary_conditions=(boundary_conditions,
boundary_conditions_parabolic))

###############################################################################
# ODE solvers, callbacks etc.

# Create ODE problem with time span `tspan`
tspan = (0.0, 25.0)
ode = semidiscretize(semi, tspan);

summary_callback = SummaryCallback()
alive_callback = AliveCallback(alive_interval=100)
analysis_interval = 100
analysis_callback = AnalysisCallback(semi, interval=analysis_interval)
callbacks = CallbackSet(summary_callback, alive_callback)

###############################################################################
# run the simulation

time_int_tol = 1e-8
sol = solve(ode, RDPK3SpFSAL49(); abstol=time_int_tol, reltol=time_int_tol,
ode_default_options()..., callback=callbacks)
summary_callback() # print the timer summary


Loading