Problems
Fluid
ImmersedBodies.gridstep
— Functiongridstep(::CartesianGrid)
The spacing between grid vertices.
gridstep(::MultiDomainGrid, level=1)
Grid step on the level
th multi domain level.
ImmersedBodies.gridsize
— Functiongridsize(grid::CartesianGrid, pts::GridPoints=GridVertices())
Returns the dimensions of an array of points on the grid.
gridsize(grid::MultiDomainGrid, pts::GridPoints=GridVertices(), levels=:)
The dimensions of the multi domain grid.
ImmersedBodies.extents
— Functionextents(::CartesianGrid) -> ((xmin, xmax), (ymin, ymax))
Minimum and maximum coordinates of the grid.
ImmersedBodies.coords
— Functioncoords(grid::CartesianGrid, pts::GridPoints=GridVertices())
Returns a tuple of ranges (x, y)
such that (x[i], y[j])
is the coordinate of the point at index (i, j)
.
coords(grid::MultiDomainGrid, pts::GridPoints=GridVertices(), levels=:)
Return the coordinates of each CartesianGrid
subdomain in levels
.
coords(grid, func, ...)
Coordinates of the quantity func
on grid
. func
can be one of the following (or the in-place !
versions):
ImmersedBodies.fluid_grid
— Functionfluid_grid(; [h], xlims, ylims, nlevel)
A cartesian grid with step h
, limits xlims
and ylims
, and nlevel
total grids that expand outward. Each grid has the same center point, and grid step h * 2 ^ (level - 1)
for level
in 1:nlevel
. If h
is included, return a MultiDomainGrid
. Otherwise, return a MultiDomainExtents
and the grid step will be automatically computed when passed to Fluid
.
ImmersedBodies.CartesianGrid
— TypeCartesianGrid(h, xlims, ylims)
CartesianGrid(; h, xlims, ylims)
A Cartesian grid with grid step h
.
ImmersedBodies.MultiDomainGrid
— TypeMultiDomainGrid(; h, xlims, ylims, nlevel)
Multiple CartesianGrid
s with different scales, centered at the same point.
See also fluid_grid
.
ImmersedBodies.MultiDomainExtents
— TypeMultiDomainExtents(; xlims, ylims, nlevel)
The region defined by a MultiDomainGrid
, without the grid step.
See also fluid_grid
.
ImmersedBodies.subdomain
— Functionsubdomain(grid::MultiDomainGrid, level) :: CartesianGrid
Return the level
th multi domain level of grid
.
ImmersedBodies.GridMotion
— TypeGridMotion
The motion of the fluid discretization relative to the global frame in which the freestream velocity is expressed. Can be one of:
ImmersedBodies.StaticGrid
— TypeStaticGrid() :: GridMotion
A grid that is static in the global frame.
ImmersedBodies.MovingGrid
— TypeMovingGrid(f) :: GridMotion
A grid that moves in global frame. f(t)
should return a GridVelocity
that expresses the current motion of the grid.
ImmersedBodies.GridVelocity
— TypeGridVelocity(; center, vel, angle, angular_vel)
The current motion and orientation of the grid relative to the global frame.
Keywords
center
: The center of rotation.vel
: The grid's velocity in the global frame at the center of rotation.angle
: The grid's orientation relative to the global frame in radians.angular_vel
: The time rate of change ofangle
.
ImmersedBodies.Fluid
— TypeFluid(; grid, Re, freestream_vel, [grid_motion])
Keywords
grid::Union{MultiDomainGrid,MultiDomainExtents}
: The discretization of the fluid. Seefluid_grid
.Re
: Reynolds number.freestream_vel(t) -> (vx, vy)
: Freestream velocity as a function of time.grid_motion::GridMotion
: Whether the grid is moving relative to the global frame.
Bodies
ImmersedBodies.n_panels
— Functionn_panels(x)
The number of panels in a thing.
ImmersedBodies.Panels
— TypePanels(x::AbstractMatrix, ds::AbstractVector)
The positions xb
and lengths ds
of panels that influence the fluid. xb
has shape (n, 2)
and ds
has length n
.
ImmersedBodies.PanelState
— TypePanelState(; xb::AbstractMatrix, ds::AbstractVector, ub::AbstractMatrix)
The positions xb
, lengths ds
, and velocities ub
of panels that influence the fluid. xb
and ub
have shape (n, 2)
and ds
has length n
.
ImmersedBodies.AbstractBody
— TypeAbstractBody
A body that can be immersed in the fluid.
ImmersedBodies.PresetBody
— TypePresetBody <: AbstractBody
A body that is not influenced by the fluid.
ImmersedBodies.Bodies
— TypeBodies(; bodies::AbstractBody...)
A group of bodies. Keyword arguments specify bodies by their name.
ImmersedBodies.PanelSection
— TypePanelSection
Specifies a subsection of the panels in Bodies
.
ImmersedBodies.section_body
— Functionsection_body(section::PanelSection)
The AbstractBody
of a section
.
ImmersedBodies.panel_range
— Functionpanel_range(bodies::Bodies, body::Symbol)
panel_range(section::PanelSection)
The index range in the panels of the given body.
ImmersedBodies.bodypanels
— Functionbodypanels(body::AbstractBody)
The Panels
of a body's reference state.
ImmersedBodies.StaticBody
— TypeStaticBody(panels::Panels) :: PresetBody
A body that is fixed in place at panels
.
ImmersedBodies.RigidBodyTransform
— TypeRigidBodyTransform(pos, vel, angle, angular_vel)
RigidBodyTransform(; pos, vel, angle, angular_vel)
The transformation of a rigid body at a point in time. Relative to the global frame, the rigid body is at position (x, y) = pos
, traveling at velocity (vx, vy) = vel
, oriented at angle angle
, and rotating at rate angular_vel
.
ImmersedBodies.MovingRigidBody
— TypeMovingRigidBody(motion, panels::Panels) :: PresetBody
A non-deforming body with displacement and rotation over time. With zero displacement and zero angle, the body is at panels
. motion(t)
is the RigidBodyTransform
of the body at time t
.
Time-stepping Scheme
ImmersedBodies.timestep
— Functiontimestep(prob::Problem)
timestep(scheme::AbstractScheme)
The time between consecutive time steps.
ImmersedBodies.AbstractScheme
— TypeAbstractScheme
A time-stepping scheme.
ImmersedBodies.default_scheme
— Functiondefault_scheme([T,] grid; Umax, [cfl])
A default AbstractScheme
to hit a target cfl
number.
Arguments
T::Type{<:AbstractScheme}
: The type of scheme to return.grid::Union{CartesianGrid,MultiDomainGrid}
: The discretization of the fluid.Umax
: The maximum fluid velocity relative to the discretization.cfl
: Target CFL number.
ImmersedBodies.CNAB
— TypeCNAB(; dt, n=2)
An n
-step Crank-Nicolson/Adams-Bashforth timestepping scheme with time step dt
.
Problem
ImmersedBodies.Problem
— TypeProblem(; fluid::Fluid, bodies::Bodies, scheme::AbstractScheme)
Problem(fluid::Fluid, bodies::Bodies, scheme::AbstractScheme)
A description of the immersed boundary problem to solve.
State
ImmersedBodies.State
— TypeState(prob::Problem; t0=0.0)
The state of the prob
system at a certain time step. t0
specifies the time at state.index == 1
.
ImmersedBodies.x_velocity
— Functionx_velocity(state, [levels])
Return the x velocity array of state
on subdomain levels
.
ImmersedBodies.y_velocity
— Functiony_velocity(state, [levels])
Return the y velocity array of state
on subdomain levels
.
ImmersedBodies.vorticity
— Functionvorticity(state, [levels])
Return the vorticity array of state
on subdomain levels
.
ImmersedBodies.boundary_pos
— Functionboundary_pos(state)
boundary_pos(state, inds)
boundary_pos(state, body::Symbol)
Return the positions of each panel point. In the first form, return all of the points. In the second form, return the points at indices inds
. In the last form, return the points for the body named body
.
ImmersedBodies.boundary_len
— Functionboundary_len(state)
boundary_len(state, inds)
boundary_len(state, body::Symbol)
Return the lengths of each panel. See boundary_pos
for the meaning of the parameters.
ImmersedBodies.boundary_vel
— Functionboundary_vel(state)
boundary_vel(state, inds)
boundary_vel(state, body::Symbol)
Return the velocities of each panel. See boundary_pos
for the meaning of the parameters.
ImmersedBodies.boundary_force
— Functionboundary_(state)
boundary_force(state, inds)
boundary_force(state, body::Symbol)
Return the force on each panel by the fluid. See boundary_pos
for the meaning of the parameters.
ImmersedBodies.boundary_total_force
— Functionboundary_total_force(state)
boundary_total_force(state, inds)
boundary_total_force(state, body::Symbol)
The total [x, y]
force. See boundary_pos
for the meaning of the parameters.