|
Nektar++
|
Integrate pressure and viscous forces over selected boundaries. More...
#include <AeroForcesOp.hpp>
Public Member Functions | |
| void | Configure (const std::vector< unsigned int > &velocityComponents, const MultiRegions::ExpListSharedPtr &pressureExpansion, const unsigned int pressureComponent, const std::vector< bool > &selectedBoundaryRegions, const TData rho, const TData mu, const std::array< TData, 3 > &pivot) |
velocityComponents and pressureComponent are the indices of the velocity and pressure in the fields whose gradient and values Apply() receives, which may hold further components. | |
| void | Apply (LibUtilities::Field< TData, FieldState::Phys > &pressure, LibUtilities::Field< TData, FieldState::Phys > &velocityGradient) |
| Collective: every rank must call it. | |
| void | operator() (LibUtilities::Field< TData, FieldState::Phys > &pressure, LibUtilities::Field< TData, FieldState::Phys > &velocityGradient) |
| Collective: as Apply(). | |
| void | SetRootOnly (const bool rootOnly) |
Reduce the results of the next Apply() to rank zero alone if rootOnly, else to every rank. | |
| std::array< TData, 3 > | GetPressureForce () |
| Pressure force from the last Apply(). | |
| std::array< TData, 3 > | GetViscousForce () |
| Viscous force from the last Apply(). | |
| std::array< TData, 3 > | GetPressureMoment () |
| Moment of the pressure traction about the pivot from the last Apply(). | |
| std::array< TData, 3 > | GetViscousMoment () |
| Moment of the viscous traction about the pivot from the last Apply(). | |
Public Member Functions inherited from Nektar::MultiRegions::Operator< TData > | |
| virtual | ~Operator ()=default |
| Operator (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components) | |
| Construct the interface part of a concrete operator; called by the factory-registered creator functions. | |
Static Public Member Functions | |
| static std::shared_ptr< AeroForcesOp< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components, const std::string &execStr="") |
expansionList and components are those of the velocity. | |
Static Public Member Functions inherited from Nektar::MultiRegions::Operator< TData > | |
| template<template< typename > typename TOperator> | |
| static std::shared_ptr< TOperator< TData > > | Create (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > components, const std::string &execStr) |
| Create a concrete operator instance through the operator factory. | |
| static std::string | GetOpExecSpace (std::shared_ptr< LibUtilities::SessionReader > session, const bool warn=true) |
| Return the execution space name ("opExecSpace") for an operator. | |
| static const DefaultOpImplRule * | GetDefaultOpImplRule (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace) |
| Return the row of the default implementation table (DefaultOpImplTable.hpp) that a block of elements takes, or null if none does. | |
| static std::string | GetDefaultOpImpl (const StdRegions::StdExpansionSharedPtr &exp, const std::string &execSpace) |
| Return the implementation a block of elements takes when neither the command line nor the session names one for its operator. | |
| static std::vector< unsigned int > | GetDefaultInterleaveWidths (const MultiRegions::ExpListSharedPtr &expansionList) |
Return the default interleave widths, one per block of expansionList, that persistent Fields (e.g. solution storage, time-integration and linear-solver workspace) built on it should be constructed with. | |
| static bool | IsDiscontinuousProjection (std::shared_ptr< LibUtilities::SessionReader > session) |
| Return true if the session uses a Discontinuous (DG) projection. | |
Static Public Attributes | |
| static const std::string | name = "AeroForces" |
Protected Member Functions | |
| AeroForcesOp (const MultiRegions::ExpListSharedPtr &expansionList, const std::vector< std::string > &components) | |
| ~AeroForcesOp () override=default | |
| virtual void | v_Configure (const std::vector< unsigned int > &velocityComponents, const MultiRegions::ExpListSharedPtr &pressureExpansion, const unsigned int pressureComponent, const std::vector< bool > &selectedBoundaryRegions, const TData rho, const TData mu, const std::array< TData, 3 > &pivot)=0 |
| virtual void | v_Apply (LibUtilities::Field< TData, FieldState::Phys > &pressure, LibUtilities::Field< TData, FieldState::Phys > &velocityGradient)=0 |
| std::array< TData, 3 > | GetResultVector (const unsigned int offset) |
The 3-vector at offset of the reduced result, read on the host. | |
Protected Attributes | |
| bool | m_rootOnly = false |
| Whether Apply() reduces the results to rank zero alone. | |
| LibUtilities::MemoryRegion< TData > | m_result |
| Reduced result of Apply(), of size resultSize, allocated by Configure(). | |
Protected Attributes inherited from Nektar::MultiRegions::Operator< TData > | |
| MultiRegions::ExpListSharedPtr | m_expansionList |
| Expansion list the operator acts on. | |
| std::vector< std::string > | m_components |
| Names of the field components the operator was built for. | |
| LibUtilities::NekDataWarehouseSharedPtr | m_dataWarehouse |
| Data warehouse shared with the other operators on the expansion list, used to build and cache shared tables (basis matrices, mode indices, geometric factors) once. | |
Static Protected Attributes | |
| static constexpr unsigned int | pressureForce = 0 |
| Offsets of the 3-vectors in m_result. | |
| static constexpr unsigned int | viscousForce = 3 |
| static constexpr unsigned int | pressureMoment = 6 |
| static constexpr unsigned int | viscousMoment = 9 |
| static constexpr unsigned int | resultSize = 12 |
| Number of entries in m_result. | |
Integrate pressure and viscous forces over selected boundaries.
Volume-to-boundary restriction, traction evaluation, quadrature and the local reduction execute in the selected operator execution space, and the forces and moments are reduced across the ranks in one packed buffer.
After Apply(), the getters return Cartesian 3-vectors, with component d (0 = x, 1 = y, 2 = z) at index d:
GetViscousMoment(): the moment of the viscous traction about the pivot.
\( \Gamma \) is the union of the selected boundary regions, \( \mathbf{n} \) the unit normal pointing out of the domain, so that the forces are those the fluid exerts on the boundary, and \( \mathbf{r} \) the position relative to the pivot. In 2D the z force components and the x and y moment components are zero, and the z moment components hold the in-plane moments.
A 3DH1 expansion is integrated as its 2D planes are: each local plane gives the forces and moments per unit span, as in 2D, from the in-plane velocity gradient, and the result is their average over all the planes.
Apply() is collective: every rank must call it. The getters read the reduced values on the host, on every rank, or on rank zero only after SetRootOnly(true), which reduces them to rank zero alone. Internally the four 3-vectors are packed in m_result, starting at the offsets pressureForce, viscousForce, pressureMoment and viscousMoment.
Definition at line 84 of file AeroForcesOp.hpp.
|
inlineprotected |
Definition at line 175 of file AeroForcesOp.hpp.
|
overrideprotecteddefault |
|
inline |
Collective: every rank must call it.
Definition at line 114 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::v_Apply().
|
inline |
velocityComponents and pressureComponent are the indices of the velocity and pressure in the fields whose gradient and values Apply() receives, which may hold further components.
Definition at line 102 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::v_Configure().
|
inlinestatic |
expansionList and components are those of the velocity.
Definition at line 88 of file AeroForcesOp.hpp.
Referenced by Nektar::FilterAeroForces::v_Initialise().
|
inline |
Pressure force from the last Apply().
Definition at line 136 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::GetResultVector(), and Nektar::AeroForcesOp< TData >::pressureForce.
|
inline |
Moment of the pressure traction about the pivot from the last Apply().
Definition at line 149 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::GetResultVector(), and Nektar::AeroForcesOp< TData >::pressureMoment.
|
inlineprotected |
The 3-vector at offset of the reduced result, read on the host.
Definition at line 195 of file AeroForcesOp.hpp.
References ASSERTL0, Nektar::MultiRegions::Operator< TData >::m_expansionList, Nektar::AeroForcesOp< TData >::m_result, and Nektar::AeroForcesOp< TData >::m_rootOnly.
Referenced by Nektar::AeroForcesOp< TData >::GetPressureForce(), Nektar::AeroForcesOp< TData >::GetPressureMoment(), Nektar::AeroForcesOp< TData >::GetViscousForce(), and Nektar::AeroForcesOp< TData >::GetViscousMoment().
|
inline |
Viscous force from the last Apply().
Definition at line 142 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::GetResultVector(), and Nektar::AeroForcesOp< TData >::viscousForce.
|
inline |
Moment of the viscous traction about the pivot from the last Apply().
Definition at line 155 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::GetResultVector(), and Nektar::AeroForcesOp< TData >::viscousMoment.
|
inline |
Collective: as Apply().
Definition at line 121 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::v_Apply().
|
inline |
Reduce the results of the next Apply() to rank zero alone if rootOnly, else to every rank.
Definition at line 130 of file AeroForcesOp.hpp.
References Nektar::AeroForcesOp< TData >::m_rootOnly.
|
protectedpure virtual |
Implemented in Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >.
Referenced by Nektar::AeroForcesOp< TData >::Apply(), and Nektar::AeroForcesOp< TData >::operator()().
|
protectedpure virtual |
Implemented in Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >.
Referenced by Nektar::AeroForcesOp< TData >::Configure().
|
protected |
Reduced result of Apply(), of size resultSize, allocated by Configure().
Definition at line 173 of file AeroForcesOp.hpp.
Referenced by Nektar::AeroForcesOp< TData >::GetResultVector(), Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >::v_Apply(), and Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >::v_Configure().
|
protected |
Whether Apply() reduces the results to rank zero alone.
Definition at line 170 of file AeroForcesOp.hpp.
Referenced by Nektar::AeroForcesOp< TData >::GetResultVector(), Nektar::AeroForcesOp< TData >::SetRootOnly(), and Nektar::detail::AeroForcesOpImpl< ExecSpace, TData >::v_Apply().
|
inlinestatic |
Definition at line 97 of file AeroForcesOp.hpp.
|
staticconstexprprotected |
Offsets of the 3-vectors in m_result.
Definition at line 162 of file AeroForcesOp.hpp.
Referenced by Nektar::AeroForcesOp< TData >::GetPressureForce().
|
staticconstexprprotected |
Definition at line 164 of file AeroForcesOp.hpp.
Referenced by Nektar::AeroForcesOp< TData >::GetPressureMoment().
|
staticconstexprprotected |
Number of entries in m_result.
Definition at line 167 of file AeroForcesOp.hpp.
|
staticconstexprprotected |
Definition at line 163 of file AeroForcesOp.hpp.
Referenced by Nektar::AeroForcesOp< TData >::GetViscousForce().
|
staticconstexprprotected |
Definition at line 165 of file AeroForcesOp.hpp.
Referenced by Nektar::AeroForcesOp< TData >::GetViscousMoment().