pub struct PanelMethod { /* private fields */ }Expand description
Source panel method for potential flow around a body.
Solves the boundary integral equation: -σ(x)/2 + ∫Γ ∂G/∂n(x,y) σ(y) dΓ(y) = -V∞ · n(x)
where σ is the source strength distribution, V_∞ is the free-stream velocity, and n is the outward normal. After solving, the surface velocity and pressure coefficient can be evaluated.
Implementations§
Source§impl PanelMethod
impl PanelMethod
Sourcepub fn new(mesh: BoundaryMesh, cfg: PanelMethodConfig) -> Self
pub fn new(mesh: BoundaryMesh, cfg: PanelMethodConfig) -> Self
Create a new panel method solver.
Sourcepub fn solve(&mut self) -> IntegrateResult<()>
pub fn solve(&mut self) -> IntegrateResult<()>
Solve for the source strength distribution σ on the boundary.
The no-penetration BC requires V_∞ · n = 0 on the body surface, leading to the RHS: b[i] = -V_∞ · n_i.
Sourcepub fn velocity_at(&self, p: [f64; 2]) -> [f64; 2]
pub fn velocity_at(&self, p: [f64; 2]) -> [f64; 2]
Evaluate the induced velocity at a field point p (must be exterior).
u_induced(p) = ∫_Γ σ(y) ∇_p G(p, y) dΓ(y)
Sourcepub fn surface_cp(&self) -> IntegrateResult<(Vec<f64>, Vec<f64>)>
pub fn surface_cp(&self) -> IntegrateResult<(Vec<f64>, Vec<f64>)>
Evaluate the surface velocity magnitude and pressure coefficient on each panel’s midpoint.
Returns (velocities, cp_values) where each entry corresponds to a panel.
Sourcepub fn source_strengths(&self) -> &[f64]
pub fn source_strengths(&self) -> &[f64]
Return a reference to the computed source strengths.
Sourcepub fn potential_at(&self, p: [f64; 2]) -> f64
pub fn potential_at(&self, p: [f64; 2]) -> f64
Compute source panel velocity potential Φ at field point p.
Auto Trait Implementations§
impl Freeze for PanelMethod
impl RefUnwindSafe for PanelMethod
impl Send for PanelMethod
impl Sync for PanelMethod
impl Unpin for PanelMethod
impl UnsafeUnpin for PanelMethod
impl UnwindSafe for PanelMethod
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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