Functions and types

Functions

ViscousFlow.evaluate_freestreamMethod
evaluate_freestream(t,x,sys; [subtract_translation = true])

Provide the components of the free stream velocity at time t. If the problem is set up in the rotational frame of reference, then this transforms the specified velocity and also subtracts the translational velocity of the center of rotation. (If subtract_translation = false, then it does not subtract this translation velocity.)

source
ViscousFlow.forceMethod
force(sol,sys,bodyi[;axes=0,reference_body=bodyi]) -> Tuple{Vector}

Calculate the moment and force exerted by the fluid on body bodyi from the computational solution sol of system sys. It returns the force history as a tuple of arrays: one array for each component. If axes=0 (the default), then the components are provided in the inertial coordinate system. However, this can be changed to any body ID to provide the components in another system. The keyword force_reference determines which body's system the moment is taken about. By default, it is the body bodyi itself, but any other body can be specified, or the inertial system (by specifying 0).

source
ViscousFlow.momentMethod
moment(sol,sys,bodyi[;center=(0,0)]) -> Vector

Calculated the momemt exerted by the fluid on body bodyi from the computational solution sol of system sys. It returns the moment history as an array. The moment is calculated about center center, which defaults to (0,0) in whichever coordinate system the problem is solved.

source
ViscousFlow.powerMethod
power(sol,sys,bodyi;include_freestream=false)

Calculate the history of the total rate of work done by the flow on body bodyi (or on the flow by the body, if negative) from the computational solution sol of system sys. If freestream=false (default), then the free stream is not subtracted from the translational velocity in the calculation. If it is true, then the translational part of power is based on translational velocity minus the free stream (i.e., a reference frame at rest at infinity).

source
ViscousFlow.setup_gridMethod
setup_grid(xlim::Tuple,ylim::Tuple,phys_params::Dict[;nthreads_max=length(Sys.cpu_info())])

Construct a Cartesian grid with limits xlim and ylim and spacing determined by the Reynolds number in the phys_params. The maximum number of threads can be optionally set; it defaults to the number of processor cores.

source
ViscousFlow.surface_point_spacingMethod
surface_point_spacing(g::PhysicalGrid,phys_params)

Calculate the surface point spacing for a given grid, using the specified parameter "point spacing ratio" in the physical parameters, or the default value (1.4) if not specified.

source
ViscousFlow.velocity_rel_to_inertial_frame!Method
velocity_rel_to_inertial_frame!(u_prime,x,t,base_cache,phys_params,motions)

Changes the input velocity u_prime (u', which is measured relative to the translating frame) to u (measured relative to the inertial frame, but expressed in rotating coordinates). Note that the inertial frame has zero velocity at infinity, so any free stream is also removed here.

source
ViscousFlow.velocity_rel_to_rotating_frame!Method
velocity_rel_to_rotating_frame!(u_prime,x,t,base_cache,phys_params,motions)

Changes the input velocity u_prime (u', which is measured relative to the translating frame) to û (measured relative to the translating/rotating frame)

source
ViscousFlow.viscousflow_systemMethod
viscousflow_system(grid,[bodies];kwargs...)

Construct the operators and cache variables for a viscous flow problem.

The kwargs are the optional keyword aguments. There are several, some of which are crucial for certain types of problems.

  • ddftype = to set the DDF type. The default is CartesianGrids.Yang3.
  • scaling = to set the scaling type, GridScaling (default) or IndexScaling.
  • dtype = to set the element type to Float64 (default) or ComplexF64.
  • phys_params = A dictionary to pass in physical parameters, or to pass in alternative models for the freestream velocity (with the "freestream" key)
  • bc = A dictionary to pass in boundary condition data or functions, using "external" and "internal" keys to pass in functions that provide the corresponding surface data outside and inside the surface(s).
  • forcing = A dictionary to pass in forcing models (via the "forcing models" key)
  • motions = to provide function(s) that specify the velocity of the immersed surface(s).
  • reference_body = to solve the problem in a reference frame attached to a body rather than the inertial frame (with is the default, with body number 0).
  • timestep_func = to pass in a function for time-dependent problems that provides the time-step size. It is expected that this function takes in two arguments, the grid::PhysicalGrid and phys_params, and returns the time step. It defaults to the basic Fourier/CFL type function default_timestep
source

Types

Index