Public Documentation
Documentation for GridPotentialFlow.jl
's public interface.
See the Internals section of the manual for internal package docs covering all submodules.
Contents
Index
GridPotentialFlow.PotentialFlowBody
GridPotentialFlow.PotentialFlowBody
GridPotentialFlow.Vortex
GridPotentialFlow.VortexModel
GridPotentialFlow.VortexModel
Base.length
GridPotentialFlow.addedmass
GridPotentialFlow.getU
GridPotentialFlow.getrange
GridPotentialFlow.getvortexpositions
GridPotentialFlow.getΓ
GridPotentialFlow.getΩ
GridPotentialFlow.impulse
GridPotentialFlow.impulse
GridPotentialFlow.impulse
GridPotentialFlow.pushvortices!
GridPotentialFlow.setU
GridPotentialFlow.setU∞
GridPotentialFlow.setvortexpositions!
GridPotentialFlow.setvortexstrengths!
GridPotentialFlow.setvortices!
GridPotentialFlow.setΓ
GridPotentialFlow.setΩ
GridPotentialFlow.solve
GridPotentialFlow.solve!
GridPotentialFlow.streamfunction
GridPotentialFlow.streamfunction!
GridPotentialFlow.subtractcirculation!
GridPotentialFlow.vortexvelocities!
GridPotentialFlow.vortexvelocities!
GridPotentialFlow.vorticity
GridPotentialFlow.vorticity!
Public Interface
GridPotentialFlow.PotentialFlowBody
— Typemutable struct PotentialFlowBody
Defines a rigid body for VortexModel
in GridPotentialFlow.jl
.
GridPotentialFlow.PotentialFlowBody
— MethodPotentialFlowBody(
b::Body{N, C};
U,
Ω,
Γ,
edges,
σ
) -> PotentialFlowBody
Constructs a potential flow body with shape b
, linear velocity U
, rotational velocity Ω
, and initial circulation Γ
. Edges that should be regularized can be specified in edges
and their suction parameter ranges in σ
, which defaults to zero for each regularized edge.
GridPotentialFlow.Vortex
— Typemutable struct Vortex
Defines a point vortex with x-position x
, y-position y
, and strength Γ
.
Fields
x::Float64
: x: x-coordinate of the vortex position.y::Float64
: y: y-coordinate of the vortex position.Γ::Float64
: Γ: Strength of the vortex. Positive if counter-clockwise.
GridPotentialFlow.VortexModel
— Typemutable struct VortexModel{Nb, Ne, TS<:Union{Laplacian, GridPotentialFlow.AbstractPotentialFlowSystem}, TU<:Nodes, TE<:Edges, TF<:ScalarData, TX<:VectorData, ILS<:Union{Nothing, ILMSystem}}
Defines a grid-based vortex model with Nb
bodies and Ne
edges that are regularized. If isshedding
is true
, the strengths of the last Ne
vortices in vortices
can be computed in order to regularized the Ne
edges.
Fields
g::PhysicalGrid
: g: The grid on which the vortex model is defined.bodies::Vector{PotentialFlowBody}
: bodies: Bodies in the vortex model.vortices::StructArrays.StructVector{Vortex}
: vortices: Point vortices in the vortex model.U∞::Tuple{Float64, Float64}
: U∞: Uniform flow in the vortex model.system::Union{Laplacian, GridPotentialFlow.AbstractPotentialFlowSystem}
: system: Potential flow system that has to be solved with anAbstractPotentialFlowRHS
and anAbstractPotentialFlowSolution
to compute the potential flow that governs the vortex model.
ilsys::Union{Nothing, ILMSystem}
_nodedata::Nodes
: Internal fields_edgedata::Edges
_bodyvectordata::VectorData
_ψ::Nodes
_f::ScalarData
_w::Nodes
_ψb::ScalarData
Examples
(under construction)
GridPotentialFlow.VortexModel
— MethodVortexModel(
g::PhysicalGrid,
bodies::Vector{PotentialFlowBody},
vortices::StructArrays.StructVector{Vortex},
U∞::Tuple{Float64, Float64}
) -> VortexModel{_A, _B, _C, Nodes{Dual, _A1, _B1, Float64, Matrix{Float64}}, _D, ScalarData{_A2, T, _B2}} where {_A, _B, _C<:Union{Laplacian, GridPotentialFlow.AbstractPotentialFlowSystem}, _A1, _B1, _D<:Edges, _A2, T<:Number, _B2<:(AbstractVector)}
Constructs a vortex model using the given function.
Base.length
— Methodlength(b::PotentialFlowBody) -> Any
Returns the number of surface points in the body b
.
GridPotentialFlow.addedmass
— Methodaddedmass(vm)
Computes the translational coefficients of the added mass matrix of the bodies in the vortex model vm
.
GridPotentialFlow.getU
— MethodgetU(b::PotentialFlowBody) -> Tuple{Float64, Float64}
Returns the linear velocity of the body b
.
GridPotentialFlow.getrange
— Methodgetrange(
b::AbstractVector{PotentialFlowBody},
i::Int64
) -> Any
Returns the subrange of indices in the global set of surface point data corresponding to body i
in b
.
GridPotentialFlow.getvortexpositions
— Methodgetvortexpositions(vm)
Returns the positions of the vortices in the vortex model vm
.
GridPotentialFlow.getΓ
— MethodgetΓ(b::PotentialFlowBody) -> Float64
Returns the bound circulation of the body b
.
GridPotentialFlow.getΩ
— MethodgetΩ(b::PotentialFlowBody) -> Float64
Returns the rotational velocity of the body b
.
GridPotentialFlow.impulse
— Methodimpulse(vm)
Computes the impulse associated with the current state vortices and bodies in the vortex model vm
. Note that newly inserted vortices should have their strengths set prior to calling this function to be included in the impulse calculation.
GridPotentialFlow.impulse
— Methodimpulse(vm, wphysical, fphysical)
Computes the impulse associated with the vorticity wphysical
, the bound vortex sheet strength fphysical
, and the velocities of the discrete points of the bodies in vm
.
GridPotentialFlow.impulse
— Methodimpulse(sol, vm)
Computes the impulse associated with the body motions in the vortex model vm
and the vortex sheet strength in sol
. Note that newly inserted vortices should have their strengths set prior to calling this function to be included in the impulse calculation.
GridPotentialFlow.pushvortices!
— Methodpushvortices!(vm, newvortices)
Adds newvortices
to the existing vortices in the vortex model vm
.
GridPotentialFlow.setU
— MethodsetU(
b::PotentialFlowBody,
U::Tuple{Float64, Float64}
) -> Tuple{Float64, Float64}
Sets the linear velocity of the body b
to U
.
GridPotentialFlow.setU∞
— MethodsetU∞(vm, U∞)
Sets the uniform flow of the vortex model vm
to U∞
.
GridPotentialFlow.setvortexpositions!
— Methodsetvortexpositions!(vm, X)
Sets the positions of the vortices in the vortex model vm
to the provided X
.
GridPotentialFlow.setvortexstrengths!
— Methodsetvortexstrengths!(vm, Γ)
setvortexstrengths!(vm, Γ, idx)
Sets the strenghts of the vortices in the vortex model vm
to the provided Γ
. Indices can be provided in idx
to specify the indices of the vortices whose strengths have to be set, in which case the length of Γ
must be the same as the number of indices.
GridPotentialFlow.setvortices!
— Methodsetvortices!(vm, newvortices)
Replaces the vortices of the vortex model vm
by a copy of newvortices
.
GridPotentialFlow.setΓ
— MethodsetΓ(b::PotentialFlowBody, Γ::Float64) -> Float64
Sets the bound circulation of the body b
to Γ
.
GridPotentialFlow.setΩ
— MethodsetΩ(b::PotentialFlowBody, Ω::Float64) -> Float64
Sets the rotational velocity of the body b
to Ω
.
GridPotentialFlow.solve!
— Methodsolve!(sol, vm)
Solves the saddle point system associated with the vortex model vm
and stores the solution in sol
. If the vortex model contains bodies with regularized edges and a number of vortices which is greater than or equal to the number of regularized edges, the returned solution contains the computed strengths of the last N vortices in vm
, with N the number of regularized edges.
GridPotentialFlow.solve
— Methodsolve(vm)
Solves the saddle point system associated with the vortex model vm
and returns the solution. If the vortex model contains bodies with regularized edges and a number of vortices which is greater than or equal to the number of regularized edges, the returned solution contains the computed strengths of the last N vortices in vm
, with N the number of regularized edges.
GridPotentialFlow.streamfunction!
— Methodstreamfunction!(ψ, vm)
Computes the stream function field ψ
on the physical grid for the potential flow associated with the current state of the vortex model vm
.
GridPotentialFlow.streamfunction
— Methodstreamfunction(vm)
Computes and returns the stream function field on the physical grid for the potential flow associated with the current state of the vortex model vm
.
GridPotentialFlow.subtractcirculation!
— Methodsubtractcirculation!(
b::AbstractVector{PotentialFlowBody},
δΓ_vec::AbstractVector
)
Returns the indices in the global set of surface point data of all regularized points in b
.
GridPotentialFlow.vortexvelocities!
— Methodvortexvelocities!(Ẋ_vortices, vm, ψ)
Computes and stores in Ẋ_vortices
the flow velocity, associated with the discrete vector potential field ψ
, as VectorData
at the locations of the vortices stored in the vortex model vm
.
GridPotentialFlow.vortexvelocities!
— Methodvortexvelocities!(vm)
Returns the flow velocity as VectorData
at the locations of the vortices stored in the vortex model vm
, accounting for bodies in vm
. If the vm
has Ne
regularized edges and vortices, the strengths of the last Ne
vortices will be computed and set in vm
and the circulation of the shedded vortices will be subtracted from the bound circulation of each body.
GridPotentialFlow.vorticity!
— Methodvorticity!(wphysical, vm; onlybulk)
Computes the vorticity field w
associated with the vortices stored in the vortex model vm
on the physical grid. If the extra boolean keyword onlybulk
is set to true
, the function ignores the vorticity from the last Ne
vortices in vm
.
GridPotentialFlow.vorticity
— Methodvorticity(vm)
Computes the vorticity field associated with the vortices stored in the vortex model vm
on the physical grid.