[!IMPORTANT] This package will be no longer maintained. Its functionality is available in VoronoiFVM.jl starting with version 1.18. The repository will archived.
VoronoiFVMDiffEq.jl
Glue package between VoronoiFVM.jl and DifferentialEquations.jl
The package extends the constructors for ODEFunction
and ODEProblem
by methods taking in a VoronoiFVM.System
:
using VoronoiFVMDiffEq, DifferentialEquations
system = VoronoiFVM.System(...)
inival = unknowns(system)
problem = ODEProblem(system,inival,tspan)
odesolution = DifferentialEquations.solve(problem, QNDF2())
voronoifvmsolution = reshape(odesolution, system)
Instead of QNDF2
you can try all mass matrix form capable stiff ode solvers form the DifferentialEquations.jl suite.
The package re-exports all of VoronoiFVM, so that it is sufficient to use
this package instead of VoronoiFVM.jl.
The package requires a recent Julia version (currently 1.8) due to significant advances in package precompilation.
Choice of ODE/DAE solver
As this package interfaces to the PDE solver package VoronoiFVM.jl, a general advise is to choose methods able to handle stiff problems. Moreover, often, discretized PDE systems (e.g. containing elliptic equations) are differential agebraic equation (DAE) systems which should be solved by DAE solvers.
Methods
SciMLBase.ODEProblem
— TypeODEProblem(system,inival,tspan,callback=DifferentialEquations.CallbackSet())
Create an ODEProblem in mass matrix form which can be handeled by ODE solvers from DifferentialEquations.jl.
Parameters:
system
: AVoronoiFVM.System
inival
: Initial value. Consider to pass a stationary solution attspan[1]
.tspan
: Time intervalcallback
: (optional) callback for ODE solver
The method returns an ODEProblem which can be solved by DifferentialEquations.solve().
SciMLBase.ODEFunction
— Type ODEFunction(system,inival=unknowns(system,inival=0),t0=0)
Create an ODEPFunction in mass matrix form to be handeled by ODE solvers from DifferentialEquations.jl.
Parameters:
system
: AVoronoiFVM.System
jacval
(optional): Initial value. Default is a zero vector. Consider to pass a stationary solution at timetjac
.tjac
(optional): tjac, Default: 0
The jacval
and tjac
are passed for a first evaluation of the Jacobian, allowing to detect the sparsity pattern which is passed to the DifferentialEquations.jl solver.
Base.reshape
— Functionreshape(ode_solution, system)
Create a TransientSolution
from the output of the ode solver. The main difference between them is that the TransientSolution
reflects the species structure of the probem which is not seen by the ODE solver.