API

VEM.AbstractRedistributionKernelType
AbstractRedistributionKernel

An abstract type representing a vortex blob redistribution kernel, which defines how weights are assigned based on distance normalized by the vortex blob core radius.

source
VEM.AbstractVortexBlobType
AbstractVortexBlob{Dimension, Scalar <: AbstractFloat}

Abstract type representing a vortex blob in Dimension-dimensional space, parameterized by a floating-point type Scalar.

source
VEM.CartesianMeshType
CartesianMesh{Dimension,Scalar<:AbstractFloat}(cells_per_axis::NTuple{Dimension,Int}, spacing::Scalar)

A Cartesian mesh for vortex blob methods.

Argumentss

  • `cellsperaxis: The number of cells along each axis.
  • spacing: The spacing between nodes in the mesh.
source
VEM.FloatType
Float

Default floating-point type (Float32 or Float64) corresponding to the system's word size.

source
VEM.GaussianVortexBlobType
GaussianVortexBlob(circulation::Union{Scalar,StaticArrays.SVector{Dimension,Scalar}}, center::StaticArrays.SVector{Dimension, Scalar}, radius::Scalar) where {Dimension, Scalar}
GaussianVortexBlob(circulation, center, radius)

A smooth vortex blob with a Gaussian vorticity distribution. It is characterized by an amount of circulation it carries, a position and a finite core radius.

Arguments

  • circulation: The circulation strength of the vortex blob.
  • center: The position of the vortex blob.
  • radius: The core radius of the vortex blob.

Returns

A GaussianVortexBlob instance.

source
VEM.M4PrimeType
M4Prime

M4' is a vortex blob redistribution kernel. It is defined by a piecewise function that assigns weights based on the distance from the center of the vortex blob, normalized by the blob's core radius. The M4' kernel has a support radius of 2, meaning that it assigns non-zero weights to points at a distance greater than 2 core radii.

source
VEM.VelocityFieldType
VelocityField <: AbstractInducedField

A singleton type representing a velocity field.

source
Base.zeroMethod
Base.zero(::T) where {T<:AbstractVortexBlob}

Return a vortex blob with all data set to 0.

Arguments

  • ::AbstractVortexBlob: An instance of a vortex blob.

Returns

A vortex blob instance with zero circulation, center, and radius.

source
Base.zeroMethod
zero(::Type{GaussianVortexBlob{Dimension,Scalar}}) where {Dimension, Scalar}

Return a GaussianVortexBlob with all data set to 0.

Arguments

  • GaussianVortexBlob{Dimension,Scalar}: The type of a vortex blob..

Returns

A GaussianVortexBlob instance with zero circulation, center, and radius.

source
VEM.advection!Method
advection!(blobs, time, time_step; time_scheme=ODE.RK4())

Advance the position of a collection of blobs by a single time step according to the local velocity field induced by the collection. The positions of the blobs are updated in-place.

Arguments

  • blobs: An iterable collection of vortex blobs.
  • time: The time at the start of a time step.
  • time_step: The time increment over a single step.
  • time_scheme: (Optional) The time integration scheme to use. Defaults to OrdinaryDiffEq.RK4() (classical Runge-Kutta 4th order).
source
VEM.blob_center!Method
blob_center!(blob::AbstractVortexBlob, new_center)

Update the position of the vortex blob.

Arguments

  • blob: The vortex blob.
  • new_center: The new vortex blob position.
source
VEM.blob_centerMethod
blob_center(blob::AbstractVortexBlob)

Arguments

  • blob: The vortex blob.

Returns

The position of the vortex blob.

source
VEM.blob_circulation!Method
blob_circulation!(blob::AbstractVortexBlob, new_circulation)

Update the circulation of the vortex blob.

Arguments

  • blob: The vortex blob.
  • new_circulation: The new circulation strength.
source
VEM.blob_circulationMethod
blob_circulation(blob::AbstractVortexBlob)

Arguments

  • blob: The vortex blob.

Returns

The circulation of the vortex blob.

source
VEM.blob_dimensionMethod
blob_dimension(blob::AbstractVortexBlob)

Arguments

  • blob: The vortex blob.

Returns

The spatial dimension of the vortex blob.

source
VEM.blob_radius!Method
blob_radius!(blob::AbstractVortexBlob, new_radius)

Update the core radius of the vortex blob.

Arguments

  • blob: The vortex blob.
  • new_radius: The new core radius.
source
VEM.blob_radiusMethod
blob_radius(blob::AbstractVortexBlob)

Arguments

  • blob: The vortex blob.

Returns

The core radius of the vortex blob.

source
VEM.blob_scalarMethod
blob_scalar(blob::AbstractVortexBlob)

Arguments

  • blob: The vortex blob.

Returns

The floating-point type of the vortex blob data.

source
VEM.cells_per_axisMethod
cells_per_axis(mesh::CartesianMesh)

Get the number of cells per axis in the mesh.

Arguments

  • mesh: The Cartesian mesh.

Returns

The number of cells per axis in the Cartesian mesh.

source
VEM.diffusion!Method
diffusion!(blobs, viscosity, mesh, time, time_step; time_scheme=ODE.RK4())

Apply diffusion to the given blobs over a time step using the specified time integration scheme.

Arguments

  • blobs: A collection of blobs.
  • viscosity: The fluid viscosity.
  • mesh: The Cartesian mesh whose nodes are the locations of the blobs.
  • time: The time at the start of the time step.
  • time_step: The time increment for diffusion.
  • time_scheme: (Optional) The time integration scheme to use, default is ODE.RK4().
source
VEM.direct_sum!Method
direct_sum!(field, induced_field::AbstractInducedField, blobs, targets)

Compute the superposition of fields induced by a collection of blobs at a collection of targets (in-place).

Arguments

  • field: The superimposed induced field.
  • induced_field: The type of field to be induced by the blobs.
  • blobs: A single blob or an iterable collection of vortex blobs.
  • targets: A single target or an iterable collection of targets.
source
VEM.direct_sumMethod
direct_sum(induced_field::AbstractInducedField, blobs, targets)

Compute the superposition of fields induced by a collection of blobs at a collection of targets (out-of-place).

Arguments

  • induced_field: The type of field to be induced by the blobs.
  • blobs: A single blob or an iterable collection of vortex blobs.
  • targets: A single target or an iterable collection of targets.

Returns

A vector where each entry corresponds to the superposition of inductions at a target.

source
VEM.field_scalarMethod
field_scalar(::VelocityField, blob::AbstractVortexBlob)

Determine the scalar type of the velocity field induced by a vortex blob.

Arguments

  • ::VelocityField: The type of field that is induced.
  • blob: The vortex blob for which the field is being induced.

Returns

The scalar type of the velocity field induced by the vortex blob.

source
VEM.induceMethod
induce(::VelocityField, blob::GaussianVortexBlob{2}, target)

Compute the velocity induced at target due to a 2D Gaussian vortex blob.

Arguments

  • VelocityField: The type of field that is induced.
  • blob: The vortex blob.
  • target: The target position.

Returns

The induced velocity at target.

source
VEM.induceMethod
induce(::VorticityField, blob::GaussianVortexBlob{2}, target)

Compute the vorticity induced at target due to a 2D Gaussian vortex blob.

Arguments

  • VorticityField: The type of field that is induced.
  • blob: The vortex blob.
  • target: The target position.

Returns

The induced vorticity at target.

source
VEM.interpolate_circulationMethod
interpolate_circulation(blobs, mesh::CartesianMesh, kernel::AbstractRedistributionKernel)

Interpolate the circulation of the blobs onto the nodes of the mesh using the redistribution kernel.

Arguments

  • blobs: The vortex blobs whose circulation is to be interpolated.
  • mesh: The Cartesian mesh onto which the circulation will be interpolated at the nodes.
  • kernel: The redistribution kernel that determines the weights for interpolation.

Returns

The interpolated circulation at the nodes of the Cartesian mesh.

source
VEM.mesh_boundsMethod
mesh_bounds(mesh::CartesianMesh)

Get the bounds of the mesh.

Arguments

  • mesh: The Cartesian mesh.

Returns

The bounds of the Cartesian mesh as a tuple of tuples, where each inner tuple contains the minimum and maximum bounds along each axis.

source
VEM.mesh_dimensionMethod
mesh_dimension(::CartesianMesh)

Get the dimension of the CartesianMesh.

Arguments

  • ::CartesianMesh: The Cartesian mesh.

Returns

The dimension of the Cartesian mesh.

source
VEM.mesh_nodesMethod
mesh_nodes(mesh)

Get the nodes of the mesh.

Arguments

  • mesh: The Cartesian mesh.

Returns

The nodes of the Cartesian mesh as a matrix of static vectors.

source
VEM.mesh_scalarMethod
mesh_scalar(::CartesianMesh)

Get the scalar type of the CartesianMesh.

Arguments

  • ::CartesianMesh: The Cartesian mesh.

Returns

The scalar type of the Cartesian mesh.

source
VEM.node_spacingMethod
node_spacing(::CartesianMesh)

Get the spacing between nodes in the mesh.

Arguments

  • mesh: The Cartesian mesh.

Returns

The spacing between nodes in the Cartesian mesh.

source
VEM.nodes_per_axisMethod
nodes_per_axis(::CartesianMesh)

Get the number of nodes per axis in the mesh.

Arguments

  • mesh: The Cartesian mesh.

Returns

The number of nodes per axis in the Cartesian mesh.

source
VEM.population_control!Method
population_control!(blobs, tolerance)

Prune vortex blobs based on their circulation magnitude to maintain a manageable population size. The pruning procedure ensures that the sum of circulation magnitude removed is smaller than the specified tolerance multiplied by the sum of all circulation magnitudes.

Arguments

  • blobs: A collection of vortex blobs.
  • tolerance: A scalar value that determines a relative threshold for pruning.

Returns

  • removed_circulation: The total circulation removed due to pruning.
source
VEM.redistributionMethod
redistribution(old_blobs, mesh::CartesianMesh, kernel::AbstractRedistributionKernel)

Redistribute the old_blobs onto the mesh using the redistribution kernel.

Arguments

  • old_blobs: The vortex blobs to be redistributed.
  • mesh: The Cartesian mesh onto which the blobs will be redistributed at the nodes.
  • kernel: The redistribution kernel that determines the weights for redistribution.

Returns

The redistributed vortex blobs at the nodes of the Cartesian mesh.

source
VEM.redistribution_weightMethod
redistribution_weight(::M4Prime, distance)

Compute the redistribution weight for a given distance using the M4' kernel.

Arguments

  • ::M4Prime: An instance of the M4' redistribution kernel.
  • distance: The distance from the center of the vortex blob, normalized by the blob's core radius.

Returns

The redistribution weight corresponding to the given distance.

source
VEM.support_radiusMethod
support_radius(::M4Prime)

Arguments

  • ::M4Prime: An instance of the M4' redistribution kernel.

Returns

The support radius of the M4' redistribution kernel.

source