Force and moment partitioning influence potential solver 2D

Version 2.0.1 (5.75 KB) by Xiaowei He
Computes 2-D influence potential fields of the force and moment partitioning method using the MATLAB Partial Differential Equation Toolbox.
47 Downloads
Updated 20 Jul 2023

View License

fmpmPotentialPDE2d computes the influence potential field of the
force and moment partitioning method [1] using the MATLAB Partial
Differential Equation Toolbox.
Two-Dimensional version developed based on code used in Zhu et al. [2].
The boundary conditions on the non-reference geometry are
(n dot grad(phi)) = 0 in multi-body configurations, which implies the
non-penetration property of the influence field.
-------------------------------------------------------------------------
Syntax:
phi = fmpmPotentialPDE2d(xdomain, ydomain, geo, 'loadtype')
phi = fmpmPotentialPDE2d(xdomain, ydomain, geo1, geo2, ..., geoN, 'loadtype')
phi = fmpmPotentialPDE2d(__, refgeoN)
phi = fmpmPotentialPDE2d(__, refgeoN, innerTrSize, outerTrSize)
[phi, X, Y] = fmpmPotentialPDE2d(__)
[__, bodygeo] = fmpmPotentialPDE2d(__)
[__, bodygeo, x_surf, y_surf] = fmpmPotentialPDE2d(__)
[__, bodygeo, x_surf, y_surf, phi_surf] = fmpmPotentialPDE2d(__)
[__, bodygeo, x_surf, y_surf, phi_surf, dphidx_surf, dphidy_surf] = fmpmPotentialPDE2d(__)
[__, bodygeo, x_surf, y_surf, phi_surf, dphidx_surf, dphidy_surf, norm_surf] = fmpmPotentialPDE2d(__)
-------------------------------------------------------------------------
Inputs:
xdomain: x-coordiante vector of the computational domain (outter boundary).
ydomain: y-coordiante vector of the computational domain (outter boundary).
geo1, geo2, ..., geoN: N-by-2 vectors give the x and y coordinates of the
body geometries. (inner boundary). The first
geometry geo1 is the reference geometry for which
the phi field will be computed by default. The
referece geometry/geometries can be specified by
the refgeoN argument otherwise.
'loadtype': a char variable that specifies the type of load of which the
influence field will be computed. 'loadtype' must be 'lift',
'pitch', or 'drag'. When 'pitch' is used, a 1-by-2 array,
refaxis, that specifies the x and y coordinates of the pitch
moment reference axis should follow the 'pitch' argument. If
refaxis is empty [], the default refaxis is the geometric
center of the reference geometry.
refgeoN: a scalar or a row vector that specifies the reference
geometry/geometries for the phi field. The values of the
elements refer to the order of geo1, geo2, ..., geoN inputs. The
default reference geometry is geo1 if refgeoN is not specified
or refgeoN = [];
innerTrSize: a scalar that specifies the size of the triangular mesh on
the inner boudaries (bodies). The default value is 0.5*ds
where ds is the minimum unit length of the computational
domain if innerTrSize is not specified or innerTrSize = [];
outerTrSize: a scalar that specifies the size of the triangular mesh on
the outer boudaries (computational domain). The default
value is 10*ds where ds is the minimum unit length of the
computational domain if outerTrSize is not specified or
outerTrSize = [];
-------------------------------------------------------------------------
Outputs:
phi: influence potential field.
X: x-coordinate mesh generated based on xdomain and ydomain.
Y: y-coordinate mesh generated based on xdomain and ydomain.
bodygeo: polyshape object defined by the geo input.
x_surf: x-coordinate vector of the data points on the reference body
surface.
y_surf: y-coordinate vector of the data points on the reference body
surface.
phi_surf: phi vector of the data points on the reference body surface.
dphidx_surf: vector of gradients of phi in the x-direction on the data
points on the reference body surface.
dphidy_surf: vector of gradients of phi in the y-direction on the data
points on the reference body surface.
normxy_surf: an N-by-2 array that contains the x- (first column) and y-
(second column) componets of the surface normal vectors of
the reference geometries. The dimension and the order of
normxy_surf corespond to x_surf and y_surf.
-------------------------------------------------------------------------
Examples:
1. geo = [[-0.5, 0.5, 0]', [-0.5, -0.5, 0.5]'];
[phi, X, Y] = fmpmPotentialPDE2d(-2:0.1:2, -1:0.1:1, geo, 'lift');
Computes the lift influence potential field on a triangle defiend by
points (-0.5, -0.5), (0.5, -0.5), and (0, 0.5) in a computational
domain defiend by x-coordinates -2:0.1:2 and y-coordinates -1:0.1:1.
Output phi returns the influence field; X and Y return the mesh grids.
2. geo1 = [[-0.5, 0.5, 0]', [-0.5, -0.5, 0.5]'];
geo2 = [[0, 1.2, 1.2, 0]', [-0.2, -0.2, 0.1, 0.1]'];
[phi, ~, ~, bodyshape] = ...
fmpmPotentialPDE2d(-2:0.1:2, -1:0.1:1, geo1, geo2, 'pitch', [0.5, 0], 2, 0.05, 0.1);
Computes the pitch moment influence potential field on geo2
(as refgeoN = 2) in a multi-body geometry by geo1 and geo2. The size
of the triangular mesh on the geometry is 0.05 on the inner boundaries
and 0.1 on the outer boudaries. The pitch moment reference point is
given by refaxis = [0.5, 0]. Output bodyshape returns the combined
geometry as a polyshape object.
3. geo1 = [[-0.5, 0.5, 0]', [-0.5, -0.5, 0.5]'];
geo2 = [[0, 1.2, 1.2, 0]', [-0.2, -0.2, 0.1, 0.1]'];
geo3 = [[0.1, 1.3, 1.3, 0.1]', [-0.3, -0.3, 0, 0]'];
phi = fmpmPotentialPDE2d(-2:0.1:2, -1:0.1:1, geo1, geo2, geo3, 'pitch', [], [1, 3]);
Computes the pitch moment influence potential field on the combined
body of geo1 and geo3 (as refgeoN = [1, 3]) referenced to the
geometric center (as refaxis = []) of the combined geometry.
4. geo1 = [[-0.5, 0.5, 0]', [-0.5, -0.5, 0.5]'];
geo2 = [[0, 1.2, 1.2, 0]', [-0.2, -0.2, 0.1, 0.1]'];
[phi, ~, ~, bodyshape, x_surf, y_surf, phi_surf, ~, ~, normxy_surf] = ...
fmpmPotentialPDE2d(-2:0.1:2, -1:0.1:1, geo1, geo2, 'lift');
Computes the lift influence potential field of geo1 (default setting
as refgeoN is not specified) and returns the polygon object of the
conbined geometry that contains geo1 and geo2. x_surf and y_surf
returns the coordinates of the surface data points on the reference
geometry geo1. phi_surf returns the corresponding phi values and
normxy_surf returns the corresponding surface normal vectors of these
points.
-------------------------------------------------------------------------
version 2.0.1
- Fixed a bug where using a single output argument causes a formatting
error.
Xiaowei He and Yuanhang Zhu
7/20/2023
% -------------------------------------------------------------------------
version 2.0.0
- Extended the influence field to multi-body configurations.
- Added an output argument for surface normal vectors on the reference
geometry.
- Optimized the organization of the input and output arguments
accordingly.
- Updates in the headlines and examples.
Xiaowei He and Yuanhang Zhu
7/17/2023
-------------------------------------------------------------------------
version 1.2.1
- Optimized the outer boundary detection to prevent potential false
boundary conditions.
- Changed the default minimum triangular size to 0.5*innerTrSize to
prevent potential insufficient element size.
Xiaowei He and Yuanhang Zhu
6/19/2023
-------------------------------------------------------------------------
version 1.1.0
- Added output options including phi values on the body surface and the
corresponding x- and y- gradients. See e.g.3 and e.g.4.
Xiaowei He and Yuanhang Zhu
6/15/2023
-------------------------------------------------------------------------
version 1.0.0
Xiaowei He and Yuanhang Zhu
05/30/2023
-------------------------------------------------------------------------
[1]. Menon, K. & Mittal, R. (2021). Quantitative analysis of the
kinematics and induced aerodynamic loading of individual vortices in
vortex-dominated flows: A computation and data-driven approach. Journal
of Computational Physics 443, 110515.
[2]. Zhu et al. (2023). Force moment partitioning and scaling analysis of
vortices shed by a 2D pitching wing in quiescent fluid. arXiv:2301.13373
[physics.flu-dyn].
-------------------------------------------------------------------------

Cite As

Xiaowei He (2024). Force and moment partitioning influence potential solver 2D (https://www.mathworks.com/matlabcentral/fileexchange/130274-force-and-moment-partitioning-influence-potential-solver-2d), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
2.0.1

- Fixed a bug where using a single output argument causes a formatting error.

2.0.0

- Extended the influence field to multi-body configurations.
- Added an output argument for surface normal vectors on the reference geometry.
- Optimized the organization of the input and output arguments accordingly.
- Updates in the headlines.

1.2.1

- Optimized the outer boundary detection to prevent potential false boundary conditions.
- Changed the default minimum triangular size to 0.5*innerTrSize to prevent potential insufficient element size.

1.2.0

- Added output options including phi values on the body surface and the corresponding x- and y- gradients.

1.0.0