pub struct FluidDynamicsOperations;Expand description
Fluid dynamics operations
Implementations§
Source§impl FluidDynamicsOperations
impl FluidDynamicsOperations
Sourcepub fn vorticity(
velocity_field: &[Expression],
variables: Vec<Symbol>,
) -> Vec<Expression>
pub fn vorticity( velocity_field: &[Expression], variables: Vec<Symbol>, ) -> Vec<Expression>
Compute vorticity (curl of velocity field)
§Examples
use mathhook_core::calculus::derivatives::FluidDynamicsOperations;
use mathhook_core::{Expression, symbol};
let x = symbol!(x);
let y = symbol!(y);
let velocity_field = vec![
Expression::mul(vec![Expression::integer(-1), Expression::symbol(y.clone())]),
Expression::symbol(x.clone())
];
let vorticity = FluidDynamicsOperations::vorticity(&velocity_field, vec![x, y]);Sourcepub fn circulation(
velocity_field: &[Expression],
variables: &[Symbol],
) -> Expression
pub fn circulation( velocity_field: &[Expression], variables: &[Symbol], ) -> Expression
Compute circulation (line integral of velocity around closed curve)
§Examples
use mathhook_core::calculus::derivatives::FluidDynamicsOperations;
use mathhook_core::{Expression};
use mathhook_core::symbol;
let x = symbol!(x);
let y = symbol!(y);
let velocity_field = vec![
Expression::symbol(y.clone()),
Expression::mul(vec![Expression::integer(-1), Expression::symbol(x.clone())])
];
let circulation = FluidDynamicsOperations::circulation(&velocity_field, &[x, y]);Sourcepub fn is_incompressible(
velocity_field: &[Expression],
variables: Vec<Symbol>,
) -> bool
pub fn is_incompressible( velocity_field: &[Expression], variables: Vec<Symbol>, ) -> bool
Check if velocity field is incompressible (divergence = 0)
§Examples
use mathhook_core::calculus::derivatives::FluidDynamicsOperations;
use mathhook_core::{Expression};
use mathhook_core::symbol;
let x = symbol!(x);
let y = symbol!(y);
let velocity_field = vec![
Expression::symbol(y.clone()),
Expression::mul(vec![Expression::integer(-1), Expression::symbol(x.clone())])
];
let is_incompressible = FluidDynamicsOperations::is_incompressible(&velocity_field, vec![x, y]);Auto Trait Implementations§
impl Freeze for FluidDynamicsOperations
impl RefUnwindSafe for FluidDynamicsOperations
impl Send for FluidDynamicsOperations
impl Sync for FluidDynamicsOperations
impl Unpin for FluidDynamicsOperations
impl UnsafeUnpin for FluidDynamicsOperations
impl UnwindSafe for FluidDynamicsOperations
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more