Forcing
VortexPasta.Forcing Module
ForcingDefines methods for injecting and dissipating the energy generated by a system of vortices.
sourceForcing methods
VortexPasta.Forcing.NoForcing Type
NoForcing() <: AbstractForcingRepresents the absence of external forcing.
sourceVortexPasta.Forcing.NormalFluidForcing Type
NormalFluidForcing <: AbstractForcing
NormalFluidForcing(vn::Function; α, α′ = 0)Forcing due to mutual friction with a normal fluid.
The normal fluid is represented by a function vn which should take a position x⃗::SVector{N, T} and return a velocity v⃗::SVector{N, T} (N is the number of dimensions, usually N = 3).
In particular, the function could be a synthetic velocity field from the SyntheticFields module (see below for examples).
This type of forcing defines an external velocity
Here
The forcing velocity is of the form:
where
Note
This "forcing" generally affects all lengthscales, even when FourierBandForcing method can be more relevant.
Example
Define a mutual friction forcing based on a large-scale normal fluid velocity field (see SyntheticFields.FourierBandVectorField):
julia> using VortexPasta.Forcing: NormalFluidForcing
julia> using VortexPasta.SyntheticFields: SyntheticFields, FourierBandVectorField
julia> using Random: Xoshiro
julia> rng = Xoshiro(42); # initialise random number generator (optional, but recommended)
julia> Ls = (2π, 2π, 2π); # domain dimensions
julia> vn_rms = 1.0; # typical magnitude (rms value) of normal fluid velocity components
julia> vn = FourierBandVectorField(undef, Ls; kmin = 0.1, kmax = 1.5) # create field with non-zero Fourier wavevectors kmin ≤ |k⃗| ≤ kmax
FourierBandVectorField{Float64, 3} with 9 independent Fourier coefficients in |k⃗| ∈ [1.0, 1.4142]
julia> SyntheticFields.init_coefficients!(rng, vn, vn_rms); # randomly set non-zero Fourier coefficients of the velocity field
julia> forcing = NormalFluidForcing(vn; α = 0.8, α′ = 0)
NormalFluidForcing{Float64} with:
├─ Normal velocity field: FourierBandVectorField{Float64, 3} with 9 independent Fourier coefficients in |k⃗| ∈ [1.0, 1.4142]
└─ Friction coefficients: α = 0.8 and α′ = 0.0VortexPasta.Forcing.FourierBandForcing Type
FourierBandForcing <: AbstractForcing
FourierBandForcing(vn::FourierBandVectorField; α, α′ = 0, filtered_vorticity = false)Forcing due to mutual friction of a normal fluid with a Fourier-filtered superfluid velocity.
This forcing is similar to NormalFluidForcing, but tries to only affect scales within a given band [kmin, kmax] in Fourier space. This is achieved by a normal fluid velocity field represented by a FourierBandVectorField, and by a modified Schwarz's equation in which only a coarse-grained superfluid flow is taken into account in the estimation of the mutual friction term.
Concretely, the vortex line velocity according to this forcing type is:
The forcing velocity is of the form:
where [kmin, kmax] where vn is defined. See NormalFluidForcing for other definitions.
Using a filtered vorticity field
To further ensure that this forcing only affects the chosen range of scales, one can pass filtered_vorticity = true, which will replace the local unit tangent
VortexPasta.Forcing.FourierBandForcingBS Type
FourierBandForcingBS <: AbstractForcing
FourierBandForcingBS(; kmin, kmax, α, ε_target, α′ = 0, modify_length = true)Forcing based on Biot–Savart energetics within a given range of wavenumbers.
This type of forcing does not rely on an imposed normal fluid velocity. Instead, it starts from the functional derivative of the energy at a given wavevector
One should pass either α or ε_target but never both. They should be positive for energy injection (negative values lead to energy dissipation):
α(\alpha) is a non-dimensional coefficient which directly sets the amplitude of the forcing velocity;ε_target(\varepsilon_target) has the units of an energy injection rate. In this case, the amplitudewill be adjusted over time in order to keep a roughly constant energy injection rate (which in general will not be equal to ε_target, see remarks below).
The modify_length parameter can be set to false to avoid this forcing from increasing (or decreasing) the vortex length. This changes the forcing velocity by removing the component that is parallel to the local vortex curvature, such that it doesn't modify the vortex length locally. This is experimental, and might help (or not) avoiding non-local energy transfers from large to small scales.
Extended help
Forcing definition
The applied forcing velocity has the basic form:
where kmin and kmax. This choice ensures that energy is injected within this range of wavenumbers.
If
Explanations
This forcing attempts to increase the kinetic energy at selected wavenumbers. Its definition starts from the expression for the kinetic energy at wavenumber
The idea is to translate the vortex positions by
where
The functional derivative of vorticity in Fourier space is:
where
The functional derivative of
Finally, the idea is to advect the filaments with a velocity which is parallel to this result for each forced
where
Estimating the energy injection rate
One can also try to estimate an energy injection rate at wavevector
In general, this estimate may be quite inaccurate since the forcing can also affect the energy at wavevectors other than
Dissipation methods
VortexPasta.Forcing.NoDissipation Type
NoDissipation() <: AbstractDissipationRepersents the absence of dissipation term.
sourceVortexPasta.Forcing.DissipationBS Type
DissipationBS <: AbstractDissipation
DissipationBS(; α, ε_target)Dissipation based on Biot–Savart energetics.
Note that this dissipation method acts at all scales. To dissipate at small scales only, use SmallScaleDissipationBS.
To set the dissipation amplitude, one should pass either α or ε_target but never both. They should be positive for energy dissipation (negative values lead to energy injection, which may lead to instabilities!):
α(\alpha) is a non-dimensional coefficient which directly sets the amplitude of the dissipation term;ε_target(\varepsilon_target) has the units of an energy dissipation rate. In this case, the amplitudewill be adjusted over time in order to keep a constant energy dissipation rate.
Extended help
Dissipation term definition
The idea is to apply a "dissipation velocity"
where
Energy dissipation rate
The dissipation rate associated to this term is:
VortexPasta.Forcing.SmallScaleDissipationBS Type
SmallScaleDissipationBS <: AbstractDissipation
SmallScaleDissipationBS(; kdiss, α, ε_target)Dissipation based on Biot–Savart energetics at large wavenumbers (small scales).
Compared to DissipationBS, which in principle acts at all scales, SmallScaleDissipationBS acts mainly at small scales (wavenumbers k > kdiss). It is also much more expensive to compute, since it requires a low-pass filter done in Fourier space.
This dissipation method works similarly to FourierBandForcingBS. The main difference is that it acts at a different range of scales (wavenumbers k > kdiss), and that positive values of α or ε_target lead to dissipation and not injection.
As in FourierBandForcingBS, one should pass either α or ε_target but never both. They should be positive for energy dissipation (negative values lead to energy injection at small scales, which may lead to instabilities!):
α(\alpha) is a non-dimensional coefficient which directly sets the amplitude of the dissipation term;ε_target(\varepsilon_target) has the units of an energy dissipation rate. In this case, the amplitudewill be adjusted over time in order to keep a roughly constant energy dissipation rate (which in general will not be equal to ε_target, as discussed inFourierBandForcingBS).
Extended help
Dissipation term definition
The idea is to apply a "dissipation velocity" FourierBandForcingBS, such dissipation velocity can be written as:
where
In practice, this velocity is obtained as
Energy dissipation rate
At scales
Abstract types
VortexPasta.Forcing.AbstractForcing Type
AbstractForcingAbstract type representing a forcing method.
Note that, in general, all forcing methods can also be used as dissipation methods (e.g. by setting forcing coefficients to a negative value).
sourceVortexPasta.Forcing.AbstractDissipation Type
AbstractDissipationAbstract type representing a dissipation method (via an extra dissipation term in the vortex velocity).
sourceInternals
VortexPasta.Forcing.apply! Function
Forcing.apply!(forcing::AbstractForcing, vs::AbstractVector{<:Vec3}, f::AbstractFilament; [scheduler])Apply forcing to a single filament f with self-induced velocities vs.
At output, the vs vector is overwritten with the actual vortex line velocities.
The optional scheduler keyword can be used to parallelise computations using one of the schedulers defined in OhMyThreads.jl.
Forcing.apply!(forcing::NormalFluidForcing, vs, vn, tangents; [scheduler])This variant can be used in the case of a NormalFluidForcing if one already has precomputed values of the normal fluid velocity and local unit tangents at filament points.